@aibee/crc-bmap 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var mi=Object.create;var Se=Object.defineProperty;var _i=Object.getOwnPropertyDescriptor;var yi=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,xi=Object.prototype.hasOwnProperty;var Ct=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Ei=(s,e)=>{for(var t in e)Se(s,t,{get:e[t],enumerable:!0})},jn=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of yi(e))!xi.call(s,r)&&r!==t&&Se(s,r,{get:()=>e[r],enumerable:!(n=_i(e,r))||n.enumerable});return s};var Zt=(s,e,t)=>(t=s!=null?mi(vi(s)):{},jn(e||!s||!s.__esModule?Se(t,"default",{value:s,enumerable:!0}):t,s)),bi=s=>jn(Se({},"__esModule",{value:!0}),s);var $n=Ct((So,Yn)=>{Yn.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e}});var Jn=Ct((Mo,Zn)=>{var Kn=$n();Zn.exports=function(s,e){Array.isArray(e)||(e=[]),s.length>0&&e.push(Kn([0,0],s[0]));for(var t=0;t<s.length-1;t++){var n=s[t],r=s[t+1],i=n[0],o=n[1],a=r[0],l=r[1],u=[.75*i+.25*a,.75*o+.25*l],c=[.25*i+.75*a,.25*o+.75*l];e.push(u),e.push(c)}return s.length>1&&e.push(Kn([0,0],s[s.length-1])),e}});var rr=Ct((Co,nr)=>{var dn=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((e,t)=>e.priority-t.priority)}set(e,t){let n=Number(t);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(e)?this.queue.map(r=>(r.key===e&&Object.assign(r,{priority:n}),r)):(this.keys.add(e),this.queue.push({key:e,priority:n})),this.sort(),this.queue.length}next(){let e=this.queue.shift();return this.keys.delete(e.key),e}isEmpty(){return this.queue.length===0}has(e){return this.keys.has(e)}get(e){return this.queue.find(t=>t.key===e)}};nr.exports=dn});var sr=Ct((Po,or)=>{function ir(s,e){let t=new Map;for(let[n,r]of s)n!==e&&r instanceof Map?t.set(n,ir(r,e)):n!==e&&t.set(n,r);return t}or.exports=ir});var ur=Ct((Ao,lr)=>{function Ni(s){let e=Number(s);return!(isNaN(e)||e<=0)}function ar(s){let e=new Map;return Object.keys(s).forEach(n=>{let r=s[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return e.set(n,ar(r));if(!Ni(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return e.set(n,Number(r))}),e}lr.exports=ar});var pr=Ct((Io,hr)=>{function cr(s){if(!(s instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof s}`);s.forEach((e,t)=>{if(typeof e=="object"&&e instanceof Map){cr(e);return}if(typeof e!="number"||e<=0)throw new Error(`Values must be numbers greater than 0. Found value ${e} at ${t}`)})}hr.exports=cr});var mn=Ct((Ro,gr)=>{var Di=rr(),Oi=sr(),fr=ur(),dr=pr(),gn=class{constructor(e){e instanceof Map?(dr(e),this.graph=e):e?this.graph=fr(e):this.graph=new Map}addNode(e,t){let n;return t instanceof Map?(dr(t),n=t):n=fr(t),this.graph.set(e,n),this}addVertex(e,t){return this.addNode(e,t)}removeNode(e){return this.graph=Oi(this.graph,e),this}path(e,t,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new Di,o=new Map,a=[],l=0,u=[];if(n.avoid&&(u=[].concat(n.avoid)),u.includes(e))throw new Error(`Starting node (${e}) cannot be avoided`);if(u.includes(t))throw new Error(`Ending node (${t}) cannot be avoided`);for(i.set(e,0);!i.isEmpty();){let c=i.next();if(c.key===t){l=c.priority;let p=c.key;for(;o.has(p);)a.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,d)=>{if(r.has(d)||u.includes(d))return null;if(!i.has(d))return o.set(d,c.key),i.set(d,c.priority+p);let m=i.get(d).priority,f=c.priority+p;return f<m?(o.set(d,c.key),i.set(d,f)):null})}return a.length?(n.trim?a.shift():a=a.concat([e]),n.reverse||(a=a.reverse()),n.cost?{path:a,cost:l}:a):n.cost?{path:null,cost:0}:null}shortestPath(...e){return this.path(...e)}};gr.exports=gn});var no={};Ei(no,{AibeeLoader:()=>Xn,BMap:()=>Tn,BMapSelect:()=>On,BaseSvg:()=>J,Context:()=>_e,CrLoader:()=>qn,CrNavPath:()=>Dn,Equipment:()=>Cn,Events:()=>ln,Floor:()=>ct,GlbModel:()=>he,Graphic:()=>R,GraphicLayer:()=>se,GroundTexture:()=>qt,HeatmapElement:()=>ie,HooksName:()=>Wt,HoverHelper:()=>me,Lane:()=>pe,Layer:()=>F,MapTypePolar:()=>Vr,MergeGraphic:()=>fe,Model:()=>oe,MulFloors:()=>In,NavPath:()=>Ln,Navigation:()=>An,Overlay:()=>re,PathDirection:()=>pn,PdrPosition:()=>Fn,Poi:()=>bt,Poi2:()=>q,PoiLayer:()=>ae,PoiLayer2:()=>Ut,RoadNetwork:()=>_n,RoadNetwork2:()=>yn,SelectBox:()=>En,Selection:()=>ge,Sensor:()=>Ee,Shadow:()=>ne,SvgLine:()=>le,SvgPolygon:()=>ue,TextTexture:()=>de,Timer:()=>D,TweenUtil:()=>Dt,UA:()=>sn,Wall:()=>ce,addAlphaToHexColor:()=>Ci,calc_angle:()=>tn,calc_direction:()=>we,convertToSnakeCase:()=>vn,createCircle:()=>Vt,createLine:()=>te,createRect:()=>mt,createSvg:()=>rn,createSvgElement:()=>Qt,createThreeBox:()=>Bi,createThreeLine:()=>Ui,darkenColor:()=>pt,defaultAibeeLoaderOption:()=>eo,defaultConfig:()=>zr,defaultGraphicOptions:()=>Te,defaultOptions:()=>Cr,defaultTextTextureOptions:()=>Nr,dispose:()=>V,distancePointToSegment:()=>hn,generatorKeyByObj:()=>Lt,getAngle:()=>tr,getCenter:()=>Jt,getConfig:()=>wn,getDirectPath:()=>Li,getDistanceByPathPos:()=>fn,getLength:()=>A,getLongestSideDir:()=>Si,getMinEdgeSquare:()=>en,getPathLength:()=>at,getPointEdgeIndex:()=>Pt,getPosByPathDistance:()=>ee,hasChinese:()=>Qe,hexToRgb:()=>Me,initDirectionalLight:()=>Je,initLight:()=>Ze,initShape:()=>st,isAndroid:()=>Pi,isContain:()=>gt,isControl:()=>Rt,isIphone:()=>Ht,isMac:()=>It,isPointInPolygon:()=>nn,loadBuildingGround:()=>Un,loadExternalStreet:()=>$i,loadGraphics:()=>Bn,moveOnRoute:()=>Ri,proxyOptions:()=>At,removeWeightPath:()=>er,setCirclePosition:()=>_t,setLineStartEnd:()=>et,setRectPosition:()=>B,simplifyPath:()=>cn,sleepOnePromise:()=>on,sleepOneRf:()=>wi,smoothPath:()=>un,strToNumber:()=>Ti,timeoutPromise:()=>Z,toWebWorker:()=>Fi,transformGraphicData:()=>X,translatePosToCenter:()=>rt,triggerWorker:()=>lt,vector3ToDevice:()=>y,xhrGet:()=>Ai});module.exports=bi(no);var Ge=require("three");var D=class{tasks={requestAnimation:new Set,timeout:new Set,interval:new Set};requestAnimationFrame(e){let t=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(t),e()});return this.tasks.requestAnimation.add(t),t}cancelAnimationFrame(e){this.tasks.requestAnimation.delete(e),window.cancelAnimationFrame(e)}setTimeout(e,t){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),e()},t);return this.tasks.timeout.add(n),n}clearTimeout(e){this.tasks.timeout.delete(e),window.clearTimeout(e)}setInterval(e,t){let n=window.setInterval(()=>{this.tasks.interval.delete(n),e()},t);return this.tasks.interval.add(n),n}clearInterval(e){this.tasks.interval.delete(e),window.clearInterval(e)}dispose(){this.tasks.requestAnimation.forEach(e=>{window.cancelAnimationFrame(e)}),this.tasks.requestAnimation.clear(),this.tasks.timeout.forEach(e=>{window.clearTimeout(e)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(e=>{window.clearInterval(e)}),this.tasks.interval.clear()}};var K=require("three");function Ze(){let s=new K.Group,e=new K.AmbientLight(16777215,2.6);return s.add(e),s}function st(s,e=[]){let t=new K.Shape(s.map(n=>new K.Vector2(...n)));return e.length&&e.forEach(n=>{var r=new K.Path(n.map(i=>new K.Vector2(...i)));t.holes.push(r)}),t}function Je(s=16777215,e=1){let t=new K.DirectionalLight(s,e);return t.castShadow=!0,t.shadow.radius=8,t.shadow.bias=-.001,t.shadow.mapSize.set(256,256),t.shadow.camera.left=-200,t.shadow.camera.right=200,t.shadow.camera.top=200,t.shadow.camera.bottom=-200,t}function V(s,e){if(e&&s.children&&s.children.length&&s.children.forEach(t=>{V(t,e)}),s.isMesh){let t=s;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n.dispose()}):t.material.dispose())}s.isLight&&s.dispose?.()}function Qe(s){return/[\u4E00-\u9FA5]+/g.test(s)}var C=require("three"),kt=require("@turf/turf");function y(s,e,t,n){let r=s.clone().project(e),i=t/2,o=n/2,a=Math.round(r.x*i+i),l=Math.round(-r.y*o+o);return{x:a,y:l}}function Jt(s){let e=(0,kt.featureCollection)(s.map(n=>(0,kt.point)(n)));return(0,kt.center)(e).geometry.coordinates}function gt(s,e,t){return s.x>=e.x&&s.x<=t.x&&s.y>=e.y&&s.y<=t.y}function Si(s){let e=0,t=new C.Vector3;for(let n=1;n<s.length;n++){let r=new C.Vector3(s[n-1][0],s[n-1][1],0),i=new C.Vector3(s[n][0],s[n][1],0),o=i.distanceTo(r);o>e&&(e=o,t=i.clone().sub(r).normalize())}return t}function A(s,e){return Math.sqrt((e[0]-s[0])**2+(e[1]-s[1])**2)}function at(s){let e=0;for(let t=0;t<s.length-1;t++)e+=A(s[t],s[t+1]);return e}function tn(s,e,t){let n=new C.Vector2(e[0]-s[0],e[1]-s[1]),r=new C.Vector2(e[0]-t[0],e[1]-t[1]),o=n.angleTo(r)*180/Math.PI,a=new C.Vector2(e[0]-s[0],e[1]-s[1]);return new C.Vector2(t[0]-s[0],t[1]-s[1]).cross(a)>0?o:-o}function en(s,e){let t=Math.min(A(s[0][0],s[0][1]),A(s[0][2],s[0][1]))-1;e||(e=Jt(s[0]));let n=Mi(e,t),r=new C.Vector2(s[0][0][0],s[0][0][1]),i=new C.Vector2(s[0][1][0],s[0][1][1]),o=new C.Vector2(s[0][2][0],s[0][2][1]),l=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new C.Vector2(0,1)),u=new C.Matrix3;return u.multiply(new C.Matrix3().translate(e[0],e[1])).multiply(new C.Matrix3().rotate(l)).multiply(new C.Matrix3().translate(-e[0],-e[1])),[n.map(c=>{let h=new C.Vector2(c[0],c[1]).applyMatrix3(u);return[h.x,h.y]})]}function Mi(s,e){let t=e/2;return[[s[0]-t,s[1]+t],[s[0]+t,s[1]+t],[s[0]+t,s[1]-t],[s[0]-t,s[1]-t],[s[0]-t,s[1]+t]]}function Pt(s,e){let t=0,n=1/0,[r,i]=e;for(let o=0;o<s.length-1;o++){let[a,l]=s[o],[u,c]=s[o+1],h=Math.min(a,u)<=r&&r<=Math.max(a,u),p=Math.min(l,c)<=i&&i<=Math.max(l,c);if(h&&p){let d=Math.abs((u-a)*(i-l)-(c-l)*(r-a));d<n&&(n=d,t=o)}}return t}function nn(s,e){let t=s[0],n=s[1],r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let a=e[i][0],l=e[i][1],u=e[o][0],c=e[o][1];l>n!=c>n&&t<(u-a)*(n-l)/(c-l)+a&&(r=!r)}return r}function At(s,e){return new Proxy(s,{get:(t,n,r)=>Reflect.get(t,n,r),set:(t,n,r,i)=>{let o=Reflect.get(t,n,i),a=Reflect.set(t,n,r,i);return o!==r&&e.dispatchEvent({type:`change-${n}`,value:r}),a}})}function Z(s,e){return Promise.race([s,new Promise((t,n)=>{setTimeout(()=>n(new Error("Promise timeout")),e)})])}function Qt(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function rn(s,e){let t=Qt("svg");return t.setAttribute("width",s),t.setAttribute("height",e),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function Vt(s="2",e){let t=Qt("circle");return t.setAttribute("r",s),t.setAttribute("fill",e),t}function te(s){let e=Qt("line");return e.setAttribute("stroke",s),e}function mt(s,e){let t=Qt("rect");return t.setAttribute("stroke",s),t.setAttribute("fill",e),t}function _t(s,e,t){s.setAttribute("cx",`${e}`),s.setAttribute("cy",`${t}`)}function et(s,e,t){e&&(s.setAttribute("x1",`${e.x}`),s.setAttribute("y1",`${e.y}`)),t&&(s.setAttribute("x2",`${t.x}`),s.setAttribute("y2",`${t.y}`))}function B(s,e,t,n,r){s.setAttribute("x",`${e}`),s.setAttribute("y",`${t}`),s.setAttribute("width",`${n}`),s.setAttribute("height",`${r}`)}function on(){return Promise.resolve()}function wi(){return new Promise(s=>{requestAnimationFrame(s)})}function Ti(s){return parseInt(s.replace("#","0x"),16)}function Ci(s,e){let t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16),i=Math.round(t*e),o=Math.round(n*e),a=Math.round(r*e);return`#${(1<<24|i<<16|o<<8|a).toString(16).slice(1)}`}function pt(s,e=.85){let t,n,r;if(s.startsWith("#"))t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16);else{let o=s.slice(4,-1).split(",");t=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return t=Math.min(Math.floor(t*e),255),n=Math.min(Math.floor(n*e),255),r=Math.min(Math.floor(r*e),255),"#"+((1<<24)+(t<<16)+(n<<8)+r).toString(16).slice(1)}function Me(s,e){s=s.replace(/^#/,"");let t=parseInt(s.substring(0,2),16),n=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16);return e!==void 0?`rgba(${t}, ${n}, ${r}, ${e})`:`rgb(${t}, ${n}, ${r})`}var It=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,sn=(window.navigator.userAgent||"").toLocaleLowerCase(),Ht=/ios|iphone/i.test(sn),Pi=/android|adr|linux/gi.test(sn);function Rt(s){return It?s==="Meta":s==="Control"}var an="__once__",ln=class{events=new Map;on(e,t){if(typeof t!="function")return;let n=this.events.get(e);return n?n.add(t):this.events.set(e,new Set([t]))}once(e,t){if(typeof t!="function")return;let n=`${an}${e}`,r=this.events.get(n);return r?r.add(t):this.events.set(n,new Set([t]))}off(e,t){let n=this.events.get(e),r=this.events.get(`${an}${e}`);!n&&!r||(t===void 0&&(n?.clear(),r?.clear()),n?.has(t)&&n.delete(t),r?.has(t)&&r.delete(t))}offAll(){this.events.clear()}emit(e,...t){let n=this.events.get(e),r=this.events.get(`${an}${e}`);!n&&!r||(n?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.clear())}};var Wt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(Wt||{});function Lt(s){return Object.keys(s).sort().map(e=>`${e}=${s[e]}`).join("&")}function Ai(s,e){return new Promise((t,n)=>{let r=new XMLHttpRequest;r.open("GET",s,!0),Object.keys(e.headers||{}).forEach(i=>{r.setRequestHeader(i,e.headers[i])}),e.responseType&&(r.responseType=e.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(e.responseType==="arraybuffer")t(r.response);else try{let i=JSON.parse(r.responseText);t(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var Xt=require("three"),Qn=Zt(Jn(),1);function tr(s,e){let t=s.clone().normalize(),n=e.clone().normalize();return Math.acos(t.dot(n))}function Ii(s){let e=0;return s.reduce(([t,n],[r,i])=>(e+=Math.sqrt((r-t)**2+(i-n)**2),[r,i])),e/s.length}function un(s,e=.25){if(Ii(s)<e)return s;let t=(0,Qn.default)(s);return un(t,e)}function cn(s,e=!1,t=!0,n=5,r=150,i=3){let o=[],a=!e;if(o.push(s[0]),s.length<2)return o;for(let u=0;u<s.length-2;u+=1){let c=s[u],h=s[u+1],p=s[u+2],d=new Xt.Vector2(c[0]-h[0],c[1]-h[1]),m=new Xt.Vector2(p[0]-h[0],p[1]-h[1]),f=tr(d,m)/Math.PI*180,g=d.length()+m.length();(!a||f<r&&g>.01||g>n)&&(o.push(s[u+1]),a=!0)}if(o.push(s[s.length-1]),!t)return o;let l=[];l.push(o[0]);for(let u=0;u<o.length-2;u+=1){let c=new Xt.Vector2(o[u][0],o[u][1]),h=new Xt.Vector2(o[u+1][0],o[u+1][1]),p=new Xt.Vector2(o[u+2][0],o[u+2][1]),d=c.distanceTo(h)/2,m=p.distanceTo(h)/2,f=h.clone(),g=h.clone();f.add(c.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d)),g.add(p.clone().sub(h).normalize().multiplyScalar(m>i?i/2:m));let E=[[f.x,f.y],[h.x,h.y],[g.x,g.y]];l.push(...un(E,i/25))}return l.push(o[o.length-1]),er(l)}function er(s){if(s.length<=1)return s;let e=[],t;return s.forEach(([n,r])=>{t?n===t[0]&&r===t[1]||(t=[n,r],e.push([n,r])):(t=[n,r],e.push([n,r]))}),e}function hn(s,e,t){let n=Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2);if(n===0)return{distance:Math.sqrt((s[0]-e[0])**2+(s[1]-e[1])**2),closestPoint:e.slice(0)};let r=Math.max(0,Math.min(1,((s[0]-e[0])*(t[0]-e[0])+(s[1]-e[1])*(t[1]-e[1]))/n**2)),i=[e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1])];return{distance:Math.sqrt((s[0]-i[0])**2+(s[1]-i[1])**2),closestPoint:i}}function Ri(s,e,t){let[n,r]=s,[i,o]=e,a=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(a===0||a<t)return[...e];let l=t/a,u=n+(i-n)*l,c=r+(o-r)*l;return[u,c]}var pn=(u=>(u.START="start",u.END="end",u.FRONT="front",u.RIGHT="right",u.LEFT="left",u.RIGHT_FRONT="right_front",u.LEFT_FRONT="left_front",u.RIGHT_BACK="right_back",u.LEFT_BACK="left_back",u))(pn||{});function we(s,e,t){let n=tn(s,e,t);return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function Li(s){if(!s.length)return[];let e=[{direction:"start",distance:A(s[0],s[1]),points:[s[0],s[1]]}];for(let t=2;t<s.length;t++){let n=we(s[t-2],s[t-1],s[t]);if(n==="front"){let r=e[e.length-1],i=A(s[t-1],s[t]);r.distance+=i,t!==2&&r.points.push(s[t-1])}else e.push({direction:n,distance:A(s[t-1],s[t]),points:[s[t-1],s[t]]})}return e.push({direction:"end",distance:0,points:[s[s.length-1]]}),e}function fn(s,e){if(s.length<2)return-1;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=[e[0]-r[0],e[1]-r[1]],a=[i[0]-r[0],i[1]-r[1]],l=Math.min(i[0],r[0])<=e[0]&&e[0]<=Math.max(i[0],r[0]),u=Math.min(i[1],r[1])<=e[1]&&e[1]<=Math.max(i[1],r[1]);if(l&&u){let c=o[0]*a[1]-o[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((e[0]-r[0])**2+(e[1]-r[1])**2);return t+h}}t+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function ee(s,e){if(s.length<2)return s[0]??null;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2);if(t+=o,t>=e){let a=(e-(t-o))/o,l=r[0]+(i[0]-r[0])*a,u=r[1]+(i[1]-r[1])*a;return[l,u]}}return null}var ft=Zt(mn(),1);var nt="___",_n=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new ft.default;escalatorRoute=new ft.default;straightLadderRoute=new ft.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(t=>{t.points.forEach(n=>{let r=`${t.floor}${nt}${n.id}`;if(this.pointMap.set(r,n),this.nodeMap.set(`${n.floor}${nt}${n.nodeId}`,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push({...n}),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push({...n}),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push({...n}),this.facilityMap.set(n.targetId,i)}}),t.lines.filter(n=>n.direction!=="no").forEach(n=>{let r=`${t.floor}${nt}${n.from}`,i=`${t.floor}${nt}${n.to}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;if(o?.length&&a?.length){let l=A(o,a);this.addLineItem(r,i,l),n.direction==="double"&&this.addLineItem(i,r,l)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${nt}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${nt}${o[u].id}`,h=this.pointMap.get(l)?.cds,p=this.pointMap.get(c)?.cds;if(h?.length&&p?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=n;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){let a=`${i.start.floor}${nt}${i.start.id}`,l=`${i.end.floor}${nt}${i.end.id}`,u=this.pointMap.get(a)?.cds,c=this.pointMap.get(l)?.cds;if(u?.length&&c?.length){let h=e;this.addLineItem(a,l,h,r)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new ft.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new ft.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new ft.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${nt}${e.nodeId}`);if(t){let[n,r]=t.split(nt);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=A(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:n.point.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(e);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((p,d)=>p+at(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${nt}${e.id}`,i=`${t.floor}${nt}${t.id}`,o=n.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u;if(a[a.length-1]?.floor===c){let h=a[a.length-1];h.points.push(u.cds),h.endType=u.type,h.destId=u.nodeId,h.distance=at(h.points)}else a.push({floor:c,points:[u.cds],endType:u.type,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t){return this.getRoutePath(e,t,this.baseRoute)}getEscalatorPath(e,t){return this.getRoutePath(e,t,this.escalatorRoute)}getStraightLadderPath(e,t){return this.getRoutePath(e,t,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ft.default,this.escalatorRoute=new ft.default,this.straightLadderRoute=new ft.default}};var G=Zt(mn(),1);var yt=require("lodash"),w="___",yn=class{constructor(e=3){this.lift_priority=e}roadInfo=[];facilities=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;rampMap=new Map;staircaseMap=new Map;parkingMap=new Map;lineMap=new Map;baseRoute=new G.default;escalatorRoute=new G.default;straightLadderRoute=new G.default;forwardLineMap=new Map;forwardRoute=new G.default;isFacilityByType(e){return["facility","escalator","straightLadder","staircase","ramp"].includes(e)}initFacilities(e){this.facilities=e.map(t=>{let n=[];try{n=JSON.parse(t.entry_end_floor)}catch{n=[]}let r=[];try{r=JSON.parse(t.entry_start_floor)}catch{r=[]}return{...t,entry_start_floor:r,entry_end_floor:n}})}initRoute(e,t){this.clear(),this.roadInfo=e,this.initFacilities(t);let n=new Date,r=n.getHours()*60+n.getMinutes();e.length&&(e.forEach(i=>{(i.points||[]).filter(o=>o.openStatus!==!1).filter(o=>{if(!o.startTime||!o.endTime)return!0;let[a,l]=o.startTime.split(":").map(d=>+d),[u,c]=o.endTime.split(":").map(d=>+d),h=a*60+l,p=u*60+c;return r>=h&&r<=p}).forEach(o=>{o.floor=i.floor;let a=`${i.floor}${w}${o.id}`;if(this.nodeMap.set(`${i.floor}${w}${o.nodeId}`,`${i.floor}${w}${o.relatedId||o.id}`),this.pointMap.set(a,o),this.isFacilityByType(o.type)){let l=this.facilities.find(u=>u.id===+o.targetId);if(l){switch(l.entry_infra_type){case"straightLadder":if(l.entry_end_floor.find(p=>p.floor===i.floor)&&l.entry_start_floor.find(p=>p.floor===i.floor)){let p=this.straightLadderMap.get(o.targetId)||[];p.push({...o}),this.straightLadderMap.set(o.targetId,p)}break;case"staircase":if(l.entry_end_floor.find(p=>p.floor===i.floor)&&l.entry_start_floor.find(p=>p.floor===i.floor)){let p=this.staircaseMap.get(o.targetId)||[];p.push({...o}),this.staircaseMap.set(o.targetId,p)}break;case"escalator":let c=this.escalatorMap.get(o.targetId)||[];if(l.entry_start_floor.find(p=>p.floor===i.floor)){let p=c.find(d=>d.end?.floor!==i.floor&&!d.start);p?p.start=o:c.push({start:o})}if(l.entry_end_floor.find(p=>p.floor===i.floor)){let p=c.find(d=>d.start?.floor!==i.floor&&!d.end);p?p.end=o:c.push({end:o})}this.escalatorMap.set(o.targetId,c);break;case"ramp":let h=this.rampMap.get(o.targetId)||[];if(l.entry_start_floor.find(p=>p.floor===i.floor)){let p=h.find(d=>d.end?.floor!==i.floor&&!d.start);p?p.start=o:h.push({start:o})}if(l.entry_end_floor.find(p=>p.floor===i.floor)){let p=h.find(d=>d.start?.floor!==i.floor&&!d.end);p?p.end=o:h.push({end:o})}this.rampMap.set(o.targetId,h);break}let u=this.facilityMap.get(o.targetId)||[];u.push({...o}),this.facilityMap.set(o.targetId,u)}}o.type==="parkingSpace"&&this.parkingMap.set(`${i.floor}${w}${o.name}`,o)}),(i.lines||[]).filter(o=>o.direction!=="no").forEach(o=>{let a=`${i.floor}${w}${o.from}`,l=`${i.floor}${w}${o.to}`,u=this.pointMap.get(a),c=this.pointMap.get(l);if(!u||!c)return;let h=u.cds,p=c.cds,d=A(h,p);if(!u.permission&&!c.permission)switch(this.addLineItem(a,l,d),this.addLineItem(l,a,d),o.direction){case"double":this.addLineItem(a,l,d,this.forwardLineMap),this.addLineItem(l,a,d,this.forwardLineMap);break;case"single":this.addLineItem(a,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,a,d,this.forwardLineMap);break}else u.permission&&(this.setPermissionLine(a,l,u.permission,d,""),this.setPermissionLine(l,a,u.permission,d,"")),c.permission&&c.permission!==u.permission&&(this.setPermissionLine(a,l,c.permission,d,""),this.setPermissionLine(l,a,c.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(e){return this[`permission_${e}`]||(this[`permission_${e}`]=new Set),this[`permission_${e}`]}setPermissionLine(e,t,n,r,i){this.getPermissionMap(n).add({fromKey:e,toKey:t,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((e,t)=>{if(e.length<2){this.straightLadderMap.delete(t);return}for(let n=0;n<e.length;n++){let r=`${e[n].floor}${w}${e[n].id}`,i=this.pointMap.get(r);if(i){for(let o=0;o<e.length;o++)if(n!==o){let a=`${e[o].floor}${w}${e[o].id}`,l=this.pointMap.get(a);if(!l)continue;i.permission&&this.setPermissionLine(r,a,i.permission,1,"straightLadder"),l.permission&&l.permission!==i.permission&&this.setPermissionLine(r,a,l.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((e,t)=>{if(e.length<2){this.staircaseMap.delete(t);return}for(let n=0;n<e.length;n++){let r=`${e[n].floor}${w}${e[n].id}`,i=this.pointMap.get(r);if(i){for(let o=0;o<e.length;o++)if(n!==o){let a=`${e[o].floor}${w}${e[o].id}`,l=this.pointMap.get(a);if(!l)continue;i.permission&&this.setPermissionLine(r,a,i.permission,1,"staircase"),l.permission&&l.permission!==i.permission&&this.setPermissionLine(r,a,l.permission,1,"straightLadder")}}}}),this.escalatorMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),a.permission&&a.permission!==o.permission&&this.setPermissionLine(r,i,a.permission,1,"escalator"))}})}),this.rampMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),a.permission&&a.permission!==o.permission&&this.setPermissionLine(r,i,a.permission,10,"ramp"))}})})}addPermissionLineToMap(e,t,n,r){let i=this.getPermissionMap(e);console.log(i),i.forEach(o=>{t.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${w}${o[a].id}`,u=this.pointMap.get(l);if(!(!u||u.permission)){for(let c=0;c<o.length;c++)if(a!==c){let h=`${o[c].floor}${w}${o[c].id}`,p=this.pointMap.get(h);if(!p||p.permission)continue;if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,h,d,r)}else{let d=n;this.addLineItem(l,h,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(a=>{if(a.start&&a.end){let l=`${a.start.floor}${w}${a.start.id}`,u=`${a.end.floor}${w}${a.end.id}`,c=this.pointMap.get(l),h=this.pointMap.get(u);if(c&&h&&!c.permission&&!h.permission){let p=e;this.addLineItem(l,u,p,r)}}})})}initBaseRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,e),this.baseRoute=new G.default(e)}initEscalatorRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new G.default(e)}initStraightLadderRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new G.default(e)}initForwardRoute(){this.rampMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&!o.permission&&!a.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.forwardRoute=new G.default(this.forwardLineMap)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility||e.parkingSpace&&e.floor?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${w}${e.nodeId}`);if(t){let[n,r]=t.split(w);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=A(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:t.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){if(e.parkingSpace){let n=this.parkingMap.get(`${e.floor}${w}${e.parkingSpace}`);if(n)return{floor:e.floor,id:n.id}}let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilities.filter(r=>+r.type_id==+e.facility).map(r=>r.id).map(r=>this.facilityMap.get(`${r}`)).flat(2)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n="",r){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let i=this.transformStart(e);if(!i)return"no-start";let o=this.transformEnd(t);if(!o)return"no-end";let a=this.getBasePath.bind(this);switch(n){case"escalator":a=this.getEscalatorPath.bind(this);break;case"straightLadder":a=this.getStraightLadderPath.bind(this);break;case"forward":a=this.getForwardPath.bind(this);break;default:a=this.getBasePath.bind(this);break}if(o.id)return a(i,o,r);if(o.facility){let u=this.facilities.filter(h=>+h.type_id==+t.facility).map(h=>h.id).map(h=>this.facilityMap.get(`${h}`)).flat(2).filter(h=>h).filter(h=>o.floor?h.floor===o.floor:!0);if(!u.length)return null;let c=u.map(h=>a(i,{floor:h.floor,id:h.id},r)).filter(h=>!!h);return c.reduce((h,p)=>{let d=p.reduce((m,f)=>m+at(f.points),0);return d<h.distance&&(h.distance=d,h.path=p),h},{distance:1/0,path:c[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${w}${e.id}`,i=`${t.floor}${w}${t.id}`,o=n.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u,h=u.type;if(this.isFacilityByType(u.type)){let p=this.facilities.find(d=>d.id===+u.targetId);p&&(h=p.entry_infra_type)}if(a[a.length-1]?.floor===c){let p=a[a.length-1];p.points.push(u.cds),p.endType=h,p.destId=u.nodeId,p.distance=at(p.points)}else a.push({floor:c,points:[u.cds],endType:h,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t,n){if(!n)return this.getRoutePath(e,t,this.baseRoute);let r=(0,yt.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let i=new G.default(r);return this.getRoutePath(e,t,i)}getEscalatorPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.escalatorRoute);let r=(0,yt.cloneDeep)(this.escalatorRoute.graph),i=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",1*i],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]));let o=new G.default(r);return this.getRoutePath(e,t,o)}getStraightLadderPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.straightLadderRoute);let r=(0,yt.cloneDeep)(this.straightLadderRoute.graph),i=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",3*i],["straightLadder",1*i],["staircase",3e4*i]]));let o=new G.default(r);return this.getRoutePath(e,t,o)}getForwardPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.forwardRoute);let r=(0,yt.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],r,new Map([["ramp",10]]));let i=new G.default(r);return this.getRoutePath(e,t,i)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new G.default,this.escalatorRoute=new G.default,this.straightLadderRoute=new G.default}};var Nt=class{static keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let e=this.createKey();for(;this.keySet.has(e);)e=this.createKey();return e}static removeKey(e){this.keySet.delete(e)}static dispose(){this.keySet.clear()}};function vn(s){return s.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function lt(s,e,t){return new Promise((n,r)=>{let i=Nt.genUniqueKey(),o=({data:a})=>{a.type===`${e}_result`&&a.key===i&&(Nt.removeKey(i),self.removeEventListener("message",o),a.error?r(a.error):n(a.data))};s.addEventListener("message",o),s.postMessage({type:e,key:i,data:t})})}function Fi(s){let e={};for(let n in s)n.startsWith("on")&&(e[vn(n.slice(2))]=s[n]);let t=async({data:n})=>{if(e[n.type])try{let r=await e[n.type](n.data);self.postMessage({type:`${n.type}_result`,key:n.key,data:r})}catch(r){self.postMessage({type:`${n.type}_result`,key:n.key,error:r})}else self.postMessage({type:`${n.type}_result`,key:n.key,error:"no_event"})};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var ut=require("three");function Ui(s,e=16711680){let t=new ut.LineBasicMaterial({color:e}),n=new ut.BufferGeometry().setFromPoints(s);return new ut.Line(n,t)}function Bi(s,e=16711680){let t=new ut.LineBasicMaterial({color:e}),n=new ut.BoxGeometry(1,1,1),r=new ut.Mesh(n,t);return r.position.copy(s),r}function X(s,e,t=0){s.forEach(n=>{n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"?(n.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=e[0],i[1]-=e[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(r=>r.map(i=>rt(i,e)))),n.doors?.length&&n.doors.map(r=>{r.coord=rt(r.coordinate,e)}),n.center&&(n.center=rt(n.center,e))):n.geometry.coords=rt(n.geometry.cds,e)});for(let n=0;n<s.length;n++){let r=s[n];r.deltaHeight=1e-5*(t+n+1)}}function rt(s,e){return[s[0]-e[0],s[1]-e[1]]}var mr=require("@tweenjs/tween.js"),Dt=class{pauseTween=!1;tweenStore=new Set;group=new mr.Group;constructor(){}update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(e=>{this.tweenStore.add(e),e.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(e=>{e.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(e){this.group.remove(e)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(e=>e.stop()),this.group.removeAll()}dispose(){this.clear()}};var S=require("three");var Or=require("three");var v=require("three");var yr=require("three/examples/jsm/lines/LineMaterial"),H=require("three");function _r(s){return`${s.x}-${s.y}-${s.z}`}var I=class{static lineMaterialMap=new Map;static meshStandardMaterialMap=new Map;static meshBasicMaterialMap=new Map;static shaderMaterialMap=new Map;static line2MaterialMap=new Map;static generateLineMaterialKey({color:e,opacity:t}){return`${e}-${t}`}static createLineMaterial({color:e,opacity:t}){let n=this.generateLineMaterialKey({color:e,opacity:t});if(this.lineMaterialMap.has(n))return this.lineMaterialMap.get(n);let r=new H.LineBasicMaterial({color:new H.Color(e).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(n,r),r}static createMeshStandardMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let r=new H.MeshStandardMaterial({color:new H.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(n,r),r}static createMeshBasicMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshBasicMaterialMap.has(n))return this.meshBasicMaterialMap.get(n);let r=new H.MeshBasicMaterial({color:e,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(n,r),r}static createShaderMaterial({gradualColor:e,center:t,maxValue:n,opacity:r,direction:i,max:o,min:a}){let l=`${e.toString()}-${_r(t)}-${n}-${r}-${_r(i)}`;if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let u=`
1
+ "use strict";var _i=Object.create;var Se=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var xi=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty;var Ct=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),bi=(s,e)=>{for(var t in e)Se(s,t,{get:e[t],enumerable:!0})},Yn=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vi(e))!Ei.call(s,r)&&r!==t&&Se(s,r,{get:()=>e[r],enumerable:!(n=yi(e,r))||n.enumerable});return s};var Zt=(s,e,t)=>(t=s!=null?_i(xi(s)):{},Yn(e||!s||!s.__esModule?Se(t,"default",{value:s,enumerable:!0}):t,s)),Si=s=>Yn(Se({},"__esModule",{value:!0}),s);var Kn=Ct((Mo,$n)=>{$n.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e}});var Qn=Ct((wo,Jn)=>{var Zn=Kn();Jn.exports=function(s,e){Array.isArray(e)||(e=[]),s.length>0&&e.push(Zn([0,0],s[0]));for(var t=0;t<s.length-1;t++){var n=s[t],r=s[t+1],i=n[0],o=n[1],a=r[0],l=r[1],u=[.75*i+.25*a,.75*o+.25*l],c=[.25*i+.75*a,.25*o+.75*l];e.push(u),e.push(c)}return s.length>1&&e.push(Zn([0,0],s[s.length-1])),e}});var ir=Ct((Po,rr)=>{var dn=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((e,t)=>e.priority-t.priority)}set(e,t){let n=Number(t);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(e)?this.queue.map(r=>(r.key===e&&Object.assign(r,{priority:n}),r)):(this.keys.add(e),this.queue.push({key:e,priority:n})),this.sort(),this.queue.length}next(){let e=this.queue.shift();return this.keys.delete(e.key),e}isEmpty(){return this.queue.length===0}has(e){return this.keys.has(e)}get(e){return this.queue.find(t=>t.key===e)}};rr.exports=dn});var ar=Ct((Ao,sr)=>{function or(s,e){let t=new Map;for(let[n,r]of s)n!==e&&r instanceof Map?t.set(n,or(r,e)):n!==e&&t.set(n,r);return t}sr.exports=or});var cr=Ct((Io,ur)=>{function Di(s){let e=Number(s);return!(isNaN(e)||e<=0)}function lr(s){let e=new Map;return Object.keys(s).forEach(n=>{let r=s[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return e.set(n,lr(r));if(!Di(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return e.set(n,Number(r))}),e}ur.exports=lr});var fr=Ct((Ro,pr)=>{function hr(s){if(!(s instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof s}`);s.forEach((e,t)=>{if(typeof e=="object"&&e instanceof Map){hr(e);return}if(typeof e!="number"||e<=0)throw new Error(`Values must be numbers greater than 0. Found value ${e} at ${t}`)})}pr.exports=hr});var mn=Ct((Lo,mr)=>{var Oi=ir(),Fi=ar(),dr=cr(),gr=fr(),gn=class{constructor(e){e instanceof Map?(gr(e),this.graph=e):e?this.graph=dr(e):this.graph=new Map}addNode(e,t){let n;return t instanceof Map?(gr(t),n=t):n=dr(t),this.graph.set(e,n),this}addVertex(e,t){return this.addNode(e,t)}removeNode(e){return this.graph=Fi(this.graph,e),this}path(e,t,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new Oi,o=new Map,a=[],l=0,u=[];if(n.avoid&&(u=[].concat(n.avoid)),u.includes(e))throw new Error(`Starting node (${e}) cannot be avoided`);if(u.includes(t))throw new Error(`Ending node (${t}) cannot be avoided`);for(i.set(e,0);!i.isEmpty();){let c=i.next();if(c.key===t){l=c.priority;let p=c.key;for(;o.has(p);)a.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,d)=>{if(r.has(d)||u.includes(d))return null;if(!i.has(d))return o.set(d,c.key),i.set(d,c.priority+p);let m=i.get(d).priority,f=c.priority+p;return f<m?(o.set(d,c.key),i.set(d,f)):null})}return a.length?(n.trim?a.shift():a=a.concat([e]),n.reverse||(a=a.reverse()),n.cost?{path:a,cost:l}:a):n.cost?{path:null,cost:0}:null}shortestPath(...e){return this.path(...e)}};mr.exports=gn});var ro={};bi(ro,{AibeeLoader:()=>qn,BMap:()=>Tn,BMapSelect:()=>On,BaseSvg:()=>J,Context:()=>_e,CrLoader:()=>jn,CrNavPath:()=>Dn,Equipment:()=>Cn,Events:()=>ln,Floor:()=>ht,GlbModel:()=>he,Graphic:()=>R,GraphicLayer:()=>se,GroundTexture:()=>qt,HeatmapElement:()=>ie,HooksName:()=>Wt,HoverHelper:()=>me,Lane:()=>pe,Layer:()=>F,MapTypePolar:()=>Hr,MergeGraphic:()=>fe,Model:()=>oe,MulFloorNavigationPlugin:()=>Un,MulFloors:()=>In,NavPath:()=>Ln,Navigation:()=>An,Overlay:()=>re,PathDirection:()=>pn,PdrPosition:()=>Fn,Poi:()=>bt,Poi2:()=>q,PoiLayer:()=>ae,PoiLayer2:()=>Ut,RoadNetwork:()=>_n,RoadNetwork2:()=>yn,SelectBox:()=>En,Selection:()=>ge,Sensor:()=>Ee,Shadow:()=>ne,SvgLine:()=>le,SvgPolygon:()=>ue,TextTexture:()=>de,Timer:()=>D,TweenUtil:()=>Dt,UA:()=>sn,Wall:()=>ce,addAlphaToHexColor:()=>Pi,calc_angle:()=>tn,calc_direction:()=>we,convertToSnakeCase:()=>vn,createCircle:()=>Vt,createLine:()=>te,createRect:()=>mt,createSvg:()=>rn,createSvgElement:()=>Qt,createThreeBox:()=>Gi,createThreeLine:()=>Bi,darkenColor:()=>ft,defaultAibeeLoaderOption:()=>no,defaultConfig:()=>kr,defaultGraphicOptions:()=>Te,defaultOptions:()=>Pr,defaultTextTextureOptions:()=>Dr,dispose:()=>V,distancePointToSegment:()=>hn,generatorKeyByObj:()=>Lt,getAngle:()=>er,getCenter:()=>Jt,getConfig:()=>wn,getDirectPath:()=>Ni,getDistanceByPathPos:()=>fn,getLength:()=>A,getLongestSideDir:()=>Mi,getMinEdgeSquare:()=>en,getPathLength:()=>lt,getPointEdgeIndex:()=>Pt,getPosByPathDistance:()=>ee,hasChinese:()=>Qe,hexToRgb:()=>Me,initDirectionalLight:()=>Je,initLight:()=>Ze,initShape:()=>at,isAndroid:()=>Ai,isContain:()=>gt,isControl:()=>Rt,isIphone:()=>Ht,isMac:()=>It,isPointInPolygon:()=>nn,loadBuildingGround:()=>Bn,loadExternalStreet:()=>Ki,loadGraphics:()=>Gn,moveOnRoute:()=>Li,proxyOptions:()=>At,removeWeightPath:()=>nr,setCirclePosition:()=>_t,setLineStartEnd:()=>et,setRectPosition:()=>B,simplifyPath:()=>cn,sleepOnePromise:()=>on,sleepOneRf:()=>Ti,smoothPath:()=>un,strToNumber:()=>Ci,timeoutPromise:()=>Z,toWebWorker:()=>Ui,transformGraphicData:()=>X,translatePosToCenter:()=>rt,triggerWorker:()=>ut,vector3ToDevice:()=>y,xhrGet:()=>Ii});module.exports=Si(ro);var Ge=require("three");var D=class{tasks={requestAnimation:new Set,timeout:new Set,interval:new Set};requestAnimationFrame(e){let t=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(t),e()});return this.tasks.requestAnimation.add(t),t}cancelAnimationFrame(e){this.tasks.requestAnimation.delete(e),window.cancelAnimationFrame(e)}setTimeout(e,t){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),e()},t);return this.tasks.timeout.add(n),n}clearTimeout(e){this.tasks.timeout.delete(e),window.clearTimeout(e)}setInterval(e,t){let n=window.setInterval(()=>{this.tasks.interval.delete(n),e()},t);return this.tasks.interval.add(n),n}clearInterval(e){this.tasks.interval.delete(e),window.clearInterval(e)}dispose(){this.tasks.requestAnimation.forEach(e=>{window.cancelAnimationFrame(e)}),this.tasks.requestAnimation.clear(),this.tasks.timeout.forEach(e=>{window.clearTimeout(e)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(e=>{window.clearInterval(e)}),this.tasks.interval.clear()}};var K=require("three");function Ze(){let s=new K.Group,e=new K.AmbientLight(16777215,2.6);return s.add(e),s}function at(s,e=[]){let t=new K.Shape(s.map(n=>new K.Vector2(...n)));return e.length&&e.forEach(n=>{var r=new K.Path(n.map(i=>new K.Vector2(...i)));t.holes.push(r)}),t}function Je(s=16777215,e=1){let t=new K.DirectionalLight(s,e);return t.castShadow=!0,t.shadow.radius=8,t.shadow.bias=-.001,t.shadow.mapSize.set(256,256),t.shadow.camera.left=-200,t.shadow.camera.right=200,t.shadow.camera.top=200,t.shadow.camera.bottom=-200,t}function V(s,e){if(e&&s.children&&s.children.length&&s.children.forEach(t=>{V(t,e)}),s.isMesh){let t=s;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n.dispose()}):t.material.dispose())}s.isLight&&s.dispose?.()}function Qe(s){return/[\u4E00-\u9FA5]+/g.test(s)}var C=require("three"),kt=require("@turf/turf");function y(s,e,t,n){let r=s.clone().project(e),i=t/2,o=n/2,a=Math.round(r.x*i+i),l=Math.round(-r.y*o+o);return{x:a,y:l}}function Jt(s){let e=(0,kt.featureCollection)(s.map(n=>(0,kt.point)(n)));return(0,kt.center)(e).geometry.coordinates}function gt(s,e,t){return s.x>=e.x&&s.x<=t.x&&s.y>=e.y&&s.y<=t.y}function Mi(s){let e=0,t=new C.Vector3;for(let n=1;n<s.length;n++){let r=new C.Vector3(s[n-1][0],s[n-1][1],0),i=new C.Vector3(s[n][0],s[n][1],0),o=i.distanceTo(r);o>e&&(e=o,t=i.clone().sub(r).normalize())}return t}function A(s,e){return Math.sqrt((e[0]-s[0])**2+(e[1]-s[1])**2)}function lt(s){let e=0;for(let t=0;t<s.length-1;t++)e+=A(s[t],s[t+1]);return e}function tn(s,e,t){let n=new C.Vector2(e[0]-s[0],e[1]-s[1]),r=new C.Vector2(e[0]-t[0],e[1]-t[1]),o=n.angleTo(r)*180/Math.PI,a=new C.Vector2(e[0]-s[0],e[1]-s[1]);return new C.Vector2(t[0]-s[0],t[1]-s[1]).cross(a)>0?o:-o}function en(s,e){let t=Math.min(A(s[0][0],s[0][1]),A(s[0][2],s[0][1]))-1;e||(e=Jt(s[0]));let n=wi(e,t),r=new C.Vector2(s[0][0][0],s[0][0][1]),i=new C.Vector2(s[0][1][0],s[0][1][1]),o=new C.Vector2(s[0][2][0],s[0][2][1]),l=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new C.Vector2(0,1)),u=new C.Matrix3;return u.multiply(new C.Matrix3().translate(e[0],e[1])).multiply(new C.Matrix3().rotate(l)).multiply(new C.Matrix3().translate(-e[0],-e[1])),[n.map(c=>{let h=new C.Vector2(c[0],c[1]).applyMatrix3(u);return[h.x,h.y]})]}function wi(s,e){let t=e/2;return[[s[0]-t,s[1]+t],[s[0]+t,s[1]+t],[s[0]+t,s[1]-t],[s[0]-t,s[1]-t],[s[0]-t,s[1]+t]]}function Pt(s,e){let t=0,n=1/0,[r,i]=e;for(let o=0;o<s.length-1;o++){let[a,l]=s[o],[u,c]=s[o+1],h=Math.min(a,u)<=r&&r<=Math.max(a,u),p=Math.min(l,c)<=i&&i<=Math.max(l,c);if(h&&p){let d=Math.abs((u-a)*(i-l)-(c-l)*(r-a));d<n&&(n=d,t=o)}}return t}function nn(s,e){let t=s[0],n=s[1],r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let a=e[i][0],l=e[i][1],u=e[o][0],c=e[o][1];l>n!=c>n&&t<(u-a)*(n-l)/(c-l)+a&&(r=!r)}return r}function At(s,e){return new Proxy(s,{get:(t,n,r)=>Reflect.get(t,n,r),set:(t,n,r,i)=>{let o=Reflect.get(t,n,i),a=Reflect.set(t,n,r,i);return o!==r&&e.dispatchEvent({type:`change-${n}`,value:r}),a}})}function Z(s,e){return Promise.race([s,new Promise((t,n)=>{setTimeout(()=>n(new Error("Promise timeout")),e)})])}function Qt(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function rn(s,e){let t=Qt("svg");return t.setAttribute("width",s),t.setAttribute("height",e),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function Vt(s="2",e){let t=Qt("circle");return t.setAttribute("r",s),t.setAttribute("fill",e),t}function te(s){let e=Qt("line");return e.setAttribute("stroke",s),e}function mt(s,e){let t=Qt("rect");return t.setAttribute("stroke",s),t.setAttribute("fill",e),t}function _t(s,e,t){s.setAttribute("cx",`${e}`),s.setAttribute("cy",`${t}`)}function et(s,e,t){e&&(s.setAttribute("x1",`${e.x}`),s.setAttribute("y1",`${e.y}`)),t&&(s.setAttribute("x2",`${t.x}`),s.setAttribute("y2",`${t.y}`))}function B(s,e,t,n,r){s.setAttribute("x",`${e}`),s.setAttribute("y",`${t}`),s.setAttribute("width",`${n}`),s.setAttribute("height",`${r}`)}function on(){return Promise.resolve()}function Ti(){return new Promise(s=>{requestAnimationFrame(s)})}function Ci(s){return parseInt(s.replace("#","0x"),16)}function Pi(s,e){let t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16),i=Math.round(t*e),o=Math.round(n*e),a=Math.round(r*e);return`#${(1<<24|i<<16|o<<8|a).toString(16).slice(1)}`}function ft(s,e=.85){let t,n,r;if(s.startsWith("#"))t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16);else{let o=s.slice(4,-1).split(",");t=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return t=Math.min(Math.floor(t*e),255),n=Math.min(Math.floor(n*e),255),r=Math.min(Math.floor(r*e),255),"#"+((1<<24)+(t<<16)+(n<<8)+r).toString(16).slice(1)}function Me(s,e){s=s.replace(/^#/,"");let t=parseInt(s.substring(0,2),16),n=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16);return e!==void 0?`rgba(${t}, ${n}, ${r}, ${e})`:`rgb(${t}, ${n}, ${r})`}var It=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,sn=(window.navigator.userAgent||"").toLocaleLowerCase(),Ht=/ios|iphone/i.test(sn),Ai=/android|adr|linux/gi.test(sn);function Rt(s){return It?s==="Meta":s==="Control"}var an="__once__",ln=class{events=new Map;on(e,t){if(typeof t!="function")return;let n=this.events.get(e);return n?n.add(t):this.events.set(e,new Set([t]))}once(e,t){if(typeof t!="function")return;let n=`${an}${e}`,r=this.events.get(n);return r?r.add(t):this.events.set(n,new Set([t]))}off(e,t){let n=this.events.get(e),r=this.events.get(`${an}${e}`);!n&&!r||(t===void 0&&(n?.clear(),r?.clear()),n?.has(t)&&n.delete(t),r?.has(t)&&r.delete(t))}offAll(){this.events.clear()}emit(e,...t){let n=this.events.get(e),r=this.events.get(`${an}${e}`);!n&&!r||(n?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.clear())}};var Wt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(Wt||{});function Lt(s){return Object.keys(s).sort().map(e=>`${e}=${s[e]}`).join("&")}function Ii(s,e){return new Promise((t,n)=>{let r=new XMLHttpRequest;r.open("GET",s,!0),Object.keys(e.headers||{}).forEach(i=>{r.setRequestHeader(i,e.headers[i])}),e.responseType&&(r.responseType=e.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(e.responseType==="arraybuffer")t(r.response);else try{let i=JSON.parse(r.responseText);t(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var Xt=require("three"),tr=Zt(Qn(),1);function er(s,e){let t=s.clone().normalize(),n=e.clone().normalize();return Math.acos(t.dot(n))}function Ri(s){let e=0;return s.reduce(([t,n],[r,i])=>(e+=Math.sqrt((r-t)**2+(i-n)**2),[r,i])),e/s.length}function un(s,e=.25){if(Ri(s)<e)return s;let t=(0,tr.default)(s);return un(t,e)}function cn(s,e=!1,t=!0,n=5,r=150,i=3){let o=[],a=!e;if(o.push(s[0]),s.length<2)return o;for(let u=0;u<s.length-2;u+=1){let c=s[u],h=s[u+1],p=s[u+2],d=new Xt.Vector2(c[0]-h[0],c[1]-h[1]),m=new Xt.Vector2(p[0]-h[0],p[1]-h[1]),f=er(d,m)/Math.PI*180,g=d.length()+m.length();(!a||f<r&&g>.01||g>n)&&(o.push(s[u+1]),a=!0)}if(o.push(s[s.length-1]),!t)return o;let l=[];l.push(o[0]);for(let u=0;u<o.length-2;u+=1){let c=new Xt.Vector2(o[u][0],o[u][1]),h=new Xt.Vector2(o[u+1][0],o[u+1][1]),p=new Xt.Vector2(o[u+2][0],o[u+2][1]),d=c.distanceTo(h)/2,m=p.distanceTo(h)/2,f=h.clone(),g=h.clone();f.add(c.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d)),g.add(p.clone().sub(h).normalize().multiplyScalar(m>i?i/2:m));let E=[[f.x,f.y],[h.x,h.y],[g.x,g.y]];l.push(...un(E,i/25))}return l.push(o[o.length-1]),nr(l)}function nr(s){if(s.length<=1)return s;let e=[],t;return s.forEach(([n,r])=>{t?n===t[0]&&r===t[1]||(t=[n,r],e.push([n,r])):(t=[n,r],e.push([n,r]))}),e}function hn(s,e,t){let n=Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2);if(n===0)return{distance:Math.sqrt((s[0]-e[0])**2+(s[1]-e[1])**2),closestPoint:e.slice(0)};let r=Math.max(0,Math.min(1,((s[0]-e[0])*(t[0]-e[0])+(s[1]-e[1])*(t[1]-e[1]))/n**2)),i=[e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1])];return{distance:Math.sqrt((s[0]-i[0])**2+(s[1]-i[1])**2),closestPoint:i}}function Li(s,e,t){let[n,r]=s,[i,o]=e,a=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(a===0||a<t)return[...e];let l=t/a,u=n+(i-n)*l,c=r+(o-r)*l;return[u,c]}var pn=(u=>(u.START="start",u.END="end",u.FRONT="front",u.RIGHT="right",u.LEFT="left",u.RIGHT_FRONT="right_front",u.LEFT_FRONT="left_front",u.RIGHT_BACK="right_back",u.LEFT_BACK="left_back",u))(pn||{});function we(s,e,t){let n=tn(s,e,t);return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function Ni(s){if(!s.length)return[];let e=[{direction:"start",distance:A(s[0],s[1]),points:[s[0],s[1]]}];for(let t=2;t<s.length;t++){let n=we(s[t-2],s[t-1],s[t]);if(n==="front"){let r=e[e.length-1],i=A(s[t-1],s[t]);r.distance+=i,t!==2&&r.points.push(s[t-1])}else e.push({direction:n,distance:A(s[t-1],s[t]),points:[s[t-1],s[t]]})}return e.push({direction:"end",distance:0,points:[s[s.length-1]]}),e}function fn(s,e){if(s.length<2)return-1;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=[e[0]-r[0],e[1]-r[1]],a=[i[0]-r[0],i[1]-r[1]],l=Math.min(i[0],r[0])<=e[0]&&e[0]<=Math.max(i[0],r[0]),u=Math.min(i[1],r[1])<=e[1]&&e[1]<=Math.max(i[1],r[1]);if(l&&u){let c=o[0]*a[1]-o[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((e[0]-r[0])**2+(e[1]-r[1])**2);return t+h}}t+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function ee(s,e){if(s.length<2)return s[0]??null;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2);if(t+=o,t>=e){let a=(e-(t-o))/o,l=r[0]+(i[0]-r[0])*a,u=r[1]+(i[1]-r[1])*a;return[l,u]}}return null}var dt=Zt(mn(),1);var nt="___",_n=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new dt.default;escalatorRoute=new dt.default;straightLadderRoute=new dt.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(t=>{t.points.forEach(n=>{let r=`${t.floor}${nt}${n.id}`;if(this.pointMap.set(r,n),this.nodeMap.set(`${n.floor}${nt}${n.nodeId}`,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push({...n}),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push({...n}),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push({...n}),this.facilityMap.set(n.targetId,i)}}),t.lines.filter(n=>n.direction!=="no").forEach(n=>{let r=`${t.floor}${nt}${n.from}`,i=`${t.floor}${nt}${n.to}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;if(o?.length&&a?.length){let l=A(o,a);this.addLineItem(r,i,l),n.direction==="double"&&this.addLineItem(i,r,l)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${nt}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${nt}${o[u].id}`,h=this.pointMap.get(l)?.cds,p=this.pointMap.get(c)?.cds;if(h?.length&&p?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=n;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){let a=`${i.start.floor}${nt}${i.start.id}`,l=`${i.end.floor}${nt}${i.end.id}`,u=this.pointMap.get(a)?.cds,c=this.pointMap.get(l)?.cds;if(u?.length&&c?.length){let h=e;this.addLineItem(a,l,h,r)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new dt.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new dt.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new dt.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${nt}${e.nodeId}`);if(t){let[n,r]=t.split(nt);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=A(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:n.point.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(e);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((p,d)=>p+lt(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${nt}${e.id}`,i=`${t.floor}${nt}${t.id}`,o=n.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u;if(a[a.length-1]?.floor===c){let h=a[a.length-1];h.points.push(u.cds),h.endType=u.type,h.destId=u.nodeId,h.distance=lt(h.points)}else a.push({floor:c,points:[u.cds],endType:u.type,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t){return this.getRoutePath(e,t,this.baseRoute)}getEscalatorPath(e,t){return this.getRoutePath(e,t,this.escalatorRoute)}getStraightLadderPath(e,t){return this.getRoutePath(e,t,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new dt.default,this.escalatorRoute=new dt.default,this.straightLadderRoute=new dt.default}};var G=Zt(mn(),1);var yt=require("lodash"),w="___",yn=class{constructor(e=3){this.lift_priority=e}roadInfo=[];facilities=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;rampMap=new Map;staircaseMap=new Map;parkingMap=new Map;lineMap=new Map;baseRoute=new G.default;escalatorRoute=new G.default;straightLadderRoute=new G.default;forwardLineMap=new Map;forwardRoute=new G.default;isFacilityByType(e){return["facility","escalator","straightLadder","staircase","ramp"].includes(e)}initFacilities(e){this.facilities=e.map(t=>{let n=[];try{n=JSON.parse(t.entry_end_floor)}catch{n=[]}let r=[];try{r=JSON.parse(t.entry_start_floor)}catch{r=[]}return{...t,entry_start_floor:r,entry_end_floor:n}})}initRoute(e,t){this.clear(),this.roadInfo=e,this.initFacilities(t);let n=new Date,r=n.getHours()*60+n.getMinutes();e.length&&(e.forEach(i=>{(i.points||[]).filter(o=>o.openStatus!==!1).filter(o=>{if(!o.startTime||!o.endTime)return!0;let[a,l]=o.startTime.split(":").map(d=>+d),[u,c]=o.endTime.split(":").map(d=>+d),h=a*60+l,p=u*60+c;return r>=h&&r<=p}).forEach(o=>{o.floor=i.floor;let a=`${i.floor}${w}${o.id}`;if(this.nodeMap.set(`${i.floor}${w}${o.nodeId}`,`${i.floor}${w}${o.relatedId||o.id}`),this.pointMap.set(a,o),this.isFacilityByType(o.type)){let l=this.facilities.find(u=>u.id===+o.targetId);if(l){switch(l.entry_infra_type){case"straightLadder":if(l.entry_end_floor.find(p=>p.floor===i.floor)&&l.entry_start_floor.find(p=>p.floor===i.floor)){let p=this.straightLadderMap.get(o.targetId)||[];p.push({...o}),this.straightLadderMap.set(o.targetId,p)}break;case"staircase":if(l.entry_end_floor.find(p=>p.floor===i.floor)&&l.entry_start_floor.find(p=>p.floor===i.floor)){let p=this.staircaseMap.get(o.targetId)||[];p.push({...o}),this.staircaseMap.set(o.targetId,p)}break;case"escalator":let c=this.escalatorMap.get(o.targetId)||[];if(l.entry_start_floor.find(p=>p.floor===i.floor)){let p=c.find(d=>d.end?.floor!==i.floor&&!d.start);p?p.start=o:c.push({start:o})}if(l.entry_end_floor.find(p=>p.floor===i.floor)){let p=c.find(d=>d.start?.floor!==i.floor&&!d.end);p?p.end=o:c.push({end:o})}this.escalatorMap.set(o.targetId,c);break;case"ramp":let h=this.rampMap.get(o.targetId)||[];if(l.entry_start_floor.find(p=>p.floor===i.floor)){let p=h.find(d=>d.end?.floor!==i.floor&&!d.start);p?p.start=o:h.push({start:o})}if(l.entry_end_floor.find(p=>p.floor===i.floor)){let p=h.find(d=>d.start?.floor!==i.floor&&!d.end);p?p.end=o:h.push({end:o})}this.rampMap.set(o.targetId,h);break}let u=this.facilityMap.get(o.targetId)||[];u.push({...o}),this.facilityMap.set(o.targetId,u)}}o.type==="parkingSpace"&&this.parkingMap.set(`${i.floor}${w}${o.name}`,o)}),(i.lines||[]).filter(o=>o.direction!=="no").forEach(o=>{let a=`${i.floor}${w}${o.from}`,l=`${i.floor}${w}${o.to}`,u=this.pointMap.get(a),c=this.pointMap.get(l);if(!u||!c)return;let h=u.cds,p=c.cds,d=A(h,p);if(!u.permission&&!c.permission)switch(this.addLineItem(a,l,d),this.addLineItem(l,a,d),o.direction){case"double":this.addLineItem(a,l,d,this.forwardLineMap),this.addLineItem(l,a,d,this.forwardLineMap);break;case"single":this.addLineItem(a,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,a,d,this.forwardLineMap);break}else u.permission&&(this.setPermissionLine(a,l,u.permission,d,""),this.setPermissionLine(l,a,u.permission,d,"")),c.permission&&c.permission!==u.permission&&(this.setPermissionLine(a,l,c.permission,d,""),this.setPermissionLine(l,a,c.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(e){return this[`permission_${e}`]||(this[`permission_${e}`]=new Set),this[`permission_${e}`]}setPermissionLine(e,t,n,r,i){this.getPermissionMap(n).add({fromKey:e,toKey:t,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((e,t)=>{if(e.length<2){this.straightLadderMap.delete(t);return}for(let n=0;n<e.length;n++){let r=`${e[n].floor}${w}${e[n].id}`,i=this.pointMap.get(r);if(i){for(let o=0;o<e.length;o++)if(n!==o){let a=`${e[o].floor}${w}${e[o].id}`,l=this.pointMap.get(a);if(!l)continue;i.permission&&this.setPermissionLine(r,a,i.permission,1,"straightLadder"),l.permission&&l.permission!==i.permission&&this.setPermissionLine(r,a,l.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((e,t)=>{if(e.length<2){this.staircaseMap.delete(t);return}for(let n=0;n<e.length;n++){let r=`${e[n].floor}${w}${e[n].id}`,i=this.pointMap.get(r);if(i){for(let o=0;o<e.length;o++)if(n!==o){let a=`${e[o].floor}${w}${e[o].id}`,l=this.pointMap.get(a);if(!l)continue;i.permission&&this.setPermissionLine(r,a,i.permission,1,"staircase"),l.permission&&l.permission!==i.permission&&this.setPermissionLine(r,a,l.permission,1,"straightLadder")}}}}),this.escalatorMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),a.permission&&a.permission!==o.permission&&this.setPermissionLine(r,i,a.permission,1,"escalator"))}})}),this.rampMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),a.permission&&a.permission!==o.permission&&this.setPermissionLine(r,i,a.permission,10,"ramp"))}})})}addPermissionLineToMap(e,t,n,r){let i=this.getPermissionMap(e);console.log(i),i.forEach(o=>{t.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${w}${o[a].id}`,u=this.pointMap.get(l);if(!(!u||u.permission)){for(let c=0;c<o.length;c++)if(a!==c){let h=`${o[c].floor}${w}${o[c].id}`,p=this.pointMap.get(h);if(!p||p.permission)continue;if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,h,d,r)}else{let d=n;this.addLineItem(l,h,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(a=>{if(a.start&&a.end){let l=`${a.start.floor}${w}${a.start.id}`,u=`${a.end.floor}${w}${a.end.id}`,c=this.pointMap.get(l),h=this.pointMap.get(u);if(c&&h&&!c.permission&&!h.permission){let p=e;this.addLineItem(l,u,p,r)}}})})}initBaseRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,e),this.baseRoute=new G.default(e)}initEscalatorRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new G.default(e)}initStraightLadderRoute(){let e=new Map((0,yt.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new G.default(e)}initForwardRoute(){this.rampMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${w}${n.start.id}`,i=`${n.end.floor}${w}${n.end.id}`,o=this.pointMap.get(r),a=this.pointMap.get(i);o&&a&&!o.permission&&!a.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.forwardRoute=new G.default(this.forwardLineMap)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility||e.parkingSpace&&e.floor?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${w}${e.nodeId}`);if(t){let[n,r]=t.split(w);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=A(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:t.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){if(e.parkingSpace){let n=this.parkingMap.get(`${e.floor}${w}${e.parkingSpace}`);if(n)return{floor:e.floor,id:n.id}}let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilities.filter(r=>+r.type_id==+e.facility).map(r=>r.id).map(r=>this.facilityMap.get(`${r}`)).flat(2)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n="",r){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let i=this.transformStart(e);if(!i)return"no-start";let o=this.transformEnd(t);if(!o)return"no-end";let a=this.getBasePath.bind(this);switch(n){case"escalator":a=this.getEscalatorPath.bind(this);break;case"straightLadder":a=this.getStraightLadderPath.bind(this);break;case"forward":a=this.getForwardPath.bind(this);break;default:a=this.getBasePath.bind(this);break}if(o.id)return a(i,o,r);if(o.facility){let u=this.facilities.filter(h=>+h.type_id==+t.facility).map(h=>h.id).map(h=>this.facilityMap.get(`${h}`)).flat(2).filter(h=>h).filter(h=>o.floor?h.floor===o.floor:!0);if(!u.length)return null;let c=u.map(h=>a(i,{floor:h.floor,id:h.id},r)).filter(h=>!!h);return c.reduce((h,p)=>{let d=p.reduce((m,f)=>m+lt(f.points),0);return d<h.distance&&(h.distance=d,h.path=p),h},{distance:1/0,path:c[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${w}${e.id}`,i=`${t.floor}${w}${t.id}`,o=n.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u,h=u.type;if(this.isFacilityByType(u.type)){let p=this.facilities.find(d=>d.id===+u.targetId);p&&(h=p.entry_infra_type)}if(a[a.length-1]?.floor===c){let p=a[a.length-1];p.points.push(u.cds),p.endType=h,p.destId=u.nodeId,p.distance=lt(p.points)}else a.push({floor:c,points:[u.cds],endType:h,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t,n){if(!n)return this.getRoutePath(e,t,this.baseRoute);let r=(0,yt.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let i=new G.default(r);return this.getRoutePath(e,t,i)}getEscalatorPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.escalatorRoute);let r=(0,yt.cloneDeep)(this.escalatorRoute.graph),i=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",1*i],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]));let o=new G.default(r);return this.getRoutePath(e,t,o)}getStraightLadderPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.straightLadderRoute);let r=(0,yt.cloneDeep)(this.straightLadderRoute.graph),i=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder"],r,new Map([["escalator",3*i],["straightLadder",1*i],["staircase",3e4*i]]));let o=new G.default(r);return this.getRoutePath(e,t,o)}getForwardPath(e,t,n){if(!n)return this.getRoutePath(e,t,this.forwardRoute);let r=(0,yt.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],r,new Map([["ramp",10]]));let i=new G.default(r);return this.getRoutePath(e,t,i)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new G.default,this.escalatorRoute=new G.default,this.straightLadderRoute=new G.default}};var Nt=class{static keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let e=this.createKey();for(;this.keySet.has(e);)e=this.createKey();return e}static removeKey(e){this.keySet.delete(e)}static dispose(){this.keySet.clear()}};function vn(s){return s.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function ut(s,e,t){return new Promise((n,r)=>{let i=Nt.genUniqueKey(),o=({data:a})=>{a.type===`${e}_result`&&a.key===i&&(Nt.removeKey(i),self.removeEventListener("message",o),a.error?r(a.error):n(a.data))};s.addEventListener("message",o),s.postMessage({type:e,key:i,data:t})})}function Ui(s){let e={};for(let n in s)n.startsWith("on")&&(e[vn(n.slice(2))]=s[n]);let t=async({data:n})=>{if(e[n.type])try{let r=await e[n.type](n.data);self.postMessage({type:`${n.type}_result`,key:n.key,data:r})}catch(r){self.postMessage({type:`${n.type}_result`,key:n.key,error:r})}else self.postMessage({type:`${n.type}_result`,key:n.key,error:"no_event"})};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var ct=require("three");function Bi(s,e=16711680){let t=new ct.LineBasicMaterial({color:e}),n=new ct.BufferGeometry().setFromPoints(s);return new ct.Line(n,t)}function Gi(s,e=16711680){let t=new ct.LineBasicMaterial({color:e}),n=new ct.BoxGeometry(1,1,1),r=new ct.Mesh(n,t);return r.position.copy(s),r}function X(s,e,t=0){s.forEach(n=>{n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"?(n.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=e[0],i[1]-=e[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(r=>r.map(i=>rt(i,e)))),n.doors?.length&&n.doors.map(r=>{r.coord=rt(r.coordinate,e)}),n.center&&(n.center=rt(n.center,e))):n.geometry.coords=rt(n.geometry.cds,e)});for(let n=0;n<s.length;n++){let r=s[n];r.deltaHeight=1e-5*(t+n+1)}}function rt(s,e){return[s[0]-e[0],s[1]-e[1]]}var _r=require("@tweenjs/tween.js"),Dt=class{pauseTween=!1;tweenStore=new Set;group=new _r.Group;constructor(){}update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(e=>{this.tweenStore.add(e),e.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(e=>{e.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(e){this.group.remove(e)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(e=>e.stop()),this.group.removeAll()}dispose(){this.clear()}};var S=require("three");var Fr=require("three");var v=require("three");var vr=require("three/examples/jsm/lines/LineMaterial"),H=require("three");function yr(s){return`${s.x}-${s.y}-${s.z}`}var I=class{static lineMaterialMap=new Map;static meshStandardMaterialMap=new Map;static meshBasicMaterialMap=new Map;static shaderMaterialMap=new Map;static line2MaterialMap=new Map;static generateLineMaterialKey({color:e,opacity:t}){return`${e}-${t}`}static createLineMaterial({color:e,opacity:t}){let n=this.generateLineMaterialKey({color:e,opacity:t});if(this.lineMaterialMap.has(n))return this.lineMaterialMap.get(n);let r=new H.LineBasicMaterial({color:new H.Color(e).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(n,r),r}static createMeshStandardMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let r=new H.MeshStandardMaterial({color:new H.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(n,r),r}static createMeshBasicMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshBasicMaterialMap.has(n))return this.meshBasicMaterialMap.get(n);let r=new H.MeshBasicMaterial({color:e,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(n,r),r}static createShaderMaterial({gradualColor:e,center:t,maxValue:n,opacity:r,direction:i,max:o,min:a}){let l=`${e.toString()}-${yr(t)}-${n}-${r}-${yr(i)}`;if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let u=`
2
2
  uniform vec3 uColor;
3
3
  uniform vec3 uGradualColor;
4
4
  uniform vec3 center;
@@ -35,7 +35,7 @@
35
35
  void main() {
36
36
  gl_FragColor = vec4(vColor.x, vColor.y, vColor.z, opacity);
37
37
  }
38
- `,h=new H.ShaderMaterial({uniforms:{uColor:{value:new H.Color(e[0]).convertLinearToSRGB()},uGradualColor:{value:new H.Color(e[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:n},opacity:{value:r},uDirection:{value:i},uMax:{value:o},uMin:{value:a}},vertexShader:u,fragmentShader:c,side:H.DoubleSide});return this.shaderMaterialMap.set(l,h),h}static createLine2MaterialMap({color:e,width:t,dashed:n,resolution:r}){let i=`${e}-${t}-${n}-${r.x}-${r.y}`;if(this.line2MaterialMap.has(i))return this.line2MaterialMap.get(i);let o=new yr.LineMaterial({color:parseInt(e.slice(1),16),dashed:n,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:r});return this.line2MaterialMap.set(i,o),o}static dispose(){this.lineMaterialMap.forEach((e,t)=>{e.dispose()}),this.lineMaterialMap.clear(),this.meshStandardMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshStandardMaterialMap.clear(),this.meshBasicMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshBasicMaterialMap.clear(),this.shaderMaterialMap.forEach((e,t)=>{e.dispose()}),this.shaderMaterialMap.clear(),this.line2MaterialMap.forEach((e,t)=>{e.dispose()}),this.line2MaterialMap.clear()}};var Ot=require("three");var vt=class{static canvas=document.createElement("canvas");static ctx=this.canvas.getContext("2d");static cacheMap=new Map;static options={width:1024,height:64,font:"54px sans-serif",textBaseline:"hanging",lineWidth:12,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};static getCanvas(){if(this.canvas)return this.canvas;{let e=document.createElement("canvas");return this.canvas=e,e}}static getCtx(){if(this.ctx)return this.ctx;let t=this.getCanvas().getContext("2d");return this.ctx=t,t}static getMergedOptions(e){return{...this.options,...e}}static setCtxStyle(e){let t=this.getCanvas(),n=this.getCtx();t.width=e.width,t.height=e.height,n.font=e.font,n.textBaseline=e.textBaseline,n.lineWidth=e.lineWidth,n.fillStyle=e.fillStyle,n.strokeStyle=e.strokeStyle}static getTextureByText(e,t){let n=this.getMergedOptions(t),r=Lt({...n,text:e});if(this.cacheMap.has(r))return this.cacheMap.get(r);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let a=Qe(e)?4:8;n.lineWidth&&o.strokeText(e,2,a),o.fillText(e,2,a);let l=Math.ceil(o.measureText(e).width);l=l%2===0?l:l+1,l+=2;let u=o.getImageData(0,0,l,64),c=new Ot.DataTexture(Uint8Array.from(u.data),l,64,Ot.RGBAFormat);return c.flipY=!0,c.minFilter=Ot.LinearFilter,c.magFilter=Ot.LinearFilter,this.cacheMap.set(r,c),c}static dispose(){this.ctx=null,this.canvas=null,this.cacheMap.forEach(e=>e.dispose()),this.cacheMap.clear()}};var Ft=require("three"),xt=class{static textureLoader=new Ft.TextureLoader;static urlTextureMap=new Map;static getTextureByUrl(e){if(this.urlTextureMap.has(e))return this.urlTextureMap.get(e);let t=this.textureLoader.loadAsync(e);return t.then(n=>{n.format=Ft.RGBAFormat,n.magFilter=Ft.LinearFilter,n.minFilter=Ft.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(e,n)}),this.urlTextureMap.set(e,t),t}static dispose(){this.urlTextureMap.forEach(e=>{e instanceof Promise?e.then(t=>t.dispose()):e.dispose()}),this.urlTextureMap.clear()}};var vr=require("three/examples/jsm/loaders/GLTFLoader"),Et=class{static loader=new vr.GLTFLoader;static modelMap=new Map;static async loadModel(e){if(this.modelMap.has(e)){let n=this.modelMap.get(e);if(n instanceof Promise)n.then(r=>({...r,scene:r.scene.clone()}));else return{...n,scene:n.scene.clone()}}let t=new Promise((n,r)=>{this.loader.load(e,i=>{n(i),this.modelMap.set(e,i)},void 0,r)});return this.modelMap.set(e,t),t.then(n=>({...n,scene:n.scene.clone()}))}static dispose(){this.modelMap.forEach(e=>{e instanceof Promise?e.then(t=>V(t.scene)):V(e.scene)}),this.modelMap.clear()}};var xr=require("lodash"),Te={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],locked:!1,visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9},R=class extends v.Object3D{constructor(t,n){super();this.context=t;if(this.options=At((0,xr.cloneDeep)({...Te,...n}),this),this.options.geometry.type==="point"){let[r,i]=this.options.geometry.coords;return this.position.set(r,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",({value:r})=>{this.dispose(),this.init()}),this.addEventListener("change-strokeColor",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-airHeight",({value:r})=>{this.position.z=r}),this.addEventListener("change-visible",({value:r})=>{this.visible=r}),this.addEventListener("change-stroke",({value:r})=>{if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else this.line&&(this.remove(this.line),this.lineGeometry?.dispose())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}geometry;material;mesh;line;lineMaterial;lineGeometry;options;getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new v.Vector3,n=new v.Box3;return n.setFromObject(this),n.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new v.Vector3(0,0,0);let t=new v.Box3,n=new v.Vector3;return t.setFromObject(this),t.getSize(n),n}getPosition(){let t=this.getCenter();return t.setZ(t.z+this.options.height/2),t}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){if(this.options.doors?.length&&this.options.geometry.type==="polygon"){let t=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let r=n.type==="single"?.5:1,i=.5,o=Pt(t,n.coord),a=new v.Vector2(...n.coord),l=new v.Vector2(...t[o]).sub(new v.Vector2(...n.coord)).normalize(),u=new v.Vector2().addVectors(a,l.clone().multiplyScalar(r)),c=new v.Vector2().addVectors(a,l.clone().multiplyScalar(-r)),h=new v.Vector2(-l.y,l.x),p=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i));nn([p.x,p.y],t)||(h.multiplyScalar(-1),p=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i)));let d=new v.Vector2().addVectors(c,h.clone().multiplyScalar(i)),m=[[u.x,u.y],[p.x,p.y],[d.x,d.y],[c.x,c.y]];this.options.geometry.coords=[[...t.slice(0,o+1),...m,...t.slice(o+1)]],t=this.options.geometry.coords[0]})}}initGeometry(){let t=st(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new v.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=I.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let n=I.createMeshBasicMaterial({color:pt(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,n],[t,n]}getMaxAndMin(t,n){let r=new v.Box3().setFromObject(this),i=t.clone().add(n.clone().multiplyScalar(1e3)),o=new v.Ray(i,n.clone().multiplyScalar(-1)),a=new v.Vector3;o.intersectBox(r,a);let l=t.clone().add(n.clone().multiplyScalar(-1e3)),u=new v.Ray(l,n.clone()),c=new v.Vector3;return u.intersectBox(r,c),{max:c,min:a}}initGradualMaterial(){let{max:t,min:n}=new v.Box3().setFromObject(this),r=t.clone().sub(n),i=Math.max(r.x,r.y,r.z)/2,o=this.getPosition(),a=new v.Vector3(-1,.2,0).normalize(),{max:l,min:u}=this.getMaxAndMin(o,a),c=I.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,0),max:l,min:u});if(this.options.height<=.1)return this.material=c,c;let h=this.getCenter(),p=new v.Vector3(-1,.2,1).normalize(),{max:d,min:m}=this.getMaxAndMin(h,p),f=I.createShaderMaterial({gradualColor:[pt(this.options.gradualColor[0],this.options.colorFactor),pt(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,1),max:d,min:m});return this.material=[c,f],[c,f]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=I.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new v.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options.height+this.options.deltaHeight,{coords:r}=this.options.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let a=0;a<o.length;a++){let l=o[a],u=a+1===o.length?o[0]:o[a+1];t.push(new v.Vector3(l[0],l[1],n)),t.push(new v.Vector3(u[0],u[1],n))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new v.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new v.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.line=t,this.add(t),t}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let n=t.intersectObject(this.mesh);if(n[0]){let{point:r,distance:i}=n[0];return{position:r,distance:i}}return!1}dispose(){this.geometry?.dispose(),this.line?.geometry.dispose(),this.clear()}};var it=require("three");var ne=class extends it.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let e=Je(16777215,.5);return e.position.set(0,0,100),this.add(e),e}changeLightCamera(e){let t=e.x,n=e.y;this.directionalLight.shadow.camera.left=-t,this.directionalLight.shadow.camera.right=t,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(t,n)}changeLightColor(e){this.directionalLight.color=new it.Color(e)}setPosition(e){this.position.copy(e),this.directionalLight.position.set(-e.x/2,-e.y/2,100)}initPlane(e=1e3,t=1e3){let n=new it.PlaneGeometry(e,t),r=new it.ShadowMaterial({transparent:!0,opacity:0,side:it.DoubleSide}),i=new it.Mesh(n,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(e){this.directionalLight.target=e}transformOpacity(e){return e*this.basicOpacity}setOpacity(e){this.plane.material.opacity=this.transformOpacity(e)}dispose(){V(this,!0)}};var Ce=require("three");var M=require("three");var Er=require("lodash");var Gi={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},re=class extends M.EventDispatcher{constructor(t,n={}){super();this.context=t;this.options={...Gi,...n},this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}div;element;position=new M.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,Er.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){if(this.element instanceof R&&this.element.options.geometry.type==="polygon"){let{max:i,min:o}=new M.Box3().setFromObject(this.element),a=(i.x+o.x)/2,l=(i.y+o.y)/2;return{left:new M.Vector3(o.x,l,i.z),leftTop:new M.Vector3(o.x,i.y,i.z),top:new M.Vector3(a,i.y,i.z),rightTop:new M.Vector3(i.x,i.y,i.z),right:new M.Vector3(i.x,l,i.z),rightBottom:new M.Vector3(i.x,o.y,i.z),bottom:new M.Vector3(a,o.y,i.z),leftBottom:new M.Vector3(o.x,o.y,i.z),center:new M.Vector3(a,l,i.z)}}let{x:t,y:n,z:r}=this.element?.getPosition?.()||this.position;return{left:new M.Vector3(t,n,r),leftTop:new M.Vector3(t,n,r),top:new M.Vector3(t,n,r),rightTop:new M.Vector3(t,n,r),right:new M.Vector3(t,n,r),rightBottom:new M.Vector3(t,n,r),bottom:new M.Vector3(t,n,r),leftBottom:new M.Vector3(t,n,r),center:new M.Vector3(t,n,r)}}getPlacementScreenPosition(){let{width:t,height:n}=this.context.clientSize,r=this.getPlacementPosition();return Object.keys(r).reduce((i,o)=>{let{x:a,y:l}=y(r[o],this.context.camera,t,n);return i[o]={x:a,y:l},i},{})}checkOverflow(t,n){let{width:r,height:i}=this.context.clientSize;return n.x>0&&t.x<r&&n.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:n}=this.div,r=this.getPlacementScreenPosition(),i=t/2,o=n/2,a=[{type:"center",getBox(l,u){return{max:{x:i+l,y:u-n},min:{x:l-i,y:u}}}},{type:"left",getBox(l,u){return{max:{x:l,y:u-o},min:{x:l-t,y:u+o}}}},{type:"leftTop",getBox(l,u){return{max:{x:l,y:u-n},min:{x:l-t,y:u}}}},{type:"top",getBox(l,u){return{max:{x:l+i,y:u-n},min:{x:l-i,y:u}}}},{type:"rightTop",getBox(l,u){return{max:{x:l+t,y:u-n},min:{x:l,y:u}}}},{type:"right",getBox(l,u){return{max:{x:l+t,y:u-o},min:{x:l,y:u+o}}}},{type:"rightBottom",getBox(l,u){return{max:{x:l+t,y:u},min:{x:l,y:u+n}}}},{type:"bottom",getBox(l,u){return{max:{x:l+i,y:u},min:{x:l-i,y:u+n}}}},{type:"leftBottom",getBox(l,u){return{max:{x:l,y:u},min:{x:l-t,y:u+o}}}}];for(let l=0;l<a.length;l++){let u=a[l],c=r[u.type],{max:h,min:p}=u.getBox(c.x,c.y);if(this.checkOverflow(h,p))return{type:u.type,position:c}}return{type:"center",position:r.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className=`overlay_${t.type}`,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,n="block"){t!==this.visible&&(this.div.style.display=t?n:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=`${t}`}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new M.Box3().setFromObject(this.element).getCenter(new M.Vector3):this.position}get withinDisplayRange(){let{x:t,y:n}=this.clientPos,{width:r,height:i}=this.context.clientSize;return t>=0&&t<=r&&n>=0&&n<=i}_updatePosition(t,n){this.clientPos={x:t,y:n};let{width:r,height:i,x:o,y:a}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${o}px`,this.div.style.top=`${a+i}px`),this.options.autoUpdate?this.div.style.transform=`translate3d(${t}px, ${-i+n}px, 0)`:this.dispatchEvent({type:"update-position",x:t,y:n,width:r,height:i})}updatePosition(t=!1){let n=this.getPosition(),{width:r,height:i}=this.context.clientSize,{x:o,y:a}=y(n,this.context.camera,r,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()};registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.unRegistryEvent(),this.unBindElement(),this.observer?.disconnect(),this.div?.remove(),this.div=null}};var zi={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},bt=class extends Ce.EventDispatcher{constructor(t,n){super();this.context=t;this.options=At({...zi,...n},this),this.position.set(n.position?.x||0,n.position?.y||0,n.position?.z||0),this.overlay=new re(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:r,y:i,height:o})=>{this.overlay.div.style.transform=`translate3d(calc(${r}px - 50%), calc(${-o+i}px - ${this.options.icon&&this.options.icon_position!=="center"?"100%":"50%"}), 0)`}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",({value:r})=>{r?this.img?this.img.setAttribute("src",r):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",({value:r})=>{let i=this.textDiv;if(i){let o=this.initText();this.div.replaceChild(o,i)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",({value:r})=>{this.overlay.setOpacity(r)}),this.addEventListener("change-icon_size",({value:r})=>{this.img&&(this.img.style.width=`${r?.[0]||32}px`,this.img.style.height=`${r?.[1]||32}px`,this.resetSize())}),this.addEventListener("change-icon_opacity",({value:r})=>{this.img&&(this.img.style.opacity=`${r}`)}),this.addEventListener("change-icon_border",({value:r})=>{this.img&&(this.img.style.border=`${r.width}px solid ${r.color}`)}),this.addEventListener("change-background",({value:r})=>{this.div.style.background=r})}div;textDiv;img;overlay;options;visible=!0;size={width:0,height:0};position=new Ce.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await on(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:n}=this.img.getBoundingClientRect();this.size={width:t+2,height:n+2}}else{let{width:t,height:n}=this.div.getBoundingClientRect();this.size={width:t+2,height:n+2}}}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(n=>{let r=document.createElement("div");if(r.style.whiteSpace="nowrap",n.styles)for(let[i,o]of Object.entries(n.styles))r.style[i]=o;r.textContent=n.text,t.appendChild(r)}),t}initIcon(){let t=document.createElement("img");return t.setAttribute("src",this.options.icon),t.style.width=`${this.options.icon_size?.[0]||32}px`,t.style.height=`${this.options.icon_size?.[1]||32}px`,t.style.opacity=`${this.options.icon_opacity}px`,t.style.borderRadius="50%",this.options.icon_border.width&&(t.style.border=`${this.options.icon_border.width}px solid ${this.options.icon_border.color}`),t.onload=()=>{this.resetSize()},this.img=t,t}_changePosition=()=>{this.overlay.updatePosition(!0)};registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t=this.context.config.poi.boxScale){let{width:n,height:r}=this.size,i=n*t,o=r*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,n){if(!this.overlay.visible||!this.visible)return!1;let r=this.getOriginBox();return t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}};var j=require("three");var O=require("three"),br=require("@mars3d/heatmap.js"),St=require("@turf/turf"),ie=class extends O.Object3D{constructor(t){super();this.context=t;this.div=document.createElement("div")}heatmap;div;plane;clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){this.clearHeatmap();let{width:n,height:r,leftTop:i,center:o}=this.getBox(t);this.heatmap=(0,br.create)({width:n,height:r,container:this.div,...this.context.config.heatMap}),this.heatmap.setData(this.transformData(t,i)),this.initPlane(n,r),this.position.set(o[0],o[1],this.position.z)}initPlane(t,n){this.plane&&this.remove(this.plane);let r=new O.PlaneGeometry(t,n),i=new O.Texture(this.div.firstChild);i.needsUpdate=!0;let o=new O.MeshBasicMaterial({transparent:!0,side:O.DoubleSide,map:i});o.needsUpdate=!0,this.plane=new O.Mesh(r,o),this.add(this.plane)}getTransMatrix({x:t,y:n}){return new O.Matrix3().makeScale(1,-1).multiply(new O.Matrix3().makeTranslation(0-t,0-n))}transformData(t,n){let r=this.getTransMatrix(n);return{data:t.data.map(o=>{let a=new O.Vector2(o.x,o.y).applyMatrix3(r);return{x:a.x,y:a.y,value:o.value}}),max:t.max,min:t.min}}getBox(t){let n=(0,St.featureCollection)(t.data.map(u=>(0,St.point)([u.x,u.y]))),r=(0,St.bbox)(n),i=r[2]-r[0],o=r[3]-r[1],a={x:r[0],y:r[3]},l=(0,St.center)(n);return{width:i,height:o,leftTop:a,center:l.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var Pe=require("three");var oe=class extends Pe.Object3D{constructor(t,n){super();this.context=t;this.options=n;this.position.copy(n.position||new Pe.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await Et.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){V(this),this.model=null}};var Ae=require("three");var Sr=require("three");var F=class extends Sr.Object3D{constructor(t){super();this.context=t}dispose(){V(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var se=class extends F{graphicMap=new Map;constructor(e){super(e)}getCenter(){return new Ae.Box3().setFromObject(this).getCenter(new Ae.Vector3)}createGraphic(e){let t=new R(this.context,e);return t.userData.data=e,this.add(t),this.graphicMap.set(e.id,t),t}removeGraphic(e){this.remove(e),this.graphicMap.delete(e.options.id),e.dispose()}removeGraphicById(e){this.graphicMap.has(e)&&this.removeGraphic(this.graphicMap.get(e))}getGraphicByNodeId(e){return this.graphicMap.get(e)||null}getGraphicByRaycaster(e){let t={distance:1e4,graphic:null,position:null},n=this.children.reduce((r,i)=>{if(i instanceof R){let o=i.raycast(e);if(o){let{distance:a}=o;if(a<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},t);return n===t?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}};var Mr=require("lodash");var ae=class extends F{pois=[];debounceCollisionDetection;timer=new D;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,Mr.debounce)(this.collisionDetection,10)}clear(e=!1){return this.pois.forEach(t=>{t.options.built_in&&!e||t.dispose()}),this.pois=e?[]:this.pois.filter(t=>t.options.built_in),this}createPoi(e){let t=new bt(this.context,e);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){return this.pois.filter(r=>r instanceof bt&&r.isContain(e,t))}onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,r)=>{let{left:i,right:o,top:a,bottom:l}=n.getBox();if(r===0||!n.options.collision_enable){e.push({left:i,right:o,top:a,bottom:l}),n.parentSetVisible(!0);return}let u=e.some(c=>c.left<o&&c.right>i&&c.top<l&&c.bottom>a);n.parentSetVisible(!u),u||e.push({left:i,right:o,top:a,bottom:l})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var xn=require("lodash");var Ie=require("three"),Ut=class extends F{pois=[];debounceCollisionDetection;debounceChangeParkingSpaceVisibleByZoom;timer=new D;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,xn.debounce)(this.collisionDetection,10),this.debounceChangeParkingSpaceVisibleByZoom=(0,xn.debounce)(this.changeParkingSpaceVisibleByZoom,10)}clear(){return this.pois.forEach(e=>{e.dispose()}),this.pois=[],this}createPoi(e){let t=new q(this.context,e);return this.pushPoi(t),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.remove(e),this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(this.add(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceChangeParkingSpaceVisibleByZoom(),this.debounceCollisionDetection()}),!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){let n=new Ie.Vector2(e,t);return this.pois.filter(i=>i instanceof q&&i.canSelect&&i.box.containsPoint(n))}changeParkingSpaceVisibleByZoom=()=>{let e=this.parent?.parent;if(e&&e instanceof ct){let{clientSize:{width:t,height:n}}=this.context,{max:r,min:i}=e.box,a=Math.min(t/(r.x-i.x),n/(r.y-i.y))*(r.x-i.x)/45;this.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let u=this.context.camera.zoom>=a;l.visible=u,u||l.parentSetVisible(u)})}};onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[],{camera:t}=this.context;t.updateMatrixWorld();let n=o=>o<=1&&o>=-1,r=t.projectionMatrix.clone();r.multiply(t.matrixWorldInverse),this.pois.filter(o=>{if(o.visible){let a=o.spriteIcon?o.spriteIcon?.matrixWorld:o.spriteText?.matrixWorld||o.matrixWorld,l=new Ie.Vector3().setFromMatrixPosition(a);return l.applyMatrix4(r),o.screenPosition=l,n(l.x)&&n(l.y)&&n(l.z)}return!1}).forEach((o,a)=>{let l=o.getBox(o.screenPosition);if(a===0||!o.options.collision_enable){e.push(l),o.parentSetVisible(!0);return}let u=e.some(c=>c.intersectsBox(l));o.parentSetVisible(!u),u||e.push(l)})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var ct=class extends j.Object3D{constructor(t){super();this.context=t;this.groundLayer=new F(this.context),this.graphicLayer=new se(this.context),this.poiLayer=new ae(this.context),this.poiLayer2=new Ut(this.context),this.wallLayer=new F(this.context),this.textureLayer=new F(this.context),this.glbModelLayer=new F(this.context),this.laneLayer=new F(this.context),this.mergeGraphicLayer=new F(this.context),this.textTextureLayer=new F(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}graphicLayer;poiLayer;poiLayer2;wallLayer;textureLayer;glbModelLayer;laneLayer;mergeGraphicLayer;textTextureLayer;grounds=new Set;groundLayer;shadow=new ne;heatmap;groundUpper=new j.Object3D;models=new j.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";box=new j.Box3;getPosition(){return this.box.getCenter(new j.Vector3)}createGround(t){let n=new R(this.context,t);n.userData.data=t,this.addGrounds([n])}addGrounds(t){t.forEach(n=>{this.grounds.has(n)||(n.mesh.castShadow=!0,this.grounds.add(n),this.groundLayer.add(n))}),this.changeGroundMaxHeight()}changeGroundMaxHeight(){let t=Array.from(this.grounds);this.groundMaxHeight=this.grounds.size>0?Math.max(...t.map(n=>n.options.height+n.options.airHeight+n.options.deltaHeight)):0,this.groundUpper.position.z=this.groundMaxHeight+.01}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new j.Box3().setFromObject(this).getCenter(new j.Vector3)}addModel(t){let n=new oe(this.context,t);return this.models.add(n),this.modelMap.set(t.id,n),n}addShadow(){let t=new j.Box3().setFromObject(this.groundUpper),n=t.getCenter(new j.Vector3),r=t.getSize(new j.Vector3);this.shadow.setPosition(n),this.shadow.changeLightCamera(r)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addHeatmap(t){this.heatmap||(this.heatmap=new ie(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let n=new j.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(n.max.z),this.heatmap}removeHeatMap(){this.heatmap&&(this.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=void 0)}setShadowOpacity(t){this.shadow.setOpacity(t)}setShadowVisible(t){this.shadow.visible=t}updateBox(){this.box.setFromObject(this)}dispose(){console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(t=>t.dispose()),this.heatmap?.dispose(),this.groundUpper.clear(),this.models.children.forEach(t=>t.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}};var Re=require("three");var J=class extends Re.EventDispatcher{constructor(t){super();this.context=t;this.svg=rn(`${t.container.clientWidth}`,`${t.container.clientHeight}`),t.container.appendChild(this.svg),this._registryEvent()}points=[];svg;enable=!0;_onResize=({width:t,height:n})=>{this.svg&&(this.svg.setAttribute("width",`${t}`),this.svg.setAttribute("height",`${n}`))};_registryEvent(){this.context.addEventListener("resize",this._onResize)}_unRegistryEvent(){this.context.removeEventListener("resize",this._onResize)}setEnable(t){this.enable=t,t?this.svg.style.display="block":this.svg.style.display="none"}getIntersectByPointerEvent(t){let{camera:n,renderer:r}=this.context,{offsetX:i,offsetY:o}=t,{clientWidth:a,clientHeight:l}=r.domElement,u=i/a*2-1,c=1-o/l*2;return new Re.Vector3(u,c,0).unproject(n)}getSvgCoordinate(t){let{camera:n,container:r}=this.context;return y(t,n,r.clientWidth,r.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var le=class extends J{constructor(t){super(t);this.context=t;let{config:{svg:{circle:n,line:r}}}=t;this.circles=[Vt(n.radius,n.fill),Vt(n.radius,n.fill)],this.line=te(r.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}circles;line;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.points[0]){let t=this.getSvgCoordinate(this.points[0]);_t(this.circles[0],t.x,t.y),et(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);_t(this.circles[1],t.x,t.y),et(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",et(this.line,void 0,{x:t.offsetX,y:t.offsetY}))};onPointerleave=()=>{this.points[1]||(this.line.style.display="none")};onPointerdown=t=>{if(this.points[1])return;let n=this.getIntersectByPointerEvent(t);if(n){let{offsetX:r,offsetY:i}=t,o=this.circles[this.points.length];_t(o,r,i),this.points.length||et(this.line,{x:r,y:i},{x:r,y:i}),this.addPoint(n)}};addPoint(t){if(this.points.push(t),this.points.length>=2){let n=this.calculatedDistance();this.dispatchEvent({type:"distance",distance:n})}}calculatedDistance(){let[{x:t,y:n},{x:r,y:i}]=this.points;return Math.sqrt((r-t)**2+(i-n)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}};var ue=class extends J{circles=[];lines=[];isClose=!1;constructor(e){super(e),this.registryEvent()}setEnable(e){super.setEnable(e),e?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(e){this.circles.push(e),this.svg.appendChild(e)}addLine(e){this.lines.push(e),this.svg.appendChild(e)}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{this.points.length&&this.points.forEach((e,t)=>{let n=this.getSvgCoordinate(e);this.circles[t]&&_t(this.circles[t],n.x,n.y),t!==0&&et(this.lines[t-1],void 0,n),this.lines[t]&&et(this.lines[t],n)})};onPointermove=e=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",et(this.lastLine,void 0,{x:e.offsetX,y:e.offsetY}))};onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")};onPointerdown=e=>{if(this.isClose)return;let t=this.getIntersectByPointerEvent(e);if(t){let{offsetX:n,offsetY:r}=e;this.checkAdsorb(n,r)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(t);let{circle:{fill:i,radius:o},line:{stroke:a}}=this.context.config.svg;if(!this.isClose){let l=Vt(o,i);_t(l,n,r),this.addCircle(l)}if(this.lines.length&&et(this.lastLine,void 0,{x:n,y:r}),!this.isClose){let l=te(a);et(l,{x:n,y:r},{x:n,y:r}),this.addLine(l)}}};checkAdsorb(e,t){if(this.points.length<3)return!1;let n=this.circles[0],r=+n.getAttribute("cx"),i=+n.getAttribute("cy");return Math.sqrt((e-r)**2+(t-i)**2)<=5}addPoint(e){if(this.points.push(e),this.isClose){let t=this.calculatedArea();this.dispatchEvent({type:"area",area:t})}}calculatedArea(){let e=this.points.map(r=>[r.x,r.y]),t=0,n=e.length;for(let r=0;r<n;r++){let i=(r+1)%n;t+=e[r][0]*e[i][1]-e[i][0]*e[r][1]}return Math.abs(t/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}};var wr=require("three");var En=class extends J{constructor(t){super(t);this.context=t;let{config:{svg:{line:n}}}=t;this.rect=mt(n.stroke,"transparent"),this.svg.appendChild(this.rect);for(let r=0;r<4;r++)this.cornerRect[r]=mt(n.stroke,"#ffffff"),this.centerRect[r]=mt(n.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[r]),this.svg.appendChild(this.centerRect[r]);this.registryEvent()}rect;cornerRect=[];centerRect=[];graphic;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.graphic){let t=new wr.Box3().setFromObject(this.graphic),{camera:n,container:{clientWidth:r,clientHeight:i}}=this.context,{min:o,max:a}=t,l=y(o,n,r,i),u=y(a,n,r,i);B(this.rect,l.x,u.y,Math.abs(u.x-l.x),Math.abs(u.y-l.y));let{x:c,y:h}=l,{x:p,y:d}=u,m=5,f=[{x:c-m,y:d-m},{x:p-m,y:d-m},{x:c-m,y:h-m},{x:p-m,y:h-m}];for(let b=0;b<f.length;b++)B(this.cornerRect[b],f[b].x,f[b].y,m*2,m*2);let g=4,E=(c+p)/2,x=(h+d)/2,z=[{x:E-g,y:d-g},{x:c-g,y:x-g},{x:p-g,y:x-g},{x:E-g,y:h-g}];for(let b=0;b<z.length;b++)B(this.centerRect[b],z[b].x,z[b].y,g*2,g*2)}else{B(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)B(this.cornerRect[t],0,0,0,0),B(this.centerRect[t],0,0,0,0)}};selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}};var P=require("three");var bn=require("three/examples/jsm/utils/BufferGeometryUtils");var ce=class extends P.Object3D{constructor(t,n){super();this.context=t;this.options=n;n.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(n=>{let r=st(n.geometry.coords[0],n.geometry.coords.slice(1));return new P.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:n.height,curveSegments:4})});this.geometry=(0,bn.mergeGeometries)(t),t.forEach(n=>n.dispose())}initMaterial(){let t=`
38
+ `,h=new H.ShaderMaterial({uniforms:{uColor:{value:new H.Color(e[0]).convertLinearToSRGB()},uGradualColor:{value:new H.Color(e[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:n},opacity:{value:r},uDirection:{value:i},uMax:{value:o},uMin:{value:a}},vertexShader:u,fragmentShader:c,side:H.DoubleSide});return this.shaderMaterialMap.set(l,h),h}static createLine2MaterialMap({color:e,width:t,dashed:n,resolution:r}){let i=`${e}-${t}-${n}-${r.x}-${r.y}`;if(this.line2MaterialMap.has(i))return this.line2MaterialMap.get(i);let o=new vr.LineMaterial({color:parseInt(e.slice(1),16),dashed:n,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:r});return this.line2MaterialMap.set(i,o),o}static dispose(){this.lineMaterialMap.forEach((e,t)=>{e.dispose()}),this.lineMaterialMap.clear(),this.meshStandardMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshStandardMaterialMap.clear(),this.meshBasicMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshBasicMaterialMap.clear(),this.shaderMaterialMap.forEach((e,t)=>{e.dispose()}),this.shaderMaterialMap.clear(),this.line2MaterialMap.forEach((e,t)=>{e.dispose()}),this.line2MaterialMap.clear()}};var Ot=require("three");var vt=class{static canvas=document.createElement("canvas");static ctx=this.canvas.getContext("2d");static cacheMap=new Map;static options={width:1024,height:64,font:"54px sans-serif",textBaseline:"hanging",lineWidth:12,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};static getCanvas(){if(this.canvas)return this.canvas;{let e=document.createElement("canvas");return this.canvas=e,e}}static getCtx(){if(this.ctx)return this.ctx;let t=this.getCanvas().getContext("2d");return this.ctx=t,t}static getMergedOptions(e){return{...this.options,...e}}static setCtxStyle(e){let t=this.getCanvas(),n=this.getCtx();t.width=e.width,t.height=e.height,n.font=e.font,n.textBaseline=e.textBaseline,n.lineWidth=e.lineWidth,n.fillStyle=e.fillStyle,n.strokeStyle=e.strokeStyle}static getTextureByText(e,t){let n=this.getMergedOptions(t),r=Lt({...n,text:e});if(this.cacheMap.has(r))return this.cacheMap.get(r);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let a=Qe(e)?4:8;n.lineWidth&&o.strokeText(e,2,a),o.fillText(e,2,a);let l=Math.ceil(o.measureText(e).width);l=l%2===0?l:l+1,l+=2;let u=o.getImageData(0,0,l,64),c=new Ot.DataTexture(Uint8Array.from(u.data),l,64,Ot.RGBAFormat);return c.flipY=!0,c.minFilter=Ot.LinearFilter,c.magFilter=Ot.LinearFilter,this.cacheMap.set(r,c),c}static dispose(){this.ctx=null,this.canvas=null,this.cacheMap.forEach(e=>e.dispose()),this.cacheMap.clear()}};var Ft=require("three"),xt=class{static textureLoader=new Ft.TextureLoader;static urlTextureMap=new Map;static getTextureByUrl(e){if(this.urlTextureMap.has(e))return this.urlTextureMap.get(e);let t=this.textureLoader.loadAsync(e);return t.then(n=>{n.format=Ft.RGBAFormat,n.magFilter=Ft.LinearFilter,n.minFilter=Ft.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(e,n)}),this.urlTextureMap.set(e,t),t}static dispose(){this.urlTextureMap.forEach(e=>{e instanceof Promise?e.then(t=>t.dispose()):e.dispose()}),this.urlTextureMap.clear()}};var xr=require("three/examples/jsm/loaders/GLTFLoader"),Et=class{static loader=new xr.GLTFLoader;static modelMap=new Map;static async loadModel(e){if(this.modelMap.has(e)){let n=this.modelMap.get(e);if(n instanceof Promise)n.then(r=>({...r,scene:r.scene.clone()}));else return{...n,scene:n.scene.clone()}}let t=new Promise((n,r)=>{this.loader.load(e,i=>{n(i),this.modelMap.set(e,i)},void 0,r)});return this.modelMap.set(e,t),t.then(n=>({...n,scene:n.scene.clone()}))}static dispose(){this.modelMap.forEach(e=>{e instanceof Promise?e.then(t=>V(t.scene)):V(e.scene)}),this.modelMap.clear()}};var Er=require("lodash"),Te={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],locked:!1,visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9},R=class extends v.Object3D{constructor(t,n){super();this.context=t;if(this.options=At((0,Er.cloneDeep)({...Te,...n}),this),this.options.geometry.type==="point"){let[r,i]=this.options.geometry.coords;return this.position.set(r,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",({value:r})=>{this.dispose(),this.init()}),this.addEventListener("change-strokeColor",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-airHeight",({value:r})=>{this.position.z=r}),this.addEventListener("change-visible",({value:r})=>{this.visible=r}),this.addEventListener("change-stroke",({value:r})=>{if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else this.line&&(this.remove(this.line),this.lineGeometry?.dispose())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}geometry;material;mesh;line;lineMaterial;lineGeometry;options;getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new v.Vector3,n=new v.Box3;return n.setFromObject(this),n.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new v.Vector3(0,0,0);let t=new v.Box3,n=new v.Vector3;return t.setFromObject(this),t.getSize(n),n}getPosition(){let t=this.getCenter();return t.setZ(t.z+this.options.height/2),t}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){if(this.options.doors?.length&&this.options.geometry.type==="polygon"){let t=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let r=n.type==="single"?.5:1,i=.5,o=Pt(t,n.coord),a=new v.Vector2(...n.coord),l=new v.Vector2(...t[o]).sub(new v.Vector2(...n.coord)).normalize(),u=new v.Vector2().addVectors(a,l.clone().multiplyScalar(r)),c=new v.Vector2().addVectors(a,l.clone().multiplyScalar(-r)),h=new v.Vector2(-l.y,l.x),p=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i));nn([p.x,p.y],t)||(h.multiplyScalar(-1),p=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i)));let d=new v.Vector2().addVectors(c,h.clone().multiplyScalar(i)),m=[[u.x,u.y],[p.x,p.y],[d.x,d.y],[c.x,c.y]];this.options.geometry.coords=[[...t.slice(0,o+1),...m,...t.slice(o+1)]],t=this.options.geometry.coords[0]})}}initGeometry(){let t=at(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new v.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=I.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let n=I.createMeshBasicMaterial({color:ft(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,n],[t,n]}getMaxAndMin(t,n){let r=new v.Box3().setFromObject(this),i=t.clone().add(n.clone().multiplyScalar(1e3)),o=new v.Ray(i,n.clone().multiplyScalar(-1)),a=new v.Vector3;o.intersectBox(r,a);let l=t.clone().add(n.clone().multiplyScalar(-1e3)),u=new v.Ray(l,n.clone()),c=new v.Vector3;return u.intersectBox(r,c),{max:c,min:a}}initGradualMaterial(){let{max:t,min:n}=new v.Box3().setFromObject(this),r=t.clone().sub(n),i=Math.max(r.x,r.y,r.z)/2,o=this.getPosition(),a=new v.Vector3(-1,.2,0).normalize(),{max:l,min:u}=this.getMaxAndMin(o,a),c=I.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,0),max:l,min:u});if(this.options.height<=.1)return this.material=c,c;let h=this.getCenter(),p=new v.Vector3(-1,.2,1).normalize(),{max:d,min:m}=this.getMaxAndMin(h,p),f=I.createShaderMaterial({gradualColor:[ft(this.options.gradualColor[0],this.options.colorFactor),ft(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,1),max:d,min:m});return this.material=[c,f],[c,f]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=I.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new v.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options.height+this.options.deltaHeight,{coords:r}=this.options.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let a=0;a<o.length;a++){let l=o[a],u=a+1===o.length?o[0]:o[a+1];t.push(new v.Vector3(l[0],l[1],n)),t.push(new v.Vector3(u[0],u[1],n))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new v.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new v.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.line=t,this.add(t),t}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let n=t.intersectObject(this.mesh);if(n[0]){let{point:r,distance:i}=n[0];return{position:r,distance:i}}return!1}dispose(){this.geometry?.dispose(),this.line?.geometry.dispose(),this.clear()}};var it=require("three");var ne=class extends it.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let e=Je(16777215,.5);return e.position.set(0,0,100),this.add(e),e}changeLightCamera(e){let t=e.x,n=e.y;this.directionalLight.shadow.camera.left=-t,this.directionalLight.shadow.camera.right=t,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(t,n)}changeLightColor(e){this.directionalLight.color=new it.Color(e)}setPosition(e){this.position.copy(e),this.directionalLight.position.set(-e.x/2,-e.y/2,100)}initPlane(e=1e3,t=1e3){let n=new it.PlaneGeometry(e,t),r=new it.ShadowMaterial({transparent:!0,opacity:0,side:it.DoubleSide}),i=new it.Mesh(n,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(e){this.directionalLight.target=e}transformOpacity(e){return e*this.basicOpacity}setOpacity(e){this.plane.material.opacity=this.transformOpacity(e)}dispose(){V(this,!0)}};var Ce=require("three");var M=require("three");var br=require("lodash");var zi={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},re=class extends M.EventDispatcher{constructor(t,n={}){super();this.context=t;this.options={...zi,...n},this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}div;element;position=new M.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,br.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){if(this.element instanceof R&&this.element.options.geometry.type==="polygon"){let{max:i,min:o}=new M.Box3().setFromObject(this.element),a=(i.x+o.x)/2,l=(i.y+o.y)/2;return{left:new M.Vector3(o.x,l,i.z),leftTop:new M.Vector3(o.x,i.y,i.z),top:new M.Vector3(a,i.y,i.z),rightTop:new M.Vector3(i.x,i.y,i.z),right:new M.Vector3(i.x,l,i.z),rightBottom:new M.Vector3(i.x,o.y,i.z),bottom:new M.Vector3(a,o.y,i.z),leftBottom:new M.Vector3(o.x,o.y,i.z),center:new M.Vector3(a,l,i.z)}}let{x:t,y:n,z:r}=this.element?.getPosition?.()||this.position;return{left:new M.Vector3(t,n,r),leftTop:new M.Vector3(t,n,r),top:new M.Vector3(t,n,r),rightTop:new M.Vector3(t,n,r),right:new M.Vector3(t,n,r),rightBottom:new M.Vector3(t,n,r),bottom:new M.Vector3(t,n,r),leftBottom:new M.Vector3(t,n,r),center:new M.Vector3(t,n,r)}}getPlacementScreenPosition(){let{width:t,height:n}=this.context.clientSize,r=this.getPlacementPosition();return Object.keys(r).reduce((i,o)=>{let{x:a,y:l}=y(r[o],this.context.camera,t,n);return i[o]={x:a,y:l},i},{})}checkOverflow(t,n){let{width:r,height:i}=this.context.clientSize;return n.x>0&&t.x<r&&n.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:n}=this.div,r=this.getPlacementScreenPosition(),i=t/2,o=n/2,a=[{type:"center",getBox(l,u){return{max:{x:i+l,y:u-n},min:{x:l-i,y:u}}}},{type:"left",getBox(l,u){return{max:{x:l,y:u-o},min:{x:l-t,y:u+o}}}},{type:"leftTop",getBox(l,u){return{max:{x:l,y:u-n},min:{x:l-t,y:u}}}},{type:"top",getBox(l,u){return{max:{x:l+i,y:u-n},min:{x:l-i,y:u}}}},{type:"rightTop",getBox(l,u){return{max:{x:l+t,y:u-n},min:{x:l,y:u}}}},{type:"right",getBox(l,u){return{max:{x:l+t,y:u-o},min:{x:l,y:u+o}}}},{type:"rightBottom",getBox(l,u){return{max:{x:l+t,y:u},min:{x:l,y:u+n}}}},{type:"bottom",getBox(l,u){return{max:{x:l+i,y:u},min:{x:l-i,y:u+n}}}},{type:"leftBottom",getBox(l,u){return{max:{x:l,y:u},min:{x:l-t,y:u+o}}}}];for(let l=0;l<a.length;l++){let u=a[l],c=r[u.type],{max:h,min:p}=u.getBox(c.x,c.y);if(this.checkOverflow(h,p))return{type:u.type,position:c}}return{type:"center",position:r.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className=`overlay_${t.type}`,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,n="block"){t!==this.visible&&(this.div.style.display=t?n:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=`${t}`}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new M.Box3().setFromObject(this.element).getCenter(new M.Vector3):this.position}get withinDisplayRange(){let{x:t,y:n}=this.clientPos,{width:r,height:i}=this.context.clientSize;return t>=0&&t<=r&&n>=0&&n<=i}_updatePosition(t,n){this.clientPos={x:t,y:n};let{width:r,height:i,x:o,y:a}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${o}px`,this.div.style.top=`${a+i}px`),this.options.autoUpdate?this.div.style.transform=`translate3d(${t}px, ${-i+n}px, 0)`:this.dispatchEvent({type:"update-position",x:t,y:n,width:r,height:i})}updatePosition(t=!1){let n=this.getPosition(),{width:r,height:i}=this.context.clientSize,{x:o,y:a}=y(n,this.context.camera,r,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()};registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.unRegistryEvent(),this.unBindElement(),this.observer?.disconnect(),this.div?.remove(),this.div=null}};var ki={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},bt=class extends Ce.EventDispatcher{constructor(t,n){super();this.context=t;this.options=At({...ki,...n},this),this.position.set(n.position?.x||0,n.position?.y||0,n.position?.z||0),this.overlay=new re(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:r,y:i,height:o})=>{this.overlay.div.style.transform=`translate3d(calc(${r}px - 50%), calc(${-o+i}px - ${this.options.icon&&this.options.icon_position!=="center"?"100%":"50%"}), 0)`}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",({value:r})=>{r?this.img?this.img.setAttribute("src",r):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",({value:r})=>{let i=this.textDiv;if(i){let o=this.initText();this.div.replaceChild(o,i)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",({value:r})=>{this.overlay.setOpacity(r)}),this.addEventListener("change-icon_size",({value:r})=>{this.img&&(this.img.style.width=`${r?.[0]||32}px`,this.img.style.height=`${r?.[1]||32}px`,this.resetSize())}),this.addEventListener("change-icon_opacity",({value:r})=>{this.img&&(this.img.style.opacity=`${r}`)}),this.addEventListener("change-icon_border",({value:r})=>{this.img&&(this.img.style.border=`${r.width}px solid ${r.color}`)}),this.addEventListener("change-background",({value:r})=>{this.div.style.background=r})}div;textDiv;img;overlay;options;visible=!0;size={width:0,height:0};position=new Ce.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await on(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:n}=this.img.getBoundingClientRect();this.size={width:t+2,height:n+2}}else{let{width:t,height:n}=this.div.getBoundingClientRect();this.size={width:t+2,height:n+2}}}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(n=>{let r=document.createElement("div");if(r.style.whiteSpace="nowrap",n.styles)for(let[i,o]of Object.entries(n.styles))r.style[i]=o;r.textContent=n.text,t.appendChild(r)}),t}initIcon(){let t=document.createElement("img");return t.setAttribute("src",this.options.icon),t.style.width=`${this.options.icon_size?.[0]||32}px`,t.style.height=`${this.options.icon_size?.[1]||32}px`,t.style.opacity=`${this.options.icon_opacity}px`,t.style.borderRadius="50%",this.options.icon_border.width&&(t.style.border=`${this.options.icon_border.width}px solid ${this.options.icon_border.color}`),t.onload=()=>{this.resetSize()},this.img=t,t}_changePosition=()=>{this.overlay.updatePosition(!0)};registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t=this.context.config.poi.boxScale){let{width:n,height:r}=this.size,i=n*t,o=r*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,n){if(!this.overlay.visible||!this.visible)return!1;let r=this.getOriginBox();return t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}};var j=require("three");var O=require("three"),Sr=require("@mars3d/heatmap.js"),St=require("@turf/turf"),ie=class extends O.Object3D{constructor(t){super();this.context=t;this.div=document.createElement("div")}heatmap;div;plane;clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){this.clearHeatmap();let{width:n,height:r,leftTop:i,center:o}=this.getBox(t);this.heatmap=(0,Sr.create)({width:n,height:r,container:this.div,...this.context.config.heatMap}),this.heatmap.setData(this.transformData(t,i)),this.initPlane(n,r),this.position.set(o[0],o[1],this.position.z)}initPlane(t,n){this.plane&&this.remove(this.plane);let r=new O.PlaneGeometry(t,n),i=new O.Texture(this.div.firstChild);i.needsUpdate=!0;let o=new O.MeshBasicMaterial({transparent:!0,side:O.DoubleSide,map:i});o.needsUpdate=!0,this.plane=new O.Mesh(r,o),this.add(this.plane)}getTransMatrix({x:t,y:n}){return new O.Matrix3().makeScale(1,-1).multiply(new O.Matrix3().makeTranslation(0-t,0-n))}transformData(t,n){let r=this.getTransMatrix(n);return{data:t.data.map(o=>{let a=new O.Vector2(o.x,o.y).applyMatrix3(r);return{x:a.x,y:a.y,value:o.value}}),max:t.max,min:t.min}}getBox(t){let n=(0,St.featureCollection)(t.data.map(u=>(0,St.point)([u.x,u.y]))),r=(0,St.bbox)(n),i=r[2]-r[0],o=r[3]-r[1],a={x:r[0],y:r[3]},l=(0,St.center)(n);return{width:i,height:o,leftTop:a,center:l.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var Pe=require("three");var oe=class extends Pe.Object3D{constructor(t,n){super();this.context=t;this.options=n;this.position.copy(n.position||new Pe.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await Et.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){V(this),this.model=null}};var Ae=require("three");var Mr=require("three");var F=class extends Mr.Object3D{constructor(t){super();this.context=t}dispose(){V(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var se=class extends F{graphicMap=new Map;constructor(e){super(e)}getCenter(){return new Ae.Box3().setFromObject(this).getCenter(new Ae.Vector3)}createGraphic(e){let t=new R(this.context,e);return t.userData.data=e,this.add(t),this.graphicMap.set(e.id,t),t}removeGraphic(e){this.remove(e),this.graphicMap.delete(e.options.id),e.dispose()}removeGraphicById(e){this.graphicMap.has(e)&&this.removeGraphic(this.graphicMap.get(e))}getGraphicByNodeId(e){return this.graphicMap.get(e)||null}getGraphicByRaycaster(e){let t={distance:1e4,graphic:null,position:null},n=this.children.reduce((r,i)=>{if(i instanceof R){let o=i.raycast(e);if(o){let{distance:a}=o;if(a<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},t);return n===t?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}};var wr=require("lodash");var ae=class extends F{pois=[];debounceCollisionDetection;timer=new D;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,wr.debounce)(this.collisionDetection,10)}clear(e=!1){return this.pois.forEach(t=>{t.options.built_in&&!e||t.dispose()}),this.pois=e?[]:this.pois.filter(t=>t.options.built_in),this}createPoi(e){let t=new bt(this.context,e);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){return this.pois.filter(r=>r instanceof bt&&r.isContain(e,t))}onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,r)=>{let{left:i,right:o,top:a,bottom:l}=n.getBox();if(r===0||!n.options.collision_enable){e.push({left:i,right:o,top:a,bottom:l}),n.parentSetVisible(!0);return}let u=e.some(c=>c.left<o&&c.right>i&&c.top<l&&c.bottom>a);n.parentSetVisible(!u),u||e.push({left:i,right:o,top:a,bottom:l})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var xn=require("lodash");var Ie=require("three"),Ut=class extends F{pois=[];debounceCollisionDetection;debounceChangeParkingSpaceVisibleByZoom;timer=new D;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,xn.debounce)(this.collisionDetection,10),this.debounceChangeParkingSpaceVisibleByZoom=(0,xn.debounce)(this.changeParkingSpaceVisibleByZoom,10)}clear(){return this.pois.forEach(e=>{e.dispose()}),this.pois=[],this}createPoi(e){let t=new q(this.context,e);return this.pushPoi(t),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.remove(e),this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(this.add(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceChangeParkingSpaceVisibleByZoom(),this.debounceCollisionDetection()}),!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){let n=new Ie.Vector2(e,t);return this.pois.filter(i=>i instanceof q&&i.canSelect&&i.box.containsPoint(n))}changeParkingSpaceVisibleByZoom=()=>{let e=this.parent?.parent;if(e&&e instanceof ht){let{clientSize:{width:t,height:n}}=this.context,{max:r,min:i}=e.box,a=Math.min(t/(r.x-i.x),n/(r.y-i.y))*(r.x-i.x)/45;this.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let u=this.context.camera.zoom>=a;l.visible=u,u||l.parentSetVisible(u)})}};onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[],{camera:t}=this.context;t.updateMatrixWorld();let n=o=>o<=1&&o>=-1,r=t.projectionMatrix.clone();r.multiply(t.matrixWorldInverse),this.pois.filter(o=>{if(o.visible){let a=o.spriteIcon?o.spriteIcon?.matrixWorld:o.spriteText?.matrixWorld||o.matrixWorld,l=new Ie.Vector3().setFromMatrixPosition(a);return l.applyMatrix4(r),o.screenPosition=l,n(l.x)&&n(l.y)&&n(l.z)}return!1}).forEach((o,a)=>{let l=o.getBox(o.screenPosition);if(a===0||!o.options.collision_enable){e.push(l),o.parentSetVisible(!0);return}let u=e.some(c=>c.intersectsBox(l));o.parentSetVisible(!u),u||e.push(l)})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var ht=class extends j.Object3D{constructor(t){super();this.context=t;this.groundLayer=new F(this.context),this.graphicLayer=new se(this.context),this.poiLayer=new ae(this.context),this.poiLayer2=new Ut(this.context),this.wallLayer=new F(this.context),this.textureLayer=new F(this.context),this.glbModelLayer=new F(this.context),this.laneLayer=new F(this.context),this.mergeGraphicLayer=new F(this.context),this.textTextureLayer=new F(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}graphicLayer;poiLayer;poiLayer2;wallLayer;textureLayer;glbModelLayer;laneLayer;mergeGraphicLayer;textTextureLayer;grounds=new Set;groundLayer;shadow=new ne;heatmap;groundUpper=new j.Object3D;models=new j.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";box=new j.Box3;getPosition(){return this.box.getCenter(new j.Vector3)}createGround(t){let n=new R(this.context,t);n.userData.data=t,this.addGrounds([n])}addGrounds(t){t.forEach(n=>{this.grounds.has(n)||(n.mesh.castShadow=!0,this.grounds.add(n),this.groundLayer.add(n))}),this.changeGroundMaxHeight()}changeGroundMaxHeight(){let t=Array.from(this.grounds);this.groundMaxHeight=this.grounds.size>0?Math.max(...t.map(n=>n.options.height+n.options.airHeight+n.options.deltaHeight)):0,this.groundUpper.position.z=this.groundMaxHeight+.01}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new j.Box3().setFromObject(this).getCenter(new j.Vector3)}addModel(t){let n=new oe(this.context,t);return this.models.add(n),this.modelMap.set(t.id,n),n}addShadow(){let t=new j.Box3().setFromObject(this.groundUpper),n=t.getCenter(new j.Vector3),r=t.getSize(new j.Vector3);this.shadow.setPosition(n),this.shadow.changeLightCamera(r)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addHeatmap(t){this.heatmap||(this.heatmap=new ie(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let n=new j.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(n.max.z),this.heatmap}removeHeatMap(){this.heatmap&&(this.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=void 0)}setShadowOpacity(t){this.shadow.setOpacity(t)}setShadowVisible(t){this.shadow.visible=t}updateBox(){this.box.setFromObject(this)}dispose(){console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(t=>t.dispose()),this.heatmap?.dispose(),this.groundUpper.clear(),this.models.children.forEach(t=>t.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}};var Re=require("three");var J=class extends Re.EventDispatcher{constructor(t){super();this.context=t;this.svg=rn(`${t.container.clientWidth}`,`${t.container.clientHeight}`),t.container.appendChild(this.svg),this._registryEvent()}points=[];svg;enable=!0;_onResize=({width:t,height:n})=>{this.svg&&(this.svg.setAttribute("width",`${t}`),this.svg.setAttribute("height",`${n}`))};_registryEvent(){this.context.addEventListener("resize",this._onResize)}_unRegistryEvent(){this.context.removeEventListener("resize",this._onResize)}setEnable(t){this.enable=t,t?this.svg.style.display="block":this.svg.style.display="none"}getIntersectByPointerEvent(t){let{camera:n,renderer:r}=this.context,{offsetX:i,offsetY:o}=t,{clientWidth:a,clientHeight:l}=r.domElement,u=i/a*2-1,c=1-o/l*2;return new Re.Vector3(u,c,0).unproject(n)}getSvgCoordinate(t){let{camera:n,container:r}=this.context;return y(t,n,r.clientWidth,r.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var le=class extends J{constructor(t){super(t);this.context=t;let{config:{svg:{circle:n,line:r}}}=t;this.circles=[Vt(n.radius,n.fill),Vt(n.radius,n.fill)],this.line=te(r.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}circles;line;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.points[0]){let t=this.getSvgCoordinate(this.points[0]);_t(this.circles[0],t.x,t.y),et(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);_t(this.circles[1],t.x,t.y),et(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",et(this.line,void 0,{x:t.offsetX,y:t.offsetY}))};onPointerleave=()=>{this.points[1]||(this.line.style.display="none")};onPointerdown=t=>{if(this.points[1])return;let n=this.getIntersectByPointerEvent(t);if(n){let{offsetX:r,offsetY:i}=t,o=this.circles[this.points.length];_t(o,r,i),this.points.length||et(this.line,{x:r,y:i},{x:r,y:i}),this.addPoint(n)}};addPoint(t){if(this.points.push(t),this.points.length>=2){let n=this.calculatedDistance();this.dispatchEvent({type:"distance",distance:n})}}calculatedDistance(){let[{x:t,y:n},{x:r,y:i}]=this.points;return Math.sqrt((r-t)**2+(i-n)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}};var ue=class extends J{circles=[];lines=[];isClose=!1;constructor(e){super(e),this.registryEvent()}setEnable(e){super.setEnable(e),e?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(e){this.circles.push(e),this.svg.appendChild(e)}addLine(e){this.lines.push(e),this.svg.appendChild(e)}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{this.points.length&&this.points.forEach((e,t)=>{let n=this.getSvgCoordinate(e);this.circles[t]&&_t(this.circles[t],n.x,n.y),t!==0&&et(this.lines[t-1],void 0,n),this.lines[t]&&et(this.lines[t],n)})};onPointermove=e=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",et(this.lastLine,void 0,{x:e.offsetX,y:e.offsetY}))};onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")};onPointerdown=e=>{if(this.isClose)return;let t=this.getIntersectByPointerEvent(e);if(t){let{offsetX:n,offsetY:r}=e;this.checkAdsorb(n,r)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(t);let{circle:{fill:i,radius:o},line:{stroke:a}}=this.context.config.svg;if(!this.isClose){let l=Vt(o,i);_t(l,n,r),this.addCircle(l)}if(this.lines.length&&et(this.lastLine,void 0,{x:n,y:r}),!this.isClose){let l=te(a);et(l,{x:n,y:r},{x:n,y:r}),this.addLine(l)}}};checkAdsorb(e,t){if(this.points.length<3)return!1;let n=this.circles[0],r=+n.getAttribute("cx"),i=+n.getAttribute("cy");return Math.sqrt((e-r)**2+(t-i)**2)<=5}addPoint(e){if(this.points.push(e),this.isClose){let t=this.calculatedArea();this.dispatchEvent({type:"area",area:t})}}calculatedArea(){let e=this.points.map(r=>[r.x,r.y]),t=0,n=e.length;for(let r=0;r<n;r++){let i=(r+1)%n;t+=e[r][0]*e[i][1]-e[i][0]*e[r][1]}return Math.abs(t/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}};var Tr=require("three");var En=class extends J{constructor(t){super(t);this.context=t;let{config:{svg:{line:n}}}=t;this.rect=mt(n.stroke,"transparent"),this.svg.appendChild(this.rect);for(let r=0;r<4;r++)this.cornerRect[r]=mt(n.stroke,"#ffffff"),this.centerRect[r]=mt(n.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[r]),this.svg.appendChild(this.centerRect[r]);this.registryEvent()}rect;cornerRect=[];centerRect=[];graphic;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.graphic){let t=new Tr.Box3().setFromObject(this.graphic),{camera:n,container:{clientWidth:r,clientHeight:i}}=this.context,{min:o,max:a}=t,l=y(o,n,r,i),u=y(a,n,r,i);B(this.rect,l.x,u.y,Math.abs(u.x-l.x),Math.abs(u.y-l.y));let{x:c,y:h}=l,{x:p,y:d}=u,m=5,f=[{x:c-m,y:d-m},{x:p-m,y:d-m},{x:c-m,y:h-m},{x:p-m,y:h-m}];for(let b=0;b<f.length;b++)B(this.cornerRect[b],f[b].x,f[b].y,m*2,m*2);let g=4,E=(c+p)/2,x=(h+d)/2,z=[{x:E-g,y:d-g},{x:c-g,y:x-g},{x:p-g,y:x-g},{x:E-g,y:h-g}];for(let b=0;b<z.length;b++)B(this.centerRect[b],z[b].x,z[b].y,g*2,g*2)}else{B(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)B(this.cornerRect[t],0,0,0,0),B(this.centerRect[t],0,0,0,0)}};selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}};var P=require("three");var bn=require("three/examples/jsm/utils/BufferGeometryUtils");var ce=class extends P.Object3D{constructor(t,n){super();this.context=t;this.options=n;n.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(n=>{let r=at(n.geometry.coords[0],n.geometry.coords.slice(1));return new P.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:n.height,curveSegments:4})});this.geometry=(0,bn.mergeGeometries)(t),t.forEach(n=>n.dispose())}initMaterial(){let t=`
39
39
  varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
40
40
  uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
41
41
  uniform vec3 uColor;
@@ -74,7 +74,7 @@
74
74
  gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
75
75
  }
76
76
  }
77
- `,r=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let u=o.getZ(l);u>r&&(r=u),u<i&&(i=u)}let a=new P.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new P.Color(this.options[0].fillColor)},uGradualColor1:{value:new P.Color(pt(this.options[0].fillColor,.99))},uGradualColor2:{value:new P.Color(pt(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=a}initLineMaterial(){let{strokeColor:t,strokeOpacity:n}=this.options[0],r=I.createLineMaterial({color:t,opacity:n});return this.lineMaterial=r,r}getBorderPoints(t){let{height:n,deltaHeight:r,geometry:i}=t,o=[],a=n+(r||0),{coords:l}=i;for(let u=0;u<l.length;u++){let c=l[u];for(let h=0;h<c.length;h++){let p=c[h],d=h+1===c.length?c[0]:c[h+1];o.push(new P.Vector3(p[0],p[1],a)),o.push(new P.Vector3(d[0],d[1],a))}}return o}initLineGeometry(){let t=this.options.map(n=>{let r=this.getBorderPoints(n);return new P.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,bn.mergeGeometries)(t)}createBorder(){let t=new P.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new P.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var ot=require("three"),Tr=require("three/examples/jsm/utils/BufferGeometryUtils");var Cr={uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},qt=class extends ot.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Cr,...r})),this.init()}options;mesh;async init(){let t=this.options.map(o=>{let{geometry:a}=o,l=st(a.coords[0],a.coords.slice(1)),u=new ot.ShapeGeometry(l,4),c=o.height+o.deltaHeight+o.airHeight,h=u.getAttribute("position");for(let d=0;d<h.count;d++)h.setZ(d,c);let p=[0,1,1,1,1,0,0,0];return u.setAttribute("uv",new ot.Float32BufferAttribute(p,2)),u}),n=(0,Tr.mergeGeometries)(t,!0);t.forEach(o=>o.dispose());let r=await Promise.all(this.options.map(async o=>{let{iconUrl:a}=o,l=await xt.getTextureByUrl(a);return new ot.MeshBasicMaterial({map:l,alphaTest:1,side:ot.DoubleSide})})),i=new ot.Mesh(n,r);this.mesh=i,this.position.z+=.004,this.add(i)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Mt=require("three");var ki={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},he=class extends Mt.Object3D{constructor(t,n){super();this.context=t;this.options=Object.assign({},ki,n),this.loadModel()}model=null;options;async loadModel(){let t=await Et.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let r=new Mt.Box3().setFromObject(t.scene).getSize(new Mt.Vector3),i=Math.max(r.x,r.y),o=this.options.width/i;this.scale.set(o,o,o),this.meshSetMaterial(t.scene),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)}meshSetMaterial(t){t instanceof Mt.Mesh&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(r=>{this.meshSetMaterial(r)})}dispose(){V(this),this.model=null}};var W=require("three");var Sn=require("three/examples/jsm/utils/BufferGeometryUtils"),Pr=require("three/examples/jsm/lines/Line2"),Ar=require("three/examples/jsm/lines/LineGeometry");var pe=class extends W.Object3D{constructor(t,n){super();this.context=t;this.options=n;n.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;doubleLines=[];initGeometry(){let t=this.options.map(n=>{let r=st(n.geometry.coords[0].slice(0,-1),n.geometry.coords.slice(1)),i=new W.ShapeGeometry(r,4),o=i.getAttribute("position");for(let a=0;a<o.count;a++)o.setZ(a,n.airHeight+(n.deltaHeight||0));return i});this.geometry=(0,Sn.mergeGeometries)(t),t.forEach(n=>n.dispose())}initMaterial(){let{fillColor:t,fillOpacity:n}=this.options[0],r=I.createMeshBasicMaterial({color:t,opacity:n});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:n}=this.options[0],r=I.createLineMaterial({color:t,opacity:n});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:n,geometry:r}=t,i=[],o=n||0,{coords:a}=r;for(let l=0;l<a.length;l++){let u=a[l];for(let c=0;c<u.length;c++){let h=u[c],p=c+1===u.length?u[0]:u[c+1];i.push(new W.Vector3(h[0],h[1],o)),i.push(new W.Vector3(p[0],p[1],o))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let n=t.reduce((r,i)=>{let o=`${i.secondColor}-${i.dashed}`;return r[o]&&r[o].push(i),r[o]||(r[o]=[i]),r},{});this.doubleLines=Object.values(n).map(r=>{let i=I.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed,resolution:new W.Vector2(this.context.clientSize.width,this.context.clientSize.height)});return r.map(o=>{let a=new Ar.LineGeometry,l=o.geometry.otherCoords[1].map(c=>[...c,o.airHeight+(o.deltaHeight||0)]).flat(2);a.setPositions(l);let u=new Pr.Line2(a,i);return u.computeLineDistances(),u.position.z+=.001,this.add(u),u})}).flat(2)}initLineGeometry(){let t=this.options.map(n=>{let r=this.getBorderPoints(n);return new W.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,Sn.mergeGeometries)(t)}createBorder(){let t=new W.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new W.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder()),this.initDoubleLine(),this.position.z+=.002+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.doubleLines.map(t=>t.geometry.dispose()),this.clear()}};var L=require("three");var Ir=require("three/examples/jsm/utils/BufferGeometryUtils");var fe=class extends L.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Te,...r})),this.init()}geometry;material;mesh;line;lineMaterial;lineGeometry;options;init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initGeometry(){let t=this.options.map(r=>{let i=st(r.geometry.coords[0],r.geometry.coords.slice(1));return new L.ExtrudeGeometry(i,{steps:1,bevelEnabled:!1,depth:r.height,curveSegments:4})}),n=(0,Ir.mergeGeometries)(t);return t.forEach(r=>r.dispose()),n}initMaterial(){let t=`
77
+ `,r=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let u=o.getZ(l);u>r&&(r=u),u<i&&(i=u)}let a=new P.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new P.Color(this.options[0].fillColor)},uGradualColor1:{value:new P.Color(ft(this.options[0].fillColor,.99))},uGradualColor2:{value:new P.Color(ft(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=a}initLineMaterial(){let{strokeColor:t,strokeOpacity:n}=this.options[0],r=I.createLineMaterial({color:t,opacity:n});return this.lineMaterial=r,r}getBorderPoints(t){let{height:n,deltaHeight:r,geometry:i}=t,o=[],a=n+(r||0),{coords:l}=i;for(let u=0;u<l.length;u++){let c=l[u];for(let h=0;h<c.length;h++){let p=c[h],d=h+1===c.length?c[0]:c[h+1];o.push(new P.Vector3(p[0],p[1],a)),o.push(new P.Vector3(d[0],d[1],a))}}return o}initLineGeometry(){let t=this.options.map(n=>{let r=this.getBorderPoints(n);return new P.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,bn.mergeGeometries)(t)}createBorder(){let t=new P.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new P.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var ot=require("three"),Cr=require("three/examples/jsm/utils/BufferGeometryUtils");var Pr={uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},qt=class extends ot.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Pr,...r})),this.init()}options;mesh;async init(){let t=this.options.map(o=>{let{geometry:a}=o,l=at(a.coords[0],a.coords.slice(1)),u=new ot.ShapeGeometry(l,4),c=o.height+o.deltaHeight+o.airHeight,h=u.getAttribute("position");for(let d=0;d<h.count;d++)h.setZ(d,c);let p=[0,1,1,1,1,0,0,0];return u.setAttribute("uv",new ot.Float32BufferAttribute(p,2)),u}),n=(0,Cr.mergeGeometries)(t,!0);t.forEach(o=>o.dispose());let r=await Promise.all(this.options.map(async o=>{let{iconUrl:a}=o,l=await xt.getTextureByUrl(a);return new ot.MeshBasicMaterial({map:l,alphaTest:1,side:ot.DoubleSide})})),i=new ot.Mesh(n,r);this.mesh=i,this.position.z+=.004,this.add(i)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Mt=require("three");var Vi={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},he=class extends Mt.Object3D{constructor(t,n){super();this.context=t;this.options=Object.assign({},Vi,n),this.loadModel()}model=null;options;async loadModel(){let t=await Et.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let r=new Mt.Box3().setFromObject(t.scene).getSize(new Mt.Vector3),i=Math.max(r.x,r.y),o=this.options.width/i;this.scale.set(o,o,o),this.meshSetMaterial(t.scene),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)}meshSetMaterial(t){t instanceof Mt.Mesh&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(r=>{this.meshSetMaterial(r)})}dispose(){V(this),this.model=null}};var W=require("three");var Sn=require("three/examples/jsm/utils/BufferGeometryUtils"),Ar=require("three/examples/jsm/lines/Line2"),Ir=require("three/examples/jsm/lines/LineGeometry");var pe=class extends W.Object3D{constructor(t,n){super();this.context=t;this.options=n;n.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;doubleLines=[];initGeometry(){let t=this.options.map(n=>{let r=at(n.geometry.coords[0].slice(0,-1),n.geometry.coords.slice(1)),i=new W.ShapeGeometry(r,4),o=i.getAttribute("position");for(let a=0;a<o.count;a++)o.setZ(a,n.airHeight+(n.deltaHeight||0));return i});this.geometry=(0,Sn.mergeGeometries)(t),t.forEach(n=>n.dispose())}initMaterial(){let{fillColor:t,fillOpacity:n}=this.options[0],r=I.createMeshBasicMaterial({color:t,opacity:n});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:n}=this.options[0],r=I.createLineMaterial({color:t,opacity:n});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:n,geometry:r}=t,i=[],o=n||0,{coords:a}=r;for(let l=0;l<a.length;l++){let u=a[l];for(let c=0;c<u.length;c++){let h=u[c],p=c+1===u.length?u[0]:u[c+1];i.push(new W.Vector3(h[0],h[1],o)),i.push(new W.Vector3(p[0],p[1],o))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let n=t.reduce((r,i)=>{let o=`${i.secondColor}-${i.dashed}`;return r[o]&&r[o].push(i),r[o]||(r[o]=[i]),r},{});this.doubleLines=Object.values(n).map(r=>{let i=I.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed,resolution:new W.Vector2(this.context.clientSize.width,this.context.clientSize.height)});return r.map(o=>{let a=new Ir.LineGeometry,l=o.geometry.otherCoords[1].map(c=>[...c,o.airHeight+(o.deltaHeight||0)]).flat(2);a.setPositions(l);let u=new Ar.Line2(a,i);return u.computeLineDistances(),u.position.z+=.001,this.add(u),u})}).flat(2)}initLineGeometry(){let t=this.options.map(n=>{let r=this.getBorderPoints(n);return new W.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,Sn.mergeGeometries)(t)}createBorder(){let t=new W.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new W.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder()),this.initDoubleLine(),this.position.z+=.002+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.doubleLines.map(t=>t.geometry.dispose()),this.clear()}};var L=require("three");var Rr=require("three/examples/jsm/utils/BufferGeometryUtils");var fe=class extends L.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Te,...r})),this.init()}geometry;material;mesh;line;lineMaterial;lineGeometry;options;init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initGeometry(){let t=this.options.map(r=>{let i=at(r.geometry.coords[0],r.geometry.coords.slice(1));return new L.ExtrudeGeometry(i,{steps:1,bevelEnabled:!1,depth:r.height,curveSegments:4})}),n=(0,Rr.mergeGeometries)(t);return t.forEach(r=>r.dispose()),n}initMaterial(){let t=`
78
78
  varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
79
79
  uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
80
80
  uniform vec3 uColor;
@@ -100,9 +100,9 @@
100
100
  gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
101
101
  }
102
102
  }
103
- `,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>r&&(r=l)}let o=new L.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new L.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new L.Color(pt(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=o}initLineMaterial(){let t=I.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new L.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options[0].height+this.options[0].deltaHeight;return this.options.map(r=>{let{coords:i}=r.geometry;for(let o=0;o<i.length;o++){let a=i[o];for(let l=0;l<a.length;l++){let u=a[l],c=l+1===a.length?a[0]:a[l+1];t.push(new L.Vector3(u[0],u[1],n)),t.push(new L.Vector3(c[0],c[1],n))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new L.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new L.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){this.geometry.dispose(),this.material.dispose(),this.line?.geometry.dispose(),this.clear()}};var U=require("three");var Rr=require("lodash"),Vi={text:"",icon:"",icon_size:[18,18],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1},q=class extends U.Object3D{constructor(t,n){super();this.context=t;this.options=At((0,Rr.cloneDeep)({...Vi,...n}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}options;textAspect=1;spriteText;spriteIcon;box=new U.Box2;boxHelper;_initIconPromise=null;get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get deltaZ(){return!this.options.icon&&this.options.text?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:.1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",async({value:t})=>{this._initIconPromise&&await this._initIconPromise,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),await this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text",({value:t})=>{this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.rotation=t/180*Math.PI)}),this.addEventListener("change-icon_size",({value:t})=>{this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-depth_test",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.depthTest=t),this.spriteText&&(this.spriteText.material.depthTest=t)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}async initIcon(){if(this.options.icon)return this._initIconPromise=new Promise(async t=>{let n=await xt.getTextureByUrl(this.options.icon),r=new U.Sprite(new U.SpriteMaterial({map:n,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));r.visible=!1,r.renderOrder=1e5+this.options.level,n.needsUpdate=!0,this.add(r),this.spriteIcon=r,t(r)}).then(()=>{this._initIconPromise=null})}initText(){if(this.options.text){let t=vt.getTextureByText(this.options.text);this.textAspect=t.image.width/t.image.height;let n=new U.Sprite(new U.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test}));n.visible=!1,n.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=n,this.add(n)}}initSize(){let t=0,n=0,{icon:r,text:i}=this.options;r?i?(t=0,n=t*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(t=.5,n=0):i?(n=.5,t=0):(t=0,n=0),this.spriteIcon?.center.set(.5,t),this.spriteText?.center.set(.5,n)}async init(){await this.initIcon(),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}_initScale=({zoom:t})=>{if(this.spriteText){let n=this.textHeight/t;this.spriteText.scale.set(this.textAspect*n,n,.1)}this.spriteIcon&&this.spriteIcon?.scale.set(this.options.icon_size[0]/t,this.options.icon_size[1]/t,.1),this.resetZ()};resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:n,height:r}}=this.context,i=n*(t.x+1)/2,o=r*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let a=this.iconWidth/2,l=new U.Box2(new U.Vector2(i-a,o-this.iconHeight),new U.Vector2(i+a,o)),u=this.textWidth/2,c=new U.Box2(new U.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new U.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=c.union(l),this.box}renderBoxHelper(t,n){if(!this.boxHelper){let r=document.createElement("div");r.style.position="absolute",r.style.zIndex="999",r.style.border="1px solid red",r.style.pointerEvents="none",this.boxHelper=r,this.context.container.appendChild(r)}t&&n?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=n+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.unRegistryEvent(),this.spriteText=void 0}};var Q=require("three"),Lr=require("three/examples/jsm/utils/BufferGeometryUtils");var Nr={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},de=class extends Q.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Nr,...r})),this.init()}options;mesh;async init(){let t=this.options.map(a=>vt.getTextureByText(a.texts[0],{fillStyle:Me(a.fillColor,a.fillOpacity),strokeStyle:Me(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),n=t.map((a,l)=>{let u=this.options[l],{width:c,height:h}=a.image,p=c/h,d=u.secondHeight*p,m=new Q.PlaneGeometry(d,u.secondHeight),f=new Q.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Q.Matrix4().makeRotationZ(u.secondRotate));return m.applyMatrix4(f),m}),r=(0,Lr.mergeGeometries)(n,!0);n.forEach(a=>a.dispose());let i=t.map(a=>{let l=new Q.MeshBasicMaterial({map:a,alphaTest:1,side:Q.DoubleSide});return a.needsUpdate=!0,l}),o=new Q.Mesh(r,i);this.mesh=o,this.position.z+=.004,this.add(o)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Dr=require("three"),Le=class extends J{startPoint;endPoint;rect;frustum=new Dr.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),B(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);B(this.rect,n.x,n.y,r,i)}else B(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=y(this.startPoint,t,n,r),o=y(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof R&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=y(p,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=y(l,r,i,o),h=y(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var ge=class extends Or.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Le(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=t,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(n,r),l=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!l.has(c.options.id)){let h=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&h.options.geometry.type==="point"&&(a.push(h),l.add(c.options.id))}}),(It?t.metaKey:t.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Rt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Rt(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(n=>{this._list.add(n)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var Ne=require("three");var me=class extends Ne.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new D;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:n,e:r})=>{let i=n.map(u=>this.context.currentFloor?.graphicLayer.graphicMap.get(u.options.id)).filter(u=>u&&u.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:o}=this.context.config.hover,a=new Set;if(i.length){let u,c=1e4;i.forEach(h=>{let p=n.find(d=>d.options.id===h.options.id);if(p instanceof bt){let{x:d,y:m}=p.clientPos,f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}else if(p instanceof q){let{x:d,y:m}=p.box.getCenter(new Ne.Vector2),f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}}),a.add(u)}a.size||t.forEach(u=>a.add(u)),a.forEach(u=>{if(this.graphicTimerMap.get(u)||this.curGraphics.has(u))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(u),this.graphicTimerMap.delete(u),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},o);this.graphicTimerMap.set(u,c)}),this.graphicTimerMap.forEach((u,c)=>{a.has(c)||(this.timer.clearTimeout(u),this.graphicTimerMap.delete(c))});let l=this.curGraphics.size;this.curGraphics.forEach(u=>{a.has(u)||this.curGraphics.delete(u)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var Bt=require("three");var De=class{constructor(e){this.context=e;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new Bt.Vector3,zoom:1,target:new Bt.Vector3};enable=!0;box=new Bt.Box3;updateBox(){this.box.setFromObject(this.context.scene)}setEnable(e){this.enable=e,e?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(g=>g instanceof ct).length)return null;let t=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:a}=t,l=y(o,n,r,i),u=y(a,n,r,i),c=y(new Bt.Vector3(o.x,a.y,a.z),n,r,i),h=y(new Bt.Vector3(a.x,o.y,o.z),n,r,i),p=Math.min(l.x,u.x,c.x,h.x),d=Math.max(l.x,u.x,c.x,h.x),m=Math.min(l.y,u.y,c.y,h.y),f=Math.max(l.y,u.y,c.y,h.y);return{left:p,right:d,top:m,bottom:f}}checkDistanceToScreenEdge({left:e,right:t,top:n,bottom:r}){let{width:i,height:o}=this.context.clientSize,[a,l,u,c]=this.context.config.cameraBound.padding,h=t>=c,p=i-e>=l,d=o-n>=u,m=r>=a;return h&&p&&d&&m}onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:t,right:n,top:r,bottom:i}=e;this.checkDistanceToScreenEdge({left:t,right:n,top:r,bottom:i})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var Mn=require("three"),Fr=require("three/examples/jsm/controls/MapControls"),Gt=require("@tweenjs/tween.js");var Oe=class extends Fr.MapControls{constructor(t,n,r){super(n,r);this.context=t;this.camera=n;this.domElement=r;this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=n.zoom,this.registryEvent()}prevCameraZoom=1;tweenGroup=new Gt.Group;offsetY=0;registryEvent(){this.addEventListener("change",()=>{let t=this.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.dispatchEvent({type:"change-zoom",zoom:t}))}),this.context.addEventListener("update",this.tweenUpdate)}tweenUpdate=()=>{this.tweenGroup.update()};setPolarAngle(t,n=!1){let{maxPolarAngle:r,minPolarAngle:i}=this,o=r===i;(n||t<=r&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=r,this.minPolarAngle=i)}async setPolarAngleByDuration(t,n=!1,r=500){return r<=0?this.setPolarAngle(t,n):Z(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setPolarAngle(o.polar,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}setAzimuthalAngle(t,n){let{maxAzimuthAngle:r,minAzimuthAngle:i,maxPolarAngle:o,minPolarAngle:a}=this,l=r===i;if(n||t<=r&&t>=i){this.maxAzimuthAngle=t,this.minAzimuthAngle=t;let u=this.getPolarAngle();this.maxPolarAngle=u,this.minPolarAngle=u,this.update(),this.maxPolarAngle=o,this.minPolarAngle=a}l||(this.maxAzimuthAngle=r,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,n=!1,r=500){return r<=0?this.setAzimuthalAngle(t,n):Z(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}getCameraLookAt(){return new Mn.Vector3().subVectors(this.target,this.camera.position)}async setCameraPositionByTarget(t,n){let r=this.target.clone(),i=this.getCameraLookAt();if(!n){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return Z(new Promise(o=>{let a=new Gt.Tween(r,this.tweenGroup).to(t,n).onUpdate(()=>{this.camera.position.copy(r.clone().sub(i)),this.target.copy(r.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(a),this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update(),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}setZoom(t,n,r=!1){let{minZoom:i,maxZoom:o}=this;(r||t>=i&&t<=o)&&(this.camera.position.copy(n.clone().sub(this.getCameraLookAt())),this.target.copy(n),this.camera.zoom=t,this.update())}async setZoomByDuration(t,n,r=!1,i=500){let o=this.getCameraLookAt(),a={zoom:this.camera.zoom,target:this.target.clone()};return i?Z(new Promise(l=>{let u=new Gt.Tween(a,this.tweenGroup).to({zoom:t,target:n},i).onUpdate(()=>{this.setZoom(a.zoom,a.target,r)}).onComplete(()=>{this.tweenGroup.remove(u),this.enabled=!0,l(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500):this.setZoom(t,n,r)}setTargetByOffset(t,n=this.target.clone()){if(!t)return;this.camera.updateMatrix();let r=new Mn.Vector3;r.setFromMatrixColumn(this.camera.matrix,1),r.normalize(),r.multiplyScalar(t/this.camera.zoom),n.add(r),this.setCameraPositionByTarget(n,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){this.clearTween()}};var jt=require("three");var Fe=class extends jt.WebGLRenderer{event=new jt.EventDispatcher;scene;camera;enable=!0;timer=new D;constructor(e){super({antialias:!0,alpha:!0,...e}),this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=jt.PCFSoftShadowMap}setCameraAndScene(e,t){this.scene=e,this.camera=t}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(e,t){this.event.addEventListener(e,t)}removeEventListener(e,t){this.event.removeEventListener(e,t)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}};var Ur=require("three"),Ue=class extends Ur.Scene{constructor(){super()}};var Br=require("three"),Be=class extends Br.OrthographicCamera{constructor(e,t){super(-e/2,e/2,t/2,-t/2,-1e3,5e3),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var _e=class extends S.EventDispatcher{constructor(t,n){super();this.container=t;this.config=n;this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new ge(this),this.hoverHelper=new me(this),this.resizeClientSize(),this.registryEvent()}scene=new Ue;renderer=new Fe;camera;control;lights=Ze();currentFloor;selection;hoverHelper;basicRatio;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:n,width:r,height:i}=this.container.getBoundingClientRect();this.clientSize={width:r||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:n}}init(){let{clientWidth:t,clientHeight:n}=this.container;this.camera=new Be(t,n),this.renderer.setSize(t,n),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Oe(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.control.addEventListener("change-zoom",({zoom:r})=>{this.dispatchEvent({type:"control-zoom-change",zoom:r})}),this.renderer.addEventListener("update",()=>{this.dispatchEvent({type:"update"})}),this.cameraBound=new De(this)}getRatio(t=new S.Vector3(0,0,0),n=new S.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,o=y(t,this.camera,r,i),a=y(n,this.camera,r,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(n=>{n instanceof S.AmbientLight&&(n.color=new S.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}onWindowResize=()=>{let{container:t,camera:n,renderer:r}=this,{clientWidth:i,clientHeight:o}=t;i=Math.max(1,i),o=Math.max(1,o),n.left=-i/2,n.right=i/2,n.top=o/2,n.bottom=-o/2,n.updateProjectionMatrix(),r.setSize(i,o),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:o})};onClick=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);n.length&&this.dispatchEvent({type:"graphic-click",graphics:n,position:r});let i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);i.length&&this.dispatchEvent({type:"poi-click",pois:i})};getGraphicsByDeviceXy(t,n){let r=new S.Vector2;r.x=t/this.clientSize.width*2-1,r.y=n/this.clientSize.height*-2+1;let i=new S.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(i)||{graphics:[],position:null}}getPoisByDeviceXy(t,n){let r=this.currentFloor?.poiLayer.getPoiByDeviceXy(t,n),i=this.currentFloor?.poiLayer2.getPoiByDeviceXy(t,n);return(r||[]).concat(i||[])}onPointerover=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:n,pois:i,position:r})};onPointermove=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:n,pois:i,position:r})};onPointerleave=t=>{this.dispatchEvent({type:"pointer-level"})};onSelectionSelect=({graphics:t,isMultipleSelect:n})=>{this.dispatchEvent({type:"select-graphic",graphics:t,isMultipleSelect:n})};onHoverChange=({graphics:t})=>{this.dispatchEvent({type:"hover",graphics:t})};registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange)}setPolarAngle(t,n=500){return this.control.setPolarAngleByDuration(t,!0,n)}setAzimuthalAngle(t,n=500){return this.control.setAzimuthalAngleDuration(t,!0,n)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,n,r=500){return this.control.setZoomByDuration(t,n,!0,r)}getFitCameraToObjectZoom(t,n=[20,20,20,20],r=500,i=!0){let[o,a,l,u]=n,{clientSize:{width:c,height:h}}=this,p=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let d=new S.Box3().setFromObject(t);this.setPolarAngle(p,0);let{max:m,min:f}=d,g=new S.Vector3(f.x,m.y,m.z),E=new S.Vector3(m.x,m.y,m.z),x=new S.Vector3(m.x,f.y,f.z),z=new S.Vector3(f.x,f.y,f.z),b=y(g,this.camera,c,h),T=y(E,this.camera,c,h),k=y(z,this.camera,c,h),$=y(x,this.camera,c,h),Kt=new S.Box2().setFromPoints([new S.Vector2(b.x,b.y),new S.Vector2(T.x,T.y),new S.Vector2(k.x,k.y),new S.Vector2($.x,$.y)]).getSize(new S.Vector2),Ke=(c-a-u)/Kt.x,fi=(h-o-l)/Kt.y,di=Math.min(Ke,fi),gi=new S.Vector3((m.x+f.x)/2,(m.y+f.y)/2,(m.z+f.z)/2);return{zoom:di*this.camera.zoom,center:gi}}fitCameraToObject(t,n=[20,20,20,20],r=500,i=!0){let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,n,r,i);return this.setZoom(o,a,r)}getFitCameraToGroundZoom(t=[20,20,20,20],n=500,r=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n,r).zoom}fitCameraToGround(t=[20,20,20,20],n=500,r=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,n,r):Promise.resolve(!1)}async setCameraPosition(t,n){return this.control.setCameraPositionByTarget(t,n)}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),V(this.scene)}};var Gr=require("lodash"),zr={apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function wn(s){return(0,Gr.merge)({},zr,s)}var kr=require("lodash");var Vr=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(Vr||{}),Tn=class extends Ge.EventDispatcher{constructor(t,n={}){super();this.container=t;this.config=wn(n),this.context=new _e(t,this.config),this.registryEvent()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new D;plugins=[];changeBuildingCenter(t,{brand:n,project:r}){let i=t?Jt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(n=>n!==t)}triggerHooks(t,n){this.dispatchEvent({type:t,data:n})}switchFloorByFloor(t,n=t.graphicLayer.children){this.triggerHooks("switch_floor_before",{curFloor:t,graphics:n}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(void 0,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}onControlChange=()=>{let{camera:{zoom:t}}=this.context;t!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=t)};addModel(t,n){if(t.options.geometry.type==="polygon"){let r=this.context.currentFloor?.addModel({...n,position:t.getPosition().setZ(.1),id:t.options.id});if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:a=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,a,1)}}}addHeatmap(t){return this.context.currentFloor?.addHeatmap(t)}getLegacyToGraphicMap(){return this.context.currentFloor?.userData.legacyToGraphicMap||new Map}getFloorAllGraphics(){return this.context.currentFloor?.graphicLayer.children.filter(t=>t instanceof R)||[]}createGraphicPoi(t,n){if(this.context.currentFloor){n.id===void 0&&(n.id=t.options.id);let r=t.options.center,i=t.getCenter(),o=r?.[0]||i.x,a=r?.[1]||i.y;return console.log(o,a,r,i),this.context.currentFloor.addPoi({...n,position:{x:o,y:a,z:i.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,n=500){let r=t.getPosition();return this.context.setCameraPosition(r,n)}async translateElementToCenterX(t,n=500){return Z(new Promise(r=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:u}=this.context,h=y(o,u,a,l).x-a/2,p=new Ge.Vector3;p.setFromMatrixColumn(this.context.camera.matrix,0),p.normalize(),p.multiplyScalar(h/this.context.camera.zoom),i.add(p),this.context.setCameraPosition(i,n).then(r)})}),n+500)}getElementDeviceCoordinate(t){let n=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return y(n,this.context.camera,r,i)}changeMapType(t,n=500){return this.type=t,t==="2d"?this.context.setPolarAngle(0,n):this.context.setPolarAngle(1.1,n)}async resetView(t=300){let n=t/3;await this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,n),await this.context.setPolarAngle(this.config.control.defaultPolar,n),await this.context.fitCameraToGround(this.config.defaultPadding,n,!1)}reduceMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r-t,this.context.control.target,n)}enlargeMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r+t,this.context.control.target,n)}onKeydown=t=>{this.polarKeys.includes(t.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(t.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)};onKeyUp=t=>{if(this.polarKeys.includes(t.code)){let n=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=n,this.context.control.minPolarAngle=n}if(this.azimuthalKeys.includes(t.code)){let n=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=n,this.context.control.minAzimuthAngle=n}};registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver((0,kr.debounce)(this.resize,5));t.observe(this.container),this.observe=t}}unRegistryEvent(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),this.observe?.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t=.1){let n=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(n+t,500)}async measureDistance(){return this.cancelDistance(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new le(this.context);let r=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){r(),n("cancel")},this.svgLine.addEventListener("distance",({distance:i})=>{t(i)})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ue(this.context);let r=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){r(),n("cancel")},this.svgPolygon.addEventListener("area",({area:i})=>{t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(t)||null}deleteGraphic(t){this.context.currentFloor?.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Jt(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){this.context.currentFloor?.poiLayer.removePoiById(t),this.context.currentFloor?.poiLayer2.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)||this.context.currentFloor?.poiLayer2.getPoiById(t)}getPois(){return[...(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in),...this.context.currentFloor?.poiLayer2.pois||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let t=this.context.control.getAzimuthalAngle(),n=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let r=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=n,this.context.control.minZoom=r,this.context.control.maxZoom=r*25,this.basicZoom=n,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(t,0),this.context.cameraBound.setEnable(!0)};dispose(){this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.context.dispose(),this.unRegistryEvent(),vt.dispose(),xt.dispose(),Nt.dispose(),Et.dispose(),I.dispose()}};var Hr=require("three"),dt=class extends Hr.EventDispatcher{bmap;constructor(e){super(),this.bmap=e,this.bmap.use(this)}dispose(){}};var Cn=class extends dt{equipmentList=[];equipmentMap=new Map;constructor(e){super(e),this.fetchEquipment(),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}async fetchEquipment(){let{apiDomain:e,apiPath:{equipmentList:t},apiInfo:n}=this.bmap.config,r=`${e}${t}`;await fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)}onSwitchFloor=({data:{graphics:e}})=>{this.equipmentList.length&&this.changeGraphicToEquipment(e)};getGraphicEquipment(e){return e.userData.data.info.userData.equipment}changeGraphicToEquipment(e){e.filter(t=>{let n=this.getGraphicEquipment(t);return n&&this.equipmentMap.has(n)}).forEach(t=>{let n=this.equipmentMap.get(this.getGraphicEquipment(t)),r=this.bmap.createGraphicPoi(t,{icon:n?.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),Array.from(this.bmap.context.currentFloor?.poiLayer.pois||[]).forEach(e=>{e.userData.type==="equipment"&&this.bmap.context.currentFloor?.poiLayer.removePoi(e)})}};var N=require("three");var _=require("three"),tt=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}})}};tt.prototype.setMatrixWorld=function(s){this.matrixWorld=s};tt.prototype.setGeometry=function(s,e){this._geometry=s,this.setPoints(s.getAttribute("position").array,e)};tt.prototype.setPoints=function(s,e){if(!(s instanceof Float32Array)&&!(s instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=s,this.widthCallback=e,this.positions=[],this.counters=[],s.length&&s[0]instanceof _.Vector3)for(var t=0;t<s.length;t++){var n=s[t],r=t/s.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<s.length;t+=3){var r=t/s.length;this.positions.push(s[t],s[t+1],s[t+2]),this.positions.push(s[t],s[t+1],s[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Hi(s,e){var t=new _.Matrix4,n=new _.Ray,r=new _.Sphere,i=new _.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),s.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),n.copy(s.ray).applyMatrix4(t);var a=new _.Vector3,l=new _.Vector3,u=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var d=h.array,m=p.position.array,f=p.width.array,g=0,E=d.length-1;g<E;g+=c){var x=d[g],z=d[g+1];a.fromArray(m,x*3),l.fromArray(m,z*3);var b=f[Math.floor(g/3)]!==void 0?f[Math.floor(g/3)]:1,T=s.params.Line.threshold+this.material.lineWidth*b/2,k=T*T,$=n.distanceSqToSegment(a,l,i,u);if(!($>k)){i.applyMatrix4(this.matrixWorld);var Tt=s.ray.origin.distanceTo(i);Tt<s.near||Tt>s.far||(e.push({distance:Tt,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}),g=E)}}}}tt.prototype.raycast=Hi;tt.prototype.compareV3=function(s,e){var t=s*6,n=e*6;return this.positions[t]===this.positions[n]&&this.positions[t+1]===this.positions[n+1]&&this.positions[t+2]===this.positions[n+2]};tt.prototype.copyV3=function(s){var e=s*6;return[this.positions[e],this.positions[e+1],this.positions[e+2]]};tt.prototype.getDistance=function(s){let e=0;for(let t=0;t<s;t++){let n=6*t,r=new _.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new _.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);e+=o}return e};tt.prototype.process=function(){var s=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var e;let t=this.getDistance(s-1);var n;this.compareV3(0,s-1)?n=this.copyV3(s-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<s;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?e=this.widthCallback(r/(s-1)):e=1,this.width.push(e),this.width.push(e),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===s-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/t;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<s-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(s-1,0)?n=this.copyV3(1):n=this.copyV3(s-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Pn(s,e,t,n,r){var i;if(s=s.subarray||s.slice?s:s.buffer,t=t.subarray||t.slice?t:t.buffer,s=e?s.subarray?s.subarray(e,r&&e+r):s.slice(e,r&&e+r):s,t.set)t.set(s,n);else for(i=0;i<s.length;i++)t[i+n]=s[i];return t}tt.prototype.advance=function(s){var e=this._attributes.position.array,t=this._attributes.previous.array,n=this._attributes.next.array,r=e.length;Pn(e,0,t,0,r),Pn(e,6,e,0,r-6),e[r-6]=s.x,e[r-5]=s.y,e[r-4]=s.z,e[r-3]=s.x,e[r-2]=s.y,e[r-1]=s.z,Pn(e,6,n,0,r-6),n[r-6]=s.x,n[r-5]=s.y,n[r-4]=s.z,n[r-3]=s.x,n[r-2]=s.y,n[r-1]=s.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
103
+ `,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>r&&(r=l)}let o=new L.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new L.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new L.Color(ft(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=o}initLineMaterial(){let t=I.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new L.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options[0].height+this.options[0].deltaHeight;return this.options.map(r=>{let{coords:i}=r.geometry;for(let o=0;o<i.length;o++){let a=i[o];for(let l=0;l<a.length;l++){let u=a[l],c=l+1===a.length?a[0]:a[l+1];t.push(new L.Vector3(u[0],u[1],n)),t.push(new L.Vector3(c[0],c[1],n))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new L.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new L.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){this.geometry.dispose(),this.material.dispose(),this.line?.geometry.dispose(),this.clear()}};var U=require("three");var Lr=require("lodash"),Hi={text:"",icon:"",icon_size:[18,18],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1},q=class extends U.Object3D{constructor(t,n){super();this.context=t;this.options=At((0,Lr.cloneDeep)({...Hi,...n}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}options;textAspect=1;spriteText;spriteIcon;box=new U.Box2;boxHelper;_initIconPromise=null;get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get deltaZ(){return!this.options.icon&&this.options.text?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:.1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",async({value:t})=>{this._initIconPromise&&await this._initIconPromise,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),await this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text",({value:t})=>{this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.rotation=t/180*Math.PI)}),this.addEventListener("change-icon_size",({value:t})=>{this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-depth_test",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.depthTest=t),this.spriteText&&(this.spriteText.material.depthTest=t)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}async initIcon(){if(this.options.icon)return this._initIconPromise=new Promise(async t=>{let n=await xt.getTextureByUrl(this.options.icon),r=new U.Sprite(new U.SpriteMaterial({map:n,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));r.visible=!1,r.renderOrder=1e5+this.options.level,n.needsUpdate=!0,this.add(r),this.spriteIcon=r,t(r)}).then(()=>{this._initIconPromise=null})}initText(){if(this.options.text){let t=vt.getTextureByText(this.options.text);this.textAspect=t.image.width/t.image.height;let n=new U.Sprite(new U.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test}));n.visible=!1,n.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=n,this.add(n)}}initSize(){let t=0,n=0,{icon:r,text:i}=this.options;r?i?(t=0,n=t*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(t=.5,n=0):i?(n=.5,t=0):(t=0,n=0),this.spriteIcon?.center.set(.5,t),this.spriteText?.center.set(.5,n)}async init(){await this.initIcon(),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}_initScale=({zoom:t})=>{if(this.spriteText){let n=this.textHeight/t;this.spriteText.scale.set(this.textAspect*n,n,.1)}this.spriteIcon&&this.spriteIcon?.scale.set(this.options.icon_size[0]/t,this.options.icon_size[1]/t,.1),this.resetZ()};resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:n,height:r}}=this.context,i=n*(t.x+1)/2,o=r*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let a=this.iconWidth/2,l=new U.Box2(new U.Vector2(i-a,o-this.iconHeight),new U.Vector2(i+a,o)),u=this.textWidth/2,c=new U.Box2(new U.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new U.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=c.union(l),this.box}renderBoxHelper(t,n){if(!this.boxHelper){let r=document.createElement("div");r.style.position="absolute",r.style.zIndex="999",r.style.border="1px solid red",r.style.pointerEvents="none",this.boxHelper=r,this.context.container.appendChild(r)}t&&n?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=n+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.unRegistryEvent(),this.spriteText=void 0}};var Q=require("three"),Nr=require("three/examples/jsm/utils/BufferGeometryUtils");var Dr={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},de=class extends Q.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Dr,...r})),this.init()}options;mesh;async init(){let t=this.options.map(a=>vt.getTextureByText(a.texts[0],{fillStyle:Me(a.fillColor,a.fillOpacity),strokeStyle:Me(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),n=t.map((a,l)=>{let u=this.options[l],{width:c,height:h}=a.image,p=c/h,d=u.secondHeight*p,m=new Q.PlaneGeometry(d,u.secondHeight),f=new Q.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Q.Matrix4().makeRotationZ(u.secondRotate));return m.applyMatrix4(f),m}),r=(0,Nr.mergeGeometries)(n,!0);n.forEach(a=>a.dispose());let i=t.map(a=>{let l=new Q.MeshBasicMaterial({map:a,alphaTest:1,side:Q.DoubleSide});return a.needsUpdate=!0,l}),o=new Q.Mesh(r,i);this.mesh=o,this.position.z+=.004,this.add(o)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Or=require("three"),Le=class extends J{startPoint;endPoint;rect;frustum=new Or.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),B(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);B(this.rect,n.x,n.y,r,i)}else B(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=y(this.startPoint,t,n,r),o=y(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof R&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=y(p,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=y(l,r,i,o),h=y(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var ge=class extends Fr.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Le(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=t,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(n,r),l=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!l.has(c.options.id)){let h=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&h.options.geometry.type==="point"&&(a.push(h),l.add(c.options.id))}}),(It?t.metaKey:t.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Rt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Rt(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(n=>{this._list.add(n)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var Ne=require("three");var me=class extends Ne.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new D;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:n,e:r})=>{let i=n.map(u=>this.context.currentFloor?.graphicLayer.graphicMap.get(u.options.id)).filter(u=>u&&u.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:o}=this.context.config.hover,a=new Set;if(i.length){let u,c=1e4;i.forEach(h=>{let p=n.find(d=>d.options.id===h.options.id);if(p instanceof bt){let{x:d,y:m}=p.clientPos,f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}else if(p instanceof q){let{x:d,y:m}=p.box.getCenter(new Ne.Vector2),f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}}),a.add(u)}a.size||t.forEach(u=>a.add(u)),a.forEach(u=>{if(this.graphicTimerMap.get(u)||this.curGraphics.has(u))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(u),this.graphicTimerMap.delete(u),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},o);this.graphicTimerMap.set(u,c)}),this.graphicTimerMap.forEach((u,c)=>{a.has(c)||(this.timer.clearTimeout(u),this.graphicTimerMap.delete(c))});let l=this.curGraphics.size;this.curGraphics.forEach(u=>{a.has(u)||this.curGraphics.delete(u)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var Bt=require("three");var De=class{constructor(e){this.context=e;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new Bt.Vector3,zoom:1,target:new Bt.Vector3};enable=!0;box=new Bt.Box3;updateBox(){this.box.setFromObject(this.context.scene)}setEnable(e){this.enable=e,e?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(g=>g instanceof ht).length)return null;let t=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:a}=t,l=y(o,n,r,i),u=y(a,n,r,i),c=y(new Bt.Vector3(o.x,a.y,a.z),n,r,i),h=y(new Bt.Vector3(a.x,o.y,o.z),n,r,i),p=Math.min(l.x,u.x,c.x,h.x),d=Math.max(l.x,u.x,c.x,h.x),m=Math.min(l.y,u.y,c.y,h.y),f=Math.max(l.y,u.y,c.y,h.y);return{left:p,right:d,top:m,bottom:f}}checkDistanceToScreenEdge({left:e,right:t,top:n,bottom:r}){let{width:i,height:o}=this.context.clientSize,[a,l,u,c]=this.context.config.cameraBound.padding,h=t>=c,p=i-e>=l,d=o-n>=u,m=r>=a;return h&&p&&d&&m}onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:t,right:n,top:r,bottom:i}=e;this.checkDistanceToScreenEdge({left:t,right:n,top:r,bottom:i})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var Mn=require("three"),Ur=require("three/examples/jsm/controls/MapControls"),Gt=require("@tweenjs/tween.js");var Oe=class extends Ur.MapControls{constructor(t,n,r){super(n,r);this.context=t;this.camera=n;this.domElement=r;this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=n.zoom,this.registryEvent()}prevCameraZoom=1;tweenGroup=new Gt.Group;offsetY=0;registryEvent(){this.addEventListener("change",()=>{let t=this.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.dispatchEvent({type:"change-zoom",zoom:t}))}),this.context.addEventListener("update",this.tweenUpdate)}tweenUpdate=()=>{this.tweenGroup.update()};setPolarAngle(t,n=!1){let{maxPolarAngle:r,minPolarAngle:i}=this,o=r===i;(n||t<=r&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=r,this.minPolarAngle=i)}async setPolarAngleByDuration(t,n=!1,r=500){return r<=0?this.setPolarAngle(t,n):Z(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setPolarAngle(o.polar,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}setAzimuthalAngle(t,n){let{maxAzimuthAngle:r,minAzimuthAngle:i,maxPolarAngle:o,minPolarAngle:a}=this,l=r===i;if(n||t<=r&&t>=i){this.maxAzimuthAngle=t,this.minAzimuthAngle=t;let u=this.getPolarAngle();this.maxPolarAngle=u,this.minPolarAngle=u,this.update(),this.maxPolarAngle=o,this.minPolarAngle=a}l||(this.maxAzimuthAngle=r,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,n=!1,r=500){return r<=0?this.setAzimuthalAngle(t,n):Z(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}getCameraLookAt(){return new Mn.Vector3().subVectors(this.target,this.camera.position)}async setCameraPositionByTarget(t,n){let r=this.target.clone(),i=this.getCameraLookAt();if(!n){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return Z(new Promise(o=>{let a=new Gt.Tween(r,this.tweenGroup).to(t,n).onUpdate(()=>{this.camera.position.copy(r.clone().sub(i)),this.target.copy(r.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(a),this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update(),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}setZoom(t,n,r=!1){let{minZoom:i,maxZoom:o}=this;(r||t>=i&&t<=o)&&(this.camera.position.copy(n.clone().sub(this.getCameraLookAt())),this.target.copy(n),this.camera.zoom=t,this.update())}async setZoomByDuration(t,n,r=!1,i=500){let o=this.getCameraLookAt(),a={zoom:this.camera.zoom,target:this.target.clone()};return i?Z(new Promise(l=>{let u=new Gt.Tween(a,this.tweenGroup).to({zoom:t,target:n},i).onUpdate(()=>{this.setZoom(a.zoom,a.target,r)}).onComplete(()=>{this.tweenGroup.remove(u),this.enabled=!0,l(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500):this.setZoom(t,n,r)}setTargetByOffset(t,n=this.target.clone()){if(!t)return;this.camera.updateMatrix();let r=new Mn.Vector3;r.setFromMatrixColumn(this.camera.matrix,1),r.normalize(),r.multiplyScalar(t/this.camera.zoom),n.add(r),this.setCameraPositionByTarget(n,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){this.clearTween()}};var jt=require("three");var Fe=class extends jt.WebGLRenderer{event=new jt.EventDispatcher;scene;camera;enable=!0;timer=new D;constructor(e){super({antialias:!0,alpha:!0,...e}),this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=jt.PCFSoftShadowMap}setCameraAndScene(e,t){this.scene=e,this.camera=t}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(e,t){this.event.addEventListener(e,t)}removeEventListener(e,t){this.event.removeEventListener(e,t)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}};var Br=require("three"),Ue=class extends Br.Scene{constructor(){super()}};var Gr=require("three"),Be=class extends Gr.OrthographicCamera{constructor(e,t){super(-e/2,e/2,t/2,-t/2,-1e3,5e3),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var _e=class extends S.EventDispatcher{constructor(t,n){super();this.container=t;this.config=n;this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new ge(this),this.hoverHelper=new me(this),this.resizeClientSize(),this.registryEvent()}scene=new Ue;renderer=new Fe;camera;control;lights=Ze();currentFloor;selection;hoverHelper;basicRatio;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:n,width:r,height:i}=this.container.getBoundingClientRect();this.clientSize={width:r||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:n}}init(){let{clientWidth:t,clientHeight:n}=this.container;this.camera=new Be(t,n),this.renderer.setSize(t,n),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Oe(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.control.addEventListener("change-zoom",({zoom:r})=>{this.dispatchEvent({type:"control-zoom-change",zoom:r})}),this.renderer.addEventListener("update",()=>{this.dispatchEvent({type:"update"})}),this.cameraBound=new De(this)}getRatio(t=new S.Vector3(0,0,0),n=new S.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,o=y(t,this.camera,r,i),a=y(n,this.camera,r,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(n=>{n instanceof S.AmbientLight&&(n.color=new S.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}onWindowResize=()=>{let{container:t,camera:n,renderer:r}=this,{clientWidth:i,clientHeight:o}=t;i=Math.max(1,i),o=Math.max(1,o),n.left=-i/2,n.right=i/2,n.top=o/2,n.bottom=-o/2,n.updateProjectionMatrix(),r.setSize(i,o),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:o})};onClick=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);n.length&&this.dispatchEvent({type:"graphic-click",graphics:n,position:r});let i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);i.length&&this.dispatchEvent({type:"poi-click",pois:i})};getGraphicsByDeviceXy(t,n){let r=new S.Vector2;r.x=t/this.clientSize.width*2-1,r.y=n/this.clientSize.height*-2+1;let i=new S.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(i)||{graphics:[],position:null}}getPoisByDeviceXy(t,n){let r=this.currentFloor?.poiLayer.getPoiByDeviceXy(t,n),i=this.currentFloor?.poiLayer2.getPoiByDeviceXy(t,n);return(r||[]).concat(i||[])}onPointerover=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:n,pois:i,position:r})};onPointermove=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:n,pois:i,position:r})};onPointerleave=t=>{this.dispatchEvent({type:"pointer-level"})};onSelectionSelect=({graphics:t,isMultipleSelect:n})=>{this.dispatchEvent({type:"select-graphic",graphics:t,isMultipleSelect:n})};onHoverChange=({graphics:t})=>{this.dispatchEvent({type:"hover",graphics:t})};registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange)}setPolarAngle(t,n=500){return this.control.setPolarAngleByDuration(t,!0,n)}setAzimuthalAngle(t,n=500){return this.control.setAzimuthalAngleDuration(t,!0,n)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,n,r=500){return this.control.setZoomByDuration(t,n,!0,r)}getFitCameraToObjectZoom(t,n=[20,20,20,20],r=500,i=!0){let[o,a,l,u]=n,{clientSize:{width:c,height:h}}=this,p=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let d=new S.Box3().setFromObject(t);this.setPolarAngle(p,0);let{max:m,min:f}=d,g=new S.Vector3(f.x,m.y,m.z),E=new S.Vector3(m.x,m.y,m.z),x=new S.Vector3(m.x,f.y,f.z),z=new S.Vector3(f.x,f.y,f.z),b=y(g,this.camera,c,h),T=y(E,this.camera,c,h),k=y(z,this.camera,c,h),$=y(x,this.camera,c,h),Kt=new S.Box2().setFromPoints([new S.Vector2(b.x,b.y),new S.Vector2(T.x,T.y),new S.Vector2(k.x,k.y),new S.Vector2($.x,$.y)]).getSize(new S.Vector2),Ke=(c-a-u)/Kt.x,di=(h-o-l)/Kt.y,gi=Math.min(Ke,di),mi=new S.Vector3((m.x+f.x)/2,(m.y+f.y)/2,(m.z+f.z)/2);return{zoom:gi*this.camera.zoom,center:mi}}fitCameraToObject(t,n=[20,20,20,20],r=500,i=!0){let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,n,r,i);return this.setZoom(o,a,r)}getFitCameraToGroundZoom(t=[20,20,20,20],n=500,r=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n,r).zoom}fitCameraToGround(t=[20,20,20,20],n=500,r=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,n,r):Promise.resolve(!1)}async setCameraPosition(t,n){return this.control.setCameraPositionByTarget(t,n)}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),V(this.scene)}};var zr=require("lodash"),kr={apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function wn(s){return(0,zr.merge)({},kr,s)}var Vr=require("lodash");var Hr=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(Hr||{}),Tn=class extends Ge.EventDispatcher{constructor(t,n={}){super();this.container=t;this.config=wn(n),this.context=new _e(t,this.config),this.registryEvent()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new D;plugins=[];changeBuildingCenter(t,{brand:n,project:r}){let i=t?Jt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(n=>n!==t)}triggerHooks(t,n){this.dispatchEvent({type:t,data:n})}switchFloorByFloor(t,n=t.graphicLayer.children){this.triggerHooks("switch_floor_before",{curFloor:t,graphics:n}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(void 0,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}onControlChange=()=>{let{camera:{zoom:t}}=this.context;t!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=t)};addModel(t,n){if(t.options.geometry.type==="polygon"){let r=this.context.currentFloor?.addModel({...n,position:t.getPosition().setZ(.1),id:t.options.id});if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:a=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,a,1)}}}addHeatmap(t){return this.context.currentFloor?.addHeatmap(t)}getLegacyToGraphicMap(){return this.context.currentFloor?.userData.legacyToGraphicMap||new Map}getFloorAllGraphics(){return this.context.currentFloor?.graphicLayer.children.filter(t=>t instanceof R)||[]}createGraphicPoi(t,n){if(this.context.currentFloor){n.id===void 0&&(n.id=t.options.id);let r=t.options.center,i=t.getCenter(),o=r?.[0]||i.x,a=r?.[1]||i.y;return console.log(o,a,r,i),this.context.currentFloor.addPoi({...n,position:{x:o,y:a,z:i.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,n=500){let r=t.getPosition();return this.context.setCameraPosition(r,n)}async translateElementToCenterX(t,n=500){return Z(new Promise(r=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:u}=this.context,h=y(o,u,a,l).x-a/2,p=new Ge.Vector3;p.setFromMatrixColumn(this.context.camera.matrix,0),p.normalize(),p.multiplyScalar(h/this.context.camera.zoom),i.add(p),this.context.setCameraPosition(i,n).then(r)})}),n+500)}getElementDeviceCoordinate(t){let n=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return y(n,this.context.camera,r,i)}changeMapType(t,n=500){return this.type=t,t==="2d"?this.context.setPolarAngle(0,n):this.context.setPolarAngle(1.1,n)}async resetView(t=300){let n=t/3;await this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,n),await this.context.setPolarAngle(this.config.control.defaultPolar,n),await this.context.fitCameraToGround(this.config.defaultPadding,n,!1)}reduceMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r-t,this.context.control.target,n)}enlargeMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r+t,this.context.control.target,n)}onKeydown=t=>{this.polarKeys.includes(t.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(t.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)};onKeyUp=t=>{if(this.polarKeys.includes(t.code)){let n=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=n,this.context.control.minPolarAngle=n}if(this.azimuthalKeys.includes(t.code)){let n=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=n,this.context.control.minAzimuthAngle=n}};registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver((0,Vr.debounce)(this.resize,5));t.observe(this.container),this.observe=t}}unRegistryEvent(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),this.observe?.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t=.1){let n=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(n+t,500)}async measureDistance(){return this.cancelDistance(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new le(this.context);let r=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){r(),n("cancel")},this.svgLine.addEventListener("distance",({distance:i})=>{t(i)})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ue(this.context);let r=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){r(),n("cancel")},this.svgPolygon.addEventListener("area",({area:i})=>{t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(t)||null}deleteGraphic(t){this.context.currentFloor?.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Jt(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){this.context.currentFloor?.poiLayer.removePoiById(t),this.context.currentFloor?.poiLayer2.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)||this.context.currentFloor?.poiLayer2.getPoiById(t)}getPois(){return[...(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in),...this.context.currentFloor?.poiLayer2.pois||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let t=this.context.control.getAzimuthalAngle(),n=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let r=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=n,this.context.control.minZoom=r,this.context.control.maxZoom=r*25,this.basicZoom=n,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(t,0),this.context.cameraBound.setEnable(!0)};dispose(){this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.context.dispose(),this.unRegistryEvent(),vt.dispose(),xt.dispose(),Nt.dispose(),Et.dispose(),I.dispose()}};var Wr=require("three"),st=class extends Wr.EventDispatcher{bmap;constructor(e){super(),this.bmap=e,this.bmap.use(this)}dispose(){}};var Cn=class extends st{equipmentList=[];equipmentMap=new Map;constructor(e){super(e),this.fetchEquipment(),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}async fetchEquipment(){let{apiDomain:e,apiPath:{equipmentList:t},apiInfo:n}=this.bmap.config,r=`${e}${t}`;await fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)}onSwitchFloor=({data:{graphics:e}})=>{this.equipmentList.length&&this.changeGraphicToEquipment(e)};getGraphicEquipment(e){return e.userData.data.info.userData.equipment}changeGraphicToEquipment(e){e.filter(t=>{let n=this.getGraphicEquipment(t);return n&&this.equipmentMap.has(n)}).forEach(t=>{let n=this.equipmentMap.get(this.getGraphicEquipment(t)),r=this.bmap.createGraphicPoi(t,{icon:n?.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),Array.from(this.bmap.context.currentFloor?.poiLayer.pois||[]).forEach(e=>{e.userData.type==="equipment"&&this.bmap.context.currentFloor?.poiLayer.removePoi(e)})}};var N=require("three");var _=require("three"),tt=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}})}};tt.prototype.setMatrixWorld=function(s){this.matrixWorld=s};tt.prototype.setGeometry=function(s,e){this._geometry=s,this.setPoints(s.getAttribute("position").array,e)};tt.prototype.setPoints=function(s,e){if(!(s instanceof Float32Array)&&!(s instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=s,this.widthCallback=e,this.positions=[],this.counters=[],s.length&&s[0]instanceof _.Vector3)for(var t=0;t<s.length;t++){var n=s[t],r=t/s.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<s.length;t+=3){var r=t/s.length;this.positions.push(s[t],s[t+1],s[t+2]),this.positions.push(s[t],s[t+1],s[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Wi(s,e){var t=new _.Matrix4,n=new _.Ray,r=new _.Sphere,i=new _.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),s.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),n.copy(s.ray).applyMatrix4(t);var a=new _.Vector3,l=new _.Vector3,u=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var d=h.array,m=p.position.array,f=p.width.array,g=0,E=d.length-1;g<E;g+=c){var x=d[g],z=d[g+1];a.fromArray(m,x*3),l.fromArray(m,z*3);var b=f[Math.floor(g/3)]!==void 0?f[Math.floor(g/3)]:1,T=s.params.Line.threshold+this.material.lineWidth*b/2,k=T*T,$=n.distanceSqToSegment(a,l,i,u);if(!($>k)){i.applyMatrix4(this.matrixWorld);var Tt=s.ray.origin.distanceTo(i);Tt<s.near||Tt>s.far||(e.push({distance:Tt,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}),g=E)}}}}tt.prototype.raycast=Wi;tt.prototype.compareV3=function(s,e){var t=s*6,n=e*6;return this.positions[t]===this.positions[n]&&this.positions[t+1]===this.positions[n+1]&&this.positions[t+2]===this.positions[n+2]};tt.prototype.copyV3=function(s){var e=s*6;return[this.positions[e],this.positions[e+1],this.positions[e+2]]};tt.prototype.getDistance=function(s){let e=0;for(let t=0;t<s;t++){let n=6*t,r=new _.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new _.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);e+=o}return e};tt.prototype.process=function(){var s=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var e;let t=this.getDistance(s-1);var n;this.compareV3(0,s-1)?n=this.copyV3(s-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<s;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?e=this.widthCallback(r/(s-1)):e=1,this.width.push(e),this.width.push(e),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===s-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/t;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<s-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(s-1,0)?n=this.copyV3(1):n=this.copyV3(s-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Pn(s,e,t,n,r){var i;if(s=s.subarray||s.slice?s:s.buffer,t=t.subarray||t.slice?t:t.buffer,s=e?s.subarray?s.subarray(e,r&&e+r):s.slice(e,r&&e+r):s,t.set)t.set(s,n);else for(i=0;i<s.length;i++)t[i+n]=s[i];return t}tt.prototype.advance=function(s){var e=this._attributes.position.array,t=this._attributes.previous.array,n=this._attributes.next.array,r=e.length;Pn(e,0,t,0,r),Pn(e,6,e,0,r-6),e[r-6]=s.x,e[r-5]=s.y,e[r-4]=s.z,e[r-3]=s.x,e[r-2]=s.y,e[r-1]=s.z,Pn(e,6,n,0,r-6),n[r-6]=s.x,n[r-5]=s.y,n[r-4]=s.z,n[r-3]=s.x,n[r-2]=s.y,n[r-1]=s.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
104
104
  `);_.ShaderChunk.meshline_frag=["",_.ShaderChunk.fog_pars_fragment,_.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",_.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",_.ShaderChunk.fog_fragment,"if (vUV.x <= thresholdRatio) {","gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);","}","}"].join(`
105
- `);var ye=class extends _.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(e)}};ye.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Wr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Xr={texture_url:Wr,lineWidth:8,color:16777215},ze=class extends N.Object3D{constructor(t,n){super();this.navigation=t;this.config=Object.assign({},Xr,n),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom,this.setDepthTest(this.getDepthTestByControl())}mesh=null;geometry=null;material=null;texture=null;config=Xr;points=[];basicRepeat=1;prevCameraZoom=0;depthTest=!0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat()),this.setDepthTest(this.getDepthTestByControl())};getDepthTestByControl(){let t=this.navigation.bmap.context.control.getPolarAngle();return!(t>=0&&t<=.15)}setDepthTest(t){this.depthTest=t,this.material&&(this.material.depthTest=t)}onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:n}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,n)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:n,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>y(new N.Vector3(l,u,0),n,r,i)).map(({x:l,y:u})=>[l,u]);return at(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((n,r)=>{new N.TextureLoader().load(t,n,void 0,r)})}transformPoints(t){let n=[];for(let r=0;r<t.length;r++)n.push(...t[r],0);return n}updatePoints(t){this.points=t,this.changeRepeat();let n=this.transformPoints(t);this.geometry&&this.geometry.setPoints(n)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let n=this.geometry=new tt;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=N.RepeatWrapping}let r=this.material=new ye({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),i=this.mesh=new N.Mesh(n,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Yt=require("@tweenjs/tween.js"),wt=require("three");var qr=require("three");var jr=require("@tweenjs/tween.js"),Yr=require("lodash"),Xi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},ke=class extends qr.EventDispatcher{constructor(t,n){super();this.navigation=t;this.options=Object.assign({},Xi,n),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new D;resetTimer=null;tweenUtil=new Dt;simulationTween;throttleUpdatePosition;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t)};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,n){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let f=Pt(r,i);u=u.slice(f+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)],{distance:h,closestPoint:p,index:d,i:m}=c.reduce((f,g,E)=>{if(g.floor!==t)return f;let{distance:x,closestPoint:z,index:b}=g.points.reduce((T,k,$,Tt)=>{if(!Tt[$+1])return{...T,distance:T.distance===1/0?A(k,n):T.distance};let{distance:Kt,closestPoint:Ke}=hn(n,k,Tt[$+1]);return Kt<T.distance?{distance:Kt,closestPoint:Ke,index:$}:T},{distance:1/0,closestPoint:g.points[0],index:0});return x<f.distance?{distance:x,closestPoint:z,index:E,i:b}:f},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:p,routeIndex:d+l,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,n){let r=this.adsorb(t,n);if(console.log("adsorbData",r),!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){this.tweenUtil.pause(),this.throttleUpdatePosition?.cancel()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let n=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.throttleUpdatePosition=(0,Yr.throttle)(c=>{let h=ee(i,c.distance);h&&(n.push({floor:t.floor,pos:h}),this.toPosition(t.floor,h))},200),u=this.simulationTween=new jr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(l).onComplete(()=>{this.tweenUtil.remove(u),l.flush(),l.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{r(this.startCurRouteSimulation())},3e3)):(r(!0),console.log(n,this.routeIndex,this.paths))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:n,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(n+1)];return at(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:n,position:r}=this,i=n[t],o=n[t+1],a=n[t+2];if(!i||!o)return{dir:"end",distance:0};let l=A(r,o);return t===0&&A(i,r)<5?{dir:"start",distance:l}:a?{dir:we(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:n}=this.getRemainDistance();console.log(t,n,this.paths);let r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),n<=10&&(i="end"),{distance:t,curRouteDistance:n,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var $r=require("three"),ve=class extends $r.EventDispatcher{_task=[];started=!1;activeTask=null;_id=0;constructor(e=!0){super(),e&&this.start()}_isEffectiveTask(e){return e&&typeof e.run=="function"}_getIndexByTid(e){return this._task.findIndex(t=>t.tid===e)}_createTask(e){return this._isEffectiveTask(e)?{...e,tid:++this._id,meta:e.meta||{}}:!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(e){if(this._isEffectiveTask(e)){let t=this._createTask(e);return this._task.push(t),this.started&&!this.activeTask&&this.start(),t.tid}return!1}replace(e,t){if(!this._isEffectiveTask(t))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(e);if(n===-1)return console.warn(`[TaskQueue] \u6CA1\u6709\u627E\u5230id=${e}\u7684\u4EFB\u52A1`),!1;let r=this._createTask(t);return this._task.splice(n,1,r),r.tid}remove(e){let t=this._getIndexByTid(e);return t===-1?(console.warn(`[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A${e}\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task`),!1):(this._task.splice(t,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}async exec(){if(!this.started||!this._task.length)return!1;let e=this._task.shift();this.activeTask=e,this.dispatchEvent({type:"active-task-start",task:e});try{await e.run()}catch(t){console.warn("[task run err]",t,e)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:e}),this.exec()}};var qi={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},An=class extends dt{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new Dt;taskQueue=new ve;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;constructor(e,t={},n){super(e),!n&&typeof t=="object"&&(n=t),this.options=Object.assign({},qi,n);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new ke(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:e})=>{if(this.dispatchEvent({type:"navigation-info",info:e}),!e.offset){if(e.routeIndex!==this.curPathIndex)return;this.toPositionByTask(e.pos)}};toPositionByTask(e){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="toPosition")?.tid,r={run:()=>this.toPositionBySpeed(e,this.options.speed),meta:{type:"toPosition"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(e){e===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=e,this.currentPathPosition=e.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(e){this.curPathIndex=e,this.paths[e]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[e]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:e}})=>{if(this.clearTween(),this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(e,t=0){this.paths=e,this.curPathIndex=t,this.clearTween();let n=this.bmap.context.currentFloor?.name,r=e[t];if(n&&r?.floor===n)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:e})}translatePoints(e){let[t,n]=this.bmap.buildingCenter;return e.map(r=>[r[0]-t,r[1]-n])}renderPath(e){this.translatePath=e;let t=this.catmullRomCurve3(e);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new ze(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new q(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(e){return cn(e,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let e=Pt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[e],n=this.curFloorPathPoints[e+1],r=new wt.Vector3(n[0]-t[0],n[1]-t[1],0).normalize(),i=new wt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new wt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(e=100){let t=this.getPathDirection();if(t===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-t)>Math.PI&&(n>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=e/Math.PI*6*r;return Z(new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Yt.Tween(l,this.tweenUtil.group).to(u,o).easing(Yt.Easing.Quadratic.InOut).onUpdate(async()=>{this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})}async initNavigationCamera(e=1e3){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="initNavigationCamera")?.tid,r={run:()=>Z((async()=>{await this.initCameraZoom(e/2),await this.changeCameraToPathUp(e/4),await this.translateCameraToStartPoi(e/4)})(),e+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}async translateCameraToStartPoi(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(n/2),l=i.target.clone(),u=y(this.startPoi.position,r,t,n),c=u.x-o,h=a-u.y+this.options.offsetY;if(console.log("start",l.clone()),!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}return console.log("start1",l.clone()),Z(new Promise(p=>{let d=i.target.clone();console.log(d,l,e);let m=new Yt.Tween(d,this.tweenUtil.group).to(l,e).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(d,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(l,0),this.tweenUtil.remove(m),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),e+500).then(()=>{this.bmap.context.control.enabled=!0})}}async initCameraZoom(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/40;return this.bmap.context.setZoom(l,this.startPoi.position,e).finally(()=>{this.bmap.context.control.enabled=!0})}toPosition(e,t){this.positionNavigation.toPosition(e,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(e){this.positionNavigation.changeSimulationSpeed(e)}async toPositionBySpeed(e,t){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,a=fn(i,e);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,1);return this.pathTween&&this.clearTween(),Z(new Promise(c=>{let h=this.pathTween=new Yt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async p=>{this.moveDistance(p.distance+o,h)}).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),u*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})}async moveDistance(e,t){this.movedDistance=e,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let n=ee(this.curFloorPathPoints,this.movedDistance);if(n===null)return;this.currentPathPosition=n;let r=this.translatePoints([n])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),await this.changeCameraToPathUp(500/this.options.speed),t?.resume())}setStartPoiRotate(e){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-e-n)%360}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Kr=require("three"),In=class extends dt{poiLayer;floors=[];group=new Kr.Group;constructor(e){super(e),this.poiLayer=new Ut(e.context)}show(e){let t=e[0].userData.height;e.forEach(i=>{i.poiLayer2.pois.forEach(o=>{o.position.setZ(o.position.z+t),o.options.depth_test=!0,this.poiLayer.pushPoi(o)}),i.poiLayer2.pois.length=0,i.poiLayer2.dispose(),i.position.z=t,t+=i.userData.height});let{scene:n,currentFloor:r}=this.bmap.context;r&&(n.remove(r),r.dispose()),this.group.add(this.poiLayer,...e),n.add(this.group),this.floors=e,this.fitCamera(),this.bmap.context.cameraBound.updateBox()}hide(){let{scene:e}=this.bmap.context;e.remove(this.group),this.poiLayer.clear(),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:e,config:t,type:n}=this.bmap;e.cameraBound.setEnable(!1),e.control.minZoom=0,e.control.maxZoom=1/0,e.camera.zoom=1,e.setAzimuthalAngle(t.control.defaultAzimuthal,0),e.setPolarAngle(t.control.defaultPolar,0),e.fitCameraToObject(this.group,void 0,0);let r=e.camera.zoom;e.control.minZoom=r,e.control.maxZoom=r*25,n==="3d"&&e.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=e.camera.zoom,e.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),e.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(e=>e.dispose()),this.floors=[]}};var Zr=require("three");function xe(s){let e=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function Rn(){return xe(`var XP=Object.create;var Jd=Object.defineProperty,YP=Object.defineProperties,$P=Object.getOwnPropertyDescriptor,ZP=Object.getOwnPropertyDescriptors,JP=Object.getOwnPropertyNames,qv=Object.getOwnPropertySymbols,KP=Object.getPrototypeOf,Xv=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable;var Zd=(r,t,e)=>t in r?Jd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qc=(r,t)=>{for(var e in t||(t={}))Xv.call(t,e)&&Zd(r,e,t[e]);if(qv)for(var e of qv(t))QP.call(t,e)&&Zd(r,e,t[e]);return r},Yv=(r,t)=>YP(r,ZP(t));var ce=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var jP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of JP(t))!Xv.call(r,a)&&a!==e&&Jd(r,a,{get:()=>t[a],enumerable:!(o=$P(t,a))||o.enumerable});return r};var Nr=(r,t,e)=>(e=r!=null?XP(KP(r)):{},jP(t||!r||!r.__esModule?Jd(e,"default",{value:r,enumerable:!0}):e,r));var Ii=(r,t,e)=>Zd(r,typeof t!="symbol"?t+"":t,e);var Zv=ce((Pz,$v)=>{var Kd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};$v.exports=Kd});var Qv=ce((Iz,Kv)=>{function Jv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Jv(a,t)):o!==t&&e.set(o,a);return e}Kv.exports=Jv});var e_=ce((Rz,t_)=>{function tI(r){let t=Number(r);return!(isNaN(t)||t<=0)}function jv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,jv(a));if(!tI(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}t_.exports=jv});var i_=ce((Lz,r_)=>{function n_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){n_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}r_.exports=n_});var u_=ce((Nz,a_)=>{var eI=Zv(),nI=Qv(),o_=e_(),s_=i_(),Qd=class{constructor(t){t instanceof Map?(s_(t),this.graph=t):t?this.graph=o_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(s_(e),o=e):o=o_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nI(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new eI,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,b)=>{if(a.has(b)||y.includes(b))return null;if(!c.has(b))return p.set(b,_.key),c.set(b,_.priority+x);let P=c.get(b).priority,I=_.priority+x;return I<P?(p.set(b,_.key),c.set(b,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};a_.exports=Qd});var Qh=ce((Hz,Q1)=>{"use strict";var K1=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable;function oD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sD(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}Q1.exports=sD()?Object.assign:function(r,t){for(var e,o=oD(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)rD.call(e,p)&&(o[p]=e[p]);if(K1){a=K1(e);for(var d=0;d<a.length;d++)iD.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Sm=ce((wm,Mm)=>{(function(r,t){typeof wm=="object"&&typeof Mm!="undefined"?Mm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(wm,function(){"use strict";function r(M,E,N,A,U){(function z($,q,D,G,Q){for(;G>D;){if(G-D>600){var _t=G-D+1,Z=q-D+1,Dt=Math.log(_t),et=.5*Math.exp(2*Dt/3),vt=.5*Math.sqrt(Dt*et*(_t-et)/_t)*(Z-_t/2<0?-1:1),It=Math.max(D,Math.floor(q-Z*et/_t+vt)),Pt=Math.min(G,Math.floor(q+(_t-Z)*et/_t+vt));z($,q,It,Pt,Q)}var Et=$[q],yt=D,Y=G;for(t($,D,q),Q($[G],Et)>0&&t($,D,G);yt<Y;){for(t($,yt,Y),yt++,Y--;Q($[yt],Et)<0;)yt++;for(;Q($[Y],Et)>0;)Y--}Q($[D],Et)===0?t($,D,Y):t($,++Y,G),Y<=q&&(D=Y+1),q<=Y&&(G=Y-1)}})(M,E,N||0,A||M.length-1,U||e)}function t(M,E,N){var A=M[E];M[E]=M[N],M[N]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,N){if(!N)return E.indexOf(M);for(var A=0;A<E.length;A++)if(N(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,N,A,U){U||(U=P(null)),U.minX=1/0,U.minY=1/0,U.maxX=-1/0,U.maxY=-1/0;for(var z=E;z<N;z++){var $=M.children[z];d(U,M.leaf?A($):$)}return U}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function b(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function P(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,N,A,U){for(var z=[E,N];z.length;)if(!((N=z.pop())-(E=z.pop())<=A)){var $=E+Math.ceil((N-E)/A/2)*A;r(M,$,E,N,U),z.push(E,$,$,N)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,N=[];if(!b(M,E))return N;for(var A=this.toBBox,U=[];E;){for(var z=0;z<E.children.length;z++){var $=E.children[z],q=E.leaf?A($):$;b(M,q)&&(E.leaf?N.push($):x(M,q)?this._all($,N):U.push($))}E=U.pop()}return N},o.prototype.collides=function(M){var E=this.data;if(!b(M,E))return!1;for(var N=[];E;){for(var A=0;A<E.children.length;A++){var U=E.children[A],z=E.leaf?this.toBBox(U):U;if(b(M,z)){if(E.leaf||x(M,z))return!0;N.push(U)}}E=N.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var N=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var A=this.data;this.data=N,N=A}this._insert(N,this.data.height-N.height-1,!0)}else this.data=N;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=P([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var N,A,U,z=this.data,$=this.toBBox(M),q=[],D=[];z||q.length;){if(z||(z=q.pop(),A=q[q.length-1],N=D.pop(),U=!0),z.leaf){var G=a(M,z.children,E);if(G!==-1)return z.children.splice(G,1),q.push(z),this._condense(q),this}U||z.leaf||!x(z,$)?A?(N++,z=A.children[N],U=!1):z=null:(q.push(z),D.push(N),N=0,A=z,z=z.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var N=[];M;)M.leaf?E.push.apply(E,M.children):N.push.apply(N,M.children),M=N.pop();return E},o.prototype._build=function(M,E,N,A){var U,z=N-E+1,$=this._maxEntries;if(z<=$)return c(U=P(M.slice(E,N+1)),this.toBBox),U;A||(A=Math.ceil(Math.log(z)/Math.log($)),$=Math.ceil(z/Math.pow($,A-1))),(U=P([])).leaf=!1,U.height=A;var q=Math.ceil(z/$),D=q*Math.ceil(Math.sqrt($));I(M,E,N,D,this.compareMinX);for(var G=E;G<=N;G+=D){var Q=Math.min(G+D-1,N);I(M,G,Q,q,this.compareMinY);for(var _t=G;_t<=Q;_t+=q){var Z=Math.min(_t+q-1,Q);U.children.push(this._build(M,_t,Z,A-1))}}return c(U,this.toBBox),U},o.prototype._chooseSubtree=function(M,E,N,A){for(;A.push(E),!E.leaf&&A.length-1!==N;){for(var U=1/0,z=1/0,$=void 0,q=0;q<E.children.length;q++){var D=E.children[q],G=_(D),Q=(_t=M,Z=D,(Math.max(Z.maxX,_t.maxX)-Math.min(Z.minX,_t.minX))*(Math.max(Z.maxY,_t.maxY)-Math.min(Z.minY,_t.minY))-G);Q<z?(z=Q,U=G<U?G:U,$=D):Q===z&&G<U&&(U=G,$=D)}E=$||E.children[0]}var _t,Z;return E},o.prototype._insert=function(M,E,N){var A=N?M:this.toBBox(M),U=[],z=this._chooseSubtree(A,this.data,E,U);for(z.children.push(M),d(z,A);E>=0&&U[E].children.length>this._maxEntries;)this._split(U,E),E--;this._adjustParentBBoxes(A,U,E)},o.prototype._split=function(M,E){var N=M[E],A=N.children.length,U=this._minEntries;this._chooseSplitAxis(N,U,A);var z=this._chooseSplitIndex(N,U,A),$=P(N.children.splice(z,N.children.length-z));$.height=N.height,$.leaf=N.leaf,c(N,this.toBBox),c($,this.toBBox),E?M[E-1].children.push($):this._splitRoot(N,$)},o.prototype._splitRoot=function(M,E){this.data=P([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,N){for(var A,U,z,$,q,D,G,Q=1/0,_t=1/0,Z=E;Z<=N-E;Z++){var Dt=p(M,0,Z,this.toBBox),et=p(M,Z,N,this.toBBox),vt=(U=Dt,z=et,$=void 0,q=void 0,D=void 0,G=void 0,$=Math.max(U.minX,z.minX),q=Math.max(U.minY,z.minY),D=Math.min(U.maxX,z.maxX),G=Math.min(U.maxY,z.maxY),Math.max(0,D-$)*Math.max(0,G-q)),It=_(Dt)+_(et);vt<Q?(Q=vt,A=Z,_t=It<_t?It:_t):vt===Q&&It<_t&&(_t=It,A=Z)}return A||N-E},o.prototype._chooseSplitAxis=function(M,E,N){var A=M.leaf?this.compareMinX:g,U=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,N,A)<this._allDistMargin(M,E,N,U)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,N,A){M.children.sort(A);for(var U=this.toBBox,z=p(M,0,E,U),$=p(M,N-E,N,U),q=w(z)+w($),D=E;D<N-E;D++){var G=M.children[D];d(z,M.leaf?U(G):G),q+=w(z)}for(var Q=N-E-1;Q>=E;Q--){var _t=M.children[Q];d($,M.leaf?U(_t):_t),q+=w($)}return q},o.prototype._adjustParentBBoxes=function(M,E,N){for(var A=N;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,N=void 0;E>=0;E--)M[E].children.length===0?E>0?(N=M[E-1].children).splice(N.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var j1=ce((bm,Tm)=>{(function(r,t){typeof bm=="object"&&typeof Tm!="undefined"?Tm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(bm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var ex=ce(($z,tx)=>{tx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],b=e[o+_*2+0],P=e[o+_*2+1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var rx=ce((Zz,nx)=>{nx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],b=e[_+o][0],P=e[_+o][1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var sx=ce((Jz,ep)=>{var ix=ex(),ox=rx();ep.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ox(t,e,o,a):ix(t,e,o,a)};ep.exports.nested=ox;ep.exports.flat=ix});var ux=ce((np,ax)=>{(function(r,t){typeof np=="object"&&typeof ax!="undefined"?t(np):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(np,function(r){"use strict";let e=33306690738754706e-32;function o(b,P,I,M,E){let N,A,U,z,$=P[0],q=M[0],D=0,G=0;q>$==q>-$?(N=$,$=P[++D]):(N=q,q=M[++G]);let Q=0;if(D<b&&G<I)for(q>$==q>-$?(U=N-((A=$+N)-$),$=P[++D]):(U=N-((A=q+N)-q),q=M[++G]),N=A,U!==0&&(E[Q++]=U);D<b&&G<I;)q>$==q>-$?(U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D]):(U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G]),N=A,U!==0&&(E[Q++]=U);for(;D<b;)U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D],N=A,U!==0&&(E[Q++]=U);for(;G<I;)U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G],N=A,U!==0&&(E[Q++]=U);return N===0&&Q!==0||(E[Q++]=N),Q}function a(b){return new Float64Array(b)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(b,P,I,M,E,N){let A=(P-N)*(I-E),U=(b-E)*(M-N),z=A-U;if(A===0||U===0||A>0!=U>0)return z;let $=Math.abs(A+U);return Math.abs(z)>=c*$?z:-function(q,D,G,Q,_t,Z,Dt){let et,vt,It,Pt,Et,yt,Y,ht,Mt,zt,At,$t,ue,le,Qt,me,Xt,Ee,ft=q-_t,He=G-_t,te=D-Z,fe=Q-Z;Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=ft*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=te*He)-Y*Mt-ht*Mt-Y*zt))),g[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),g[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,g[2]=$t-(Ee-Et)+(At-Et),g[3]=Ee;let de=function(Vn,$n){let j=$n[0];for(let H=1;H<Vn;H++)j+=$n[H];return j}(4,g),Ue=p*Dt;if(de>=Ue||-de>=Ue||(et=q-(ft+(Et=q-ft))+(Et-_t),It=G-(He+(Et=G-He))+(Et-_t),vt=D-(te+(Et=D-te))+(Et-Z),Pt=Q-(fe+(Et=Q-fe))+(Et-Z),et===0&&vt===0&&It===0&&Pt===0)||(Ue=d*Dt+e*Math.abs(de),(de+=ft*Pt+fe*et-(te*It+He*vt))>=Ue||-de>=Ue))return de;Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=et*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=vt*He)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let be=o(4,g,4,x,y);Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=ft*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=te*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let kt=o(be,y,4,x,_);Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=et*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=vt*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let ye=o(kt,_,4,x,w);return w[ye-1]}(b,P,I,M,E,N,$)},r.orient2dfast=function(b,P,I,M,E,N){return(P-N)*(I-E)-(b-E)*(M-N)},Object.defineProperty(r,"__esModule",{value:!0})})});var dx=ce((Kz,Im)=>{"use strict";var lx=Sm(),ip=j1(),uD=sx(),lD=ux().orient2d;ip.default&&(ip=ip.default);Im.exports=px;Im.exports.default=px;function px(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dD(r),a=new lx(16);a.toBBox=function(N){return{minX:N[0],minY:N[1],maxX:N[0],maxY:N[1]}},a.compareMinX=function(N,A){return N[0]-A[0]},a.compareMinY=function(N,A){return N[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=hx(g,d),c.push(d)}var y=new lx(16);for(p=0;p<c.length;p++)y.insert(Am(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,P=x.next.p,I=Cm(b,P);if(!(I<w)){var M=I/_;g=cD(a,x.prev.p,b,P,x.next.next.p,M,y),g&&Math.min(Cm(g,b),Cm(g,P))<=M&&(c.push(x),c.push(hx(g,x)),a.remove(g),y.remove(x),y.insert(Am(x)),y.insert(Am(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function cD(r,t,e,o,a,c,p){for(var d=new ip([],fD),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Pm(_,e,o):hD(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),b=x.node,P=Pm(b,t,e),I=Pm(b,o,a);if(x.dist<P&&x.dist<I&&fx(e,b,p)&&fx(o,b,p))return b}g=d.pop(),g&&(g=g.node)}return null}function fD(r,t){return r.dist-t.dist}function hD(r,t,e){if(cx(r,e)||cx(t,e))return 0;var o=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=rp(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=rp(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function cx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function fx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(pD(d[g].p,d[g].next.p,r,t))return!1;return!0}function ic(r,t,e){return lD(r[0],r[1],t[0],t[1],e[0],e[1])}function pD(r,t,e,o){return r!==o&&t!==e&&ic(r,t,e)>0!=ic(r,t,o)>0&&ic(e,o,r)>0!=ic(e,o,t)>0}function Am(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dD(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)uD(r[c],d)||g.push(r[c]);return mD(g)}function hx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Cm(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Pm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function rp(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,b=t-c,P=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*b,N=_*x+w*b,A=P*M-I*I,U,z,$,q,D=A,G=A;A===0?(z=0,D=1,q=N,G=M):(z=I*N-M*E,q=P*N-I*E,z<0?(z=0,q=N,G=M):z>D&&(z=D,q=N+I,G=M)),q<0?(q=0,-E<0?z=0:-E>P?z=D:(z=-E,D=P)):q>G&&(q=G,-E+I<0?z=0:-E+I>P?z=D:(z=-E+I,D=P)),U=z===0?0:z/D,$=q===0?0:q/G;var Q=(1-U)*r+U*e,_t=(1-U)*t+U*o,Z=(1-$)*a+$*p,Dt=(1-$)*c+$*d,et=Z-Q,vt=Dt-_t;return et*et+vt*vt}function gD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function mD(r){r.sort(gD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&ic(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&ic(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var xx=ce((Lm,Nm)=>{(function(r,t){typeof Lm=="object"&&typeof Nm!="undefined"?Nm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Lm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),P=Math.max(p,Math.floor(c-_*x/y+b)),I=Math.min(d,Math.floor(c+(y-_)*x/y+b));t(a,c,P,I,g)}var M=a[c],E=p,N=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<N;){for(e(a,E,N),E++,N--;g(a[E],M)<0;)E++;for(;g(a[N],M)>0;)N--}g(a[p],M)===0?e(a,p,N):(N++,e(a,N,d)),N<=c&&(p=N+1),c<=N&&(d=N-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Um=ce((Mk,Fm)=>{"use strict";Fm.exports=lf;Fm.exports.default=lf;var PD=xx();function lf(r,t){if(!(this instanceof lf))return new lf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}lf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!sp(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,sp(r,g)&&(t.leaf?e.push(d):Dm(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!sp(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,sp(r,d)){if(t.leaf||Dm(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ac([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=ID(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Dm(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:Ex,compareMinY:wx,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=ac(r.slice(t,e+1)),sc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=ac([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(Mx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),Mx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return sc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Om(p),y=RD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),uf(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=ac(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,sc(e,this.toBBox),sc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=ac([r,t]),this.data.height=r.height+1,this.data.leaf=!1,sc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=af(r,0,o,this.toBBox),c=af(r,o,e,this.toBBox),p=LD(a,c),d=Om(a)+Om(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:Ex,a=r.leaf?this.compareMinY:wx,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=af(r,0,t,a),p=af(r,e-t,e,a),d=op(c)+op(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],uf(c,r.leaf?a(y):y),d+=op(c);for(g=e-t-1;g>=t;g--)y=r.children[g],uf(p,r.leaf?a(y):y),d+=op(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)uf(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():sc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function ID(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function sc(r,t){af(r,0,r.children.length,t,r)}function af(r,t,e,o,a){a||(a=ac(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],uf(a,r.leaf?o(p):p);return a}function uf(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Ex(r,t){return r.minX-t.minX}function wx(r,t){return r.minY-t.minY}function Om(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function op(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Dm(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function sp(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ac(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,PD(r,p,t,e,a),c.push(t,p,p,e))}});var Px=ce((F5,Vm)=>{"use strict";Vm.exports=cp;Vm.exports.default=cp;function cp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=Tx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,b;if(o&&(c=HD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var P=e;P<a;P+=e)w=r[P],x=r[P+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);b=Math.max(y-d,_-g),b=b!==0?32767/b:0}return hf(c,p,e,d,g,b,0),p}function Tx(r,t,e,o,a){var c,p;if(a===Hm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=bx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=bx(c,r[c],r[c+1],p);return p&&fp(p,p.next)&&(df(p),p=p.next),p}function al(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(fp(e,e.next)||Vr(e.prev,e,e.next)===0)){if(df(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function hf(r,t,e,o,a,c,p){if(r){!p&&c&&YD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?zD(r,o,a,c):BD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),df(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=GD(al(r),t,e),hf(r,t,e,o,a,c,2)):p===2&&kD(r,t,e,o,a,c):hf(al(r),t,e,o,a,c,1);break}}}}function BD(r){var t=r.prev,e=r,o=r.next;if(Vr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,b=d>g?d>y?d:y:g>y?g:y,P=o.next;P!==t;){if(P.x>=_&&P.x<=x&&P.y>=w&&P.y<=b&&cc(a,d,c,g,p,y,P.x,P.y)&&Vr(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function zD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Vr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,b=d<g?d<y?d:y:g<y?g:y,P=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=Gm(b,P,t,e,o),N=Gm(I,M,t,e,o),A=r.prevZ,U=r.nextZ;A&&A.z>=E&&U&&U.z<=N;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;A&&A.z>=E;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;U&&U.z<=N;){if(U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function GD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!fp(a,c)&&Ax(a,o,o.next,c)&&pf(a,c)&&pf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),df(o),df(o.next),o=r=c),o=o.next}while(o!==r);return al(o)}function kD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&JD(p,d)){var g=Cx(p,d);p=al(p,p.next),g=al(g,g.next),hf(p,t,e,o,a,c,0),hf(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function HD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=Tx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(ZD(y));for(a.sort(VD),c=0;c<a.length;c++)e=WD(a[c],e);return e}function VD(r,t){return r.x-t.x}function WD(r,t){var e=qD(r,t);if(!e)return t;var o=Cx(e,r);return al(o,o.next),al(e,e.next)}function qD(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&cc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),pf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&XD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function XD(r,t){return Vr(r.prev,r,t.prev)<0&&Vr(t.next,r,r.next)<0}function YD(r,t,e,o){var a=r;do a.z===0&&(a.z=Gm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$D(a)}function $D(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function Gm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function cc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function JD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KD(r,t)&&(pf(r,t)&&pf(t,r)&&QD(r,t)&&(Vr(r.prev,r,t.prev)||Vr(r,t.prev,t))||fp(r,t)&&Vr(r.prev,r,r.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function fp(r,t){return r.x===t.x&&r.y===t.y}function Ax(r,t,e,o){var a=lp(Vr(r,t,e)),c=lp(Vr(r,t,o)),p=lp(Vr(e,o,r)),d=lp(Vr(e,o,t));return!!(a!==c&&p!==d||a===0&&up(r,e,t)||c===0&&up(r,o,t)||p===0&&up(e,r,o)||d===0&&up(e,t,o))}function up(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function lp(r){return r>0?1:r<0?-1:0}function KD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ax(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function pf(r,t){return Vr(r.prev,r,r.next)<0?Vr(r,t,r.next)>=0&&Vr(r,r.prev,t)>=0:Vr(r,t,r.prev)<0||Vr(r,r.next,t)<0}function QD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Cx(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function bx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function df(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Hm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Hm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,b=o[d+1]*e,P=o[d+2]*e;w+=Math.abs((r[x]-r[P])*(r[b+1]-r[x+1])-(r[x]-r[b])*(r[P+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Hm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}cp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var $m=ce(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function t3(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Wm(t).geometry;case"LineString":return Xm(t).geometry;case"Polygon":return qm(t).geometry;case"MultiPoint":return Rx(t).geometry;case"MultiLineString":return Ix(t).geometry;case"MultiPolygon":return Lx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=t3;function Wm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hp(r[0])||!hp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Wm;function e3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Wm(o,t)}),e)}Ie.points=e3;function qm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=qm;function n3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return qm(o,t)}),e)}Ie.polygons=n3;function Xm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=Xm;function r3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Xm(o,t)}),e)}Ie.lineStrings=r3;function pp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=pp;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Rx;function Lx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Lx;function i3(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=i3;function o3(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=o3;function Nx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Nx;function Ym(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Ym;function s3(r,t){return Ox(Ym(r,t))}Ie.lengthToDegrees=s3;function a3(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=a3;function Ox(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Ox;function u3(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=u3;function l3(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Nx(Ym(r,t),e)}Ie.convertLength=l3;function c3(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=c3;function hp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=hp;function f3(r){return!!r&&r.constructor===Object}Ie.isObject=f3;function h3(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!hp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=h3;function p3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=p3});var Jm=ce(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var oo=$m();function gf(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,b=r.type,P=b==="FeatureCollection",I=b==="Feature",M=P?r.features.length:1,E=0;E<M;E++){y=P?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var N=0;N<d;N++){var A=0,U=0;if(p=x?y.geometries[N]:y,p!==null){g=p.coordinates;var z=p.type;switch(_=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(g,w,E,A,U)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,U)===!1)return!1;w++,z==="MultiPoint"&&A++}z==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,U)===!1)return!1;w++}z==="MultiLineString"&&A++,z==="Polygon"&&U++}z==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(U=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,U)===!1)return!1;w++}U++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(gf(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d3(r,t,e,o){var a=e;return gf(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Dx(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function g3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Fx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function m3(r,t,e){var o=e;return Fx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function y3(r){var t=[];return gf(r,function(e){t.push(e)}),t}function Zm(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,b=r.type==="FeatureCollection",P=r.type==="Feature",I=b?r.features.length:1;for(e=0;e<I;e++){for(d=b?r.features[e].geometry:P?r.geometry:r,y=b?r.features[e].properties:P?r.properties:{},_=b?r.features[e].bbox:P?r.bbox:void 0,w=b?r.features[e].id:P?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function v3(r,t,e){var o=e;return Zm(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function dp(r,t){Zm(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(oo.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(oo.feature(w,a),o,y)===!1)return!1}})}function _3(r,t,e){var o=e;return dp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Ux(r,t){dp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(gf(e,function(w,x,b,P,I){if(d===void 0||o>g||P>y||I>_){d=w,g=o,y=P,_=I,c=0;return}var M=oo.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function x3(r,t,e){var o=e,a=!1;return Ux(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Bx(r,t){if(!r)throw new Error("geojson is required");dp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(oo.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function E3(r,t,e){var o=e;return Bx(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function w3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),oo.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),oo.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),oo.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),oo.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function M3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return oo.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),oo.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),oo.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),oo.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),oo.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),oo.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}_i.coordAll=y3;_i.coordEach=gf;_i.coordReduce=d3;_i.featureEach=Fx;_i.featureReduce=m3;_i.findPoint=M3;_i.findSegment=w3;_i.flattenEach=dp;_i.flattenReduce=_3;_i.geomEach=Zm;_i.geomReduce=v3;_i.lineEach=Bx;_i.lineReduce=E3;_i.propEach=Dx;_i.propReduce=g3;_i.segmentEach=Ux;_i.segmentReduce=x3});var zx=ce(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});var S3=Jm();function Km(r){var t=[1/0,1/0,-1/0,-1/0];return S3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Km.default=Km;Qm.default=Km});var gp=ce((Q5,jm)=>{var da=Sm(),kx=$m(),Hx=Jm(),fc=zx().default,b3=Hx.featureEach,J5=Hx.coordEach,K5=kx.polygon,Gx=kx.featureCollection;function Vx(r){var t=new da(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}):b3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}),da.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.remove.call(this,e,o)},t.clear=function(){return da.prototype.clear.call(this)},t.search=function(e){var o=da.prototype.search.call(this,this.toBBox(e));return Gx(o)},t.collides=function(e){return da.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=da.prototype.all.call(this);return Gx(e)},t.toJSON=function(){return da.prototype.toJSON.call(this)},t.fromJSON=function(e){return da.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=fc(e);else if(e.type==="FeatureCollection")o=fc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}jm.exports=Vx;jm.exports.default=Vx});var o0=ce((a6,jx)=>{"use strict";var Qx=Object.prototype.toString;jx.exports=function(t){var e=Qx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qx.call(t.callee)==="[object Function]"),o}});var uE=ce((u6,aE)=>{"use strict";var sE;Object.keys||(vf=Object.prototype.hasOwnProperty,s0=Object.prototype.toString,tE=o0(),a0=Object.prototype.propertyIsEnumerable,eE=!a0.call({toString:null},"toString"),nE=a0.call(function(){},"prototype"),_f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xp=function(r){var t=r.constructor;return t&&t.prototype===r},rE={$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},iE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!rE["$"+r]&&vf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{xp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),oE=function(r){if(typeof window=="undefined"||!iE)return xp(r);try{return xp(r)}catch(t){return!1}},sE=function(t){var e=t!==null&&typeof t=="object",o=s0.call(t)==="[object Function]",a=tE(t),c=e&&s0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=nE&&o;if(c&&t.length>0&&!vf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&vf.call(t,_)&&p.push(String(_));if(eE)for(var w=oE(t),x=0;x<_f.length;++x)!(w&&_f[x]==="constructor")&&vf.call(t,_f[x])&&p.push(_f[x]);return p});var vf,s0,tE,a0,eE,nE,_f,xp,rE,iE,oE;aE.exports=sE});var u0=ce((l6,fE)=>{"use strict";var D3=Array.prototype.slice,F3=o0(),lE=Object.keys,Ep=lE?function(t){return lE(t)}:uE(),cE=Object.keys;Ep.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return F3(o)?cE(D3.call(o)):cE(o)})}else Object.keys=Ep;return Object.keys||Ep};fE.exports=Ep});var l0=ce((c6,hE)=>{"use strict";hE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var wp=ce((f6,pE)=>{"use strict";var U3=l0();pE.exports=function(){return U3()&&!!Symbol.toStringTag}});var gE=ce((h6,dE)=>{"use strict";dE.exports=Error});var yE=ce((p6,mE)=>{"use strict";mE.exports=EvalError});var _E=ce((d6,vE)=>{"use strict";vE.exports=RangeError});var EE=ce((g6,xE)=>{"use strict";xE.exports=ReferenceError});var c0=ce((m6,wE)=>{"use strict";wE.exports=SyntaxError});var ul=ce((y6,ME)=>{"use strict";ME.exports=TypeError});var bE=ce((v6,SE)=>{"use strict";SE.exports=URIError});var CE=ce((_6,AE)=>{"use strict";var TE=typeof Symbol!="undefined"&&Symbol,B3=l0();AE.exports=function(){return typeof TE!="function"||typeof Symbol!="function"||typeof TE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:B3()}});var IE=ce((x6,PE)=>{"use strict";var f0={__proto__:null,foo:{}},z3=Object;PE.exports=function(){return{__proto__:f0}.foo===f0.foo&&!(f0 instanceof z3)}});var NE=ce((E6,LE)=>{"use strict";var G3="Function.prototype.bind called on incompatible ",k3=Object.prototype.toString,H3=Math.max,V3="[object Function]",RE=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},W3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},q3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};LE.exports=function(t){var e=this;if(typeof e!="function"||k3.apply(e)!==V3)throw new TypeError(G3+e);for(var o=W3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,RE(o,arguments));return Object(_)===_?_:this}return e.apply(t,RE(o,arguments))},p=H3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+q3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var Mp=ce((w6,OE)=>{"use strict";var X3=NE();OE.exports=Function.prototype.bind||X3});var FE=ce((M6,DE)=>{"use strict";var Y3=Function.prototype.call,$3=Object.prototype.hasOwnProperty,Z3=Mp();DE.exports=Z3.call(Y3,$3)});var mc=ce((S6,kE)=>{"use strict";var zn,J3=gE(),K3=yE(),Q3=_E(),j3=EE(),gc=c0(),dc=ul(),tF=bE(),GE=Function,h0=function(r){try{return GE('"use strict"; return ('+r+").constructor;")()}catch(t){}},ll=Object.getOwnPropertyDescriptor;if(ll)try{ll({},"")}catch(r){ll=null}var p0=function(){throw new dc},eF=ll?function(){try{return arguments.callee,p0}catch(r){try{return ll(arguments,"callee").get}catch(t){return p0}}}():p0,hc=CE()(),nF=IE()(),Di=Object.getPrototypeOf||(nF?function(r){return r.__proto__}:null),pc={},rF=typeof Uint8Array=="undefined"||!Di?zn:Di(Uint8Array),cl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?zn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?zn:ArrayBuffer,"%ArrayIteratorPrototype%":hc&&Di?Di([][Symbol.iterator]()):zn,"%AsyncFromSyncIteratorPrototype%":zn,"%AsyncFunction%":pc,"%AsyncGenerator%":pc,"%AsyncGeneratorFunction%":pc,"%AsyncIteratorPrototype%":pc,"%Atomics%":typeof Atomics=="undefined"?zn:Atomics,"%BigInt%":typeof BigInt=="undefined"?zn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?zn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?zn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?zn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J3,"%eval%":eval,"%EvalError%":K3,"%Float32Array%":typeof Float32Array=="undefined"?zn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?zn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?zn:FinalizationRegistry,"%Function%":GE,"%GeneratorFunction%":pc,"%Int8Array%":typeof Int8Array=="undefined"?zn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?zn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?zn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hc&&Di?Di(Di([][Symbol.iterator]())):zn,"%JSON%":typeof JSON=="object"?JSON:zn,"%Map%":typeof Map=="undefined"?zn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!hc||!Di?zn:Di(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?zn:Promise,"%Proxy%":typeof Proxy=="undefined"?zn:Proxy,"%RangeError%":Q3,"%ReferenceError%":j3,"%Reflect%":typeof Reflect=="undefined"?zn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?zn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!hc||!Di?zn:Di(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?zn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hc&&Di?Di(""[Symbol.iterator]()):zn,"%Symbol%":hc?Symbol:zn,"%SyntaxError%":gc,"%ThrowTypeError%":eF,"%TypedArray%":rF,"%TypeError%":dc,"%Uint8Array%":typeof Uint8Array=="undefined"?zn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?zn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?zn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?zn:Uint32Array,"%URIError%":tF,"%WeakMap%":typeof WeakMap=="undefined"?zn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?zn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?zn:WeakSet};if(Di)try{null.error}catch(r){UE=Di(Di(r)),cl["%Error.prototype%"]=UE}var UE,iF=function r(t){var e;if(t==="%AsyncFunction%")e=h0("async function () {}");else if(t==="%GeneratorFunction%")e=h0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=h0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Di&&(e=Di(a.prototype))}return cl[t]=e,e},BE={__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"]},xf=Mp(),Sp=FE(),oF=xf.call(Function.call,Array.prototype.concat),sF=xf.call(Function.apply,Array.prototype.splice),zE=xf.call(Function.call,String.prototype.replace),bp=xf.call(Function.call,String.prototype.slice),aF=xf.call(Function.call,RegExp.prototype.exec),uF=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lF=/\\\\(\\\\)?/g,cF=function(t){var e=bp(t,0,1),o=bp(t,-1);if(e==="%"&&o!=="%")throw new gc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new gc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return zE(t,uF,function(c,p,d,g){a[a.length]=d?zE(g,lF,"$1"):p||c}),a},fF=function(t,e){var o=t,a;if(Sp(BE,o)&&(a=BE[o],o="%"+a[0]+"%"),Sp(cl,o)){var c=cl[o];if(c===pc&&(c=iF(o)),typeof c=="undefined"&&!e)throw new dc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new gc("intrinsic "+t+" does not exist!")};kE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new dc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new dc('"allowMissing" argument must be a boolean');if(aF(/^%?[^%]*%?$/,t)===null)throw new gc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cF(t),a=o.length>0?o[0]:"",c=fF("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],sF(o,oF([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=bp(x,0,1),P=bp(x,-1);if((b==='"'||b==="'"||b==="\`"||P==='"'||P==="'"||P==="\`")&&b!==P)throw new gc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Sp(cl,p))d=cl[p];else if(d!=null){if(!(x in d)){if(!e)throw new dc("base intrinsic for "+t+" exists, but the property is not available.");return}if(ll&&_+1>=o.length){var I=ll(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Sp(d,x),d=d[x];w&&!g&&(cl[p]=d)}}return d}});var Ap=ce((b6,HE)=>{"use strict";var hF=mc(),Tp=hF("%Object.defineProperty%",!0)||!1;if(Tp)try{Tp({},"a",{value:1})}catch(r){Tp=!1}HE.exports=Tp});var d0=ce((T6,VE)=>{"use strict";var pF=mc(),Cp=pF("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}VE.exports=Cp});var Pp=ce((A6,XE)=>{"use strict";var WE=Ap(),dF=c0(),yc=ul(),qE=d0();XE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new yc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new yc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new yc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new yc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new yc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new yc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!qE&&qE(t,e);if(WE)WE(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new dF("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ip=ce((C6,$E)=>{"use strict";var g0=Ap(),YE=function(){return!!g0};YE.hasArrayLengthDefineBug=function(){if(!g0)return null;try{return g0([],"length",{value:1}).length!==1}catch(t){return!0}};$E.exports=YE});var jE=ce((P6,QE)=>{"use strict";var gF=mc(),ZE=Pp(),mF=Ip()(),JE=d0(),KE=ul(),yF=gF("%Math.floor%");QE.exports=function(t,e){if(typeof t!="function")throw new KE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yF(e)!==e)throw new KE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&JE){var p=JE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(mF?ZE(t,"length",e,!0,!0):ZE(t,"length",e)),t}});var Np=ce((I6,Rp)=>{"use strict";var m0=Mp(),Lp=mc(),vF=jE(),_F=ul(),nw=Lp("%Function.prototype.apply%"),rw=Lp("%Function.prototype.call%"),iw=Lp("%Reflect.apply%",!0)||m0.call(rw,nw),tw=Ap(),xF=Lp("%Math.max%");Rp.exports=function(t){if(typeof t!="function")throw new _F("a function is required");var e=iw(m0,rw,arguments);return vF(e,1+xF(0,t.length-(arguments.length-1)),!0)};var ew=function(){return iw(m0,nw,arguments)};tw?tw(Rp.exports,"apply",{value:ew}):Rp.exports.apply=ew});var y0=ce((R6,aw)=>{"use strict";var ow=mc(),sw=Np(),EF=sw(ow("String.prototype.indexOf"));aw.exports=function(t,e){var o=ow(t,!!e);return typeof o=="function"&&EF(t,".prototype.")>-1?sw(o):o}});var cw=ce((L6,lw)=>{"use strict";var wF=wp()(),MF=y0(),v0=MF("Object.prototype.toString"),Op=function(t){return wF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:v0(t)==="[object Arguments]"},uw=function(t){return Op(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&v0(t)!=="[object Array]"&&v0(t.callee)==="[object Function]"},SF=function(){return Op(arguments)}();Op.isLegacyArguments=uw;lw.exports=SF?Op:uw});var vc=ce((N6,dw)=>{"use strict";var bF=u0(),TF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AF=Object.prototype.toString,CF=Array.prototype.concat,fw=Pp(),PF=function(r){return typeof r=="function"&&AF.call(r)==="[object Function]"},hw=Ip()(),IF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PF(o)||!o())return}hw?fw(r,t,e,!0):fw(r,t,e)},pw=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bF(t);TF&&(o=CF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IF(r,o[a],t[o[a]],e[o[a]])};pw.supportsDescriptors=!!hw;dw.exports=pw});var _0=ce((O6,mw)=>{"use strict";var gw=function(r){return r!==r};mw.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||gw(t)&&gw(e))}});var x0=ce((D6,yw)=>{"use strict";var RF=_0();yw.exports=function(){return typeof Object.is=="function"?Object.is:RF}});var _w=ce((F6,vw)=>{"use strict";var LF=x0(),NF=vc();vw.exports=function(){var t=LF();return NF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Mw=ce((U6,ww)=>{"use strict";var OF=vc(),DF=Np(),FF=_0(),xw=x0(),UF=_w(),Ew=DF(xw(),Object);OF(Ew,{getPolyfill:xw,implementation:FF,shim:UF});ww.exports=Ew});var Cw=ce((B6,Aw)=>{"use strict";var E0=y0(),Sw=wp()(),bw,Tw,w0,M0;Sw&&(bw=E0("Object.prototype.hasOwnProperty"),Tw=E0("RegExp.prototype.exec"),w0={},Dp=function(){throw w0},M0={toString:Dp,valueOf:Dp},typeof Symbol.toPrimitive=="symbol"&&(M0[Symbol.toPrimitive]=Dp));var Dp,BF=E0("Object.prototype.toString"),zF=Object.getOwnPropertyDescriptor,GF="[object RegExp]";Aw.exports=Sw?function(t){if(!t||typeof t!="object")return!1;var e=zF(t,"lastIndex"),o=e&&bw(e,"value");if(!o)return!1;try{Tw(t,M0)}catch(a){return a===w0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BF(t)===GF}});var Iw=ce((z6,Pw)=>{"use strict";var wf=function(){return typeof function(){}.name=="string"},Ef=Object.getOwnPropertyDescriptor;if(Ef)try{Ef([],"length")}catch(r){Ef=null}wf.functionsHaveConfigurableNames=function(){if(!wf()||!Ef)return!1;var t=Ef(function(){},"name");return!!t&&!!t.configurable};var kF=Function.prototype.bind;wf.boundFunctionsHaveNames=function(){return wf()&&typeof kF=="function"&&function(){}.bind().name!==""};Pw.exports=wf});var Nw=ce((G6,Lw)=>{"use strict";var Rw=Pp(),HF=Ip()(),VF=Iw().functionsHaveConfigurableNames(),WF=ul();Lw.exports=function(t,e){if(typeof t!="function")throw new WF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||VF)&&(HF?Rw(t,"name",e,!0,!0):Rw(t,"name",e)),t}});var S0=ce((k6,Ow)=>{"use strict";var qF=Nw(),XF=ul(),YF=Object;Ow.exports=qF(function(){if(this==null||this!==YF(this))throw new XF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var b0=ce((H6,Dw)=>{"use strict";var $F=S0(),ZF=vc().supportsDescriptors,JF=Object.getOwnPropertyDescriptor;Dw.exports=function(){if(ZF&&/a/mig.flags==="gim"){var t=JF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $F}});var Bw=ce((V6,Uw)=>{"use strict";var KF=vc().supportsDescriptors,QF=b0(),jF=Object.getOwnPropertyDescriptor,tU=Object.defineProperty,eU=TypeError,Fw=Object.getPrototypeOf,nU=/a/;Uw.exports=function(){if(!KF||!Fw)throw new eU("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=QF(),e=Fw(nU),o=jF(e,"flags");return(!o||o.get!==t)&&tU(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Hw=ce((W6,kw)=>{"use strict";var rU=vc(),iU=Np(),oU=S0(),zw=b0(),sU=Bw(),Gw=iU(zw());rU(Gw,{getPolyfill:zw,implementation:oU,shim:sU});kw.exports=Gw});var Ww=ce((q6,Vw)=>{"use strict";var aU=Date.prototype.getDay,uU=function(t){try{return aU.call(t),!0}catch(e){return!1}},lU=Object.prototype.toString,cU="[object Date]",fU=wp()();Vw.exports=function(t){return typeof t!="object"||t===null?!1:fU?uU(t):lU.call(t)===cU}});var T0=ce((X6,eM)=>{var qw=u0(),Xw=cw(),Yw=Mw(),$w=Cw(),Zw=Hw(),Jw=Ww(),Kw=Date.prototype.getTime;function tM(r,t,e){var o=e||{};return(o.strict?Yw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Yw(r,t):r==t:hU(r,t,o)}function Qw(r){return r==null}function jw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function hU(r,t,e){var o,a;if(typeof r!=typeof t||Qw(r)||Qw(t)||r.prototype!==t.prototype||Xw(r)!==Xw(t))return!1;var c=$w(r),p=$w(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Zw(r)===Zw(t);if(Jw(r)&&Jw(t))return Kw.call(r)===Kw.call(t);var d=jw(r),g=jw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=qw(r),_=qw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!tM(r[a],t[a],e))return!1;return!0}eM.exports=tM});var B0=ce((QW,uM)=>{var nB=T0(),ga=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rB};ga.prototype.compare=function(r,t){if(r.type!==t.type||!aM(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=sM(r),a=sM(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function sM(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function aM(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}ga.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};ga.prototype.compareLine=function(r,t,e,o){if(!aM(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};ga.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};ga.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};ga.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};ga.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};ga.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};ga.prototype.removePseudo=function(r){return r};function rB(r,t){return nB(r,t,{strict:!0})}uM.exports=ga});var lM=ce((cq,Bp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=Pu)});var cM=ce((fq,zp)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof zp!="undefined"&&zp.exports&&(zp.exports=Iu)});var z0=ce((hq,Gp)=>{function ma(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}ma.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};ma.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};ma.prototype.forEach=function(r){this._queue.forEach(r)};ma.prototype.getElements=function(){return this._queue};ma.prototype.getElementPriority=function(r){return this._priorities[r]};ma.prototype.getPriorities=function(){return this._priorities};ma.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};ma.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};ma.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Gp!="undefined"&&Gp.exports&&(Gp.exports=ma)});var hM=ce((pq,xc)=>{typeof xc!="undefined"&&xc.exports&&(fM=z0());var fM;function Ja(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Ja.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new fM(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Ja.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Ja.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ja.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Ja.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Ja.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Ja.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Ja.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof xc!="undefined"&&xc.exports&&(xc.exports=Ja)});var pM=ce((dq,kp)=>{typeof kp!="undefined"&&kp.exports&&(kp.exports={DBSCAN:lM(),KMEANS:cM(),OPTICS:hM(),PriorityQueue:z0()})});var G0=ce((xq,gM)=>{"use strict";gM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var vM=ce((Eq,yM)=>{"use strict";var mM=G0(),lB=mM.eudist,cB=mM.dist;yM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lB:cB,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,b=[],P=0;P<c;P++){for(var I=1/0,M=0;M<w;M++){var E=o(t[P],a[M]);E<=I&&(I=E)}_[P]=I}for(var N=0;N<c;N++)x+=_[N];for(var A=0;A<c;A++)b[A]={i:A,v:t[A],pr:_[A]/x,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var U=1;U<c;U++)b[U].cs=b[U-1].cs+b[U].pr;for(var z=Math.random(),$=0;$<c-1&&b[$++].cs<z;);a.push(b[$-1].v)}return a}}});var MM=ce((Sq,wM)=>{"use strict";var k0=G0(),EM=vM(),fB=k0.eudist,wq=k0.mandist,Mq=k0.dist,hB=EM.kmrand,pB=EM.kmpp,_M=1e4;function xM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dB(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||_M,_=r.length,w=r[0].length,x=w>0,b=[];if(e)e=="kmrand"?a=hB(r,t):e=="kmpp"?a=pB(r,t):a=e;else for(var P={};a.length<t;){var I=Math.floor(Math.random()*_);P[I]||(P[I]=!0,a.push(r[I]))}do{xM(t,0,b);for(var M=0;M<_;M++){for(var E=1/0,N=0,A=0;A<t;A++){var d=x?fB(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,N=A)}p[M]=N,b[N]++}for(var U=[],c=[],z=0,$=0;$<t;$++)U[$]=x?xM(w,0,U[$]):0,c[$]=a[$];if(x){for(var q=0;q<t;q++)a[q]=[];for(var D=0;D<_;D++)for(var G=p[D],Q=U[G],_t=r[D],Z=0;Z<w;Z++)Q[Z]+=_t[Z];g=!0;for(var Dt=0;Dt<t;Dt++){for(var et=a[Dt],vt=U[Dt],It=c[Dt],Pt=b[Dt],Et=0;Et<w;Et++)et[Et]=vt[Et]/Pt||0;if(g){for(var yt=0;yt<w;yt++)if(It[yt]!=et[yt]){g=!1;break}}}}else{for(var Y=0;Y<_;Y++){var ht=p[Y];U[ht]+=r[Y]}for(var Mt=0;Mt<t;Mt++)a[Mt]=U[Mt]/b[Mt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:_M-y,k:t,idxs:p,centroids:a}}wM.exports=dB});var bc=ce((Y0,$0)=>{(function(r,t){typeof Y0=="object"&&typeof $0!="undefined"?$0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Y0,function(){"use strict";function r(tt,C){var L={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},F,J,X,pt;return pt={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(pt[Symbol.iterator]=function(){return this}),pt;function st(ut){return function(nt){return k([ut,nt])}}function k(ut){if(F)throw new TypeError("Generator is already executing.");for(;L;)try{if(F=1,J&&(X=ut[0]&2?J.return:ut[0]?J.throw||((X=J.return)&&X.call(J),0):J.next)&&!(X=X.call(J,ut[1])).done)return X;switch(J=0,X&&(ut=[ut[0]&2,X.value]),ut[0]){case 0:case 1:X=ut;break;case 4:return L.label++,{value:ut[1],done:!1};case 5:L.label++,J=ut[1],ut=[0];continue;case 7:ut=L.ops.pop(),L.trys.pop();continue;default:if(X=L.trys,!(X=X.length>0&&X[X.length-1])&&(ut[0]===6||ut[0]===2)){L=0;continue}if(ut[0]===3&&(!X||ut[1]>X[0]&&ut[1]<X[3])){L.label=ut[1];break}if(ut[0]===6&&L.label<X[1]){L.label=X[1],X=ut;break}if(X&&L.label<X[2]){L.label=X[2],L.ops.push(ut);break}X[2]&&L.ops.pop(),L.trys.pop();continue}ut=C.call(tt,L)}catch(nt){ut=[6,nt],J=0}finally{F=X=0}if(ut[0]&5)throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}}var t=function(){function tt(C,L){this.next=null,this.key=C,this.data=L,this.left=null,this.right=null}return tt}();function e(tt,C){return tt>C?1:tt<C?-1:0}function o(tt,C,L){for(var F=new t(null,null),J=F,X=F;;){var pt=L(tt,C.key);if(pt<0){if(C.left===null)break;if(L(tt,C.left.key)<0){var st=C.left;if(C.left=st.right,st.right=C,C=st,C.left===null)break}X.left=C,X=C,C=C.left}else if(pt>0){if(C.right===null)break;if(L(tt,C.right.key)>0){var st=C.right;if(C.right=st.left,st.left=C,C=st,C.right===null)break}J.right=C,J=C,C=C.right}else break}return J.right=C.left,X.left=C.right,C.left=F.right,C.right=F.left,C}function a(tt,C,L,F){var J=new t(tt,C);if(L===null)return J.left=J.right=null,J;L=o(tt,L,F);var X=F(tt,L.key);return X<0?(J.left=L.left,J.right=L,L.left=null):X>=0&&(J.right=L.right,J.left=L,L.right=null),J}function c(tt,C,L){var F=null,J=null;if(C){C=o(tt,C,L);var X=L(C.key,tt);X===0?(F=C.left,J=C.right):X<0?(J=C.right,C.right=null,F=C):(F=C.left,C.left=null,J=C)}return{left:F,right:J}}function p(tt,C,L){return C===null?tt:(tt===null||(C=o(tt.key,C,L),C.left=tt),C)}function d(tt,C,L,F,J){if(tt){F(""+C+(L?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(tt)+\`
105
+ `);var ye=class extends _.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(e)}};ye.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Xr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var qr={texture_url:Xr,lineWidth:8,color:16777215},ze=class extends N.Object3D{constructor(t,n){super();this.navigation=t;this.config=Object.assign({},qr,n),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom,this.setDepthTest(this.getDepthTestByControl())}mesh=null;geometry=null;material=null;texture=null;config=qr;points=[];basicRepeat=1;prevCameraZoom=0;depthTest=!0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat()),this.setDepthTest(this.getDepthTestByControl())};getDepthTestByControl(){let t=this.navigation.bmap.context.control.getPolarAngle();return!(t>=0&&t<=.15)}setDepthTest(t){this.depthTest=t,this.material&&(this.material.depthTest=t)}onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:n}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,n)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:n,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>y(new N.Vector3(l,u,0),n,r,i)).map(({x:l,y:u})=>[l,u]);return lt(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((n,r)=>{new N.TextureLoader().load(t,n,void 0,r)})}transformPoints(t){let n=[];for(let r=0;r<t.length;r++)n.push(...t[r],0);return n}updatePoints(t){this.points=t,this.changeRepeat();let n=this.transformPoints(t);this.geometry&&this.geometry.setPoints(n)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let n=this.geometry=new tt;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=N.RepeatWrapping}let r=this.material=new ye({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),i=this.mesh=new N.Mesh(n,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Yt=require("@tweenjs/tween.js"),wt=require("three");var jr=require("three");var Yr=require("@tweenjs/tween.js"),$r=require("lodash"),qi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},ke=class extends jr.EventDispatcher{constructor(t,n){super();this.navigation=t;this.options=Object.assign({},qi,n),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new D;resetTimer=null;tweenUtil=new Dt;simulationTween;throttleUpdatePosition;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t)};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,n){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let f=Pt(r,i);u=u.slice(f+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)],{distance:h,closestPoint:p,index:d,i:m}=c.reduce((f,g,E)=>{if(g.floor!==t)return f;let{distance:x,closestPoint:z,index:b}=g.points.reduce((T,k,$,Tt)=>{if(!Tt[$+1])return{...T,distance:T.distance===1/0?A(k,n):T.distance};let{distance:Kt,closestPoint:Ke}=hn(n,k,Tt[$+1]);return Kt<T.distance?{distance:Kt,closestPoint:Ke,index:$}:T},{distance:1/0,closestPoint:g.points[0],index:0});return x<f.distance?{distance:x,closestPoint:z,index:E,i:b}:f},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:p,routeIndex:d+l,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,n){let r=this.adsorb(t,n);if(console.log("adsorbData",r),!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){this.tweenUtil.pause(),this.throttleUpdatePosition?.cancel()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let n=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.throttleUpdatePosition=(0,$r.throttle)(c=>{let h=ee(i,c.distance);h&&(n.push({floor:t.floor,pos:h}),this.toPosition(t.floor,h))},100),u=this.simulationTween=new Yr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(l).onComplete(()=>{this.tweenUtil.remove(u),l.flush(),l.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{r(this.startCurRouteSimulation())},3e3)):(r(!0),console.log(n,this.routeIndex,this.paths))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:n,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(n+1)];return lt(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:n,position:r}=this,i=n[t],o=n[t+1],a=n[t+2];if(!i||!o)return{dir:"end",distance:0};let l=A(r,o);return t===0&&A(i,r)<5?{dir:"start",distance:l}:a?{dir:we(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:n}=this.getRemainDistance();console.log(t,n,this.paths);let r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),n<=10&&(i="end"),{distance:t,curRouteDistance:n,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var Kr=require("three"),ve=class extends Kr.EventDispatcher{_task=[];started=!1;activeTask=null;_id=0;constructor(e=!0){super(),e&&this.start()}_isEffectiveTask(e){return e&&typeof e.run=="function"}_getIndexByTid(e){return this._task.findIndex(t=>t.tid===e)}_createTask(e){return this._isEffectiveTask(e)?{...e,tid:++this._id,meta:e.meta||{}}:!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(e){if(this._isEffectiveTask(e)){let t=this._createTask(e);return this._task.push(t),this.started&&!this.activeTask&&this.start(),t.tid}return!1}replace(e,t){if(!this._isEffectiveTask(t))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(e);if(n===-1)return console.warn(`[TaskQueue] \u6CA1\u6709\u627E\u5230id=${e}\u7684\u4EFB\u52A1`),!1;let r=this._createTask(t);return this._task.splice(n,1,r),r.tid}remove(e){let t=this._getIndexByTid(e);return t===-1?(console.warn(`[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A${e}\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task`),!1):(this._task.splice(t,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}async exec(){if(!this.started||!this._task.length)return!1;let e=this._task.shift();this.activeTask=e,this.dispatchEvent({type:"active-task-start",task:e});try{await e.run()}catch(t){console.warn("[task run err]",t,e)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:e}),this.exec()}};var ji={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},An=class extends st{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new Dt;taskQueue=new ve;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;constructor(e,t={},n){super(e),!n&&typeof t=="object"&&(n=t),this.options=Object.assign({},ji,n);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new ke(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:e})=>{if(this.dispatchEvent({type:"navigation-info",info:e}),!e.offset){if(e.routeIndex!==this.curPathIndex)return;this.toPositionByTask(e.pos)}};toPositionByTask(e){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="toPosition")?.tid,r={run:()=>this.toPositionBySpeed(e,this.options.speed),meta:{type:"toPosition"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(e){e===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=e,this.currentPathPosition=e.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(e){this.curPathIndex=e,this.paths[e]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[e]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:e}})=>{if(this.clearTween(),this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(e,t=0){this.paths=e,this.curPathIndex=t,this.clearTween();let n=this.bmap.context.currentFloor?.name,r=e[t];if(n&&r?.floor===n)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:e})}translatePoints(e){let[t,n]=this.bmap.buildingCenter;return e.map(r=>[r[0]-t,r[1]-n])}renderPath(e){this.translatePath=e;let t=this.catmullRomCurve3(e);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new ze(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new q(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(e){return cn(e,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let e=Pt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[e],n=this.curFloorPathPoints[e+1],r=new wt.Vector3(n[0]-t[0],n[1]-t[1],0).normalize(),i=new wt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new wt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(e=100){let t=this.getPathDirection();if(t===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-t)>Math.PI&&(n>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=e/Math.PI*6*r;return Z(new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Yt.Tween(l,this.tweenUtil.group).to(u,o).easing(Yt.Easing.Quadratic.InOut).onUpdate(async()=>{this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})}async initNavigationCamera(e=1e3){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="initNavigationCamera")?.tid,r={run:()=>Z((async()=>{await this.initCameraZoom(e/2),await this.changeCameraToPathUp(e/4),await this.translateCameraToStartPoi(e/4)})(),e+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}async translateCameraToStartPoi(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(n/2),l=i.target.clone(),u=y(this.startPoi.position,r,t,n),c=u.x-o,h=a-u.y+this.options.offsetY;if(console.log("start",l.clone()),!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}return console.log("start1",l.clone()),Z(new Promise(p=>{let d=i.target.clone();console.log(d,l,e);let m=new Yt.Tween(d,this.tweenUtil.group).to(l,e).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(d,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(l,0),this.tweenUtil.remove(m),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),e+500).then(()=>{this.bmap.context.control.enabled=!0})}}async initCameraZoom(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/40;return this.bmap.context.setZoom(l,this.startPoi.position,e).finally(()=>{this.bmap.context.control.enabled=!0})}toPosition(e,t){this.positionNavigation.toPosition(e,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(e){this.positionNavigation.changeSimulationSpeed(e)}async toPositionBySpeed(e,t){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,a=fn(i,e);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,1);return this.pathTween&&this.clearTween(),Z(new Promise(c=>{let h=this.pathTween=new Yt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async p=>{this.moveDistance(p.distance+o,h)}).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),u*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})}async moveDistance(e,t){this.movedDistance=e,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let n=ee(this.curFloorPathPoints,this.movedDistance);if(n===null)return;this.currentPathPosition=n;let r=this.translatePoints([n])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),await this.changeCameraToPathUp(500/this.options.speed),t?.resume())}setStartPoiRotate(e){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-e-n)%360}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Zr=require("three"),In=class extends st{poiLayer;floors=[];group=new Zr.Group;constructor(e){super(e),this.poiLayer=new Ut(e.context)}show(e){let t=e[0].userData.height;e.forEach(i=>{i.poiLayer2.pois.forEach(o=>{o.position.setZ(o.position.z+t),o.options.depth_test=!0,this.poiLayer.pushPoi(o)}),i.poiLayer2.pois.length=0,i.poiLayer2.dispose(),i.position.z=t,t+=i.userData.height});let{scene:n,currentFloor:r}=this.bmap.context;r&&(n.remove(r),r.dispose()),this.group.add(this.poiLayer,...e),n.add(this.group),this.floors=e,this.fitCamera(),this.bmap.context.cameraBound.updateBox()}hide(){let{scene:e}=this.bmap.context;e.remove(this.group),this.poiLayer.clear(),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:e,config:t,type:n}=this.bmap;e.cameraBound.setEnable(!1),e.control.minZoom=0,e.control.maxZoom=1/0,e.camera.zoom=1,e.setAzimuthalAngle(t.control.defaultAzimuthal,0),e.setPolarAngle(t.control.defaultPolar,0),e.fitCameraToObject(this.group,void 0,0);let r=e.camera.zoom;e.control.minZoom=r,e.control.maxZoom=r*25,n==="3d"&&e.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=e.camera.zoom,e.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),e.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(e=>e.dispose()),this.floors=[]}};var Jr=require("three");function xe(s){let e=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function Rn(){return xe(`var XP=Object.create;var Jd=Object.defineProperty,YP=Object.defineProperties,$P=Object.getOwnPropertyDescriptor,ZP=Object.getOwnPropertyDescriptors,JP=Object.getOwnPropertyNames,qv=Object.getOwnPropertySymbols,KP=Object.getPrototypeOf,Xv=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable;var Zd=(r,t,e)=>t in r?Jd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qc=(r,t)=>{for(var e in t||(t={}))Xv.call(t,e)&&Zd(r,e,t[e]);if(qv)for(var e of qv(t))QP.call(t,e)&&Zd(r,e,t[e]);return r},Yv=(r,t)=>YP(r,ZP(t));var ce=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var jP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of JP(t))!Xv.call(r,a)&&a!==e&&Jd(r,a,{get:()=>t[a],enumerable:!(o=$P(t,a))||o.enumerable});return r};var Nr=(r,t,e)=>(e=r!=null?XP(KP(r)):{},jP(t||!r||!r.__esModule?Jd(e,"default",{value:r,enumerable:!0}):e,r));var Ii=(r,t,e)=>Zd(r,typeof t!="symbol"?t+"":t,e);var Zv=ce((Pz,$v)=>{var Kd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};$v.exports=Kd});var Qv=ce((Iz,Kv)=>{function Jv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Jv(a,t)):o!==t&&e.set(o,a);return e}Kv.exports=Jv});var e_=ce((Rz,t_)=>{function tI(r){let t=Number(r);return!(isNaN(t)||t<=0)}function jv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,jv(a));if(!tI(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}t_.exports=jv});var i_=ce((Lz,r_)=>{function n_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){n_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}r_.exports=n_});var u_=ce((Nz,a_)=>{var eI=Zv(),nI=Qv(),o_=e_(),s_=i_(),Qd=class{constructor(t){t instanceof Map?(s_(t),this.graph=t):t?this.graph=o_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(s_(e),o=e):o=o_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nI(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new eI,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,b)=>{if(a.has(b)||y.includes(b))return null;if(!c.has(b))return p.set(b,_.key),c.set(b,_.priority+x);let P=c.get(b).priority,I=_.priority+x;return I<P?(p.set(b,_.key),c.set(b,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};a_.exports=Qd});var Qh=ce((Hz,Q1)=>{"use strict";var K1=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable;function oD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sD(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}Q1.exports=sD()?Object.assign:function(r,t){for(var e,o=oD(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)rD.call(e,p)&&(o[p]=e[p]);if(K1){a=K1(e);for(var d=0;d<a.length;d++)iD.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Sm=ce((wm,Mm)=>{(function(r,t){typeof wm=="object"&&typeof Mm!="undefined"?Mm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(wm,function(){"use strict";function r(M,E,N,A,U){(function z($,q,D,G,Q){for(;G>D;){if(G-D>600){var _t=G-D+1,Z=q-D+1,Dt=Math.log(_t),et=.5*Math.exp(2*Dt/3),vt=.5*Math.sqrt(Dt*et*(_t-et)/_t)*(Z-_t/2<0?-1:1),It=Math.max(D,Math.floor(q-Z*et/_t+vt)),Pt=Math.min(G,Math.floor(q+(_t-Z)*et/_t+vt));z($,q,It,Pt,Q)}var Et=$[q],yt=D,Y=G;for(t($,D,q),Q($[G],Et)>0&&t($,D,G);yt<Y;){for(t($,yt,Y),yt++,Y--;Q($[yt],Et)<0;)yt++;for(;Q($[Y],Et)>0;)Y--}Q($[D],Et)===0?t($,D,Y):t($,++Y,G),Y<=q&&(D=Y+1),q<=Y&&(G=Y-1)}})(M,E,N||0,A||M.length-1,U||e)}function t(M,E,N){var A=M[E];M[E]=M[N],M[N]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,N){if(!N)return E.indexOf(M);for(var A=0;A<E.length;A++)if(N(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,N,A,U){U||(U=P(null)),U.minX=1/0,U.minY=1/0,U.maxX=-1/0,U.maxY=-1/0;for(var z=E;z<N;z++){var $=M.children[z];d(U,M.leaf?A($):$)}return U}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function b(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function P(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,N,A,U){for(var z=[E,N];z.length;)if(!((N=z.pop())-(E=z.pop())<=A)){var $=E+Math.ceil((N-E)/A/2)*A;r(M,$,E,N,U),z.push(E,$,$,N)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,N=[];if(!b(M,E))return N;for(var A=this.toBBox,U=[];E;){for(var z=0;z<E.children.length;z++){var $=E.children[z],q=E.leaf?A($):$;b(M,q)&&(E.leaf?N.push($):x(M,q)?this._all($,N):U.push($))}E=U.pop()}return N},o.prototype.collides=function(M){var E=this.data;if(!b(M,E))return!1;for(var N=[];E;){for(var A=0;A<E.children.length;A++){var U=E.children[A],z=E.leaf?this.toBBox(U):U;if(b(M,z)){if(E.leaf||x(M,z))return!0;N.push(U)}}E=N.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var N=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var A=this.data;this.data=N,N=A}this._insert(N,this.data.height-N.height-1,!0)}else this.data=N;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=P([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var N,A,U,z=this.data,$=this.toBBox(M),q=[],D=[];z||q.length;){if(z||(z=q.pop(),A=q[q.length-1],N=D.pop(),U=!0),z.leaf){var G=a(M,z.children,E);if(G!==-1)return z.children.splice(G,1),q.push(z),this._condense(q),this}U||z.leaf||!x(z,$)?A?(N++,z=A.children[N],U=!1):z=null:(q.push(z),D.push(N),N=0,A=z,z=z.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var N=[];M;)M.leaf?E.push.apply(E,M.children):N.push.apply(N,M.children),M=N.pop();return E},o.prototype._build=function(M,E,N,A){var U,z=N-E+1,$=this._maxEntries;if(z<=$)return c(U=P(M.slice(E,N+1)),this.toBBox),U;A||(A=Math.ceil(Math.log(z)/Math.log($)),$=Math.ceil(z/Math.pow($,A-1))),(U=P([])).leaf=!1,U.height=A;var q=Math.ceil(z/$),D=q*Math.ceil(Math.sqrt($));I(M,E,N,D,this.compareMinX);for(var G=E;G<=N;G+=D){var Q=Math.min(G+D-1,N);I(M,G,Q,q,this.compareMinY);for(var _t=G;_t<=Q;_t+=q){var Z=Math.min(_t+q-1,Q);U.children.push(this._build(M,_t,Z,A-1))}}return c(U,this.toBBox),U},o.prototype._chooseSubtree=function(M,E,N,A){for(;A.push(E),!E.leaf&&A.length-1!==N;){for(var U=1/0,z=1/0,$=void 0,q=0;q<E.children.length;q++){var D=E.children[q],G=_(D),Q=(_t=M,Z=D,(Math.max(Z.maxX,_t.maxX)-Math.min(Z.minX,_t.minX))*(Math.max(Z.maxY,_t.maxY)-Math.min(Z.minY,_t.minY))-G);Q<z?(z=Q,U=G<U?G:U,$=D):Q===z&&G<U&&(U=G,$=D)}E=$||E.children[0]}var _t,Z;return E},o.prototype._insert=function(M,E,N){var A=N?M:this.toBBox(M),U=[],z=this._chooseSubtree(A,this.data,E,U);for(z.children.push(M),d(z,A);E>=0&&U[E].children.length>this._maxEntries;)this._split(U,E),E--;this._adjustParentBBoxes(A,U,E)},o.prototype._split=function(M,E){var N=M[E],A=N.children.length,U=this._minEntries;this._chooseSplitAxis(N,U,A);var z=this._chooseSplitIndex(N,U,A),$=P(N.children.splice(z,N.children.length-z));$.height=N.height,$.leaf=N.leaf,c(N,this.toBBox),c($,this.toBBox),E?M[E-1].children.push($):this._splitRoot(N,$)},o.prototype._splitRoot=function(M,E){this.data=P([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,N){for(var A,U,z,$,q,D,G,Q=1/0,_t=1/0,Z=E;Z<=N-E;Z++){var Dt=p(M,0,Z,this.toBBox),et=p(M,Z,N,this.toBBox),vt=(U=Dt,z=et,$=void 0,q=void 0,D=void 0,G=void 0,$=Math.max(U.minX,z.minX),q=Math.max(U.minY,z.minY),D=Math.min(U.maxX,z.maxX),G=Math.min(U.maxY,z.maxY),Math.max(0,D-$)*Math.max(0,G-q)),It=_(Dt)+_(et);vt<Q?(Q=vt,A=Z,_t=It<_t?It:_t):vt===Q&&It<_t&&(_t=It,A=Z)}return A||N-E},o.prototype._chooseSplitAxis=function(M,E,N){var A=M.leaf?this.compareMinX:g,U=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,N,A)<this._allDistMargin(M,E,N,U)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,N,A){M.children.sort(A);for(var U=this.toBBox,z=p(M,0,E,U),$=p(M,N-E,N,U),q=w(z)+w($),D=E;D<N-E;D++){var G=M.children[D];d(z,M.leaf?U(G):G),q+=w(z)}for(var Q=N-E-1;Q>=E;Q--){var _t=M.children[Q];d($,M.leaf?U(_t):_t),q+=w($)}return q},o.prototype._adjustParentBBoxes=function(M,E,N){for(var A=N;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,N=void 0;E>=0;E--)M[E].children.length===0?E>0?(N=M[E-1].children).splice(N.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var j1=ce((bm,Tm)=>{(function(r,t){typeof bm=="object"&&typeof Tm!="undefined"?Tm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(bm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var ex=ce(($z,tx)=>{tx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],b=e[o+_*2+0],P=e[o+_*2+1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var rx=ce((Zz,nx)=>{nx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],b=e[_+o][0],P=e[_+o][1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var sx=ce((Jz,ep)=>{var ix=ex(),ox=rx();ep.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ox(t,e,o,a):ix(t,e,o,a)};ep.exports.nested=ox;ep.exports.flat=ix});var ux=ce((np,ax)=>{(function(r,t){typeof np=="object"&&typeof ax!="undefined"?t(np):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(np,function(r){"use strict";let e=33306690738754706e-32;function o(b,P,I,M,E){let N,A,U,z,$=P[0],q=M[0],D=0,G=0;q>$==q>-$?(N=$,$=P[++D]):(N=q,q=M[++G]);let Q=0;if(D<b&&G<I)for(q>$==q>-$?(U=N-((A=$+N)-$),$=P[++D]):(U=N-((A=q+N)-q),q=M[++G]),N=A,U!==0&&(E[Q++]=U);D<b&&G<I;)q>$==q>-$?(U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D]):(U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G]),N=A,U!==0&&(E[Q++]=U);for(;D<b;)U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D],N=A,U!==0&&(E[Q++]=U);for(;G<I;)U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G],N=A,U!==0&&(E[Q++]=U);return N===0&&Q!==0||(E[Q++]=N),Q}function a(b){return new Float64Array(b)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(b,P,I,M,E,N){let A=(P-N)*(I-E),U=(b-E)*(M-N),z=A-U;if(A===0||U===0||A>0!=U>0)return z;let $=Math.abs(A+U);return Math.abs(z)>=c*$?z:-function(q,D,G,Q,_t,Z,Dt){let et,vt,It,Pt,Et,yt,Y,ht,Mt,zt,At,$t,ue,le,Qt,me,Xt,Ee,ft=q-_t,He=G-_t,te=D-Z,fe=Q-Z;Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=ft*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=te*He)-Y*Mt-ht*Mt-Y*zt))),g[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),g[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,g[2]=$t-(Ee-Et)+(At-Et),g[3]=Ee;let de=function(Vn,$n){let j=$n[0];for(let H=1;H<Vn;H++)j+=$n[H];return j}(4,g),Ue=p*Dt;if(de>=Ue||-de>=Ue||(et=q-(ft+(Et=q-ft))+(Et-_t),It=G-(He+(Et=G-He))+(Et-_t),vt=D-(te+(Et=D-te))+(Et-Z),Pt=Q-(fe+(Et=Q-fe))+(Et-Z),et===0&&vt===0&&It===0&&Pt===0)||(Ue=d*Dt+e*Math.abs(de),(de+=ft*Pt+fe*et-(te*It+He*vt))>=Ue||-de>=Ue))return de;Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=et*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=vt*He)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let be=o(4,g,4,x,y);Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=ft*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=te*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let kt=o(be,y,4,x,_);Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=et*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=vt*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let ye=o(kt,_,4,x,w);return w[ye-1]}(b,P,I,M,E,N,$)},r.orient2dfast=function(b,P,I,M,E,N){return(P-N)*(I-E)-(b-E)*(M-N)},Object.defineProperty(r,"__esModule",{value:!0})})});var dx=ce((Kz,Im)=>{"use strict";var lx=Sm(),ip=j1(),uD=sx(),lD=ux().orient2d;ip.default&&(ip=ip.default);Im.exports=px;Im.exports.default=px;function px(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dD(r),a=new lx(16);a.toBBox=function(N){return{minX:N[0],minY:N[1],maxX:N[0],maxY:N[1]}},a.compareMinX=function(N,A){return N[0]-A[0]},a.compareMinY=function(N,A){return N[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=hx(g,d),c.push(d)}var y=new lx(16);for(p=0;p<c.length;p++)y.insert(Am(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,P=x.next.p,I=Cm(b,P);if(!(I<w)){var M=I/_;g=cD(a,x.prev.p,b,P,x.next.next.p,M,y),g&&Math.min(Cm(g,b),Cm(g,P))<=M&&(c.push(x),c.push(hx(g,x)),a.remove(g),y.remove(x),y.insert(Am(x)),y.insert(Am(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function cD(r,t,e,o,a,c,p){for(var d=new ip([],fD),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Pm(_,e,o):hD(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),b=x.node,P=Pm(b,t,e),I=Pm(b,o,a);if(x.dist<P&&x.dist<I&&fx(e,b,p)&&fx(o,b,p))return b}g=d.pop(),g&&(g=g.node)}return null}function fD(r,t){return r.dist-t.dist}function hD(r,t,e){if(cx(r,e)||cx(t,e))return 0;var o=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=rp(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=rp(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function cx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function fx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(pD(d[g].p,d[g].next.p,r,t))return!1;return!0}function ic(r,t,e){return lD(r[0],r[1],t[0],t[1],e[0],e[1])}function pD(r,t,e,o){return r!==o&&t!==e&&ic(r,t,e)>0!=ic(r,t,o)>0&&ic(e,o,r)>0!=ic(e,o,t)>0}function Am(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dD(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)uD(r[c],d)||g.push(r[c]);return mD(g)}function hx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Cm(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Pm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function rp(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,b=t-c,P=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*b,N=_*x+w*b,A=P*M-I*I,U,z,$,q,D=A,G=A;A===0?(z=0,D=1,q=N,G=M):(z=I*N-M*E,q=P*N-I*E,z<0?(z=0,q=N,G=M):z>D&&(z=D,q=N+I,G=M)),q<0?(q=0,-E<0?z=0:-E>P?z=D:(z=-E,D=P)):q>G&&(q=G,-E+I<0?z=0:-E+I>P?z=D:(z=-E+I,D=P)),U=z===0?0:z/D,$=q===0?0:q/G;var Q=(1-U)*r+U*e,_t=(1-U)*t+U*o,Z=(1-$)*a+$*p,Dt=(1-$)*c+$*d,et=Z-Q,vt=Dt-_t;return et*et+vt*vt}function gD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function mD(r){r.sort(gD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&ic(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&ic(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var xx=ce((Lm,Nm)=>{(function(r,t){typeof Lm=="object"&&typeof Nm!="undefined"?Nm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Lm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),P=Math.max(p,Math.floor(c-_*x/y+b)),I=Math.min(d,Math.floor(c+(y-_)*x/y+b));t(a,c,P,I,g)}var M=a[c],E=p,N=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<N;){for(e(a,E,N),E++,N--;g(a[E],M)<0;)E++;for(;g(a[N],M)>0;)N--}g(a[p],M)===0?e(a,p,N):(N++,e(a,N,d)),N<=c&&(p=N+1),c<=N&&(d=N-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Um=ce((Mk,Fm)=>{"use strict";Fm.exports=lf;Fm.exports.default=lf;var PD=xx();function lf(r,t){if(!(this instanceof lf))return new lf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}lf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!sp(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,sp(r,g)&&(t.leaf?e.push(d):Dm(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!sp(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,sp(r,d)){if(t.leaf||Dm(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ac([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=ID(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Dm(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:Ex,compareMinY:wx,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=ac(r.slice(t,e+1)),sc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=ac([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(Mx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),Mx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return sc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Om(p),y=RD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),uf(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=ac(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,sc(e,this.toBBox),sc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=ac([r,t]),this.data.height=r.height+1,this.data.leaf=!1,sc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=af(r,0,o,this.toBBox),c=af(r,o,e,this.toBBox),p=LD(a,c),d=Om(a)+Om(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:Ex,a=r.leaf?this.compareMinY:wx,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=af(r,0,t,a),p=af(r,e-t,e,a),d=op(c)+op(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],uf(c,r.leaf?a(y):y),d+=op(c);for(g=e-t-1;g>=t;g--)y=r.children[g],uf(p,r.leaf?a(y):y),d+=op(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)uf(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():sc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function ID(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function sc(r,t){af(r,0,r.children.length,t,r)}function af(r,t,e,o,a){a||(a=ac(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],uf(a,r.leaf?o(p):p);return a}function uf(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Ex(r,t){return r.minX-t.minX}function wx(r,t){return r.minY-t.minY}function Om(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function op(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Dm(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function sp(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ac(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,PD(r,p,t,e,a),c.push(t,p,p,e))}});var Px=ce((F5,Vm)=>{"use strict";Vm.exports=cp;Vm.exports.default=cp;function cp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=Tx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,b;if(o&&(c=HD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var P=e;P<a;P+=e)w=r[P],x=r[P+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);b=Math.max(y-d,_-g),b=b!==0?32767/b:0}return hf(c,p,e,d,g,b,0),p}function Tx(r,t,e,o,a){var c,p;if(a===Hm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=bx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=bx(c,r[c],r[c+1],p);return p&&fp(p,p.next)&&(df(p),p=p.next),p}function al(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(fp(e,e.next)||Vr(e.prev,e,e.next)===0)){if(df(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function hf(r,t,e,o,a,c,p){if(r){!p&&c&&YD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?zD(r,o,a,c):BD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),df(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=GD(al(r),t,e),hf(r,t,e,o,a,c,2)):p===2&&kD(r,t,e,o,a,c):hf(al(r),t,e,o,a,c,1);break}}}}function BD(r){var t=r.prev,e=r,o=r.next;if(Vr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,b=d>g?d>y?d:y:g>y?g:y,P=o.next;P!==t;){if(P.x>=_&&P.x<=x&&P.y>=w&&P.y<=b&&cc(a,d,c,g,p,y,P.x,P.y)&&Vr(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function zD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Vr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,b=d<g?d<y?d:y:g<y?g:y,P=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=Gm(b,P,t,e,o),N=Gm(I,M,t,e,o),A=r.prevZ,U=r.nextZ;A&&A.z>=E&&U&&U.z<=N;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;A&&A.z>=E;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;U&&U.z<=N;){if(U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function GD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!fp(a,c)&&Ax(a,o,o.next,c)&&pf(a,c)&&pf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),df(o),df(o.next),o=r=c),o=o.next}while(o!==r);return al(o)}function kD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&JD(p,d)){var g=Cx(p,d);p=al(p,p.next),g=al(g,g.next),hf(p,t,e,o,a,c,0),hf(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function HD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=Tx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(ZD(y));for(a.sort(VD),c=0;c<a.length;c++)e=WD(a[c],e);return e}function VD(r,t){return r.x-t.x}function WD(r,t){var e=qD(r,t);if(!e)return t;var o=Cx(e,r);return al(o,o.next),al(e,e.next)}function qD(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&cc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),pf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&XD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function XD(r,t){return Vr(r.prev,r,t.prev)<0&&Vr(t.next,r,r.next)<0}function YD(r,t,e,o){var a=r;do a.z===0&&(a.z=Gm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$D(a)}function $D(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function Gm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function cc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function JD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KD(r,t)&&(pf(r,t)&&pf(t,r)&&QD(r,t)&&(Vr(r.prev,r,t.prev)||Vr(r,t.prev,t))||fp(r,t)&&Vr(r.prev,r,r.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function fp(r,t){return r.x===t.x&&r.y===t.y}function Ax(r,t,e,o){var a=lp(Vr(r,t,e)),c=lp(Vr(r,t,o)),p=lp(Vr(e,o,r)),d=lp(Vr(e,o,t));return!!(a!==c&&p!==d||a===0&&up(r,e,t)||c===0&&up(r,o,t)||p===0&&up(e,r,o)||d===0&&up(e,t,o))}function up(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function lp(r){return r>0?1:r<0?-1:0}function KD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ax(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function pf(r,t){return Vr(r.prev,r,r.next)<0?Vr(r,t,r.next)>=0&&Vr(r,r.prev,t)>=0:Vr(r,t,r.prev)<0||Vr(r,r.next,t)<0}function QD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Cx(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function bx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function df(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Hm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Hm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,b=o[d+1]*e,P=o[d+2]*e;w+=Math.abs((r[x]-r[P])*(r[b+1]-r[x+1])-(r[x]-r[b])*(r[P+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Hm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}cp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var $m=ce(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function t3(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Wm(t).geometry;case"LineString":return Xm(t).geometry;case"Polygon":return qm(t).geometry;case"MultiPoint":return Rx(t).geometry;case"MultiLineString":return Ix(t).geometry;case"MultiPolygon":return Lx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=t3;function Wm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hp(r[0])||!hp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Wm;function e3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Wm(o,t)}),e)}Ie.points=e3;function qm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=qm;function n3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return qm(o,t)}),e)}Ie.polygons=n3;function Xm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=Xm;function r3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Xm(o,t)}),e)}Ie.lineStrings=r3;function pp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=pp;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Rx;function Lx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Lx;function i3(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=i3;function o3(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=o3;function Nx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Nx;function Ym(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Ym;function s3(r,t){return Ox(Ym(r,t))}Ie.lengthToDegrees=s3;function a3(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=a3;function Ox(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Ox;function u3(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=u3;function l3(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Nx(Ym(r,t),e)}Ie.convertLength=l3;function c3(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=c3;function hp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=hp;function f3(r){return!!r&&r.constructor===Object}Ie.isObject=f3;function h3(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!hp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=h3;function p3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=p3});var Jm=ce(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var oo=$m();function gf(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,b=r.type,P=b==="FeatureCollection",I=b==="Feature",M=P?r.features.length:1,E=0;E<M;E++){y=P?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var N=0;N<d;N++){var A=0,U=0;if(p=x?y.geometries[N]:y,p!==null){g=p.coordinates;var z=p.type;switch(_=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(g,w,E,A,U)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,U)===!1)return!1;w++,z==="MultiPoint"&&A++}z==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,U)===!1)return!1;w++}z==="MultiLineString"&&A++,z==="Polygon"&&U++}z==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(U=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,U)===!1)return!1;w++}U++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(gf(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d3(r,t,e,o){var a=e;return gf(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Dx(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function g3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Fx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function m3(r,t,e){var o=e;return Fx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function y3(r){var t=[];return gf(r,function(e){t.push(e)}),t}function Zm(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,b=r.type==="FeatureCollection",P=r.type==="Feature",I=b?r.features.length:1;for(e=0;e<I;e++){for(d=b?r.features[e].geometry:P?r.geometry:r,y=b?r.features[e].properties:P?r.properties:{},_=b?r.features[e].bbox:P?r.bbox:void 0,w=b?r.features[e].id:P?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function v3(r,t,e){var o=e;return Zm(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function dp(r,t){Zm(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(oo.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(oo.feature(w,a),o,y)===!1)return!1}})}function _3(r,t,e){var o=e;return dp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Ux(r,t){dp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(gf(e,function(w,x,b,P,I){if(d===void 0||o>g||P>y||I>_){d=w,g=o,y=P,_=I,c=0;return}var M=oo.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function x3(r,t,e){var o=e,a=!1;return Ux(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Bx(r,t){if(!r)throw new Error("geojson is required");dp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(oo.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function E3(r,t,e){var o=e;return Bx(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function w3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),oo.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),oo.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),oo.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),oo.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function M3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return oo.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),oo.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),oo.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),oo.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),oo.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),oo.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}_i.coordAll=y3;_i.coordEach=gf;_i.coordReduce=d3;_i.featureEach=Fx;_i.featureReduce=m3;_i.findPoint=M3;_i.findSegment=w3;_i.flattenEach=dp;_i.flattenReduce=_3;_i.geomEach=Zm;_i.geomReduce=v3;_i.lineEach=Bx;_i.lineReduce=E3;_i.propEach=Dx;_i.propReduce=g3;_i.segmentEach=Ux;_i.segmentReduce=x3});var zx=ce(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});var S3=Jm();function Km(r){var t=[1/0,1/0,-1/0,-1/0];return S3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Km.default=Km;Qm.default=Km});var gp=ce((Q5,jm)=>{var da=Sm(),kx=$m(),Hx=Jm(),fc=zx().default,b3=Hx.featureEach,J5=Hx.coordEach,K5=kx.polygon,Gx=kx.featureCollection;function Vx(r){var t=new da(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}):b3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}),da.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.remove.call(this,e,o)},t.clear=function(){return da.prototype.clear.call(this)},t.search=function(e){var o=da.prototype.search.call(this,this.toBBox(e));return Gx(o)},t.collides=function(e){return da.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=da.prototype.all.call(this);return Gx(e)},t.toJSON=function(){return da.prototype.toJSON.call(this)},t.fromJSON=function(e){return da.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=fc(e);else if(e.type==="FeatureCollection")o=fc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}jm.exports=Vx;jm.exports.default=Vx});var o0=ce((a6,jx)=>{"use strict";var Qx=Object.prototype.toString;jx.exports=function(t){var e=Qx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qx.call(t.callee)==="[object Function]"),o}});var uE=ce((u6,aE)=>{"use strict";var sE;Object.keys||(vf=Object.prototype.hasOwnProperty,s0=Object.prototype.toString,tE=o0(),a0=Object.prototype.propertyIsEnumerable,eE=!a0.call({toString:null},"toString"),nE=a0.call(function(){},"prototype"),_f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xp=function(r){var t=r.constructor;return t&&t.prototype===r},rE={$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},iE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!rE["$"+r]&&vf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{xp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),oE=function(r){if(typeof window=="undefined"||!iE)return xp(r);try{return xp(r)}catch(t){return!1}},sE=function(t){var e=t!==null&&typeof t=="object",o=s0.call(t)==="[object Function]",a=tE(t),c=e&&s0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=nE&&o;if(c&&t.length>0&&!vf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&vf.call(t,_)&&p.push(String(_));if(eE)for(var w=oE(t),x=0;x<_f.length;++x)!(w&&_f[x]==="constructor")&&vf.call(t,_f[x])&&p.push(_f[x]);return p});var vf,s0,tE,a0,eE,nE,_f,xp,rE,iE,oE;aE.exports=sE});var u0=ce((l6,fE)=>{"use strict";var D3=Array.prototype.slice,F3=o0(),lE=Object.keys,Ep=lE?function(t){return lE(t)}:uE(),cE=Object.keys;Ep.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return F3(o)?cE(D3.call(o)):cE(o)})}else Object.keys=Ep;return Object.keys||Ep};fE.exports=Ep});var l0=ce((c6,hE)=>{"use strict";hE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var wp=ce((f6,pE)=>{"use strict";var U3=l0();pE.exports=function(){return U3()&&!!Symbol.toStringTag}});var gE=ce((h6,dE)=>{"use strict";dE.exports=Error});var yE=ce((p6,mE)=>{"use strict";mE.exports=EvalError});var _E=ce((d6,vE)=>{"use strict";vE.exports=RangeError});var EE=ce((g6,xE)=>{"use strict";xE.exports=ReferenceError});var c0=ce((m6,wE)=>{"use strict";wE.exports=SyntaxError});var ul=ce((y6,ME)=>{"use strict";ME.exports=TypeError});var bE=ce((v6,SE)=>{"use strict";SE.exports=URIError});var CE=ce((_6,AE)=>{"use strict";var TE=typeof Symbol!="undefined"&&Symbol,B3=l0();AE.exports=function(){return typeof TE!="function"||typeof Symbol!="function"||typeof TE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:B3()}});var IE=ce((x6,PE)=>{"use strict";var f0={__proto__:null,foo:{}},z3=Object;PE.exports=function(){return{__proto__:f0}.foo===f0.foo&&!(f0 instanceof z3)}});var NE=ce((E6,LE)=>{"use strict";var G3="Function.prototype.bind called on incompatible ",k3=Object.prototype.toString,H3=Math.max,V3="[object Function]",RE=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},W3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},q3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};LE.exports=function(t){var e=this;if(typeof e!="function"||k3.apply(e)!==V3)throw new TypeError(G3+e);for(var o=W3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,RE(o,arguments));return Object(_)===_?_:this}return e.apply(t,RE(o,arguments))},p=H3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+q3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var Mp=ce((w6,OE)=>{"use strict";var X3=NE();OE.exports=Function.prototype.bind||X3});var FE=ce((M6,DE)=>{"use strict";var Y3=Function.prototype.call,$3=Object.prototype.hasOwnProperty,Z3=Mp();DE.exports=Z3.call(Y3,$3)});var mc=ce((S6,kE)=>{"use strict";var zn,J3=gE(),K3=yE(),Q3=_E(),j3=EE(),gc=c0(),dc=ul(),tF=bE(),GE=Function,h0=function(r){try{return GE('"use strict"; return ('+r+").constructor;")()}catch(t){}},ll=Object.getOwnPropertyDescriptor;if(ll)try{ll({},"")}catch(r){ll=null}var p0=function(){throw new dc},eF=ll?function(){try{return arguments.callee,p0}catch(r){try{return ll(arguments,"callee").get}catch(t){return p0}}}():p0,hc=CE()(),nF=IE()(),Di=Object.getPrototypeOf||(nF?function(r){return r.__proto__}:null),pc={},rF=typeof Uint8Array=="undefined"||!Di?zn:Di(Uint8Array),cl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?zn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?zn:ArrayBuffer,"%ArrayIteratorPrototype%":hc&&Di?Di([][Symbol.iterator]()):zn,"%AsyncFromSyncIteratorPrototype%":zn,"%AsyncFunction%":pc,"%AsyncGenerator%":pc,"%AsyncGeneratorFunction%":pc,"%AsyncIteratorPrototype%":pc,"%Atomics%":typeof Atomics=="undefined"?zn:Atomics,"%BigInt%":typeof BigInt=="undefined"?zn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?zn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?zn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?zn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J3,"%eval%":eval,"%EvalError%":K3,"%Float32Array%":typeof Float32Array=="undefined"?zn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?zn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?zn:FinalizationRegistry,"%Function%":GE,"%GeneratorFunction%":pc,"%Int8Array%":typeof Int8Array=="undefined"?zn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?zn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?zn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hc&&Di?Di(Di([][Symbol.iterator]())):zn,"%JSON%":typeof JSON=="object"?JSON:zn,"%Map%":typeof Map=="undefined"?zn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!hc||!Di?zn:Di(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?zn:Promise,"%Proxy%":typeof Proxy=="undefined"?zn:Proxy,"%RangeError%":Q3,"%ReferenceError%":j3,"%Reflect%":typeof Reflect=="undefined"?zn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?zn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!hc||!Di?zn:Di(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?zn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hc&&Di?Di(""[Symbol.iterator]()):zn,"%Symbol%":hc?Symbol:zn,"%SyntaxError%":gc,"%ThrowTypeError%":eF,"%TypedArray%":rF,"%TypeError%":dc,"%Uint8Array%":typeof Uint8Array=="undefined"?zn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?zn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?zn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?zn:Uint32Array,"%URIError%":tF,"%WeakMap%":typeof WeakMap=="undefined"?zn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?zn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?zn:WeakSet};if(Di)try{null.error}catch(r){UE=Di(Di(r)),cl["%Error.prototype%"]=UE}var UE,iF=function r(t){var e;if(t==="%AsyncFunction%")e=h0("async function () {}");else if(t==="%GeneratorFunction%")e=h0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=h0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Di&&(e=Di(a.prototype))}return cl[t]=e,e},BE={__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"]},xf=Mp(),Sp=FE(),oF=xf.call(Function.call,Array.prototype.concat),sF=xf.call(Function.apply,Array.prototype.splice),zE=xf.call(Function.call,String.prototype.replace),bp=xf.call(Function.call,String.prototype.slice),aF=xf.call(Function.call,RegExp.prototype.exec),uF=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lF=/\\\\(\\\\)?/g,cF=function(t){var e=bp(t,0,1),o=bp(t,-1);if(e==="%"&&o!=="%")throw new gc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new gc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return zE(t,uF,function(c,p,d,g){a[a.length]=d?zE(g,lF,"$1"):p||c}),a},fF=function(t,e){var o=t,a;if(Sp(BE,o)&&(a=BE[o],o="%"+a[0]+"%"),Sp(cl,o)){var c=cl[o];if(c===pc&&(c=iF(o)),typeof c=="undefined"&&!e)throw new dc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new gc("intrinsic "+t+" does not exist!")};kE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new dc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new dc('"allowMissing" argument must be a boolean');if(aF(/^%?[^%]*%?$/,t)===null)throw new gc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cF(t),a=o.length>0?o[0]:"",c=fF("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],sF(o,oF([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=bp(x,0,1),P=bp(x,-1);if((b==='"'||b==="'"||b==="\`"||P==='"'||P==="'"||P==="\`")&&b!==P)throw new gc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Sp(cl,p))d=cl[p];else if(d!=null){if(!(x in d)){if(!e)throw new dc("base intrinsic for "+t+" exists, but the property is not available.");return}if(ll&&_+1>=o.length){var I=ll(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Sp(d,x),d=d[x];w&&!g&&(cl[p]=d)}}return d}});var Ap=ce((b6,HE)=>{"use strict";var hF=mc(),Tp=hF("%Object.defineProperty%",!0)||!1;if(Tp)try{Tp({},"a",{value:1})}catch(r){Tp=!1}HE.exports=Tp});var d0=ce((T6,VE)=>{"use strict";var pF=mc(),Cp=pF("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}VE.exports=Cp});var Pp=ce((A6,XE)=>{"use strict";var WE=Ap(),dF=c0(),yc=ul(),qE=d0();XE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new yc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new yc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new yc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new yc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new yc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new yc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!qE&&qE(t,e);if(WE)WE(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new dF("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ip=ce((C6,$E)=>{"use strict";var g0=Ap(),YE=function(){return!!g0};YE.hasArrayLengthDefineBug=function(){if(!g0)return null;try{return g0([],"length",{value:1}).length!==1}catch(t){return!0}};$E.exports=YE});var jE=ce((P6,QE)=>{"use strict";var gF=mc(),ZE=Pp(),mF=Ip()(),JE=d0(),KE=ul(),yF=gF("%Math.floor%");QE.exports=function(t,e){if(typeof t!="function")throw new KE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yF(e)!==e)throw new KE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&JE){var p=JE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(mF?ZE(t,"length",e,!0,!0):ZE(t,"length",e)),t}});var Np=ce((I6,Rp)=>{"use strict";var m0=Mp(),Lp=mc(),vF=jE(),_F=ul(),nw=Lp("%Function.prototype.apply%"),rw=Lp("%Function.prototype.call%"),iw=Lp("%Reflect.apply%",!0)||m0.call(rw,nw),tw=Ap(),xF=Lp("%Math.max%");Rp.exports=function(t){if(typeof t!="function")throw new _F("a function is required");var e=iw(m0,rw,arguments);return vF(e,1+xF(0,t.length-(arguments.length-1)),!0)};var ew=function(){return iw(m0,nw,arguments)};tw?tw(Rp.exports,"apply",{value:ew}):Rp.exports.apply=ew});var y0=ce((R6,aw)=>{"use strict";var ow=mc(),sw=Np(),EF=sw(ow("String.prototype.indexOf"));aw.exports=function(t,e){var o=ow(t,!!e);return typeof o=="function"&&EF(t,".prototype.")>-1?sw(o):o}});var cw=ce((L6,lw)=>{"use strict";var wF=wp()(),MF=y0(),v0=MF("Object.prototype.toString"),Op=function(t){return wF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:v0(t)==="[object Arguments]"},uw=function(t){return Op(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&v0(t)!=="[object Array]"&&v0(t.callee)==="[object Function]"},SF=function(){return Op(arguments)}();Op.isLegacyArguments=uw;lw.exports=SF?Op:uw});var vc=ce((N6,dw)=>{"use strict";var bF=u0(),TF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AF=Object.prototype.toString,CF=Array.prototype.concat,fw=Pp(),PF=function(r){return typeof r=="function"&&AF.call(r)==="[object Function]"},hw=Ip()(),IF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PF(o)||!o())return}hw?fw(r,t,e,!0):fw(r,t,e)},pw=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bF(t);TF&&(o=CF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IF(r,o[a],t[o[a]],e[o[a]])};pw.supportsDescriptors=!!hw;dw.exports=pw});var _0=ce((O6,mw)=>{"use strict";var gw=function(r){return r!==r};mw.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||gw(t)&&gw(e))}});var x0=ce((D6,yw)=>{"use strict";var RF=_0();yw.exports=function(){return typeof Object.is=="function"?Object.is:RF}});var _w=ce((F6,vw)=>{"use strict";var LF=x0(),NF=vc();vw.exports=function(){var t=LF();return NF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Mw=ce((U6,ww)=>{"use strict";var OF=vc(),DF=Np(),FF=_0(),xw=x0(),UF=_w(),Ew=DF(xw(),Object);OF(Ew,{getPolyfill:xw,implementation:FF,shim:UF});ww.exports=Ew});var Cw=ce((B6,Aw)=>{"use strict";var E0=y0(),Sw=wp()(),bw,Tw,w0,M0;Sw&&(bw=E0("Object.prototype.hasOwnProperty"),Tw=E0("RegExp.prototype.exec"),w0={},Dp=function(){throw w0},M0={toString:Dp,valueOf:Dp},typeof Symbol.toPrimitive=="symbol"&&(M0[Symbol.toPrimitive]=Dp));var Dp,BF=E0("Object.prototype.toString"),zF=Object.getOwnPropertyDescriptor,GF="[object RegExp]";Aw.exports=Sw?function(t){if(!t||typeof t!="object")return!1;var e=zF(t,"lastIndex"),o=e&&bw(e,"value");if(!o)return!1;try{Tw(t,M0)}catch(a){return a===w0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BF(t)===GF}});var Iw=ce((z6,Pw)=>{"use strict";var wf=function(){return typeof function(){}.name=="string"},Ef=Object.getOwnPropertyDescriptor;if(Ef)try{Ef([],"length")}catch(r){Ef=null}wf.functionsHaveConfigurableNames=function(){if(!wf()||!Ef)return!1;var t=Ef(function(){},"name");return!!t&&!!t.configurable};var kF=Function.prototype.bind;wf.boundFunctionsHaveNames=function(){return wf()&&typeof kF=="function"&&function(){}.bind().name!==""};Pw.exports=wf});var Nw=ce((G6,Lw)=>{"use strict";var Rw=Pp(),HF=Ip()(),VF=Iw().functionsHaveConfigurableNames(),WF=ul();Lw.exports=function(t,e){if(typeof t!="function")throw new WF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||VF)&&(HF?Rw(t,"name",e,!0,!0):Rw(t,"name",e)),t}});var S0=ce((k6,Ow)=>{"use strict";var qF=Nw(),XF=ul(),YF=Object;Ow.exports=qF(function(){if(this==null||this!==YF(this))throw new XF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var b0=ce((H6,Dw)=>{"use strict";var $F=S0(),ZF=vc().supportsDescriptors,JF=Object.getOwnPropertyDescriptor;Dw.exports=function(){if(ZF&&/a/mig.flags==="gim"){var t=JF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $F}});var Bw=ce((V6,Uw)=>{"use strict";var KF=vc().supportsDescriptors,QF=b0(),jF=Object.getOwnPropertyDescriptor,tU=Object.defineProperty,eU=TypeError,Fw=Object.getPrototypeOf,nU=/a/;Uw.exports=function(){if(!KF||!Fw)throw new eU("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=QF(),e=Fw(nU),o=jF(e,"flags");return(!o||o.get!==t)&&tU(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Hw=ce((W6,kw)=>{"use strict";var rU=vc(),iU=Np(),oU=S0(),zw=b0(),sU=Bw(),Gw=iU(zw());rU(Gw,{getPolyfill:zw,implementation:oU,shim:sU});kw.exports=Gw});var Ww=ce((q6,Vw)=>{"use strict";var aU=Date.prototype.getDay,uU=function(t){try{return aU.call(t),!0}catch(e){return!1}},lU=Object.prototype.toString,cU="[object Date]",fU=wp()();Vw.exports=function(t){return typeof t!="object"||t===null?!1:fU?uU(t):lU.call(t)===cU}});var T0=ce((X6,eM)=>{var qw=u0(),Xw=cw(),Yw=Mw(),$w=Cw(),Zw=Hw(),Jw=Ww(),Kw=Date.prototype.getTime;function tM(r,t,e){var o=e||{};return(o.strict?Yw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Yw(r,t):r==t:hU(r,t,o)}function Qw(r){return r==null}function jw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function hU(r,t,e){var o,a;if(typeof r!=typeof t||Qw(r)||Qw(t)||r.prototype!==t.prototype||Xw(r)!==Xw(t))return!1;var c=$w(r),p=$w(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Zw(r)===Zw(t);if(Jw(r)&&Jw(t))return Kw.call(r)===Kw.call(t);var d=jw(r),g=jw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=qw(r),_=qw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!tM(r[a],t[a],e))return!1;return!0}eM.exports=tM});var B0=ce((QW,uM)=>{var nB=T0(),ga=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rB};ga.prototype.compare=function(r,t){if(r.type!==t.type||!aM(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=sM(r),a=sM(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function sM(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function aM(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}ga.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};ga.prototype.compareLine=function(r,t,e,o){if(!aM(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};ga.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};ga.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};ga.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};ga.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};ga.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};ga.prototype.removePseudo=function(r){return r};function rB(r,t){return nB(r,t,{strict:!0})}uM.exports=ga});var lM=ce((cq,Bp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=Pu)});var cM=ce((fq,zp)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof zp!="undefined"&&zp.exports&&(zp.exports=Iu)});var z0=ce((hq,Gp)=>{function ma(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}ma.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};ma.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};ma.prototype.forEach=function(r){this._queue.forEach(r)};ma.prototype.getElements=function(){return this._queue};ma.prototype.getElementPriority=function(r){return this._priorities[r]};ma.prototype.getPriorities=function(){return this._priorities};ma.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};ma.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};ma.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Gp!="undefined"&&Gp.exports&&(Gp.exports=ma)});var hM=ce((pq,xc)=>{typeof xc!="undefined"&&xc.exports&&(fM=z0());var fM;function Ja(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Ja.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new fM(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Ja.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Ja.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ja.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Ja.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Ja.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Ja.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Ja.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof xc!="undefined"&&xc.exports&&(xc.exports=Ja)});var pM=ce((dq,kp)=>{typeof kp!="undefined"&&kp.exports&&(kp.exports={DBSCAN:lM(),KMEANS:cM(),OPTICS:hM(),PriorityQueue:z0()})});var G0=ce((xq,gM)=>{"use strict";gM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var vM=ce((Eq,yM)=>{"use strict";var mM=G0(),lB=mM.eudist,cB=mM.dist;yM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lB:cB,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,b=[],P=0;P<c;P++){for(var I=1/0,M=0;M<w;M++){var E=o(t[P],a[M]);E<=I&&(I=E)}_[P]=I}for(var N=0;N<c;N++)x+=_[N];for(var A=0;A<c;A++)b[A]={i:A,v:t[A],pr:_[A]/x,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var U=1;U<c;U++)b[U].cs=b[U-1].cs+b[U].pr;for(var z=Math.random(),$=0;$<c-1&&b[$++].cs<z;);a.push(b[$-1].v)}return a}}});var MM=ce((Sq,wM)=>{"use strict";var k0=G0(),EM=vM(),fB=k0.eudist,wq=k0.mandist,Mq=k0.dist,hB=EM.kmrand,pB=EM.kmpp,_M=1e4;function xM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dB(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||_M,_=r.length,w=r[0].length,x=w>0,b=[];if(e)e=="kmrand"?a=hB(r,t):e=="kmpp"?a=pB(r,t):a=e;else for(var P={};a.length<t;){var I=Math.floor(Math.random()*_);P[I]||(P[I]=!0,a.push(r[I]))}do{xM(t,0,b);for(var M=0;M<_;M++){for(var E=1/0,N=0,A=0;A<t;A++){var d=x?fB(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,N=A)}p[M]=N,b[N]++}for(var U=[],c=[],z=0,$=0;$<t;$++)U[$]=x?xM(w,0,U[$]):0,c[$]=a[$];if(x){for(var q=0;q<t;q++)a[q]=[];for(var D=0;D<_;D++)for(var G=p[D],Q=U[G],_t=r[D],Z=0;Z<w;Z++)Q[Z]+=_t[Z];g=!0;for(var Dt=0;Dt<t;Dt++){for(var et=a[Dt],vt=U[Dt],It=c[Dt],Pt=b[Dt],Et=0;Et<w;Et++)et[Et]=vt[Et]/Pt||0;if(g){for(var yt=0;yt<w;yt++)if(It[yt]!=et[yt]){g=!1;break}}}}else{for(var Y=0;Y<_;Y++){var ht=p[Y];U[ht]+=r[Y]}for(var Mt=0;Mt<t;Mt++)a[Mt]=U[Mt]/b[Mt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:_M-y,k:t,idxs:p,centroids:a}}wM.exports=dB});var bc=ce((Y0,$0)=>{(function(r,t){typeof Y0=="object"&&typeof $0!="undefined"?$0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Y0,function(){"use strict";function r(tt,C){var L={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},F,J,X,pt;return pt={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(pt[Symbol.iterator]=function(){return this}),pt;function st(ut){return function(nt){return k([ut,nt])}}function k(ut){if(F)throw new TypeError("Generator is already executing.");for(;L;)try{if(F=1,J&&(X=ut[0]&2?J.return:ut[0]?J.throw||((X=J.return)&&X.call(J),0):J.next)&&!(X=X.call(J,ut[1])).done)return X;switch(J=0,X&&(ut=[ut[0]&2,X.value]),ut[0]){case 0:case 1:X=ut;break;case 4:return L.label++,{value:ut[1],done:!1};case 5:L.label++,J=ut[1],ut=[0];continue;case 7:ut=L.ops.pop(),L.trys.pop();continue;default:if(X=L.trys,!(X=X.length>0&&X[X.length-1])&&(ut[0]===6||ut[0]===2)){L=0;continue}if(ut[0]===3&&(!X||ut[1]>X[0]&&ut[1]<X[3])){L.label=ut[1];break}if(ut[0]===6&&L.label<X[1]){L.label=X[1],X=ut;break}if(X&&L.label<X[2]){L.label=X[2],L.ops.push(ut);break}X[2]&&L.ops.pop(),L.trys.pop();continue}ut=C.call(tt,L)}catch(nt){ut=[6,nt],J=0}finally{F=X=0}if(ut[0]&5)throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}}var t=function(){function tt(C,L){this.next=null,this.key=C,this.data=L,this.left=null,this.right=null}return tt}();function e(tt,C){return tt>C?1:tt<C?-1:0}function o(tt,C,L){for(var F=new t(null,null),J=F,X=F;;){var pt=L(tt,C.key);if(pt<0){if(C.left===null)break;if(L(tt,C.left.key)<0){var st=C.left;if(C.left=st.right,st.right=C,C=st,C.left===null)break}X.left=C,X=C,C=C.left}else if(pt>0){if(C.right===null)break;if(L(tt,C.right.key)>0){var st=C.right;if(C.right=st.left,st.left=C,C=st,C.right===null)break}J.right=C,J=C,C=C.right}else break}return J.right=C.left,X.left=C.right,C.left=F.right,C.right=F.left,C}function a(tt,C,L,F){var J=new t(tt,C);if(L===null)return J.left=J.right=null,J;L=o(tt,L,F);var X=F(tt,L.key);return X<0?(J.left=L.left,J.right=L,L.left=null):X>=0&&(J.right=L.right,J.left=L,L.right=null),J}function c(tt,C,L){var F=null,J=null;if(C){C=o(tt,C,L);var X=L(C.key,tt);X===0?(F=C.left,J=C.right):X<0?(J=C.right,C.right=null,F=C):(F=C.left,C.left=null,J=C)}return{left:F,right:J}}function p(tt,C,L){return C===null?tt:(tt===null||(C=o(tt.key,C,L),C.left=tt),C)}function d(tt,C,L,F,J){if(tt){F(""+C+(L?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(tt)+\`
106
106
  \`);var X=C+(L?" ":"\\u2502 ");tt.left&&d(tt.left,X,!1,F,J),tt.right&&d(tt.right,X,!0,F,J)}}var g=function(){function tt(C){C===void 0&&(C=e),this._root=null,this._size=0,this._comparator=C}return tt.prototype.insert=function(C,L){return this._size++,this._root=a(C,L,this._root,this._comparator)},tt.prototype.add=function(C,L){var F=new t(C,L);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var J=this._comparator,X=o(C,this._root,J),pt=J(C,X.key);return pt===0?this._root=X:(pt<0?(F.left=X.left,F.right=X,X.left=null):pt>0&&(F.right=X.right,F.left=X,X.right=null),this._size++,this._root=F),this._root},tt.prototype.remove=function(C){this._root=this._remove(C,this._root,this._comparator)},tt.prototype._remove=function(C,L,F){var J;if(L===null)return null;L=o(C,L,F);var X=F(C,L.key);return X===0?(L.left===null?J=L.right:(J=o(C,L.left,F),J.right=L.right),this._size--,J):L},tt.prototype.pop=function(){var C=this._root;if(C){for(;C.left;)C=C.left;return this._root=o(C.key,this._root,this._comparator),this._root=this._remove(C.key,this._root,this._comparator),{key:C.key,data:C.data}}return null},tt.prototype.findStatic=function(C){for(var L=this._root,F=this._comparator;L;){var J=F(C,L.key);if(J===0)return L;J<0?L=L.left:L=L.right}return null},tt.prototype.find=function(C){return this._root&&(this._root=o(C,this._root,this._comparator),this._comparator(C,this._root.key)!==0)?null:this._root},tt.prototype.contains=function(C){for(var L=this._root,F=this._comparator;L;){var J=F(C,L.key);if(J===0)return!0;J<0?L=L.left:L=L.right}return!1},tt.prototype.forEach=function(C,L){for(var F=this._root,J=[],X=!1;!X;)F!==null?(J.push(F),F=F.left):J.length!==0?(F=J.pop(),C.call(L,F),F=F.right):X=!0;return this},tt.prototype.range=function(C,L,F,J){for(var X=[],pt=this._comparator,st=this._root,k;X.length!==0||st;)if(st)X.push(st),st=st.left;else{if(st=X.pop(),k=pt(st.key,L),k>0)break;if(pt(st.key,C)>=0&&F.call(J,st))return this;st=st.right}return this},tt.prototype.keys=function(){var C=[];return this.forEach(function(L){var F=L.key;return C.push(F)}),C},tt.prototype.values=function(){var C=[];return this.forEach(function(L){var F=L.data;return C.push(F)}),C},tt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},tt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},tt.prototype.minNode=function(C){if(C===void 0&&(C=this._root),C)for(;C.left;)C=C.left;return C},tt.prototype.maxNode=function(C){if(C===void 0&&(C=this._root),C)for(;C.right;)C=C.right;return C},tt.prototype.at=function(C){for(var L=this._root,F=!1,J=0,X=[];!F;)if(L)X.push(L),L=L.left;else if(X.length>0){if(L=X.pop(),J===C)return L;J++,L=L.right}else F=!0;return null},tt.prototype.next=function(C){var L=this._root,F=null;if(C.right){for(F=C.right;F.left;)F=F.left;return F}for(var J=this._comparator;L;){var X=J(C.key,L.key);if(X===0)break;X<0?(F=L,L=L.left):L=L.right}return F},tt.prototype.prev=function(C){var L=this._root,F=null;if(C.left!==null){for(F=C.left;F.right;)F=F.right;return F}for(var J=this._comparator;L;){var X=J(C.key,L.key);if(X===0)break;X<0?L=L.left:(F=L,L=L.right)}return F},tt.prototype.clear=function(){return this._root=null,this._size=0,this},tt.prototype.toList=function(){return w(this._root)},tt.prototype.load=function(C,L,F){L===void 0&&(L=[]),F===void 0&&(F=!1);var J=C.length,X=this._comparator;if(F&&P(C,L,0,J-1,X),this._root===null)this._root=y(C,L,0,J),this._size=J;else{var pt=b(this.toList(),_(C,L),X);J=this._size+J,this._root=x({head:pt},0,J)}return this},tt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(tt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(tt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),tt.prototype.toString=function(C){C===void 0&&(C=function(F){return String(F.key)});var L=[];return d(this._root,"",!0,function(F){return L.push(F)},C),L.join("")},tt.prototype.update=function(C,L,F){var J=this._comparator,X=c(C,this._root,J),pt=X.left,st=X.right;J(C,L)<0?st=a(L,F,st,J):pt=a(L,F,pt,J),this._root=p(pt,st,J)},tt.prototype.split=function(C){return c(C,this._root,this._comparator)},tt.prototype[Symbol.iterator]=function(){var C,L,F;return r(this,function(J){switch(J.label){case 0:C=this._root,L=[],F=!1,J.label=1;case 1:return F?[3,6]:C===null?[3,2]:(L.push(C),C=C.left,[3,5]);case 2:return L.length===0?[3,4]:(C=L.pop(),[4,C]);case 3:return J.sent(),C=C.right,[3,5];case 4:F=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},tt}();function y(tt,C,L,F){var J=F-L;if(J>0){var X=L+Math.floor(J/2),pt=tt[X],st=C[X],k=new t(pt,st);return k.left=y(tt,C,L,X),k.right=y(tt,C,X+1,F),k}return null}function _(tt,C){for(var L=new t(null,null),F=L,J=0;J<tt.length;J++)F=F.next=new t(tt[J],C[J]);return F.next=null,L.next}function w(tt){for(var C=tt,L=[],F=!1,J=new t(null,null),X=J;!F;)C?(L.push(C),C=C.left):L.length>0?(C=X=X.next=L.pop(),C=C.right):F=!0;return X.next=null,J.next}function x(tt,C,L){var F=L-C;if(F>0){var J=C+Math.floor(F/2),X=x(tt,C,J),pt=tt.head;return pt.left=X,tt.head=tt.head.next,pt.right=x(tt,J+1,L),pt}return null}function b(tt,C,L){for(var F=new t(null,null),J=F,X=tt,pt=C;X!==null&&pt!==null;)L(X.key,pt.key)<0?(J.next=X,X=X.next):(J.next=pt,pt=pt.next),J=J.next;return X!==null?J.next=X:pt!==null&&(J.next=pt),F.next}function P(tt,C,L,F,J){if(!(L>=F)){for(var X=tt[L+F>>1],pt=L-1,st=F+1;;){do pt++;while(J(tt[pt],X)<0);do st--;while(J(tt[st],X)>0);if(pt>=st)break;var k=tt[pt];tt[pt]=tt[st],tt[st]=k,k=C[pt],C[pt]=C[st],C[st]=k}P(tt,C,L,st,J),P(tt,C,st+1,F,J)}}let I=(tt,C)=>tt.ll.x<=C.x&&C.x<=tt.ur.x&&tt.ll.y<=C.y&&C.y<=tt.ur.y,M=(tt,C)=>{if(C.ur.x<tt.ll.x||tt.ur.x<C.ll.x||C.ur.y<tt.ll.y||tt.ur.y<C.ll.y)return null;let L=tt.ll.x<C.ll.x?C.ll.x:tt.ll.x,F=tt.ur.x<C.ur.x?tt.ur.x:C.ur.x,J=tt.ll.y<C.ll.y?C.ll.y:tt.ll.y,X=tt.ur.y<C.ur.y?tt.ur.y:C.ur.y;return{ll:{x:L,y:J},ur:{x:F,y:X}}},E=Number.EPSILON;E===void 0&&(E=Math.pow(2,-52));let N=E*E,A=(tt,C)=>{if(-E<tt&&tt<E&&-E<C&&C<E)return 0;let L=tt-C;return L*L<N*tt*C?0:tt<C?-1:1};class U{constructor(){this.reset()}reset(){this.xRounder=new z,this.yRounder=new z}round(C,L){return{x:this.xRounder.round(C),y:this.yRounder.round(L)}}}class z{constructor(){this.tree=new g,this.round(0)}round(C){let L=this.tree.add(C),F=this.tree.prev(L);if(F!==null&&A(L.key,F.key)===0)return this.tree.remove(C),F.key;let J=this.tree.next(L);return J!==null&&A(L.key,J.key)===0?(this.tree.remove(C),J.key):C}}let $=new U,q=11102230246251565e-32,D=134217729,G=(3+8*q)*q;function Q(tt,C,L,F,J){let X,pt,st,k,ut=C[0],nt=F[0],lt=0,dt=0;nt>ut==nt>-ut?(X=ut,ut=C[++lt]):(X=nt,nt=F[++dt]);let at=0;if(lt<tt&&dt<L)for(nt>ut==nt>-ut?(pt=ut+X,st=X-(pt-ut),ut=C[++lt]):(pt=nt+X,st=X-(pt-nt),nt=F[++dt]),X=pt,st!==0&&(J[at++]=st);lt<tt&&dt<L;)nt>ut==nt>-ut?(pt=X+ut,k=pt-X,st=X-(pt-k)+(ut-k),ut=C[++lt]):(pt=X+nt,k=pt-X,st=X-(pt-k)+(nt-k),nt=F[++dt]),X=pt,st!==0&&(J[at++]=st);for(;lt<tt;)pt=X+ut,k=pt-X,st=X-(pt-k)+(ut-k),ut=C[++lt],X=pt,st!==0&&(J[at++]=st);for(;dt<L;)pt=X+nt,k=pt-X,st=X-(pt-k)+(nt-k),nt=F[++dt],X=pt,st!==0&&(J[at++]=st);return(X!==0||at===0)&&(J[at++]=X),at}function _t(tt,C){let L=C[0];for(let F=1;F<tt;F++)L+=C[F];return L}function Z(tt){return new Float64Array(tt)}let Dt=(3+16*q)*q,et=(2+12*q)*q,vt=(9+64*q)*q*q,It=Z(4),Pt=Z(8),Et=Z(12),yt=Z(16),Y=Z(4);function ht(tt,C,L,F,J,X,pt){let st,k,ut,nt,lt,dt,at,Bt,qt,we,oe,Ve,je,ur,Qn,wr,Rr,er,Me=tt-J,nr=L-J,hr=C-X,lr=F-X;ur=Me*lr,dt=D*Me,at=dt-(dt-Me),Bt=Me-at,dt=D*lr,qt=dt-(dt-lr),we=lr-qt,Qn=Bt*we-(ur-at*qt-Bt*qt-at*we),wr=hr*nr,dt=D*hr,at=dt-(dt-hr),Bt=hr-at,dt=D*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)/ue(F)},me=(tt,C,L)=>C.y===0?null:{x:tt.x+C.x/C.y*(L-tt.y),y:L},Xt=(tt,C,L)=>C.x===0?null:{x:L,y:tt.y+C.y/C.x*(L-tt.x)},Ee=(tt,C,L,F)=>{if(C.x===0)return Xt(L,F,tt.x);if(F.x===0)return Xt(tt,C,L.x);if(C.y===0)return me(L,F,tt.y);if(F.y===0)return me(tt,C,L.y);let J=zt(C,F);if(J==0)return null;let X={x:L.x-tt.x,y:L.y-tt.y},pt=zt(X,C)/J,st=zt(X,F)/J,k=tt.x+st*C.x,ut=L.x+pt*F.x,nt=tt.y+st*C.y,lt=L.y+pt*F.y,dt=(k+ut)/2,at=(nt+lt)/2;return{x:dt,y:at}};class ft{static compare(C,L){let F=ft.comparePoints(C.point,L.point);return F!==0?F:(C.point!==L.point&&C.link(L),C.isLeft!==L.isLeft?C.isLeft?1:-1:te.compare(C.segment,L.segment))}static comparePoints(C,L){return C.x<L.x?-1:C.x>L.x?1:C.y<L.y?-1:C.y>L.y?1:0}constructor(C,L){C.events===void 0?C.events=[this]:C.events.push(this),this.point=C,this.isLeft=L}link(C){if(C.point===this.point)throw new Error("Tried to link already linked events");let L=C.point.events;for(let F=0,J=L.length;F<J;F++){let X=L[F];this.point.events.push(X),X.point=this.point}this.checkForConsuming()}checkForConsuming(){let C=this.point.events.length;for(let L=0;L<C;L++){let F=this.point.events[L];if(F.segment.consumedBy===void 0)for(let J=L+1;J<C;J++){let X=this.point.events[J];X.consumedBy===void 0&&F.otherSE.point.events===X.otherSE.point.events&&F.segment.consume(X.segment)}}}getAvailableLinkedEvents(){let C=[];for(let L=0,F=this.point.events.length;L<F;L++){let J=this.point.events[L];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&C.push(J)}return C}getLeftmostComparator(C){let L=new Map,F=J=>{let X=J.otherSE;L.set(J,{sine:le(this.point,C.point,X.point),cosine:Qt(this.point,C.point,X.point)})};return(J,X)=>{L.has(J)||F(J),L.has(X)||F(X);let{sine:pt,cosine:st}=L.get(J),{sine:k,cosine:ut}=L.get(X);return pt>=0&&k>=0?st<ut?1:st>ut?-1:0:pt<0&&k<0?st<ut?-1:st>ut?1:0:k<pt?-1:k>pt?1:0}}}let He=0;class te{static compare(C,L){let F=C.leftSE.point.x,J=L.leftSE.point.x,X=C.rightSE.point.x,pt=L.rightSE.point.x;if(pt<F)return 1;if(X<J)return-1;let st=C.leftSE.point.y,k=L.leftSE.point.y,ut=C.rightSE.point.y,nt=L.rightSE.point.y;if(F<J){if(k<st&&k<ut)return 1;if(k>st&&k>ut)return-1;let lt=C.comparePoint(L.leftSE.point);if(lt<0)return 1;if(lt>0)return-1;let dt=L.comparePoint(C.rightSE.point);return dt!==0?dt:-1}if(F>J){if(st<k&&st<nt)return-1;if(st>k&&st>nt)return 1;let lt=L.comparePoint(C.leftSE.point);if(lt!==0)return lt;let dt=C.comparePoint(L.rightSE.point);return dt<0?1:dt>0?-1:1}if(st<k)return-1;if(st>k)return 1;if(X<pt){let lt=L.comparePoint(C.rightSE.point);if(lt!==0)return lt}if(X>pt){let lt=C.comparePoint(L.rightSE.point);if(lt<0)return 1;if(lt>0)return-1}if(X!==pt){let lt=ut-st,dt=X-F,at=nt-k,Bt=pt-J;if(lt>dt&&at<Bt)return 1;if(lt<dt&&at>Bt)return-1}return X>pt?1:X<pt||ut<nt?-1:ut>nt?1:C.id<L.id?-1:C.id>L.id?1:0}constructor(C,L,F,J){this.id=++He,this.leftSE=C,C.segment=this,C.otherSE=L,this.rightSE=L,L.segment=this,L.otherSE=C,this.rings=F,this.windings=J}static fromRing(C,L,F){let J,X,pt,st=ft.comparePoints(C,L);if(st<0)J=C,X=L,pt=1;else if(st>0)J=L,X=C,pt=-1;else throw new Error(\`Tried to create degenerate segment at [\${C.x}, \${C.y}]\`);let k=new ft(J,!0),ut=new ft(X,!1);return new te(k,ut,[F],[pt])}replaceRightSE(C){this.rightSE=C,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let C=this.leftSE.point.y,L=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:C<L?C:L},ur:{x:this.rightSE.point.x,y:C>L?C:L}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(C){return C.x===this.leftSE.point.x&&C.y===this.leftSE.point.y||C.x===this.rightSE.point.x&&C.y===this.rightSE.point.y}comparePoint(C){if(this.isAnEndpoint(C))return 0;let L=this.leftSE.point,F=this.rightSE.point,J=this.vector();if(L.x===F.x)return C.x===L.x?0:C.x<L.x?1:-1;let X=(C.y-L.y)/J.y,pt=L.x+X*J.x;if(C.x===pt)return 0;let st=(C.x-L.x)/J.x,k=L.y+st*J.y;return C.y===k?0:C.y<k?-1:1}getIntersection(C){let L=this.bbox(),F=C.bbox(),J=M(L,F);if(J===null)return null;let X=this.leftSE.point,pt=this.rightSE.point,st=C.leftSE.point,k=C.rightSE.point,ut=I(L,st)&&this.comparePoint(st)===0,nt=I(F,X)&&C.comparePoint(X)===0,lt=I(L,k)&&this.comparePoint(k)===0,dt=I(F,pt)&&C.comparePoint(pt)===0;if(nt&&ut)return dt&&!lt?pt:!dt&&lt?k:null;if(nt)return lt&&X.x===k.x&&X.y===k.y?null:X;if(ut)return dt&&pt.x===st.x&&pt.y===st.y?null:st;if(dt&&lt)return null;if(dt)return pt;if(lt)return k;let at=Ee(X,this.vector(),st,C.vector());return at===null||!I(J,at)?null:$.round(at.x,at.y)}split(C){let L=[],F=C.events!==void 0,J=new ft(C,!0),X=new ft(C,!1),pt=this.rightSE;this.replaceRightSE(X),L.push(X),L.push(J);let st=new te(J,pt,this.rings.slice(),this.windings.slice());return ft.comparePoints(st.leftSE.point,st.rightSE.point)>0&&st.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(J.checkForConsuming(),X.checkForConsuming()),L}swapEvents(){let C=this.rightSE;this.rightSE=this.leftSE,this.leftSE=C,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let L=0,F=this.windings.length;L<F;L++)this.windings[L]*=-1}consume(C){let L=this,F=C;for(;L.consumedBy;)L=L.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let J=te.compare(L,F);if(J!==0){if(J>0){let X=L;L=F,F=X}if(L.prev===F){let X=L;L=F,F=X}for(let X=0,pt=F.rings.length;X<pt;X++){let st=F.rings[X],k=F.windings[X],ut=L.rings.indexOf(st);ut===-1?(L.rings.push(st),L.windings.push(k)):L.windings[ut]+=k}F.rings=null,F.windings=null,F.consumedBy=L,F.leftSE.consumedBy=L.leftSE,F.rightSE.consumedBy=L.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{let C=this.prev.consumedBy||this.prev;this._beforeState=C.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let C=this.beforeState();this._afterState={rings:C.rings.slice(0),windings:C.windings.slice(0),multiPolys:[]};let L=this._afterState.rings,F=this._afterState.windings,J=this._afterState.multiPolys;for(let st=0,k=this.rings.length;st<k;st++){let ut=this.rings[st],nt=this.windings[st],lt=L.indexOf(ut);lt===-1?(L.push(ut),F.push(nt)):F[lt]+=nt}let X=[],pt=[];for(let st=0,k=L.length;st<k;st++){if(F[st]===0)continue;let ut=L[st],nt=ut.poly;if(pt.indexOf(nt)===-1)if(ut.isExterior)X.push(nt);else{pt.indexOf(nt)===-1&&pt.push(nt);let lt=X.indexOf(ut.poly);lt!==-1&&X.splice(lt,1)}}for(let st=0,k=X.length;st<k;st++){let ut=X[st].multiPoly;J.indexOf(ut)===-1&&J.push(ut)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let C=this.beforeState().multiPolys,L=this.afterState().multiPolys;switch(rt.type){case"union":{let F=C.length===0,J=L.length===0;this._isInResult=F!==J;break}case"intersection":{let F,J;C.length<L.length?(F=C.length,J=L.length):(F=L.length,J=C.length),this._isInResult=J===rt.numMultiPolys&&F<J;break}case"xor":{let F=Math.abs(C.length-L.length);this._isInResult=F%2===1;break}case"difference":{let F=J=>J.length===1&&J[0].isSubject;this._isInResult=F(C)!==F(L);break}default:throw new Error(\`Unrecognized operation type found \${rt.type}\`)}return this._isInResult}}class fe{constructor(C,L,F){if(!Array.isArray(C)||C.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=L,this.isExterior=F,this.segments=[],typeof C[0][0]!="number"||typeof C[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let J=$.round(C[0][0],C[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};let X=J;for(let pt=1,st=C.length;pt<st;pt++){if(typeof C[pt][0]!="number"||typeof C[pt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=$.round(C[pt][0],C[pt][1]);k.x===X.x&&k.y===X.y||(this.segments.push(te.fromRing(X,k,this)),k.x<this.bbox.ll.x&&(this.bbox.ll.x=k.x),k.y<this.bbox.ll.y&&(this.bbox.ll.y=k.y),k.x>this.bbox.ur.x&&(this.bbox.ur.x=k.x),k.y>this.bbox.ur.y&&(this.bbox.ur.y=k.y),X=k)}(J.x!==X.x||J.y!==X.y)&&this.segments.push(te.fromRing(X,J,this))}getSweepEvents(){let C=[];for(let L=0,F=this.segments.length;L<F;L++){let J=this.segments[L];C.push(J.leftSE),C.push(J.rightSE)}return C}}class de{constructor(C,L){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fe(C[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 F=1,J=C.length;F<J;F++){let X=new fe(C[F],this,!1);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.interiorRings.push(X)}this.multiPoly=L}getSweepEvents(){let C=this.exteriorRing.getSweepEvents();for(let L=0,F=this.interiorRings.length;L<F;L++){let J=this.interiorRings[L].getSweepEvents();for(let X=0,pt=J.length;X<pt;X++)C.push(J[X])}return C}}class Ue{constructor(C,L){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof C[0][0][0]=="number"&&(C=[C])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,J=C.length;F<J;F++){let X=new de(C[F],this);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.polys.push(X)}this.isSubject=L}getSweepEvents(){let C=[];for(let L=0,F=this.polys.length;L<F;L++){let J=this.polys[L].getSweepEvents();for(let X=0,pt=J.length;X<pt;X++)C.push(J[X])}return C}}class be{static factory(C){let L=[];for(let F=0,J=C.length;F<J;F++){let X=C[F];if(!X.isInResult()||X.ringOut)continue;let pt=null,st=X.leftSE,k=X.rightSE,ut=[st],nt=st.point,lt=[];for(;pt=st,st=k,ut.push(st),st.point!==nt;)for(;;){let dt=st.getAvailableLinkedEvents();if(dt.length===0){let qt=ut[0].point,we=ut[ut.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${qt.x}, \${qt.y}]. Last matching segment found ends at [\${we.x}, \${we.y}].\`)}if(dt.length===1){k=dt[0].otherSE;break}let at=null;for(let qt=0,we=lt.length;qt<we;qt++)if(lt[qt].point===st.point){at=qt;break}if(at!==null){let qt=lt.splice(at)[0],we=ut.splice(qt.index);we.unshift(we[0].otherSE),L.push(new be(we.reverse()));continue}lt.push({index:ut.length,point:st.point});let Bt=st.getLeftmostComparator(pt);k=dt.sort(Bt)[0].otherSE;break}L.push(new be(ut))}return L}constructor(C){this.events=C;for(let L=0,F=C.length;L<F;L++)C[L].segment.ringOut=this;this.poly=null}getGeom(){let C=this.events[0].point,L=[C];for(let ut=1,nt=this.events.length-1;ut<nt;ut++){let lt=this.events[ut].point,dt=this.events[ut+1].point;$t(lt,C,dt)!==0&&(L.push(lt),C=lt)}if(L.length===1)return null;let F=L[0],J=L[1];$t(F,C,J)===0&&L.shift(),L.push(L[0]);let X=this.isExteriorRing()?1:-1,pt=this.isExteriorRing()?0:L.length-1,st=this.isExteriorRing()?L.length:-1,k=[];for(let ut=pt;ut!=st;ut+=X)k.push([L[ut].x,L[ut].y]);return k}isExteriorRing(){if(this._isExteriorRing===void 0){let C=this.enclosingRing();this._isExteriorRing=C?!C.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let C=this.events[0];for(let J=1,X=this.events.length;J<X;J++){let pt=this.events[J];ft.compare(C,pt)>0&&(C=pt)}let L=C.segment.prevInResult(),F=L?L.prevInResult():null;for(;;){if(!L)return null;if(!F)return L.ringOut;if(F.ringOut!==L.ringOut)return F.ringOut.enclosingRing()!==L.ringOut?L.ringOut:L.ringOut.enclosingRing();L=F.prevInResult(),F=L?L.prevInResult():null}}}class kt{constructor(C){this.exteriorRing=C,C.poly=this,this.interiorRings=[]}addInterior(C){this.interiorRings.push(C),C.poly=this}getGeom(){let C=[this.exteriorRing.getGeom()];if(C[0]===null)return null;for(let L=0,F=this.interiorRings.length;L<F;L++){let J=this.interiorRings[L].getGeom();J!==null&&C.push(J)}return C}}class ye{constructor(C){this.rings=C,this.polys=this._composePolys(C)}getGeom(){let C=[];for(let L=0,F=this.polys.length;L<F;L++){let J=this.polys[L].getGeom();J!==null&&C.push(J)}return C}_composePolys(C){let L=[];for(let F=0,J=C.length;F<J;F++){let X=C[F];if(!X.poly)if(X.isExteriorRing())L.push(new kt(X));else{let pt=X.enclosingRing();pt.poly||L.push(new kt(pt)),pt.poly.addInterior(X)}}return L}}class Vn{constructor(C){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.compare;this.queue=C,this.tree=new g(L),this.segments=[]}process(C){let L=C.segment,F=[];if(C.consumedBy)return C.isLeft?this.queue.remove(C.otherSE):this.tree.remove(L),F;let J=C.isLeft?this.tree.add(L):this.tree.find(L);if(!J)throw new Error(\`Unable to find segment #\${L.id} [\${L.leftSE.point.x}, \${L.leftSE.point.y}] -> [\${L.rightSE.point.x}, \${L.rightSE.point.y}] in SweepLine tree.\`);let X=J,pt=J,st,k;for(;st===void 0;)X=this.tree.prev(X),X===null?st=null:X.key.consumedBy===void 0&&(st=X.key);for(;k===void 0;)pt=this.tree.next(pt),pt===null?k=null:pt.key.consumedBy===void 0&&(k=pt.key);if(C.isLeft){let ut=null;if(st){let lt=st.getIntersection(L);if(lt!==null&&(L.isAnEndpoint(lt)||(ut=lt),!st.isAnEndpoint(lt))){let dt=this._splitSafely(st,lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}}let nt=null;if(k){let lt=k.getIntersection(L);if(lt!==null&&(L.isAnEndpoint(lt)||(nt=lt),!k.isAnEndpoint(lt))){let dt=this._splitSafely(k,lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}}if(ut!==null||nt!==null){let lt=null;ut===null?lt=nt:nt===null?lt=ut:lt=ft.comparePoints(ut,nt)<=0?ut:nt,this.queue.remove(L.rightSE),F.push(L.rightSE);let dt=L.split(lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}F.length>0?(this.tree.remove(L),F.push(C)):(this.segments.push(L),L.prev=st)}else{if(st&&k){let ut=st.getIntersection(k);if(ut!==null){if(!st.isAnEndpoint(ut)){let nt=this._splitSafely(st,ut);for(let lt=0,dt=nt.length;lt<dt;lt++)F.push(nt[lt])}if(!k.isAnEndpoint(ut)){let nt=this._splitSafely(k,ut);for(let lt=0,dt=nt.length;lt<dt;lt++)F.push(nt[lt])}}}this.tree.remove(L)}return F}_splitSafely(C,L){this.tree.remove(C);let F=C.rightSE;this.queue.remove(F);let J=C.split(L);return J.push(F),C.consumedBy===void 0&&this.tree.add(C),J}}let $n=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,j=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class H{run(C,L,F){rt.type=C,$.reset();let J=[new Ue(L,!0)];for(let lt=0,dt=F.length;lt<dt;lt++)J.push(new Ue(F[lt],!1));if(rt.numMultiPolys=J.length,rt.type==="difference"){let lt=J[0],dt=1;for(;dt<J.length;)M(J[dt].bbox,lt.bbox)!==null?dt++:J.splice(dt,1)}if(rt.type==="intersection")for(let lt=0,dt=J.length;lt<dt;lt++){let at=J[lt];for(let Bt=lt+1,qt=J.length;Bt<qt;Bt++)if(M(at.bbox,J[Bt].bbox)===null)return[]}let X=new g(ft.compare);for(let lt=0,dt=J.length;lt<dt;lt++){let at=J[lt].getSweepEvents();for(let Bt=0,qt=at.length;Bt<qt;Bt++)if(X.insert(at[Bt]),X.size>$n)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let pt=new Vn(X),st=X.size,k=X.pop();for(;k;){let lt=k.key;if(X.size===st){let at=lt.segment;throw new Error(\`Unable to pop() \${lt.isLeft?"left":"right"} SweepEvent [\${lt.point.x}, \${lt.point.y}] from segment #\${at.id} [\${at.leftSE.point.x}, \${at.leftSE.point.y}] -> [\${at.rightSE.point.x}, \${at.rightSE.point.y}] from queue.\`)}if(X.size>$n)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(pt.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let dt=pt.process(lt);for(let at=0,Bt=dt.length;at<Bt;at++){let qt=dt[at];qt.consumedBy===void 0&&X.insert(qt)}st=X.size,k=X.pop()}$.reset();let ut=be.factory(pt.segments);return new ye(ut).getGeom()}}let rt=new H;var Kt={union:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("union",tt,L)},intersection:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("intersection",tt,L)},xor:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("xor",tt,L)},difference:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("difference",tt,L)}};return Kt})});var HM=ce((qp,kM)=>{(function(r,t){typeof qp=="object"&&typeof kM!="undefined"?t(qp):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(qp,function(r){"use strict";function t(){}function e(n){this.message=n||""}function o(n){this.message=n||""}function a(n){this.message=n||""}function c(){}function p(n){return n===null?Qn:n.color}function d(n){return n===null?null:n.parent}function g(n,i){n!==null&&(n.color=i)}function y(n){return n===null?null:n.left}function _(n){return n===null?null:n.right}function w(){this.root_=null,this.size_=0}function x(){}function b(){this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}function P(){}function I(n){this.message=n||""}function M(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),s=Math.max(Math.min(i.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(s+l,0):Math.min(l,s);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:s;for(h=h<0?Math.max(s+arguments[2],0):Math.min(h,s);l<h;)i[l]=n,++l;return i},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!=n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var E=function(){};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.prototype.equalsWithTolerance=function(n,i,s){return Math.abs(n-i)<=s};var N=function(n){function i(s){n.call(this,s),this.name="IllegalArgumentException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),A=function(){},U={MAX_VALUE:{configurable:!0}};A.isNaN=function(n){return Number.isNaN(n)},A.doubleToLongBits=function(n){return n},A.longBitsToDouble=function(n){return n},A.isInfinite=function(n){return!Number.isFinite(n)},U.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,U);var z=function(){},$=function(){},q=function(){},D=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},G={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(n,i){switch(n){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new N("Invalid ordinate index: "+n)}},D.prototype.equals2D=function(){if(arguments.length===1){var n=arguments[0];return this.x===n.x&&this.y===n.y}if(arguments.length===2){var i=arguments[0],s=arguments[1];return!!E.equalsWithTolerance(this.x,i.x,s)&&!!E.equalsWithTolerance(this.y,i.y,s)}},D.prototype.getOrdinate=function(n){switch(n){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new N("Invalid ordinate index: "+n)},D.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||A.isNaN(this.z))&&A.isNaN(n.z)},D.prototype.equals=function(n){return n instanceof D&&this.equals2D(n)},D.prototype.equalInZ=function(n,i){return E.equalsWithTolerance(this.z,n.z,i)},D.prototype.compareTo=function(n){var i=n;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(n){var i=this.x-n.x,s=this.y-n.y,l=this.z-n.z;return Math.sqrt(i*i+s*s+l*l)},D.prototype.distance=function(n){var i=this.x-n.x,s=this.y-n.y;return Math.sqrt(i*i+s*s)},D.prototype.hashCode=function(){var n=17;return n=37*n+D.hashCode(this.x),n=37*n+D.hashCode(this.y)},D.prototype.setCoordinate=function(n){this.x=n.x,this.y=n.y,this.z=n.z},D.prototype.interfaces_=function(){return[z,$,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var n=arguments[0],i=A.doubleToLongBits(n);return Math.trunc((i^i)>>>32)}},G.DimensionalComparator.get=function(){return Q},G.serialVersionUID.get=function(){return 6683108902428367e3},G.NULL_ORDINATE.get=function(){return A.NaN},G.X.get=function(){return 0},G.Y.get=function(){return 1},G.Z.get=function(){return 2},Object.defineProperties(D,G);var Q=function(n){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new N("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};Q.prototype.compare=function(n,i){var s=n,l=i,h=Q.compare(s.x,l.x);if(h!==0)return h;var v=Q.compare(s.y,l.y);return v!==0?v:this._dimensionsToTest<=2?0:Q.compare(s.z,l.z)},Q.prototype.interfaces_=function(){return[q]},Q.prototype.getClass=function(){return Q},Q.compare=function(n,i){return n<i?-1:n>i?1:A.isNaN(n)?A.isNaN(i)?0:-1:A.isNaN(i)?1:0};var _t=function(){};_t.prototype.create=function(){},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t};var Z=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toLocationSymbol=function(n){switch(n){case Z.EXTERIOR:return"e";case Z.BOUNDARY:return"b";case Z.INTERIOR:return"i";case Z.NONE:return"-"}throw new N("Unknown location value: "+n)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(Z,Dt);var et=function(n,i){return n.interfaces_&&n.interfaces_().indexOf(i)>-1},vt=function(){},It={LOG_10:{configurable:!0}};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.log10=function(n){var i=Math.log(n);return A.isInfinite(i)||A.isNaN(i)?i:i/vt.LOG_10},vt.min=function(n,i,s,l){var h=n;return i<h&&(h=i),s<h&&(h=s),l<h&&(h=l),h},vt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1],s=arguments[2];return n<i?i:n>s?s:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],v=arguments[2];return l<h?h:l>v?v:l}},vt.wrap=function(n,i){return n<0?i- -n%i:n%i},vt.max=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2],l=n;return i>l&&(l=i),s>l&&(l=s),l}if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3],V=h;return v>V&&(V=v),S>V&&(V=S),R>V&&(V=R),V}},vt.average=function(n,i){return(n+i)/2},It.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(vt,It);var Pt=function(n){this.str=n};Pt.prototype.append=function(n){this.str+=n},Pt.prototype.setCharAt=function(n,i){this.str=this.str.substr(0,n)+i+this.str.substr(n+1)},Pt.prototype.toString=function(n){return this.str};var Et=function(n){this.value=n};Et.prototype.intValue=function(){return this.value},Et.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0},Et.isNaN=function(n){return Number.isNaN(n)};var yt=function(){};yt.isWhitespace=function(n){return n<=32&&n>=0||n===127},yt.toUpperCase=function(n){return n.toUpperCase()};var Y=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}else if(typeof arguments[0]=="string"){var l=arguments[0];n.call(this,n.parse(l))}}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.init(h,v)}},ht={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Y.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo},Y.prototype.extractSignificantDigits=function(n,i){var s=this.abs(),l=Y.magnitude(s._hi),h=Y.TEN.pow(l);(s=s.divide(h)).gt(Y.TEN)?(s=s.divide(Y.TEN),l+=1):s.lt(Y.ONE)&&(s=s.multiply(Y.TEN),l-=1);for(var v=l+1,S=new Pt,R=Y.MAX_PRINT_DIGITS-1,V=0;V<=R;V++){n&&V===v&&S.append(".");var ot=Math.trunc(s._hi);if(ot<0)break;var St=!1,bt=0;ot>9?(St=!0,bt="9"):bt="0"+ot,S.append(bt),s=s.subtract(Y.valueOf(ot)).multiply(Y.TEN),St&&s.selfAdd(Y.TEN);var Yt=!0,Jt=Y.magnitude(s._hi);if(Jt<0&&Math.abs(Jt)>=R-V&&(Yt=!1),!Yt)break}return i[0]=l,S.toString()},Y.prototype.sqr=function(){return this.multiply(this)},Y.prototype.doubleValue=function(){return this._hi+this._lo},Y.prototype.subtract=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.add(n.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},Y.prototype.equals=function(){if(arguments.length===1){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}},Y.prototype.isZero=function(){return this._hi===0&&this._lo===0},Y.prototype.selfSubtract=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},Y.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Y.prototype.min=function(n){return this.le(n)?this:n},Y.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfDivide(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,ot=null,St=null,bt=null;return V=this._hi/s,ot=Y.SPLIT*V,h=ot-V,bt=Y.SPLIT*s,h=ot-h,v=V-h,S=bt-s,St=V*s,S=bt-S,R=s-S,bt=h*S-St+h*R+v*S+v*R,ot=(this._hi-St-bt+this._lo-V*l)/s,bt=V+ot,this._hi=bt,this._lo=V-bt+ot,this}},Y.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Y.prototype.divide=function(){if(arguments[0]instanceof Y){var n=arguments[0],i=null,s=null,l=null,h=null,v=null,S=null,R=null,V=null;return s=(v=this._hi/n._hi)-(i=(S=Y.SPLIT*v)-(i=S-v)),V=i*(l=(V=Y.SPLIT*n._hi)-(l=V-n._hi))-(R=v*n._hi)+i*(h=n._hi-l)+s*l+s*h,S=(this._hi-R-V+this._lo-v*n._lo)/n._hi,new Y(V=v+S,v-V+S)}if(typeof arguments[0]=="number"){var ot=arguments[0];return A.isNaN(ot)?Y.createNaN():Y.copy(this).selfDivide(ot,0)}},Y.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo},Y.prototype.pow=function(n){if(n===0)return Y.valueOf(1);var i=new Y(this),s=Y.valueOf(1),l=Math.abs(n);if(l>1)for(;l>0;)l%2==1&&s.selfMultiply(i),(l/=2)>0&&(i=i.sqr());else s=i;return n<0?s.reciprocal():s},Y.prototype.ceil=function(){if(this.isNaN())return Y.NaN;var n=Math.ceil(this._hi),i=0;return n===this._hi&&(i=Math.ceil(this._lo)),new Y(n,i)},Y.prototype.compareTo=function(n){var i=n;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},Y.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Y.prototype.setValue=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.init(n),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},Y.prototype.max=function(n){return this.ge(n)?this:n},Y.prototype.sqrt=function(){if(this.isZero())return Y.valueOf(0);if(this.isNegative())return Y.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,s=Y.valueOf(i),l=this.subtract(s.sqr())._hi*(.5*n);return s.add(l)},Y.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfAdd(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],s=null,l=null,h=null,v=null,S=null,R=null;return h=this._hi+i,S=h-this._hi,v=h-S,v=i-S+(this._hi-v),R=v+this._lo,s=h+R,l=R+(h-s),this._hi=s+l,this._lo=l+(s-this._hi),this}}else if(arguments.length===2){var V=arguments[0],ot=arguments[1],St=null,bt=null,Yt=null,Jt=null,se=null,_e=null,Cn=null;Jt=this._hi+V,bt=this._lo+ot,se=Jt-(_e=Jt-this._hi),Yt=bt-(Cn=bt-this._lo);var Xn=(St=Jt+(_e=(se=V-_e+(this._hi-se))+bt))+(_e=(Yt=ot-Cn+(this._lo-Yt))+(_e+(Jt-St))),ui=_e+(St-Xn);return this._hi=Xn,this._lo=ui,this}},Y.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfMultiply(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,ot=null;h=(V=Y.SPLIT*this._hi)-this._hi,ot=Y.SPLIT*s,h=V-h,v=this._hi-h,S=ot-s;var St=(V=this._hi*s)+(ot=h*(S=ot-S)-V+h*(R=s-S)+v*S+v*R+(this._hi*l+this._lo*s)),bt=ot+(h=V-St);return this._hi=St,this._lo=bt,this}},Y.prototype.selfSqr=function(){return this.selfMultiply(this)},Y.prototype.floor=function(){if(this.isNaN())return Y.NaN;var n=Math.floor(this._hi),i=0;return n===this._hi&&(i=Math.floor(this._lo)),new Y(n,i)},Y.prototype.negate=function(){return this.isNaN()?this:new Y(-this._hi,-this._lo)},Y.prototype.clone=function(){},Y.prototype.multiply=function(){if(arguments[0]instanceof Y){var n=arguments[0];return n.isNaN()?Y.createNaN():Y.copy(this).selfMultiply(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return A.isNaN(i)?Y.createNaN():Y.copy(this).selfMultiply(i,0)}},Y.prototype.isNaN=function(){return A.isNaN(this._hi)},Y.prototype.intValue=function(){return Math.trunc(this._hi)},Y.prototype.toString=function(){var n=Y.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},Y.prototype.toStandardNotation=function(){var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!0,i),l=i[0]+1,h=s;if(s.charAt(0)===".")h="0"+s;else if(l<0)h="0."+Y.stringOfChar("0",-l)+s;else if(s.indexOf(".")===-1){var v=l-s.length;h=s+Y.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+h:h},Y.prototype.reciprocal=function(){var n=null,i=null,s=null,l=null,h=null,v=null,S=null,R=null;i=(h=1/this._hi)-(n=(v=Y.SPLIT*h)-(n=v-h)),s=(R=Y.SPLIT*this._hi)-this._hi;var V=h+(v=(1-(S=h*this._hi)-(R=n*(s=R-s)-S+n*(l=this._hi-s)+i*s+i*l)-h*this._lo)/this._hi);return new Y(V,h-V+v)},Y.prototype.toSciNotation=function(){if(this.isZero())return Y.SCI_NOT_ZERO;var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!1,i),l=Y.SCI_NOT_EXPONENT_CHAR+i[0];if(s.charAt(0)==="0")throw new Error("Found leading zero: "+s);var h="";s.length>1&&(h=s.substring(1));var v=s.charAt(0)+"."+h;return this.isNegative()?"-"+v+l:v+l},Y.prototype.abs=function(){return this.isNaN()?Y.NaN:this.isNegative()?this.negate():new Y(this)},Y.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Y.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo},Y.prototype.add=function(){if(arguments[0]instanceof Y){var n=arguments[0];return Y.copy(this).selfAdd(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return Y.copy(this).selfAdd(i)}},Y.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var n=arguments[0];this._hi=n,this._lo=0}else if(arguments[0]instanceof Y){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._hi=s,this._lo=l}},Y.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo},Y.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Y.prototype.trunc=function(){return this.isNaN()?Y.NaN:this.isPositive()?this.floor():this.ceil()},Y.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Y.prototype.interfaces_=function(){return[t,z,$]},Y.prototype.getClass=function(){return Y},Y.sqr=function(n){return Y.valueOf(n).selfMultiply(n)},Y.valueOf=function(){if(typeof arguments[0]=="string"){var n=arguments[0];return Y.parse(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return new Y(i)}},Y.sqrt=function(n){return Y.valueOf(n).sqrt()},Y.parse=function(n){for(var i=0,s=n.length;yt.isWhitespace(n.charAt(i));)i++;var l=!1;if(i<s){var h=n.charAt(i);h!=="-"&&h!=="+"||(i++,h==="-"&&(l=!0))}for(var v=new Y,S=0,R=0,V=0;!(i>=s);){var ot=n.charAt(i);if(i++,yt.isDigit(ot)){var St=ot-"0";v.selfMultiply(Y.TEN),v.selfAdd(St),S++}else{if(ot!=="."){if(ot==="e"||ot==="E"){var bt=n.substring(i);try{V=Et.parseInt(bt)}catch(Cn){throw Cn instanceof Error?new Error("Invalid exponent "+bt+" in string "+n):Cn}break}throw new Error("Unexpected character '"+ot+"' at position "+i+" in string "+n)}R=S}}var Yt=v,Jt=S-R-V;if(Jt===0)Yt=v;else if(Jt>0){var se=Y.TEN.pow(Jt);Yt=v.divide(se)}else if(Jt<0){var _e=Y.TEN.pow(-Jt);Yt=v.multiply(_e)}return l?Yt.negate():Yt},Y.createNaN=function(){return new Y(A.NaN,A.NaN)},Y.copy=function(n){return new Y(n)},Y.magnitude=function(n){var i=Math.abs(n),s=Math.log(i)/Math.log(10),l=Math.trunc(Math.floor(s));return 10*Math.pow(10,l)<=i&&(l+=1),l},Y.stringOfChar=function(n,i){for(var s=new Pt,l=0;l<i;l++)s.append(n);return s.toString()},ht.PI.get=function(){return new Y(3.141592653589793,12246467991473532e-32)},ht.TWO_PI.get=function(){return new Y(6.283185307179586,24492935982947064e-32)},ht.PI_2.get=function(){return new Y(1.5707963267948966,6123233995736766e-32)},ht.E.get=function(){return new Y(2.718281828459045,14456468917292502e-32)},ht.NaN.get=function(){return new Y(A.NaN,A.NaN)},ht.EPS.get=function(){return 123259516440783e-46},ht.SPLIT.get=function(){return 134217729},ht.MAX_PRINT_DIGITS.get=function(){return 32},ht.TEN.get=function(){return Y.valueOf(10)},ht.ONE.get=function(){return Y.valueOf(1)},ht.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},ht.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Y,ht);var Mt=function(){},zt={DP_SAFE_EPSILON:{configurable:!0}};Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.orientationIndex=function(n,i,s){var l=Mt.orientationIndexFilter(n,i,s);if(l<=1)return l;var h=Y.valueOf(i.x).selfAdd(-n.x),v=Y.valueOf(i.y).selfAdd(-n.y),S=Y.valueOf(s.x).selfAdd(-i.x),R=Y.valueOf(s.y).selfAdd(-i.y);return h.selfMultiply(R).selfSubtract(v.selfMultiply(S)).signum()},Mt.signOfDet2x2=function(n,i,s,l){return n.multiply(l).selfSubtract(i.multiply(s)).signum()},Mt.intersection=function(n,i,s,l){var h=Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Y.valueOf(i.x).selfSubtract(n.x)),v=Y.valueOf(l.x).selfSubtract(s.x).selfMultiply(Y.valueOf(i.y).selfSubtract(n.y)),S=h.subtract(v),R=Y.valueOf(l.x).selfSubtract(s.x).selfMultiply(Y.valueOf(n.y).selfSubtract(s.y)),V=Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Y.valueOf(n.x).selfSubtract(s.x)),ot=R.subtract(V).selfDivide(S).doubleValue(),St=Y.valueOf(n.x).selfAdd(Y.valueOf(i.x).selfSubtract(n.x).selfMultiply(ot)).doubleValue(),bt=Y.valueOf(i.x).selfSubtract(n.x).selfMultiply(Y.valueOf(n.y).selfSubtract(s.y)),Yt=Y.valueOf(i.y).selfSubtract(n.y).selfMultiply(Y.valueOf(n.x).selfSubtract(s.x)),Jt=bt.subtract(Yt).selfDivide(S).doubleValue(),se=Y.valueOf(s.y).selfAdd(Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Jt)).doubleValue();return new D(St,se)},Mt.orientationIndexFilter=function(n,i,s){var l=null,h=(n.x-s.x)*(i.y-s.y),v=(n.y-s.y)*(i.x-s.x),S=h-v;if(h>0){if(v<=0)return Mt.signum(S);l=h+v}else{if(!(h<0)||v>=0)return Mt.signum(S);l=-h-v}var R=Mt.DP_SAFE_EPSILON*l;return S>=R||-S>=R?Mt.signum(S):2},Mt.signum=function(n){return n>0?1:n<0?-1:0},zt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Mt,zt);var At=function(){},$t={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};$t.X.get=function(){return 0},$t.Y.get=function(){return 1},$t.Z.get=function(){return 2},$t.M.get=function(){return 3},At.prototype.setOrdinate=function(n,i,s){},At.prototype.size=function(){},At.prototype.getOrdinate=function(n,i){},At.prototype.getCoordinate=function(){},At.prototype.getCoordinateCopy=function(n){},At.prototype.getDimension=function(){},At.prototype.getX=function(n){},At.prototype.clone=function(){},At.prototype.expandEnvelope=function(n){},At.prototype.copy=function(){},At.prototype.getY=function(n){},At.prototype.toCoordinateArray=function(){},At.prototype.interfaces_=function(){return[$]},At.prototype.getClass=function(){return At},Object.defineProperties(At,$t);var ue=function(){},le=function(n){function i(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ue),Qt=function(){};Qt.arraycopy=function(n,i,s,l,h){for(var v=0,S=i;S<i+h;S++)s[l+v]=n[S],v++},Qt.getProperty=function(n){return{"line.separator":\`
107
107
  \`}[n]};var me=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1];this.x=s,this.y=l,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var h=arguments[0],v=arguments[1];this.x=h.y*v.w-v.y*h.w,this.y=v.x*h.w-h.x*v.w,this.w=h.x*v.y-v.x*h.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var S=arguments[0],R=arguments[1];this.x=S.y-R.y,this.y=R.x-S.x,this.w=S.x*R.y-R.x*S.y}}else if(arguments.length===3){var V=arguments[0],ot=arguments[1],St=arguments[2];this.x=V,this.y=ot,this.w=St}else if(arguments.length===4){var bt=arguments[0],Yt=arguments[1],Jt=arguments[2],se=arguments[3],_e=bt.y-Yt.y,Cn=Yt.x-bt.x,Xn=bt.x*Yt.y-Yt.x*bt.y,ui=Jt.y-se.y,rs=se.x-Jt.x,Fs=Jt.x*se.y-se.x*Jt.y;this.x=Cn*Fs-rs*Xn,this.y=ui*Xn-_e*Fs,this.w=_e*rs-ui*Cn}};me.prototype.getY=function(){var n=this.y/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new le;return n},me.prototype.getX=function(){var n=this.x/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new le;return n},me.prototype.getCoordinate=function(){var n=new D;return n.x=this.getX(),n.y=this.getY(),n},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.intersection=function(n,i,s,l){var h=n.y-i.y,v=i.x-n.x,S=n.x*i.y-i.x*n.y,R=s.y-l.y,V=l.x-s.x,ot=s.x*l.y-l.x*s.y,St=h*V-R*v,bt=(v*ot-V*S)/St,Yt=(R*S-h*ot)/St;if(A.isNaN(bt)||A.isInfinite(bt)||A.isNaN(Yt)||A.isInfinite(Yt))throw new le;return new D(bt,Yt)};var Xt=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof D){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.init(l.x,h.x,l.y,h.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],R=arguments[2],V=arguments[3];this.init(v,S,R,V)}},Ee={serialVersionUID:{configurable:!0}};Xt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Xt.prototype.equals=function(n){if(!(n instanceof Xt))return!1;var i=n;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},Xt.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new Xt;var i=this._minx>n._minx?this._minx:n._minx,s=this._miny>n._miny?this._miny:n._miny,l=this._maxx<n._maxx?this._maxx:n._maxx,h=this._maxy<n._maxy?this._maxy:n._maxy;return new Xt(i,l,s,h)},Xt.prototype.isNull=function(){return this._maxx<this._minx},Xt.prototype.getMaxX=function(){return this._maxx},Xt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];return this.covers(n.x,n.y)}if(arguments[0]instanceof Xt){var i=arguments[0];return!this.isNull()&&!i.isNull()&&i.getMinX()>=this._minx&&i.getMaxX()<=this._maxx&&i.getMinY()>=this._miny&&i.getMaxY()<=this._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&s>=this._minx&&s<=this._maxx&&l>=this._miny&&l<=this._maxy}},Xt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Xt){var n=arguments[0];return!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny)}if(arguments[0]instanceof D){var i=arguments[0];return this.intersects(i.x,i.y)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&!(s>this._maxx||s<this._minx||l>this._maxy||l<this._miny)}},Xt.prototype.getMinY=function(){return this._miny},Xt.prototype.getMinX=function(){return this._minx},Xt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];this.expandToInclude(n.x,n.y)}else if(arguments[0]instanceof Xt){var i=arguments[0];if(i.isNull())return null;this.isNull()?(this._minx=i.getMinX(),this._maxx=i.getMaxX(),this._miny=i.getMinY(),this._maxy=i.getMaxY()):(i._minx<this._minx&&(this._minx=i._minx),i._maxx>this._maxx&&(this._maxx=i._maxx),i._miny<this._miny&&(this._miny=i._miny),i._maxy>this._maxy&&(this._maxy=i._maxy))}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.isNull()?(this._minx=s,this._maxx=s,this._miny=l,this._maxy=l):(s<this._minx&&(this._minx=s),s>this._maxx&&(this._maxx=s),l<this._miny&&(this._miny=l),l>this._maxy&&(this._maxy=l))}},Xt.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n<i?n:i},Xt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Xt.prototype.compareTo=function(n){var i=n;return this.isNull()?i.isNull()?0:-1:i.isNull()?1:this._minx<i._minx?-1:this._minx>i._minx?1:this._miny<i._miny?-1:this._miny>i._miny?1:this._maxx<i._maxx?-1:this._maxx>i._maxx?1:this._maxy<i._maxy?-1:this._maxy>i._maxy?1:0},Xt.prototype.translate=function(n,i){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+i,this.getMaxY()+i)},Xt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Xt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Xt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Xt.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n>i?n:i},Xt.prototype.expandBy=function(){if(arguments.length===1){var n=arguments[0];this.expandBy(n,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=s,this._maxy+=s,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Xt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Xt){var n=arguments[0];return this.covers(n)}if(arguments[0]instanceof D){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.covers(s,l)}},Xt.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Xt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];this.init(n.x,n.x,n.y,n.y)}else if(arguments[0]instanceof Xt){var i=arguments[0];this._minx=i._minx,this._maxx=i._maxx,this._miny=i._miny,this._maxy=i._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.init(s.x,l.x,s.y,l.y)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];h<v?(this._minx=h,this._maxx=v):(this._minx=v,this._maxx=h),S<R?(this._miny=S,this._maxy=R):(this._miny=R,this._maxy=S)}},Xt.prototype.getMaxY=function(){return this._maxy},Xt.prototype.distance=function(n){if(this.intersects(n))return 0;var i=0;this._maxx<n._minx?i=n._minx-this._maxx:this._minx>n._maxx&&(i=this._minx-n._maxx);var s=0;return this._maxy<n._miny?s=n._miny-this._maxy:this._miny>n._maxy&&(s=this._miny-n._maxy),i===0?s:s===0?i:Math.sqrt(i*i+s*s)},Xt.prototype.hashCode=function(){var n=17;return n=37*n+D.hashCode(this._minx),n=37*n+D.hashCode(this._maxx),n=37*n+D.hashCode(this._miny),n=37*n+D.hashCode(this._maxy)},Xt.prototype.interfaces_=function(){return[z,t]},Xt.prototype.getClass=function(){return Xt},Xt.intersects=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];return s.x>=(n.x<i.x?n.x:i.x)&&s.x<=(n.x>i.x?n.x:i.x)&&s.y>=(n.y<i.y?n.y:i.y)&&s.y<=(n.y>i.y?n.y:i.y)}if(arguments.length===4){var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=Math.min(v.x,S.x),V=Math.max(v.x,S.x),ot=Math.min(l.x,h.x),St=Math.max(l.x,h.x);return!(ot>V)&&!(St<R)&&(R=Math.min(v.y,S.y),V=Math.max(v.y,S.y),ot=Math.min(l.y,h.y),St=Math.max(l.y,h.y),!(ot>V)&&!(St<R))}},Ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Xt,Ee);var ft={typeStr:/^\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*$/,emptyTypeStr:/^\\s*(\\w+)\\s*EMPTY\\s*$/,spaces:/\\s+/,parenComma:/\\)\\s*,\\s*\\(/,doubleParenComma:/\\)\\s*\\)\\s*,\\s*\\(\\s*\\(/,trimParens:/^\\s*\\(?(.*?)\\)?\\s*$/},He=function(n){this.geometryFactory=n||new Ce};He.prototype.read=function(n){var i,s,l;n=n.replace(/[\\n\\r]/g," ");var h=ft.typeStr.exec(n);if(n.search("EMPTY")!==-1&&((h=ft.emptyTypeStr.exec(n))[2]=void 0),h&&(s=h[1].toLowerCase(),l=h[2],fe[s]&&(i=fe[s].apply(this,[l]))),i===void 0)throw new Error("Could not parse WKT "+n);return i},He.prototype.write=function(n){return this.extractGeometry(n)},He.prototype.extractGeometry=function(n){var i=n.getGeometryType().toLowerCase();if(!te[i])return null;var s=i.toUpperCase();return n.isEmpty()?s+" EMPTY":s+"("+te[i].apply(this,[n])+")"};var te={coordinate:function(n){return n.x+" "+n.y},point:function(n){return te.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.point.apply(this,[n._geometries[s]])+")");return i.join(",")},linestring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(te.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},linearring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(te.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},multilinestring:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.linestring.apply(this,[n._geometries[s]])+")");return i.join(",")},polygon:function(n){var i=[];i.push("("+te.linestring.apply(this,[n._shell])+")");for(var s=0,l=n._holes.length;s<l;++s)i.push("("+te.linestring.apply(this,[n._holes[s]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.polygon.apply(this,[n._geometries[s]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push(this.extractGeometry(n._geometries[s]));return i.join(",")}},fe={point:function(n){if(n===void 0)return this.geometryFactory.createPoint();var i=n.trim().split(ft.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(n){if(n===void 0)return this.geometryFactory.createMultiPoint();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(l)},linestring:function(n){if(n===void 0)return this.geometryFactory.createLineString();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(ft.spaces),l.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(l)},linearring:function(n){if(n===void 0)return this.geometryFactory.createLinearRing();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(ft.spaces),l.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(l)},multilinestring:function(n){if(n===void 0)return this.geometryFactory.createMultiLineString();for(var i,s=n.trim().split(ft.parenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(l)},polygon:function(n){if(n===void 0)return this.geometryFactory.createPolygon();for(var i,s,l,h,v=n.trim().split(ft.parenComma),S=[],R=0,V=v.length;R<V;++R)i=v[R].replace(ft.trimParens,"$1"),s=fe.linestring.apply(this,[i]),l=this.geometryFactory.createLinearRing(s._points),R===0?h=l:S.push(l);return this.geometryFactory.createPolygon(h,S)},multipolygon:function(n){if(n===void 0)return this.geometryFactory.createMultiPolygon();for(var i,s=n.trim().split(ft.doubleParenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(l)},geometrycollection:function(n){if(n===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\\s*([A-Za-z])/g,"|$1")).trim().split("|"),s=[],l=0,h=i.length;l<h;++l)s.push(this.read(i[l]));return this.geometryFactory.createGeometryCollection(s)}},de=function(n){this.parser=new He(n)};de.prototype.write=function(n){return this.parser.write(n)},de.toLineString=function(n,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+i.x+" "+i.y+" )"};var Ue=function(n){function i(s){n.call(this,s),this.name="RuntimeException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),be=function(n){function i(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var s=arguments[0];n.call(this,s)}}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ue),kt=function(){};kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.shouldNeverReachHere=function(){if(arguments.length===0)kt.shouldNeverReachHere(null);else if(arguments.length===1){var n=arguments[0];throw new be("Should never reach here"+(n!==null?": "+n:""))}},kt.isTrue=function(){var n,i;if(arguments.length===1)n=arguments[0],kt.isTrue(n,null);else if(arguments.length===2&&(n=arguments[0],i=arguments[1],!n))throw i===null?new be:new be(i)},kt.equals=function(){var n,i,s;if(arguments.length===2)n=arguments[0],i=arguments[1],kt.equals(n,i,null);else if(arguments.length===3&&(n=arguments[0],i=arguments[1],s=arguments[2],!i.equals(n)))throw new be("Expected "+n+" but encountered "+i+(s!==null?": "+s:""))};var ye=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 D,this._intPt[1]=new D,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Vn={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ye.prototype.getIndexAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intLineIndex[n][i]},ye.prototype.getTopologySummary=function(){var n=new Pt;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},ye.prototype.computeIntersection=function(n,i,s,l){this._inputLines[0][0]=n,this._inputLines[0][1]=i,this._inputLines[1][0]=s,this._inputLines[1][1]=l,this._result=this.computeIntersect(n,i,s,l)},ye.prototype.getIntersectionNum=function(){return this._result},ye.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}},ye.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ye.prototype.setPrecisionModel=function(n){this._precisionModel=n},ye.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var n=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[n][0])&&!this._intPt[i].equals2D(this._inputLines[n][1]))return!0;return!1}},ye.prototype.getIntersection=function(n){return this._intPt[n]},ye.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ye.prototype.hasIntersection=function(){return this._result!==ye.NO_INTERSECTION},ye.prototype.getEdgeDistance=function(n,i){return ye.computeEdgeDistance(this._intPt[i],this._inputLines[n][0],this._inputLines[n][1])},ye.prototype.isCollinear=function(){return this._result===ye.COLLINEAR_INTERSECTION},ye.prototype.toString=function(){return de.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+de.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ye.prototype.getEndpoint=function(n,i){return this._inputLines[n][i]},ye.prototype.isIntersection=function(n){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(n))return!0;return!1},ye.prototype.getIntersectionAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][i]]},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.computeEdgeDistance=function(n,i,s){var l=Math.abs(s.x-i.x),h=Math.abs(s.y-i.y),v=-1;if(n.equals(i))v=0;else if(n.equals(s))v=l>h?l:h;else{var S=Math.abs(n.x-i.x),R=Math.abs(n.y-i.y);(v=l>h?S:R)!==0||n.equals(i)||(v=Math.max(S,R))}return kt.isTrue(!(v===0&&!n.equals(i)),"Bad distance calculation"),v},ye.nonRobustComputeEdgeDistance=function(n,i,s){var l=n.x-i.x,h=n.y-i.y,v=Math.sqrt(l*l+h*h);return kt.isTrue(!(v===0&&!n.equals(i)),"Invalid distance calculation"),v},Vn.DONT_INTERSECT.get=function(){return 0},Vn.DO_INTERSECT.get=function(){return 1},Vn.COLLINEAR.get=function(){return 2},Vn.NO_INTERSECTION.get=function(){return 0},Vn.POINT_INTERSECTION.get=function(){return 1},Vn.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ye,Vn);var $n=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(s){var l=new Xt(this._inputLines[0][0],this._inputLines[0][1]),h=new Xt(this._inputLines[1][0],this._inputLines[1][1]);return l.contains(s)&&h.contains(s)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return n.prototype.computeIntersection.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2];if(this._isProper=!1,Xt.intersects(l,h,s)&&rt.orientationIndex(l,h,s)===0&&rt.orientationIndex(h,l,s)===0)return this._isProper=!0,(s.equals(l)||s.equals(h))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(s,l,h,v,S){S.x=this.smallestInAbsValue(s.x,l.x,h.x,v.x),S.y=this.smallestInAbsValue(s.y,l.y,h.y,v.y),s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.safeHCoordinateIntersection=function(s,l,h,v){var S=null;try{S=me.intersection(s,l,h,v)}catch(R){if(!(R instanceof le))throw R;S=i.nearestEndpoint(s,l,h,v)}return S},i.prototype.intersection=function(s,l,h,v){var S=this.intersectionWithNormalization(s,l,h,v);return this.isInSegmentEnvelopes(S)||(S=new D(i.nearestEndpoint(s,l,h,v))),this._precisionModel!==null&&this._precisionModel.makePrecise(S),S},i.prototype.smallestInAbsValue=function(s,l,h,v){var S=s,R=Math.abs(S);return Math.abs(l)<R&&(S=l,R=Math.abs(l)),Math.abs(h)<R&&(S=h,R=Math.abs(h)),Math.abs(v)<R&&(S=v),S},i.prototype.checkDD=function(s,l,h,v,S){var R=Mt.intersection(s,l,h,v),V=this.isInSegmentEnvelopes(R);Qt.out.println("DD in env = "+V+" --------------------- "+R),S.distance(R)>1e-4&&Qt.out.println("Distance = "+S.distance(R))},i.prototype.intersectionWithNormalization=function(s,l,h,v){var S=new D(s),R=new D(l),V=new D(h),ot=new D(v),St=new D;this.normalizeToEnvCentre(S,R,V,ot,St);var bt=this.safeHCoordinateIntersection(S,R,V,ot);return bt.x+=St.x,bt.y+=St.y,bt},i.prototype.computeCollinearIntersection=function(s,l,h,v){var S=Xt.intersects(s,l,h),R=Xt.intersects(s,l,v),V=Xt.intersects(h,v,s),ot=Xt.intersects(h,v,l);return S&&R?(this._intPt[0]=h,this._intPt[1]=v,n.COLLINEAR_INTERSECTION):V&&ot?(this._intPt[0]=s,this._intPt[1]=l,n.COLLINEAR_INTERSECTION):S&&V?(this._intPt[0]=h,this._intPt[1]=s,!h.equals(s)||R||ot?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):S&&ot?(this._intPt[0]=h,this._intPt[1]=l,!h.equals(l)||R||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&V?(this._intPt[0]=v,this._intPt[1]=s,!v.equals(s)||S||ot?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&ot?(this._intPt[0]=v,this._intPt[1]=l,!v.equals(l)||S||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(s,l,h,v,S){var R=s.x<l.x?s.x:l.x,V=s.y<l.y?s.y:l.y,ot=s.x>l.x?s.x:l.x,St=s.y>l.y?s.y:l.y,bt=h.x<v.x?h.x:v.x,Yt=h.y<v.y?h.y:v.y,Jt=h.x>v.x?h.x:v.x,se=h.y>v.y?h.y:v.y,_e=((R>bt?R:bt)+(ot<Jt?ot:Jt))/2,Cn=((V>Yt?V:Yt)+(St<se?St:se))/2;S.x=_e,S.y=Cn,s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.computeIntersect=function(s,l,h,v){if(this._isProper=!1,!Xt.intersects(s,l,h,v))return n.NO_INTERSECTION;var S=rt.orientationIndex(s,l,h),R=rt.orientationIndex(s,l,v);if(S>0&&R>0||S<0&&R<0)return n.NO_INTERSECTION;var V=rt.orientationIndex(h,v,s),ot=rt.orientationIndex(h,v,l);return V>0&&ot>0||V<0&&ot<0?n.NO_INTERSECTION:S===0&&R===0&&V===0&&ot===0?this.computeCollinearIntersection(s,l,h,v):(S===0||R===0||V===0||ot===0?(this._isProper=!1,s.equals2D(h)||s.equals2D(v)?this._intPt[0]=s:l.equals2D(h)||l.equals2D(v)?this._intPt[0]=l:S===0?this._intPt[0]=new D(h):R===0?this._intPt[0]=new D(v):V===0?this._intPt[0]=new D(s):ot===0&&(this._intPt[0]=new D(l))):(this._isProper=!0,this._intPt[0]=this.intersection(s,l,h,v)),n.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(s,l,h,v){var S=s,R=rt.distancePointLine(s,h,v),V=rt.distancePointLine(l,h,v);return V<R&&(R=V,S=l),(V=rt.distancePointLine(h,s,l))<R&&(R=V,S=h),(V=rt.distancePointLine(v,s,l))<R&&(R=V,S=v),S},i}(ye),j=function(){};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=s.x-i.x,S=s.y-i.y;return j.signOfDet2x2(l,h,v,S)},j.signOfDet2x2=function(n,i,s,l){var h=null,v=null,S=null;if(h=1,n===0||l===0)return i===0||s===0?0:i>0?s>0?-h:h:s>0?h:-h;if(i===0||s===0)return l>0?n>0?h:-h:n>0?-h:h;if(i>0?l>0?i<=l||(h=-h,v=n,n=s,s=v,v=i,i=l,l=v):i<=-l?(h=-h,s=-s,l=-l):(v=n,n=-s,s=v,v=i,i=-l,l=v):l>0?-i<=l?(h=-h,n=-n,i=-i):(v=-n,n=s,s=v,v=-i,i=l,l=v):i>=l?(n=-n,i=-i,s=-s,l=-l):(h=-h,v=-n,n=-s,s=v,v=-i,i=-l,l=v),n>0){if(!(s>0)||!(n<=s))return h}else{if(s>0||!(n>=s))return-h;h=-h,n=-n,s=-s}for(;;){if(S=Math.floor(s/n),s-=S*n,(l-=S*i)<0)return-h;if(l>i)return h;if(n>s+s){if(i<l+l)return h}else{if(i>l+l)return-h;s=n-s,l=i-l,h=-h}if(l===0)return s===0?0:-h;if(s===0||(S=Math.floor(n/s),n-=S*s,(i-=S*l)<0))return h;if(i>l)return-h;if(s>n+n){if(l<i+i)return-h}else{if(l>i+i)return h;n=s-n,i=l-i,h=-h}if(i===0)return n===0?0:h;if(n===0)return-h}};var H=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var n=arguments[0];this._p=n};H.prototype.countSegment=function(n,i){if(n.x<this._p.x&&i.x<this._p.x)return null;if(this._p.x===i.x&&this._p.y===i.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&i.y===this._p.y){var s=n.x,l=i.x;return s>l&&(s=i.x,l=n.x),this._p.x>=s&&this._p.x<=l&&(this._isPointOnSegment=!0),null}if(n.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&n.y<=this._p.y){var h=n.x-this._p.x,v=n.y-this._p.y,S=i.x-this._p.x,R=i.y-this._p.y,V=j.signOfDet2x2(h,v,S,R);if(V===0)return this._isPointOnSegment=!0,null;R<v&&(V=-V),V>0&&this._crossingCount++}},H.prototype.isPointInPolygon=function(){return this.getLocation()!==Z.EXTERIOR},H.prototype.getLocation=function(){return this._isPointOnSegment?Z.BOUNDARY:this._crossingCount%2==1?Z.INTERIOR:Z.EXTERIOR},H.prototype.isOnSegment=function(){return this._isPointOnSegment},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.locatePointInRing=function(){if(arguments[0]instanceof D&&et(arguments[1],At)){for(var n=arguments[0],i=arguments[1],s=new H(n),l=new D,h=new D,v=1;v<i.size();v++)if(i.getCoordinate(v,l),i.getCoordinate(v-1,h),s.countSegment(l,h),s.isOnSegment())return s.getLocation();return s.getLocation()}if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var S=arguments[0],R=arguments[1],V=new H(S),ot=1;ot<R.length;ot++){var St=R[ot],bt=R[ot-1];if(V.countSegment(St,bt),V.isOnSegment())return V.getLocation()}return V.getLocation()}};var rt=function(){},Wt={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.orientationIndex=function(n,i,s){return Mt.orientationIndex(n,i,s)},rt.signedArea=function(){if(arguments[0]instanceof Array){var n=arguments[0];if(n.length<3)return 0;for(var i=0,s=n[0].x,l=1;l<n.length-1;l++){var h=n[l].x-s,v=n[l+1].y;i+=h*(n[l-1].y-v)}return i/2}if(et(arguments[0],At)){var S=arguments[0],R=S.size();if(R<3)return 0;var V=new D,ot=new D,St=new D;S.getCoordinate(0,ot),S.getCoordinate(1,St);var bt=ot.x;St.x-=bt;for(var Yt=0,Jt=1;Jt<R-1;Jt++)V.y=ot.y,ot.x=St.x,ot.y=St.y,S.getCoordinate(Jt+1,St),St.x-=bt,Yt+=ot.x*(V.y-St.y);return Yt/2}},rt.distanceLineLine=function(n,i,s,l){if(n.equals(i))return rt.distancePointLine(n,s,l);if(s.equals(l))return rt.distancePointLine(l,n,i);var h=!1;if(Xt.intersects(n,i,s,l)){var v=(i.x-n.x)*(l.y-s.y)-(i.y-n.y)*(l.x-s.x);if(v===0)h=!0;else{var S=(n.y-s.y)*(l.x-s.x)-(n.x-s.x)*(l.y-s.y),R=((n.y-s.y)*(i.x-n.x)-(n.x-s.x)*(i.y-n.y))/v,V=S/v;(V<0||V>1||R<0||R>1)&&(h=!0)}}else h=!0;return h?vt.min(rt.distancePointLine(n,s,l),rt.distancePointLine(i,s,l),rt.distancePointLine(s,n,i),rt.distancePointLine(l,n,i)):0},rt.isPointInRing=function(n,i){return rt.locatePointInRing(n,i)!==Z.EXTERIOR},rt.computeLength=function(n){var i=n.size();if(i<=1)return 0;var s=0,l=new D;n.getCoordinate(0,l);for(var h=l.x,v=l.y,S=1;S<i;S++){n.getCoordinate(S,l);var R=l.x,V=l.y,ot=R-h,St=V-v;s+=Math.sqrt(ot*ot+St*St),h=R,v=V}return s},rt.isCCW=function(n){var i=n.length-1;if(i<3)throw new N("Ring has fewer than 4 points, so orientation cannot be determined");for(var s=n[0],l=0,h=1;h<=i;h++){var v=n[h];v.y>s.y&&(s=v,l=h)}var S=l;do(S-=1)<0&&(S=i);while(n[S].equals2D(s)&&S!==l);var R=l;do R=(R+1)%i;while(n[R].equals2D(s)&&R!==l);var V=n[S],ot=n[R];if(V.equals2D(s)||ot.equals2D(s)||V.equals2D(ot))return!1;var St=rt.computeOrientation(V,s,ot),bt=!1;return bt=St===0?V.x>ot.x:St>0,bt},rt.locatePointInRing=function(n,i){return H.locatePointInRing(n,i)},rt.distancePointLinePerpendicular=function(n,i,s){var l=(s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y),h=((i.y-n.y)*(s.x-i.x)-(i.x-n.x)*(s.y-i.y))/l;return Math.abs(h)*Math.sqrt(l)},rt.computeOrientation=function(n,i,s){return rt.orientationIndex(n,i,s)},rt.distancePointLine=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(i.length===0)throw new N("Line array must contain at least one vertex");for(var s=n.distance(i[0]),l=0;l<i.length-1;l++){var h=rt.distancePointLine(n,i[l],i[l+1]);h<s&&(s=h)}return s}if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];if(S.x===R.x&&S.y===R.y)return v.distance(S);var V=(R.x-S.x)*(R.x-S.x)+(R.y-S.y)*(R.y-S.y),ot=((v.x-S.x)*(R.x-S.x)+(v.y-S.y)*(R.y-S.y))/V;if(ot<=0)return v.distance(S);if(ot>=1)return v.distance(R);var St=((S.y-v.y)*(R.x-S.x)-(S.x-v.x)*(R.y-S.y))/V;return Math.abs(St)*Math.sqrt(V)}},rt.isOnLine=function(n,i){for(var s=new $n,l=1;l<i.length;l++){var h=i[l-1],v=i[l];if(s.computeIntersection(n,h,v),s.hasIntersection())return!0}return!1},Wt.CLOCKWISE.get=function(){return-1},Wt.RIGHT.get=function(){return rt.CLOCKWISE},Wt.COUNTERCLOCKWISE.get=function(){return 1},Wt.LEFT.get=function(){return rt.COUNTERCLOCKWISE},Wt.COLLINEAR.get=function(){return 0},Wt.STRAIGHT.get=function(){return rt.COLLINEAR},Object.defineProperties(rt,Wt);var Gt=function(){};Gt.prototype.filter=function(n){},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var Ct=function(){var n=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=n,this._SRID=n.getSRID()},he={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION},Ct.prototype.getFactory=function(){return this._factory},Ct.prototype.getGeometryN=function(n){return this},Ct.prototype.getArea=function(){return 0},Ct.prototype.isRectangle=function(){return!1},Ct.prototype.equals=function(){if(arguments[0]instanceof Ct){var n=arguments[0];return n!==null&&this.equalsTopo(n)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof Ct))return!1;var s=i;return this.equalsExact(s)}},Ct.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)},Ct.prototype.geometryChanged=function(){this.apply(Ct.geometryChangedFilter)},Ct.prototype.geometryChangedAction=function(){this._envelope=null},Ct.prototype.equalsNorm=function(n){return n!==null&&this.norm().equalsExact(n.norm())},Ct.prototype.getLength=function(){return 0},Ct.prototype.getNumGeometries=function(){return 1},Ct.prototype.compareTo=function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(n)}if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(s,l)}},Ct.prototype.getUserData=function(){return this._userData},Ct.prototype.getSRID=function(){return this._SRID},Ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Ct.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION)throw new N("This method does not support GeometryCollection arguments")},Ct.prototype.equal=function(n,i,s){return s===0?n.equals(i):n.distance(i)<=s},Ct.prototype.norm=function(){var n=this.copy();return n.normalize(),n},Ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Ct.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Xt(this._envelope)},Ct.prototype.setSRID=function(n){this._SRID=n},Ct.prototype.setUserData=function(n){this._userData=n},Ct.prototype.compare=function(n,i){for(var s=n.iterator(),l=i.iterator();s.hasNext()&&l.hasNext();){var h=s.next(),v=l.next(),S=h.compareTo(v);if(S!==0)return S}return s.hasNext()?1:l.hasNext()?-1:0},Ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===Ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Ct.SORTINDEX_MULTIPOLYGON},Ct.prototype.interfaces_=function(){return[$,z,t]},Ct.prototype.getClass=function(){return Ct},Ct.hasNonEmptyElements=function(n){for(var i=0;i<n.length;i++)if(!n[i].isEmpty())return!0;return!1},Ct.hasNullElements=function(n){for(var i=0;i<n.length;i++)if(n[i]===null)return!0;return!1},he.serialVersionUID.get=function(){return 8763622679187377e3},he.SORTINDEX_POINT.get=function(){return 0},he.SORTINDEX_MULTIPOINT.get=function(){return 1},he.SORTINDEX_LINESTRING.get=function(){return 2},he.SORTINDEX_LINEARRING.get=function(){return 3},he.SORTINDEX_MULTILINESTRING.get=function(){return 4},he.SORTINDEX_POLYGON.get=function(){return 5},he.SORTINDEX_MULTIPOLYGON.get=function(){return 6},he.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},he.geometryChangedFilter.get=function(){return Kt},Object.defineProperties(Ct,he);var Kt=function(){};Kt.interfaces_=function(){return[Gt]},Kt.filter=function(n){n.geometryChangedAction()};var tt=function(){};tt.prototype.filter=function(n){},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt};var C=function(){},L={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};C.prototype.isInBoundary=function(n){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},L.Mod2BoundaryNodeRule.get=function(){return F},L.EndPointBoundaryNodeRule.get=function(){return J},L.MultiValentEndPointBoundaryNodeRule.get=function(){return X},L.MonoValentEndPointBoundaryNodeRule.get=function(){return pt},L.MOD2_BOUNDARY_RULE.get=function(){return new F},L.ENDPOINT_BOUNDARY_RULE.get=function(){return new J},L.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new X},L.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new pt},L.OGC_SFS_BOUNDARY_RULE.get=function(){return C.MOD2_BOUNDARY_RULE},Object.defineProperties(C,L);var F=function(){};F.prototype.isInBoundary=function(n){return n%2==1},F.prototype.interfaces_=function(){return[C]},F.prototype.getClass=function(){return F};var J=function(){};J.prototype.isInBoundary=function(n){return n>0},J.prototype.interfaces_=function(){return[C]},J.prototype.getClass=function(){return J};var X=function(){};X.prototype.isInBoundary=function(n){return n>1},X.prototype.interfaces_=function(){return[C]},X.prototype.getClass=function(){return X};var pt=function(){};pt.prototype.isInBoundary=function(n){return n===1},pt.prototype.interfaces_=function(){return[C]},pt.prototype.getClass=function(){return pt};var st=function(){};st.prototype.add=function(){},st.prototype.addAll=function(){},st.prototype.isEmpty=function(){},st.prototype.iterator=function(){},st.prototype.size=function(){},st.prototype.toArray=function(){},st.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var k=function(){};k.prototype.hasNext=function(){},k.prototype.next=function(){},k.prototype.remove=function(){};var ut=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(st);(o.prototype=new Error).name="NoSuchElementException";var nt=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[n,st]},i.prototype.add=function(s){return arguments.length===1?this.array_.push(s):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.set=function(s,l){var h=this.array_[s];return this.array_[s]=l,h},i.prototype.iterator=function(){return new lt(this)},i.prototype.get=function(s){if(s<0||s>=this.size())throw new e;return this.array_[s]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.remove=function(s){for(var l=!1,h=0,v=this.array_.length;h<v;h++)if(this.array_[h]===s){this.array_.splice(h,1),l=!0;break}return l},i}(ut),lt=function(n){function i(s){n.call(this),this.arrayList_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new o;return this.arrayList_.get(this.position_++)},i.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},i.prototype.set=function(s){return this.arrayList_.set(this.position_-1,s)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(k),dt=function(n){function i(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var l=arguments[0];this.ensureCapacity(l.length),this.add(l,!0)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.ensureCapacity(h.length),this.add(h,v)}}}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={coordArrayType:{configurable:!0}};return s.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(l){return this.get(l)},i.prototype.addAll=function(){if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v=!1,S=l.iterator();S.hasNext();)this.add(S.next(),h),v=!0;return v}return n.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var l=n.prototype.clone.call(this),h=0;h<this.size();h++)l.add(h,this.get(h).copy());return l},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var l=arguments[0];n.prototype.add.call(this,l)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var h=arguments[0],v=arguments[1];return this.add(h,v,!0),!0}if(arguments[0]instanceof D&&typeof arguments[1]=="boolean"){var S=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(S))return null;n.prototype.add.call(this,S)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var R=arguments[0],V=arguments[1];return this.add(R,V),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var ot=arguments[0],St=arguments[1];if(arguments[2])for(var bt=0;bt<ot.length;bt++)this.add(ot[bt],St);else for(var Yt=ot.length-1;Yt>=0;Yt--)this.add(ot[Yt],St);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var Jt=arguments[0],se=arguments[1];if(!arguments[2]){var _e=this.size();if(_e>0&&(Jt>0&&this.get(Jt-1).equals2D(se)||Jt<_e&&this.get(Jt).equals2D(se)))return null}n.prototype.add.call(this,Jt,se)}}else if(arguments.length===4){var Cn=arguments[0],Xn=arguments[1],ui=arguments[2],rs=arguments[3],Fs=1;ui>rs&&(Fs=-1);for(var Dc=ui;Dc!==rs;Dc+=Fs)this.add(Cn[Dc],Xn);return!0}},i.prototype.closeRing=function(){this.size()>0&&this.add(new D(this.get(0)),!1)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},Object.defineProperties(i,s),i}(nt),at=function(){},Bt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Bt.ForwardComparator.get=function(){return qt},Bt.BidirectionalComparator.get=function(){return we},Bt.coordArrayType.get=function(){return new Array(0).fill(null)},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])},at.ptNotInList=function(n,i){for(var s=0;s<n.length;s++){var l=n[s];if(at.indexOf(l,i)<0)return l}return null},at.scroll=function(n,i){var s=at.indexOf(i,n);if(s<0)return null;var l=new Array(n.length).fill(null);Qt.arraycopy(n,s,l,0,n.length-s),Qt.arraycopy(n,0,l,n.length-s,s),Qt.arraycopy(l,0,n,0,n.length)},at.equals=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(n===i)return!0;if(n===null||i===null||n.length!==i.length)return!1;for(var s=0;s<n.length;s++)if(!n[s].equals(i[s]))return!1;return!0}if(arguments.length===3){var l=arguments[0],h=arguments[1],v=arguments[2];if(l===h)return!0;if(l===null||h===null||l.length!==h.length)return!1;for(var S=0;S<l.length;S++)if(v.compare(l[S],h[S])!==0)return!1;return!0}},at.intersection=function(n,i){for(var s=new dt,l=0;l<n.length;l++)i.intersects(n[l])&&s.add(n[l],!0);return s.toCoordinateArray()},at.hasRepeatedPoints=function(n){for(var i=1;i<n.length;i++)if(n[i-1].equals(n[i]))return!0;return!1},at.removeRepeatedPoints=function(n){return at.hasRepeatedPoints(n)?new dt(n,!1).toCoordinateArray():n},at.reverse=function(n){for(var i=n.length-1,s=Math.trunc(i/2),l=0;l<=s;l++){var h=n[l];n[l]=n[i-l],n[i-l]=h}},at.removeNull=function(n){for(var i=0,s=0;s<n.length;s++)n[s]!==null&&i++;var l=new Array(i).fill(null);if(i===0)return l;for(var h=0,v=0;v<n.length;v++)n[v]!==null&&(l[h++]=n[v]);return l},at.copyDeep=function(){if(arguments.length===1){for(var n=arguments[0],i=new Array(n.length).fill(null),s=0;s<n.length;s++)i[s]=new D(n[s]);return i}if(arguments.length===5)for(var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=arguments[4],V=0;V<R;V++)v[S+V]=new D(l[h+V])},at.isEqualReversed=function(n,i){for(var s=0;s<n.length;s++){var l=n[s],h=i[n.length-s-1];if(l.compareTo(h)!==0)return!1}return!0},at.envelope=function(n){for(var i=new Xt,s=0;s<n.length;s++)i.expandToInclude(n[s]);return i},at.toCoordinateArray=function(n){return n.toArray(at.coordArrayType)},at.atLeastNCoordinatesOrNothing=function(n,i){return i.length>=n?i:[]},at.indexOf=function(n,i){for(var s=0;s<i.length;s++)if(n.equals(i[s]))return s;return-1},at.increasingDirection=function(n){for(var i=0;i<Math.trunc(n.length/2);i++){var s=n.length-1-i,l=n[i].compareTo(n[s]);if(l!==0)return l}return 1},at.compare=function(n,i){for(var s=0;s<n.length&&s<i.length;){var l=n[s].compareTo(i[s]);if(l!==0)return l;s++}return s<i.length?-1:s<n.length?1:0},at.minCoordinate=function(n){for(var i=null,s=0;s<n.length;s++)(i===null||i.compareTo(n[s])>0)&&(i=n[s]);return i},at.extract=function(n,i,s){i=vt.clamp(i,0,n.length);var l=(s=vt.clamp(s,-1,n.length))-i+1;s<0&&(l=0),i>=n.length&&(l=0),s<i&&(l=0);var h=new Array(l).fill(null);if(l===0)return h;for(var v=0,S=i;S<=s;S++)h[v++]=n[S];return h},Object.defineProperties(at,Bt);var qt=function(){};qt.prototype.compare=function(n,i){return at.compare(n,i)},qt.prototype.interfaces_=function(){return[q]},qt.prototype.getClass=function(){return qt};var we=function(){};we.prototype.compare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;var h=at.compare(s,l);return at.isEqualReversed(s,l)?0:h},we.prototype.OLDcompare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;for(var h=at.increasingDirection(s),v=at.increasingDirection(l),S=h>0?0:s.length-1,R=v>0?0:s.length-1,V=0;V<s.length;V++){var ot=s[S].compareTo(l[R]);if(ot!==0)return ot;S+=h,R+=v}return 0},we.prototype.interfaces_=function(){return[q]},we.prototype.getClass=function(){return we};var oe=function(){};oe.prototype.get=function(){},oe.prototype.put=function(){},oe.prototype.size=function(){},oe.prototype.values=function(){},oe.prototype.entrySet=function(){};var Ve=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(oe);(a.prototype=new Error).name="OperationNotSupported",(c.prototype=new st).contains=function(){};var je=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.contains=function(s){for(var l=0,h=this.array_.length;l<h;l++)if(this.array_[l]===s)return!0;return!1},i.prototype.add=function(s){return!this.contains(s)&&(this.array_.push(s),!0)},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.remove=function(s){throw new Error},i.prototype.size=function(){return this.array_.length},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.iterator=function(){return new ur(this)},i}(c),ur=function(n){function i(s){n.call(this),this.hashSet_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new o;return this.hashSet_.array_[this.position_++]},i.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},i.prototype.remove=function(){throw new a},i}(k),Qn=0;(w.prototype=new Ve).get=function(n){for(var i=this.root_;i!==null;){var s=n.compareTo(i.key);if(s<0)i=i.left;else{if(!(s>0))return i.value;i=i.right}}return null},w.prototype.put=function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:Qn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var s,l,h=this.root_;do if(s=h,(l=n.compareTo(h.key))<0)h=h.left;else{if(!(l>0)){var v=h.value;return h.value=i,v}h=h.right}while(h!==null);var S={key:n,left:null,right:null,value:i,parent:s,color:Qn,getValue:function(){return this.value},getKey:function(){return this.key}};return l<0?s.left=S:s.right=S,this.fixAfterInsertion(S),this.size_++,null},w.prototype.fixAfterInsertion=function(n){for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)if(d(n)===y(d(d(n)))){var i=_(d(d(n)));p(i)===1?(g(d(n),Qn),g(i,Qn),g(d(d(n)),1),n=d(d(n))):(n===_(d(n))&&(n=d(n),this.rotateLeft(n)),g(d(n),Qn),g(d(d(n)),1),this.rotateRight(d(d(n))))}else{var s=y(d(d(n)));p(s)===1?(g(d(n),Qn),g(s,Qn),g(d(d(n)),1),n=d(d(n))):(n===y(d(n))&&(n=d(n),this.rotateRight(n)),g(d(n),Qn),g(d(d(n)),1),this.rotateLeft(d(d(n))))}this.root_.color=Qn},w.prototype.values=function(){var n=new nt,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=w.successor(i))!==null;)n.add(i.value);return n},w.prototype.entrySet=function(){var n=new je,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=w.successor(i))!==null;)n.add(i);return n},w.prototype.rotateLeft=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}},w.prototype.rotateRight=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}},w.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},w.successor=function(n){if(n===null)return null;if(n.right!==null){for(var i=n.right;i.left!==null;)i=i.left;return i}for(var s=n.parent,l=n;s!==null&&l===s.right;)l=s,s=s.parent;return s},w.prototype.size=function(){return this.size_};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},x.prototype=new c,(b.prototype=new x).contains=function(n){for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===0)return!0;return!1},b.prototype.add=function(n){if(this.contains(n))return!1;for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===1)return this.array_.splice(i,0,n),!0;return this.array_.push(n),!0},b.prototype.addAll=function(n){for(var i=n.iterator();i.hasNext();)this.add(i.next());return!0},b.prototype.remove=function(n){throw new a},b.prototype.size=function(){return this.array_.length},b.prototype.isEmpty=function(){return this.array_.length===0},b.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n},b.prototype.iterator=function(){return new Rr(this)};var Rr=function(n){this.treeSet_=n,this.position_=0};Rr.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Rr.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Rr.prototype.remove=function(){throw new a};var er=function(){};er.sort=function(){var n,i,s,l,h=arguments[0];if(arguments.length===1)l=function(S,R){return S.compareTo(R)},h.sort(l);else if(arguments.length===2)s=arguments[1],l=function(S,R){return s.compare(S,R)},h.sort(l);else if(arguments.length===3){(i=h.slice(arguments[1],arguments[2])).sort();var v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length));for(h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])}else if(arguments.length===4)for(i=h.slice(arguments[1],arguments[2]),s=arguments[3],l=function(S,R){return s.compare(S,R)},i.sort(l),v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length)),h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])},er.asList=function(n){for(var i=new nt,s=0,l=n.length;s<l;s++)i.add(n[s]);return i};var Me=function(){},nr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};nr.P.get=function(){return 0},nr.L.get=function(){return 1},nr.A.get=function(){return 2},nr.FALSE.get=function(){return-1},nr.TRUE.get=function(){return-2},nr.DONTCARE.get=function(){return-3},nr.SYM_FALSE.get=function(){return"F"},nr.SYM_TRUE.get=function(){return"T"},nr.SYM_DONTCARE.get=function(){return"*"},nr.SYM_P.get=function(){return"0"},nr.SYM_L.get=function(){return"1"},nr.SYM_A.get=function(){return"2"},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toDimensionSymbol=function(n){switch(n){case Me.FALSE:return Me.SYM_FALSE;case Me.TRUE:return Me.SYM_TRUE;case Me.DONTCARE:return Me.SYM_DONTCARE;case Me.P:return Me.SYM_P;case Me.L:return Me.SYM_L;case Me.A:return Me.SYM_A}throw new N("Unknown dimension value: "+n)},Me.toDimensionValue=function(n){switch(yt.toUpperCase(n)){case Me.SYM_FALSE:return Me.FALSE;case Me.SYM_TRUE:return Me.TRUE;case Me.SYM_DONTCARE:return Me.DONTCARE;case Me.SYM_P:return Me.P;case Me.SYM_L:return Me.L;case Me.SYM_A:return Me.A}throw new N("Unknown dimension symbol: "+n)},Object.defineProperties(Me,nr);var hr=function(){};hr.prototype.filter=function(n){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var lr=function(){};lr.prototype.filter=function(n,i){},lr.prototype.isDone=function(){},lr.prototype.isGeometryChanged=function(){},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var Zn=function(n){function i(l,h){if(n.call(this,h),this._geometries=l||[],n.hasNullElements(this._geometries))throw new N("geometries must not contain null elements")}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var l=new Xt,h=0;h<this._geometries.length;h++)l.expandToInclude(this._geometries[h].getEnvelopeInternal());return l},i.prototype.getGeometryN=function(l){return this._geometries[l]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getCoordinates(),R=0;R<S.length;R++)l[++h]=S[R];return l},i.prototype.getArea=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getArea();return l},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._geometries.length!==v._geometries.length)return!1;for(var S=0;S<this._geometries.length;S++)if(!this._geometries[S].equalsExact(v._geometries[S],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<this._geometries.length;l++)this._geometries[l].normalize();er.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var l=Me.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getBoundaryDimension());return l},i.prototype.getDimension=function(){for(var l=Me.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getDimension());return l},i.prototype.getLength=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getNumPoints();return l},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createGeometryCollection(h)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=new b(er.asList(this._geometries)),v=new b(er.asList(l._geometries));return this.compare(h,v)}if(arguments.length===2){for(var S=arguments[0],R=arguments[1],V=S,ot=this.getNumGeometries(),St=V.getNumGeometries(),bt=0;bt<ot&&bt<St;){var Yt=this.getGeometryN(bt),Jt=V.getGeometryN(bt),se=Yt.compareToSameClass(Jt,R);if(se!==0)return se;bt++}return bt<ot?1:bt<St?-1:0}},i.prototype.apply=function(){if(et(arguments[0],tt))for(var l=arguments[0],h=0;h<this._geometries.length;h++)this._geometries[h].apply(l);else if(et(arguments[0],lr)){var v=arguments[0];if(this._geometries.length===0)return null;for(var S=0;S<this._geometries.length&&(this._geometries[S].apply(v),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else if(et(arguments[0],hr)){var R=arguments[0];R.filter(this);for(var V=0;V<this._geometries.length;V++)this._geometries[V].apply(R)}else if(et(arguments[0],Gt)){var ot=arguments[0];ot.filter(this);for(var St=0;St<this._geometries.length;St++)this._geometries[St].apply(ot)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),kt.shouldNeverReachHere(),null},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._geometries=new Array(this._geometries.length).fill(null);for(var h=0;h<this._geometries.length;h++)l._geometries[h]=this._geometries[h].clone();return l},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.isEmpty=function(){for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,s),i}(Ct),K=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Me.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[l-1-v]=this._geometries[v].reverse();return this.getFactory().createMultiLineString(h)},i.prototype.getBoundary=function(){return new xt(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,s),i}(Zn),xt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var n=arguments[0],i=C.MOD2_BOUNDARY_RULE;this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._geom=s,this._geomFact=s.getFactory(),this._bnRule=l}};xt.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(n);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},xt.prototype.getBoundary=function(){return this._geom instanceof jt?this.boundaryLineString(this._geom):this._geom instanceof K?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},xt.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])},xt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},xt.prototype.computeBoundaryCoordinates=function(n){var i=new nt;this._endpointMap=new w;for(var s=0;s<n.getNumGeometries();s++){var l=n.getGeometryN(s);l.getNumPoints()!==0&&(this.addEndpoint(l.getCoordinateN(0)),this.addEndpoint(l.getCoordinateN(l.getNumPoints()-1)))}for(var h=this._endpointMap.entrySet().iterator();h.hasNext();){var v=h.next(),S=v.getValue().count;this._bnRule.isInBoundary(S)&&i.add(v.getKey())}return at.toCoordinateArray(i)},xt.prototype.addEndpoint=function(n){var i=this._endpointMap.get(n);i===null&&(i=new Lt,this._endpointMap.put(n,i)),i.count++},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.getBoundary=function(){if(arguments.length===1){var n=arguments[0];return new xt(n).getBoundary()}if(arguments.length===2){var i=arguments[0],s=arguments[1];return new xt(i,s).getBoundary()}};var Lt=function(){this.count=null};Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt};var wt=function(){},Ot={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.chars=function(n,i){for(var s=new Array(i).fill(null),l=0;l<i;l++)s[l]=n;return String(s)},wt.getStackTrace=function(){if(arguments.length===1){var n=arguments[0],i=new function(){},s=new function(){}(i);return n.printStackTrace(s),i.toString()}if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v="",S=new function(){}(new function(){}(wt.getStackTrace(l))),R=0;R<h;R++)try{v+=S.readLine()+wt.NEWLINE}catch(V){if(!(V instanceof P))throw V;kt.shouldNeverReachHere()}return v}},wt.split=function(n,i){for(var s=i.length,l=new nt,h=""+n,v=h.indexOf(i);v>=0;){var S=h.substring(0,v);l.add(S),v=(h=h.substring(v+s)).indexOf(i)}h.length>0&&l.add(h);for(var R=new Array(l.size()).fill(null),V=0;V<R.length;V++)R[V]=l.get(V);return R},wt.toString=function(){if(arguments.length===1){var n=arguments[0];return wt.SIMPLE_ORDINATE_FORMAT.format(n)}},wt.spaces=function(n){return wt.chars(" ",n)},Ot.NEWLINE.get=function(){return Qt.getProperty("line.separator")},Ot.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(wt,Ot);var Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.copyCoord=function(n,i,s,l){for(var h=Math.min(n.getDimension(),s.getDimension()),v=0;v<h;v++)s.setOrdinate(l,v,n.getOrdinate(i,v))},Zt.isRing=function(n){var i=n.size();return i===0||!(i<=3)&&n.getOrdinate(0,At.X)===n.getOrdinate(i-1,At.X)&&n.getOrdinate(0,At.Y)===n.getOrdinate(i-1,At.Y)},Zt.isEqual=function(n,i){var s=n.size();if(s!==i.size())return!1;for(var l=Math.min(n.getDimension(),i.getDimension()),h=0;h<s;h++)for(var v=0;v<l;v++){var S=n.getOrdinate(h,v),R=i.getOrdinate(h,v);if(n.getOrdinate(h,v)!==i.getOrdinate(h,v)&&(!A.isNaN(S)||!A.isNaN(R)))return!1}return!0},Zt.extend=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();if(Zt.copy(i,0,l,0,h),h>0)for(var v=h;v<s;v++)Zt.copy(i,h-1,l,v,1);return l},Zt.reverse=function(n){for(var i=n.size()-1,s=Math.trunc(i/2),l=0;l<=s;l++)Zt.swap(n,l,i-l)},Zt.swap=function(n,i,s){if(i===s)return null;for(var l=0;l<n.getDimension();l++){var h=n.getOrdinate(i,l);n.setOrdinate(i,l,n.getOrdinate(s,l)),n.setOrdinate(s,l,h)}},Zt.copy=function(n,i,s,l,h){for(var v=0;v<h;v++)Zt.copyCoord(n,i+v,s,l+v)},Zt.toString=function(){if(arguments.length===1){var n=arguments[0],i=n.size();if(i===0)return"()";var s=n.getDimension(),l=new Pt;l.append("(");for(var h=0;h<i;h++){h>0&&l.append(" ");for(var v=0;v<s;v++)v>0&&l.append(","),l.append(wt.toString(n.getOrdinate(h,v)))}return l.append(")"),l.toString()}},Zt.ensureValidRing=function(n,i){var s=i.size();return s===0?i:s<=3?Zt.createClosedRing(n,i,4):i.getOrdinate(0,At.X)===i.getOrdinate(s-1,At.X)&&i.getOrdinate(0,At.Y)===i.getOrdinate(s-1,At.Y)?i:Zt.createClosedRing(n,i,s+1)},Zt.createClosedRing=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();Zt.copy(i,0,l,0,h);for(var v=h;v<s;v++)Zt.copy(i,0,l,v,1);return l};var jt=function(n){function i(l,h){n.call(this,h),this._points=null,this.init(l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Xt:this._points.expandEnvelope(new Xt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._points.size()!==v._points.size())return!1;for(var S=0;S<this._points.size();S++)if(!this.equal(this._points.getCoordinate(S),v._points.getCoordinate(S),h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<Math.trunc(this._points.size()/2);l++){var h=this._points.size()-1-l;if(!this._points.getCoordinate(l).equals(this._points.getCoordinate(h)))return this._points.getCoordinate(l).compareTo(this._points.getCoordinate(h))>0&&Zt.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Me.FALSE:0},i.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},i.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},i.prototype.getDimension=function(){return 1},i.prototype.getLength=function(){return rt.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var l=this._points.copy();return Zt.reverse(l),this.getFactory().createLineString(l)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var l=arguments[0],h=0,v=0;h<this._points.size()&&v<l._points.size();){var S=this._points.getCoordinate(h).compareTo(l._points.getCoordinate(v));if(S!==0)return S;h++,v++}return h<this._points.size()?1:v<l._points.size()?-1:0}if(arguments.length===2){var R=arguments[0];return arguments[1].compare(this._points,R._points)}},i.prototype.apply=function(){if(et(arguments[0],tt))for(var l=arguments[0],h=0;h<this._points.size();h++)l.filter(this._points.getCoordinate(h));else if(et(arguments[0],lr)){var v=arguments[0];if(this._points.size()===0)return null;for(var S=0;S<this._points.size()&&(v.filter(this._points,S),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else et(arguments[0],hr)?arguments[0].filter(this):et(arguments[0],Gt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new xt(this).getBoundary()},i.prototype.isEquivalentClass=function(l){return l instanceof i},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._points=this._points.clone(),l},i.prototype.getCoordinateN=function(l){return this._points.getCoordinate(l)},i.prototype.getGeometryType=function(){return"LineString"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._points},i.prototype.isEmpty=function(){return this._points.size()===0},i.prototype.init=function(l){if(l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),l.size()===1)throw new N("Invalid number of points in LineString (found "+l.size()+" - must be 0 or >= 2)");this._points=l},i.prototype.isCoordinate=function(l){for(var h=0;h<this._points.size();h++)if(this._points.getCoordinate(h).equals(l))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(l){return this.getFactory().createPoint(this._points.getCoordinate(l))},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,s),i}(Ct),Te=function(){};Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var ge=function(n){function i(l,h){n.call(this,h),this._coordinates=l||null,this.init(this._coordinates)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Xt;var l=new Xt;return l.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),l},i.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&(!(!this.isEmpty()||!l.isEmpty())||this.isEmpty()===l.isEmpty()&&this.equal(l.getCoordinate(),this.getCoordinate(),h))}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){},i.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getNumPoints=function(){return this.isEmpty()?0:1},i.prototype.reverse=function(){return this.copy()},i.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0];return this.getCoordinate().compareTo(l.getCoordinate())}if(arguments.length===2){var h=arguments[0];return arguments[1].compare(this._coordinates,h._coordinates)}},i.prototype.apply=function(){if(et(arguments[0],tt)){var l=arguments[0];if(this.isEmpty())return null;l.filter(this.getCoordinate())}else if(et(arguments[0],lr)){var h=arguments[0];if(this.isEmpty())return null;h.filter(this._coordinates,0),h.isGeometryChanged()&&this.geometryChanged()}else et(arguments[0],hr)?arguments[0].filter(this):et(arguments[0],Gt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._coordinates=this._coordinates.clone(),l},i.prototype.getGeometryType=function(){return"Point"},i.prototype.copy=function(){return new i(this._coordinates.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._coordinates},i.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},i.prototype.isEmpty=function(){return this._coordinates.size()===0},i.prototype.init=function(l){l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),kt.isTrue(l.size()<=1),this._coordinates=l},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,s),i}(Ct),Ne=function(){};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var pe=function(n){function i(l,h,v){if(n.call(this,v),this._shell=null,this._holes=null,l===null&&(l=this.getFactory().createLinearRing()),h===null&&(h=[]),n.hasNullElements(h))throw new N("holes must not contain null elements");if(l.isEmpty()&&n.hasNonEmptyElements(h))throw new N("shell is empty but holes are not");this._shell=l,this._holes=h}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=this._shell.getCoordinates(),S=0;S<v.length;S++)l[++h]=v[S];for(var R=0;R<this._holes.length;R++)for(var V=this._holes[R].getCoordinates(),ot=0;ot<V.length;ot++)l[++h]=V[ot];return l},i.prototype.getArea=function(){var l=0;l+=Math.abs(rt.signedArea(this._shell.getCoordinateSequence()));for(var h=0;h<this._holes.length;h++)l-=Math.abs(rt.signedArea(this._holes[h].getCoordinateSequence()));return l},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var l=this._shell.getCoordinateSequence(),h=this.getEnvelopeInternal(),v=0;v<5;v++){var S=l.getX(v);if(S!==h.getMinX()&&S!==h.getMaxX())return!1;var R=l.getY(v);if(R!==h.getMinY()&&R!==h.getMaxY())return!1}for(var V=l.getX(0),ot=l.getY(0),St=1;St<=4;St++){var bt=l.getX(St),Yt=l.getY(St);if(bt!==V==(Yt!==ot))return!1;V=bt,ot=Yt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l,S=this._shell,R=v._shell;if(!S.equalsExact(R,h)||this._holes.length!==v._holes.length)return!1;for(var V=0;V<this._holes.length;V++)if(!this._holes[V].equalsExact(v._holes[V],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var l=0;l<this._holes.length;l++)this.normalize(this._holes[l],!1);er.sort(this._holes)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];if(h.isEmpty())return null;var S=new Array(h.getCoordinates().length-1).fill(null);Qt.arraycopy(h.getCoordinates(),0,S,0,S.length);var R=at.minCoordinate(h.getCoordinates());at.scroll(S,R),Qt.arraycopy(S,0,h.getCoordinates(),0,S.length),h.getCoordinates()[S.length]=S[0],rt.isCCW(h.getCoordinates())===v&&at.reverse(h.getCoordinates())}},i.prototype.getCoordinate=function(){return this._shell.getCoordinate()},i.prototype.getNumInteriorRing=function(){return this._holes.length},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.getLength=function(){var l=0;l+=this._shell.getLength();for(var h=0;h<this._holes.length;h++)l+=this._holes[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=this._shell.getNumPoints(),h=0;h<this._holes.length;h++)l+=this._holes[h].getNumPoints();return l},i.prototype.reverse=function(){var l=this.copy();l._shell=this._shell.copy().reverse(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].copy().reverse();return l},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=this._shell,v=l._shell;return h.compareToSameClass(v)}if(arguments.length===2){var S=arguments[0],R=arguments[1],V=S,ot=this._shell,St=V._shell,bt=ot.compareToSameClass(St,R);if(bt!==0)return bt;for(var Yt=this.getNumInteriorRing(),Jt=V.getNumInteriorRing(),se=0;se<Yt&&se<Jt;){var _e=this.getInteriorRingN(se),Cn=V.getInteriorRingN(se),Xn=_e.compareToSameClass(Cn,R);if(Xn!==0)return Xn;se++}return se<Yt?1:se<Jt?-1:0}},i.prototype.apply=function(l){if(et(l,tt)){this._shell.apply(l);for(var h=0;h<this._holes.length;h++)this._holes[h].apply(l)}else if(et(l,lr)){if(this._shell.apply(l),!l.isDone())for(var v=0;v<this._holes.length&&(this._holes[v].apply(l),!l.isDone());v++);l.isGeometryChanged()&&this.geometryChanged()}else if(et(l,hr))l.filter(this);else if(et(l,Gt)){l.filter(this),this._shell.apply(l);for(var S=0;S<this._holes.length;S++)this._holes[S].apply(l)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var l=new Array(this._holes.length+1).fill(null);l[0]=this._shell;for(var h=0;h<this._holes.length;h++)l[h+1]=this._holes[h];return l.length<=1?this.getFactory().createLinearRing(l[0].getCoordinateSequence()):this.getFactory().createMultiLineString(l)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._shell=this._shell.clone(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].clone();return l},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var l=this._shell.copy(),h=new Array(this._holes.length).fill(null),v=0;v<h.length;v++)h[v]=this._holes[v].copy();return new i(l,h,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(l){return this._holes[l]},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,s),i}(Ct),Oe=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var l=arguments[0];return this._geometries[l].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.getGeometryType=function(){return"MultiPoint"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,s),i}(Zn),Tn=function(n){function i(l,h){l instanceof D&&h instanceof Ce&&(l=h.getCoordinateSequenceFactory().create(l)),n.call(this,l,h),this.validateConstruction()}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},i.prototype.reverse=function(){var l=this._points.copy();return Zt.reverse(l),this.getFactory().createLinearRing(l)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new N("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new N("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},i.prototype.getGeometryType=function(){return"LinearRing"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.MINIMUM_VALID_SIZE.get=function(){return 4},s.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,s),i}(jt),Bn=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createMultiPolygon(h)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var l=new nt,h=0;h<this._geometries.length;h++)for(var v=this._geometries[h].getBoundary(),S=0;S<v.getNumGeometries();S++)l.add(v.getGeometryN(S));var R=new Array(l.size()).fill(null);return this.getFactory().createMultiLineString(l.toArray(R))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,s),i}(Zn),rr=function(n){this._factory=n||null,this._isUserDataCopied=!1},Ki={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rr.prototype.setCopyUserData=function(n){this._isUserDataCopied=n},rr.prototype.edit=function(n,i){if(n===null)return null;var s=this.editInternal(n,i);return this._isUserDataCopied&&s.setUserData(n.getUserData()),s},rr.prototype.editInternal=function(n,i){return this._factory===null&&(this._factory=n.getFactory()),n instanceof Zn?this.editGeometryCollection(n,i):n instanceof pe?this.editPolygon(n,i):n instanceof ge?i.edit(n,this._factory):n instanceof jt?i.edit(n,this._factory):(kt.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},rr.prototype.editGeometryCollection=function(n,i){for(var s=i.edit(n,this._factory),l=new nt,h=0;h<s.getNumGeometries();h++){var v=this.edit(s.getGeometryN(h),i);v===null||v.isEmpty()||l.add(v)}return s.getClass()===Oe?this._factory.createMultiPoint(l.toArray([])):s.getClass()===K?this._factory.createMultiLineString(l.toArray([])):s.getClass()===Bn?this._factory.createMultiPolygon(l.toArray([])):this._factory.createGeometryCollection(l.toArray([]))},rr.prototype.editPolygon=function(n,i){var s=i.edit(n,this._factory);if(s===null&&(s=this._factory.createPolygon(null)),s.isEmpty())return s;var l=this.edit(s.getExteriorRing(),i);if(l===null||l.isEmpty())return this._factory.createPolygon();for(var h=new nt,v=0;v<s.getNumInteriorRing();v++){var S=this.edit(s.getInteriorRingN(v),i);S===null||S.isEmpty()||h.add(S)}return this._factory.createPolygon(l,h.toArray([]))},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.GeometryEditorOperation=function(){},Ki.NoOpGeometryOperation.get=function(){return pr},Ki.CoordinateOperation.get=function(){return ze},Ki.CoordinateSequenceOperation.get=function(){return Is},Object.defineProperties(rr,Ki);var pr=function(){};pr.prototype.edit=function(n,i){return n},pr.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},pr.prototype.getClass=function(){return pr};var ze=function(){};ze.prototype.edit=function(n,i){var s=this.editCoordinates(n.getCoordinates(),n);return s===null?n:n instanceof Tn?i.createLinearRing(s):n instanceof jt?i.createLineString(s):n instanceof ge?s.length>0?i.createPoint(s[0]):i.createPoint():n},ze.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},ze.prototype.getClass=function(){return ze};var Is=function(){};Is.prototype.edit=function(n,i){return n instanceof Tn?i.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof jt?i.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof ge?i.createPoint(this.edit(n.getCoordinateSequence(),n)):n},Is.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},Is.prototype.getClass=function(){return Is};var De=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var i=0;i<n;i++)this._coordinates[i]=new D}else if(et(arguments[0],At)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._coordinates=new Array(s.size()).fill(null);for(var l=0;l<this._coordinates.length;l++)this._coordinates[l]=s.getCoordinateCopy(l)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var h=arguments[0],v=arguments[1];this._coordinates=h,this._dimension=v,h===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var S=arguments[0],R=arguments[1];this._coordinates=new Array(S).fill(null),this._dimension=R;for(var V=0;V<S;V++)this._coordinates[V]=new D}}},Yo={serialVersionUID:{configurable:!0}};De.prototype.setOrdinate=function(n,i,s){switch(i){case At.X:this._coordinates[n].x=s;break;case At.Y:this._coordinates[n].y=s;break;case At.Z:this._coordinates[n].z=s;break;default:throw new N("invalid ordinateIndex")}},De.prototype.size=function(){return this._coordinates.length},De.prototype.getOrdinate=function(n,i){switch(i){case At.X:return this._coordinates[n].x;case At.Y:return this._coordinates[n].y;case At.Z:return this._coordinates[n].z}return A.NaN},De.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._coordinates[n]}if(arguments.length===2){var i=arguments[0],s=arguments[1];s.x=this._coordinates[i].x,s.y=this._coordinates[i].y,s.z=this._coordinates[i].z}},De.prototype.getCoordinateCopy=function(n){return new D(this._coordinates[n])},De.prototype.getDimension=function(){return this._dimension},De.prototype.getX=function(n){return this._coordinates[n].x},De.prototype.clone=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].clone();return new De(n,this._dimension)},De.prototype.expandEnvelope=function(n){for(var i=0;i<this._coordinates.length;i++)n.expandToInclude(this._coordinates[i]);return n},De.prototype.copy=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].copy();return new De(n,this._dimension)},De.prototype.toString=function(){if(this._coordinates.length>0){var n=new Pt(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)n.append(", "),n.append(this._coordinates[i]);return n.append(")"),n.toString()}return"()"},De.prototype.getY=function(n){return this._coordinates[n].y},De.prototype.toCoordinateArray=function(){return this._coordinates},De.prototype.interfaces_=function(){return[At,t]},De.prototype.getClass=function(){return De},Yo.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(De,Yo);var Ui=function(){},$o={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ui.prototype.readResolve=function(){return Ui.instance()},Ui.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new De(n)}if(et(arguments[0],At)){var i=arguments[0];return new De(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return l>3&&(l=3),l<2?new De(s):new De(s,l)}},Ui.prototype.interfaces_=function(){return[_t,t]},Ui.prototype.getClass=function(){return Ui},Ui.instance=function(){return Ui.instanceObject},$o.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},$o.instanceObject.get=function(){return new Ui},Object.defineProperties(Ui,$o);var Ka=function(n){function i(){n.call(this),this.map_=new Map}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(s){return this.map_.get(s)||null},i.prototype.put=function(s,l){return this.map_.set(s,l),l},i.prototype.values=function(){for(var s=new nt,l=this.map_.values(),h=l.next();!h.done;)s.add(h.value),h=l.next();return s},i.prototype.entrySet=function(){var s=new je;return this.map_.entries().forEach(function(l){return s.add(l)}),s},i.prototype.size=function(){return this.map_.size()},i}(oe),Se=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ci){var i=arguments[0];this._modelType=i,i===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var s=arguments[0];this._modelType=n.FIXED,this.setScale(s)}else if(arguments[0]instanceof n){var l=arguments[0];this._modelType=l._modelType,this._scale=l._scale}}},Qi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Se.prototype.equals=function(n){if(!(n instanceof Se))return!1;var i=n;return this._modelType===i._modelType&&this._scale===i._scale},Se.prototype.compareTo=function(n){var i=n,s=this.getMaximumSignificantDigits(),l=i.getMaximumSignificantDigits();return new Et(s).compareTo(new Et(l))},Se.prototype.getScale=function(){return this._scale},Se.prototype.isFloating=function(){return this._modelType===Se.FLOATING||this._modelType===Se.FLOATING_SINGLE},Se.prototype.getType=function(){return this._modelType},Se.prototype.toString=function(){var n="UNKNOWN";return this._modelType===Se.FLOATING?n="Floating":this._modelType===Se.FLOATING_SINGLE?n="Floating-Single":this._modelType===Se.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},Se.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var n=arguments[0];return A.isNaN(n)||this._modelType===Se.FLOATING_SINGLE?n:this._modelType===Se.FIXED?Math.round(n*this._scale)/this._scale:n}if(arguments[0]instanceof D){var i=arguments[0];if(this._modelType===Se.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Se.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===Se.FLOATING?n=16:this._modelType===Se.FLOATING_SINGLE?n=6:this._modelType===Se.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},Se.prototype.setScale=function(n){this._scale=Math.abs(n)},Se.prototype.interfaces_=function(){return[t,z]},Se.prototype.getClass=function(){return Se},Se.mostPrecise=function(n,i){return n.compareTo(i)>=0?n:i},Qi.serialVersionUID.get=function(){return 7777263578777804e3},Qi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Se,Qi);var ci=function n(i){this._name=i||null,n.nameToTypeMap.put(i,this)},fi={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ci.prototype.readResolve=function(){return ci.nameToTypeMap.get(this._name)},ci.prototype.toString=function(){return this._name},ci.prototype.interfaces_=function(){return[t]},ci.prototype.getClass=function(){return ci},fi.serialVersionUID.get=function(){return-552860263173159e4},fi.nameToTypeMap.get=function(){return new Ka},Object.defineProperties(ci,fi),Se.Type=ci,Se.FIXED=new ci("FIXED"),Se.FLOATING=new ci("FLOATING"),Se.FLOATING_SINGLE=new ci("FLOATING SINGLE");var Ce=function n(){this._precisionModel=new Se,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?et(arguments[0],_t)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Se&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Du={serialVersionUID:{configurable:!0}};Ce.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new D(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new D(n.getMinX(),n.getMinY()),new D(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new D(n.getMinX(),n.getMinY()),new D(n.getMinX(),n.getMaxY()),new D(n.getMaxX(),n.getMaxY()),new D(n.getMaxX(),n.getMinY()),new D(n.getMinX(),n.getMinY())]),null)},Ce.prototype.createLineString=function(n){return n?n instanceof Array?new jt(this.getCoordinateSequenceFactory().create(n),this):et(n,At)?new jt(n,this):void 0:new jt(this.getCoordinateSequenceFactory().create([]),this)},Ce.prototype.createMultiLineString=function(){if(arguments.length===0)return new K(null,this);if(arguments.length===1){var n=arguments[0];return new K(n,this)}},Ce.prototype.buildGeometry=function(n){for(var i=null,s=!1,l=!1,h=n.iterator();h.hasNext();){var v=h.next(),S=v.getClass();i===null&&(i=S),S!==i&&(s=!0),v.isGeometryCollectionOrDerived()&&(l=!0)}if(i===null)return this.createGeometryCollection();if(s||l)return this.createGeometryCollection(Ce.toGeometryArray(n));var R=n.iterator().next();if(n.size()>1){if(R instanceof pe)return this.createMultiPolygon(Ce.toPolygonArray(n));if(R instanceof jt)return this.createMultiLineString(Ce.toLineStringArray(n));if(R instanceof ge)return this.createMultiPoint(Ce.toPointArray(n));kt.shouldNeverReachHere("Unhandled class: "+R.getClass().getName())}return R},Ce.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)},Ce.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];return this.createPoint(n!==null?this.getCoordinateSequenceFactory().create([n]):null)}if(et(arguments[0],At)){var i=arguments[0];return new ge(i,this)}}},Ce.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ce.prototype.createPolygon=function(){if(arguments.length===0)return new pe(null,null,this);if(arguments.length===1){if(et(arguments[0],At)){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof Tn){var s=arguments[0];return this.createPolygon(s,null)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];return new pe(l,h,this)}},Ce.prototype.getSRID=function(){return this._SRID},Ce.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Zn(null,this);if(arguments.length===1){var n=arguments[0];return new Zn(n,this)}},Ce.prototype.createGeometry=function(n){return new rr(this).edit(n,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Ce.prototype.getPrecisionModel=function(){return this._precisionModel},Ce.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(n!==null?this.getCoordinateSequenceFactory().create(n):null)}if(et(arguments[0],At)){var i=arguments[0];return new Tn(i,this)}}},Ce.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Bn(null,this);if(arguments.length===1){var n=arguments[0];return new Bn(n,this)}},Ce.prototype.createMultiPoint=function(){if(arguments.length===0)return new Oe(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new Oe(n,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(et(arguments[0],At)){var s=arguments[0];if(s===null)return this.createMultiPoint(new Array(0).fill(null));for(var l=new Array(s.size()).fill(null),h=0;h<s.size();h++){var v=this.getCoordinateSequenceFactory().create(1,s.getDimension());Zt.copy(s,h,v,0,1),l[h]=this.createPoint(v)}return this.createMultiPoint(l)}}},Ce.prototype.interfaces_=function(){return[t]},Ce.prototype.getClass=function(){return Ce},Ce.toMultiPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toGeometryArray=function(n){if(n===null)return null;var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.getDefaultCoordinateSequenceFactory=function(){return Ui.instance()},Ce.toMultiLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toMultiPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLinearRingArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.createPointFromInternalCoord=function(n,i){return i.getPrecisionModel().makePrecise(n),i.getFactory().createPoint(n)},Du.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ce,Du);var Qa=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ml=function(n){this.geometryFactory=n||new Ce};ml.prototype.read=function(n){var i,s=(i=typeof n=="string"?JSON.parse(n):n).type;if(!ao[s])throw new Error("Unknown GeoJSON type: "+i.type);return Qa.indexOf(s)!==-1?ao[s].apply(this,[i.coordinates]):s==="GeometryCollection"?ao[s].apply(this,[i.geometries]):ao[s].apply(this,[i])},ml.prototype.write=function(n){var i=n.getGeometryType();if(!So[i])throw new Error("Geometry is not supported");return So[i].apply(this,[n])};var ao={Feature:function(n){var i={};for(var s in n)i[s]=n[s];if(n.geometry){var l=n.geometry.type;if(!ao[l])throw new Error("Unknown GeoJSON type: "+n.type);i.geometry=this.read(n.geometry)}return n.bbox&&(i.bbox=ao.bbox.apply(this,[n.bbox])),i},FeatureCollection:function(n){var i={};if(n.features){i.features=[];for(var s=0;s<n.features.length;++s)i.features.push(this.read(n.features[s]))}return n.bbox&&(i.bbox=this.parse.bbox.apply(this,[n.bbox])),i},coordinates:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(new D(l[0],l[1]))}return i},bbox:function(n){return this.geometryFactory.createLinearRing([new D(n[0],n[1]),new D(n[2],n[1]),new D(n[2],n[3]),new D(n[0],n[3]),new D(n[0],n[1])])},Point:function(n){var i=new D(n[0],n[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(n){for(var i=[],s=0;s<n.length;++s)i.push(ao.Point.apply(this,[n[s]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var i=ao.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(i)},MultiLineString:function(n){for(var i=[],s=0;s<n.length;++s)i.push(ao.LineString.apply(this,[n[s]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var i=ao.coordinates.apply(this,[n[0]]),s=this.geometryFactory.createLinearRing(i),l=[],h=1;h<n.length;++h){var v=n[h],S=ao.coordinates.apply(this,[v]),R=this.geometryFactory.createLinearRing(S);l.push(R)}return this.geometryFactory.createPolygon(s,l)},MultiPolygon:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(ao.Polygon.apply(this,[l]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(this.read(l))}return this.geometryFactory.createGeometryCollection(i)}},So={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:So.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.Point.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var i=[],s=n.getCoordinates(),l=0;l<s.length;++l){var h=s[l];i.push(So.coordinate.apply(this,[h]))}return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.LineString.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=So.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var l=0;l<n._holes.length;++l){var h=n._holes[l],v=So.LineString.apply(this,[h]);i.push(v.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.Polygon.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=l.getGeometryType();i.push(So[h].apply(this,[l]))}return{type:"GeometryCollection",geometries:i}}},Fu=function(n){this.geometryFactory=n||new Ce,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ml(this.geometryFactory)};Fu.prototype.read=function(n){var i=this.parser.read(n);return this.precisionModel.getType()===Se.FIXED&&this.reducePrecision(i),i},Fu.prototype.reducePrecision=function(n){var i,s;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(i=0,s=n.points.length;i<s;i++)this.precisionModel.makePrecise(n.points[i]);else if(n.geometries)for(i=0,s=n.geometries.length;i<s;i++)this.reducePrecision(n.geometries[i])};var _a=function(){this.parser=new ml(this.geometryFactory)};_a.prototype.write=function(n){return this.parser.write(n)};var Ht=function(){},Uu={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.opposite=function(n){return n===Ht.LEFT?Ht.RIGHT:n===Ht.RIGHT?Ht.LEFT:n},Uu.ON.get=function(){return 0},Uu.LEFT.get=function(){return 1},Uu.RIGHT.get=function(){return 2},Object.defineProperties(Ht,Uu),(I.prototype=new Error).name="EmptyStackException",(M.prototype=new ut).add=function(n){return this.array_.push(n),!0},M.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},M.prototype.push=function(n){return this.array_.push(n),n},M.prototype.pop=function(n){if(this.array_.length===0)throw new I;return this.array_.pop()},M.prototype.peek=function(){if(this.array_.length===0)throw new I;return this.array_[this.array_.length-1]},M.prototype.empty=function(){return this.array_.length===0},M.prototype.isEmpty=function(){return this.empty()},M.prototype.search=function(n){return this.array_.indexOf(n)},M.prototype.size=function(){return this.array_.length},M.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n};var bo=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};bo.prototype.getCoordinate=function(){return this._minCoord},bo.prototype.getRightmostSide=function(n,i){var s=this.getRightmostSideOfSegment(n,i);return s<0&&(s=this.getRightmostSideOfSegment(n,i-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),s},bo.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();kt.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var i=n[this._minIndex-1],s=n[this._minIndex+1],l=rt.computeOrientation(this._minCoord,s,i),h=!1;(i.y<this._minCoord.y&&s.y<this._minCoord.y&&l===rt.COUNTERCLOCKWISE||i.y>this._minCoord.y&&s.y>this._minCoord.y&&l===rt.CLOCKWISE)&&(h=!0),h&&(this._minIndex=this._minIndex-1)},bo.prototype.getRightmostSideOfSegment=function(n,i){var s=n.getEdge().getCoordinates();if(i<0||i+1>=s.length||s[i].y===s[i+1].y)return-1;var l=Ht.LEFT;return s[i].y<s[i+1].y&&(l=Ht.RIGHT),l},bo.prototype.getEdge=function(){return this._orientedDe},bo.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)(this._minCoord===null||i[s].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=s,this._minCoord=i[s])},bo.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},bo.prototype.findEdge=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();s.isForward()&&this.checkForRightmostCoordinate(s)}kt.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)===Ht.LEFT&&(this._orientedDe=this._minDe.getSym())},bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo};var Zo=function(n){function i(s,l){n.call(this,i.msgWithCoord(s,l)),this.pt=l?new D(l):null,this.name="TopologyException"}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getCoordinate=function(){return this.pt},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.msgWithCoord=function(s,l){return l?s:s+" [ "+l+" ]"},i}(Ue),Bu=function(){this.array_=[]};Bu.prototype.addLast=function(n){this.array_.push(n)},Bu.prototype.removeFirst=function(){return this.array_.shift()},Bu.prototype.isEmpty=function(){return this.array_.length===0};var Jr=function(){this._finder=null,this._dirEdgeList=new nt,this._nodes=new nt,this._rightMostCoord=null,this._env=null,this._finder=new bo};Jr.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},Jr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Jr.prototype.computeNodeDepth=function(n){for(var i=null,s=n.getEdges().iterator();s.hasNext();){var l=s.next();if(l.isVisited()||l.getSym().isVisited()){i=l;break}}if(i===null)throw new Zo("unable to find edge to compute depths at "+n.getCoordinate());n.getEdges().computeDepths(i);for(var h=n.getEdges().iterator();h.hasNext();){var v=h.next();v.setVisited(!0),this.copySymDepths(v)}},Jr.prototype.computeDepth=function(n){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(Ht.RIGHT,n),this.copySymDepths(i),this.computeDepths(i)},Jr.prototype.create=function(n){this.addReachable(n),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Jr.prototype.findResultEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();){var i=n.next();i.getDepth(Ht.RIGHT)>=1&&i.getDepth(Ht.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},Jr.prototype.computeDepths=function(n){var i=new je,s=new Bu,l=n.getNode();for(s.addLast(l),i.add(l),n.setVisited(!0);!s.isEmpty();){var h=s.removeFirst();i.add(h),this.computeNodeDepth(h);for(var v=h.getEdges().iterator();v.hasNext();){var S=v.next().getSym();if(!S.isVisited()){var R=S.getNode();i.contains(R)||(s.addLast(R),i.add(R))}}}},Jr.prototype.compareTo=function(n){var i=n;return this._rightMostCoord.x<i._rightMostCoord.x?-1:this._rightMostCoord.x>i._rightMostCoord.x?1:0},Jr.prototype.getEnvelope=function(){if(this._env===null){for(var n=new Xt,i=this._dirEdgeList.iterator();i.hasNext();)for(var s=i.next().getEdge().getCoordinates(),l=0;l<s.length-1;l++)n.expandToInclude(s[l]);this._env=n}return this._env},Jr.prototype.addReachable=function(n){var i=new M;for(i.add(n);!i.empty();){var s=i.pop();this.add(s,i)}},Jr.prototype.copySymDepths=function(n){var i=n.getSym();i.setDepth(Ht.LEFT,n.getDepth(Ht.RIGHT)),i.setDepth(Ht.RIGHT,n.getDepth(Ht.LEFT))},Jr.prototype.add=function(n,i){n.setVisited(!0),this._nodes.add(n);for(var s=n.getEdges().iterator();s.hasNext();){var l=s.next();this._dirEdgeList.add(l);var h=l.getSym().getNode();h.isVisited()||i.push(h)}},Jr.prototype.getNodes=function(){return this._nodes},Jr.prototype.getDirectedEdges=function(){return this._dirEdgeList},Jr.prototype.interfaces_=function(){return[z]},Jr.prototype.getClass=function(){return Jr};var Wn=function n(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}else if(Number.isInteger(arguments[0])){var s=arguments[0];this.init(1),this.location[Ht.ON]=s}else if(arguments[0]instanceof n){var l=arguments[0];if(this.init(l.location.length),l!==null)for(var h=0;h<this.location.length;h++)this.location[h]=l.location[h]}}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.init(3),this.location[Ht.ON]=v,this.location[Ht.LEFT]=S,this.location[Ht.RIGHT]=R}};Wn.prototype.setAllLocations=function(n){for(var i=0;i<this.location.length;i++)this.location[i]=n},Wn.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==Z.NONE)return!1;return!0},Wn.prototype.setAllLocationsIfNull=function(n){for(var i=0;i<this.location.length;i++)this.location[i]===Z.NONE&&(this.location[i]=n)},Wn.prototype.isLine=function(){return this.location.length===1},Wn.prototype.merge=function(n){if(n.location.length>this.location.length){var i=new Array(3).fill(null);i[Ht.ON]=this.location[Ht.ON],i[Ht.LEFT]=Z.NONE,i[Ht.RIGHT]=Z.NONE,this.location=i}for(var s=0;s<this.location.length;s++)this.location[s]===Z.NONE&&s<n.location.length&&(this.location[s]=n.location[s])},Wn.prototype.getLocations=function(){return this.location},Wn.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[Ht.LEFT];this.location[Ht.LEFT]=this.location[Ht.RIGHT],this.location[Ht.RIGHT]=n},Wn.prototype.toString=function(){var n=new Pt;return this.location.length>1&&n.append(Z.toLocationSymbol(this.location[Ht.LEFT])),n.append(Z.toLocationSymbol(this.location[Ht.ON])),this.location.length>1&&n.append(Z.toLocationSymbol(this.location[Ht.RIGHT])),n.toString()},Wn.prototype.setLocations=function(n,i,s){this.location[Ht.ON]=n,this.location[Ht.LEFT]=i,this.location[Ht.RIGHT]=s},Wn.prototype.get=function(n){return n<this.location.length?this.location[n]:Z.NONE},Wn.prototype.isArea=function(){return this.location.length>1},Wn.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===Z.NONE)return!0;return!1},Wn.prototype.setLocation=function(){if(arguments.length===1){var n=arguments[0];this.setLocation(Ht.ON,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.location[i]=s}},Wn.prototype.init=function(n){this.location=new Array(n).fill(null),this.setAllLocations(Z.NONE)},Wn.prototype.isEqualOnSide=function(n,i){return this.location[i]===n.location[i]},Wn.prototype.allPositionsEqual=function(n){for(var i=0;i<this.location.length;i++)if(this.location[i]!==n)return!1;return!0},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var An=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new Wn(i),this.elt[1]=new Wn(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.elt[0]=new Wn(s.elt[0]),this.elt[1]=new Wn(s.elt[1])}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.elt[0]=new Wn(Z.NONE),this.elt[1]=new Wn(Z.NONE),this.elt[l].setLocation(h)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.elt[0]=new Wn(v,S,R),this.elt[1]=new Wn(v,S,R)}else if(arguments.length===4){var V=arguments[0],ot=arguments[1],St=arguments[2],bt=arguments[3];this.elt[0]=new Wn(Z.NONE,Z.NONE,Z.NONE),this.elt[1]=new Wn(Z.NONE,Z.NONE,Z.NONE),this.elt[V].setLocations(ot,St,bt)}};An.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},An.prototype.setAllLocations=function(n,i){this.elt[n].setAllLocations(i)},An.prototype.isNull=function(n){return this.elt[n].isNull()},An.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var n=arguments[0];this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.elt[i].setAllLocationsIfNull(s)}},An.prototype.isLine=function(n){return this.elt[n].isLine()},An.prototype.merge=function(n){for(var i=0;i<2;i++)this.elt[i]===null&&n.elt[i]!==null?this.elt[i]=new Wn(n.elt[i]):this.elt[i].merge(n.elt[i])},An.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},An.prototype.getLocation=function(){if(arguments.length===1){var n=arguments[0];return this.elt[n].get(Ht.ON)}if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.elt[i].get(s)}},An.prototype.toString=function(){var n=new Pt;return this.elt[0]!==null&&(n.append("A:"),n.append(this.elt[0].toString())),this.elt[1]!==null&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()},An.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var n=arguments[0];return this.elt[n].isArea()}},An.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()},An.prototype.setLocation=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[n].setLocation(Ht.ON,i)}else if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];this.elt[s].setLocation(l,h)}},An.prototype.isEqualOnSide=function(n,i){return this.elt[0].isEqualOnSide(n.elt[0],i)&&this.elt[1].isEqualOnSide(n.elt[1],i)},An.prototype.allPositionsEqual=function(n,i){return this.elt[n].allPositionsEqual(i)},An.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new Wn(this.elt[n].location[0]))},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.toLineLabel=function(n){for(var i=new An(Z.NONE),s=0;s<2;s++)i.setLocation(s,n.getLocation(s));return i};var Mr=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new nt,this._pts=new nt,this._label=new An(Z.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new nt,this._geometryFactory=null;var n=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(n),this.computeRing()};Mr.prototype.computeRing=function(){if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)n[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=rt.isCCW(this._ring.getCoordinates())},Mr.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Mr.prototype.computePoints=function(n){this._startDe=n;var i=n,s=!0;do{if(i===null)throw new Zo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new Zo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var l=i.getLabel();kt.isTrue(l.isArea()),this.mergeLabel(l),this.addPoints(i.getEdge(),i.isForward(),s),s=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},Mr.prototype.getLinearRing=function(){return this._ring},Mr.prototype.getCoordinate=function(n){return this._pts.get(n)},Mr.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var n=this._startDe;do{var i=n.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),n=this.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2},Mr.prototype.addPoints=function(n,i,s){var l=n.getCoordinates();if(i){var h=1;s&&(h=0);for(var v=h;v<l.length;v++)this._pts.add(l[v])}else{var S=l.length-2;s&&(S=l.length-1);for(var R=S;R>=0;R--)this._pts.add(l[R])}},Mr.prototype.isHole=function(){return this._isHole},Mr.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)},Mr.prototype.containsPoint=function(n){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(n)||!rt.isPointInRing(n,i.getCoordinates()))return!1;for(var s=this._holes.iterator();s.hasNext();)if(s.next().containsPoint(n))return!1;return!0},Mr.prototype.addHole=function(n){this._holes.add(n)},Mr.prototype.isShell=function(){return this._shell===null},Mr.prototype.getLabel=function(){return this._label},Mr.prototype.getEdges=function(){return this._edges},Mr.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Mr.prototype.getShell=function(){return this._shell},Mr.prototype.mergeLabel=function(){if(arguments.length===1){var n=arguments[0];this.mergeLabel(n,0),this.mergeLabel(n,1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1],l=i.getLocation(s,Ht.RIGHT);if(l===Z.NONE)return null;if(this._label.getLocation(s)===Z.NONE)return this._label.setLocation(s,l),null}},Mr.prototype.setShell=function(n){this._shell=n,n!==null&&n.addHole(this)},Mr.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),s=0;s<this._holes.size();s++)i[s]=this._holes.get(s).getLinearRing();return n.createPolygon(this.getLinearRing(),i)},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var rd=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(s,l){s.setMinEdgeRing(l)},i.prototype.getNext=function(s){return s.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Mr),Lf=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var s=new nt,l=this._startDe;do{if(l.getMinEdgeRing()===null){var h=new rd(l,this._geometryFactory);s.add(h)}l=l.getNext()}while(l!==this._startDe);return s},i.prototype.setEdgeRing=function(s,l){s.setEdgeRing(l)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var s=this._startDe;do s.getNode().getEdges().linkMinimalDirectedEdges(this),s=s.getNext();while(s!==this._startDe)},i.prototype.getNext=function(s){return s.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Mr),Bi=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 n=arguments[0];this._label=n}}};Bi.prototype.setVisited=function(n){this._isVisited=n},Bi.prototype.setInResult=function(n){this._isInResult=n},Bi.prototype.isCovered=function(){return this._isCovered},Bi.prototype.isCoveredSet=function(){return this._isCoveredSet},Bi.prototype.setLabel=function(n){this._label=n},Bi.prototype.getLabel=function(){return this._label},Bi.prototype.setCovered=function(n){this._isCovered=n,this._isCoveredSet=!0},Bi.prototype.updateIM=function(n){kt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(n)},Bi.prototype.isInResult=function(){return this._isInResult},Bi.prototype.isVisited=function(){return this._isVisited},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi};var yl=function(n){function i(){n.call(this),this._coord=null,this._edges=null;var s=arguments[0],l=arguments[1];this._coord=s,this._edges=l,this._label=new An(0,Z.NONE)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var s=this.getEdges().getEdges().iterator();s.hasNext();)if(s.next().getEdge().isInResult())return!0;return!1},i.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},i.prototype.getCoordinate=function(){return this._coord},i.prototype.print=function(s){s.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(s){},i.prototype.computeMergedLocation=function(s,l){var h=Z.NONE;if(h=this._label.getLocation(l),!s.isNull(l)){var v=s.getLocation(l);h!==Z.BOUNDARY&&(h=v)}return h},i.prototype.setLabel=function(){if(arguments.length!==2)return n.prototype.setLabel.apply(this,arguments);var s=arguments[0],l=arguments[1];this._label===null?this._label=new An(s,l):this._label.setLocation(s,l)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var s=arguments[0];this.mergeLabel(s._label)}else if(arguments[0]instanceof An)for(var l=arguments[0],h=0;h<2;h++){var v=this.computeMergedLocation(l,h);this._label.getLocation(h)===Z.NONE&&this._label.setLocation(h,v)}},i.prototype.add=function(s){this._edges.insert(s),s.setNode(this)},i.prototype.setLabelBoundary=function(s){if(this._label===null)return null;var l=Z.NONE;this._label!==null&&(l=this._label.getLocation(s));var h=null;switch(l){case Z.BOUNDARY:h=Z.INTERIOR;break;case Z.INTERIOR:default:h=Z.BOUNDARY}this._label.setLocation(s,h)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Bi),To=function(){this.nodeMap=new w,this.nodeFact=null;var n=arguments[0];this.nodeFact=n};To.prototype.find=function(n){return this.nodeMap.get(n)},To.prototype.addNode=function(){if(arguments[0]instanceof D){var n=arguments[0],i=this.nodeMap.get(n);return i===null&&(i=this.nodeFact.createNode(n),this.nodeMap.put(n,i)),i}if(arguments[0]instanceof yl){var s=arguments[0],l=this.nodeMap.get(s.getCoordinate());return l===null?(this.nodeMap.put(s.getCoordinate(),s),s):(l.mergeLabel(s),l)}},To.prototype.print=function(n){for(var i=this.iterator();i.hasNext();)i.next().print(n)},To.prototype.iterator=function(){return this.nodeMap.values().iterator()},To.prototype.values=function(){return this.nodeMap.values()},To.prototype.getBoundaryNodes=function(n){for(var i=new nt,s=this.iterator();s.hasNext();){var l=s.next();l.getLabel().getLocation(n)===Z.BOUNDARY&&i.add(l)}return i},To.prototype.add=function(n){var i=n.getCoordinate();this.addNode(i).add(n)},To.prototype.interfaces_=function(){return[]},To.prototype.getClass=function(){return To};var kn=function(){},xa={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.isNorthern=function(n){return n===kn.NE||n===kn.NW},kn.isOpposite=function(n,i){return n===i?!1:(n-i+4)%4===2},kn.commonHalfPlane=function(n,i){if(n===i)return n;if((n-i+4)%4===2)return-1;var s=n<i?n:i;return s===0&&(n>i?n:i)===3?3:s},kn.isInHalfPlane=function(n,i){return i===kn.SE?n===kn.SE||n===kn.SW:n===i||n===i+1},kn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new N("Cannot compute the quadrant for point ( "+n+", "+i+" )");return n>=0?i>=0?kn.NE:kn.SE:i>=0?kn.NW:kn.SW}if(arguments[0]instanceof D&&arguments[1]instanceof D){var s=arguments[0],l=arguments[1];if(l.x===s.x&&l.y===s.y)throw new N("Cannot compute the quadrant for two identical points "+s);return l.x>=s.x?l.y>=s.y?kn.NE:kn.SE:l.y>=s.y?kn.NW:kn.SW}},xa.NE.get=function(){return 0},xa.NW.get=function(){return 1},xa.SW.get=function(){return 2},xa.SE.get=function(){return 3},Object.defineProperties(kn,xa);var Kr=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 n=arguments[0];this._edge=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],l=arguments[2];this._edge=i,this.init(s,l),this._label=null}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this._edge=h,this.init(v,S),this._label=R}};Kr.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:rt.computeOrientation(n._p0,n._p1,this._p1)},Kr.prototype.getDy=function(){return this._dy},Kr.prototype.getCoordinate=function(){return this._p0},Kr.prototype.setNode=function(n){this._node=n},Kr.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),l=s.lastIndexOf("."),h=s.substring(l+1);n.print(" "+h+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},Kr.prototype.compareTo=function(n){var i=n;return this.compareDirection(i)},Kr.prototype.getDirectedCoordinate=function(){return this._p1},Kr.prototype.getDx=function(){return this._dx},Kr.prototype.getLabel=function(){return this._label},Kr.prototype.getEdge=function(){return this._edge},Kr.prototype.getQuadrant=function(){return this._quadrant},Kr.prototype.getNode=function(){return this._node},Kr.prototype.toString=function(){var n=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf(".");return" "+i.substring(s+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label},Kr.prototype.computeLabel=function(n){},Kr.prototype.init=function(n,i){this._p0=n,this._p1=i,this._dx=i.x-n.x,this._dy=i.y-n.y,this._quadrant=kn.quadrant(this._dx,this._dy),kt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Kr.prototype.interfaces_=function(){return[z]},Kr.prototype.getClass=function(){return Kr};var Cc=function(n){function i(){var s=arguments[0],l=arguments[1];if(n.call(this,s),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=l,l)this.init(s.getCoordinate(0),s.getCoordinate(1));else{var h=s.getNumPoints()-1;this.init(s.getCoordinate(h),s.getCoordinate(h-1))}this.computeDirectedLabel()}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(s){return this._depth[s]},i.prototype.setVisited=function(s){this._isVisited=s},i.prototype.computeDirectedLabel=function(){this._label=new An(this._edge.getLabel()),this._isForward||this._label.flip()},i.prototype.getNext=function(){return this._next},i.prototype.setDepth=function(s,l){if(this._depth[s]!==-999&&this._depth[s]!==l)throw new Zo("assigned depths do not match",this.getCoordinate());this._depth[s]=l},i.prototype.isInteriorAreaEdge=function(){for(var s=!0,l=0;l<2;l++)this._label.isArea(l)&&this._label.getLocation(l,Ht.LEFT)===Z.INTERIOR&&this._label.getLocation(l,Ht.RIGHT)===Z.INTERIOR||(s=!1);return s},i.prototype.setNextMin=function(s){this._nextMin=s},i.prototype.print=function(s){n.prototype.print.call(this,s),s.print(" "+this._depth[Ht.LEFT]+"/"+this._depth[Ht.RIGHT]),s.print(" ("+this.getDepthDelta()+")"),this._isInResult&&s.print(" inResult")},i.prototype.setMinEdgeRing=function(s){this._minEdgeRing=s},i.prototype.isLineEdge=function(){var s=this._label.isLine(0)||this._label.isLine(1),l=!this._label.isArea(0)||this._label.allPositionsEqual(0,Z.EXTERIOR),h=!this._label.isArea(1)||this._label.allPositionsEqual(1,Z.EXTERIOR);return s&&l&&h},i.prototype.setEdgeRing=function(s){this._edgeRing=s},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var s=this._edge.getDepthDelta();return this._isForward||(s=-s),s},i.prototype.setInResult=function(s){this._isInResult=s},i.prototype.getSym=function(){return this._sym},i.prototype.isForward=function(){return this._isForward},i.prototype.getEdge=function(){return this._edge},i.prototype.printEdge=function(s){this.print(s),s.print(" "),this._isForward?this._edge.print(s):this._edge.printReverse(s)},i.prototype.setSym=function(s){this._sym=s},i.prototype.setVisitedEdge=function(s){this.setVisited(s),this._sym.setVisited(s)},i.prototype.setEdgeDepths=function(s,l){var h=this.getEdge().getDepthDelta();this._isForward||(h=-h);var v=1;s===Ht.LEFT&&(v=-1);var S=Ht.opposite(s),R=l+h*v;this.setDepth(s,l),this.setDepth(S,R)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(s){this._next=s},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(s,l){return s===Z.EXTERIOR&&l===Z.INTERIOR?1:s===Z.INTERIOR&&l===Z.EXTERIOR?-1:0},i}(Kr),ja=function(){};ja.prototype.createNode=function(n){return new yl(n,null)},ja.prototype.interfaces_=function(){return[]},ja.prototype.getClass=function(){return ja};var cr=function(){if(this._edges=new nt,this._nodes=null,this._edgeEndList=new nt,arguments.length===0)this._nodes=new To(new ja);else if(arguments.length===1){var n=arguments[0];this._nodes=new To(n)}};cr.prototype.printEdges=function(n){n.println("Edges:");for(var i=0;i<this._edges.size();i++){n.println("edge "+i+":");var s=this._edges.get(i);s.print(n),s.eiList.print(n)}},cr.prototype.find=function(n){return this._nodes.find(n)},cr.prototype.addNode=function(){if(arguments[0]instanceof yl){var n=arguments[0];return this._nodes.addNode(n)}if(arguments[0]instanceof D){var i=arguments[0];return this._nodes.addNode(i)}},cr.prototype.getNodeIterator=function(){return this._nodes.iterator()},cr.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},cr.prototype.debugPrintln=function(n){Qt.out.println(n)},cr.prototype.isBoundaryNode=function(n,i){var s=this._nodes.find(i);if(s===null)return!1;var l=s.getLabel();return l!==null&&l.getLocation(n)===Z.BOUNDARY},cr.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},cr.prototype.matchInSameDirection=function(n,i,s,l){return!!n.equals(s)&&rt.computeOrientation(n,i,l)===rt.COLLINEAR&&kn.quadrant(n,i)===kn.quadrant(s,l)},cr.prototype.getEdgeEnds=function(){return this._edgeEndList},cr.prototype.debugPrint=function(n){Qt.out.print(n)},cr.prototype.getEdgeIterator=function(){return this._edges.iterator()},cr.prototype.findEdgeInSameDirection=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(this.matchInSameDirection(n,i,h[0],h[1])||this.matchInSameDirection(n,i,h[h.length-1],h[h.length-2]))return l}return null},cr.prototype.insertEdge=function(n){this._edges.add(n)},cr.prototype.findEdgeEnd=function(n){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var s=i.next();if(s.getEdge()===n)return s}return null},cr.prototype.addEdges=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();this._edges.add(s);var l=new Cc(s,!0),h=new Cc(s,!1);l.setSym(h),h.setSym(l),this.add(l),this.add(h)}},cr.prototype.add=function(n){this._nodes.add(n),this._edgeEndList.add(n)},cr.prototype.getNodes=function(){return this._nodes.values()},cr.prototype.findEdge=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(n.equals(h[0])&&i.equals(h[1]))return l}return null},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},cr.linkResultDirectedEdges=function(n){for(var i=n.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Ei=function(){this._geometryFactory=null,this._shellList=new nt;var n=arguments[0];this._geometryFactory=n};Ei.prototype.sortShellsAndHoles=function(n,i,s){for(var l=n.iterator();l.hasNext();){var h=l.next();h.isHole()?s.add(h):i.add(h)}},Ei.prototype.computePolygons=function(n){for(var i=new nt,s=n.iterator();s.hasNext();){var l=s.next().toPolygon(this._geometryFactory);i.add(l)}return i},Ei.prototype.placeFreeHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();if(l.getShell()===null){var h=this.findEdgeRingContaining(l,n);if(h===null)throw new Zo("unable to assign hole to a shell",l.getCoordinate(0));l.setShell(h)}}},Ei.prototype.buildMinimalEdgeRings=function(n,i,s){for(var l=new nt,h=n.iterator();h.hasNext();){var v=h.next();if(v.getMaxNodeDegree()>2){v.linkDirectedEdgesForMinimalEdgeRings();var S=v.buildMinimalRings(),R=this.findShell(S);R!==null?(this.placePolygonHoles(R,S),i.add(R)):s.addAll(S)}else l.add(v)}return l},Ei.prototype.containsPoint=function(n){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(n))return!0;return!1},Ei.prototype.buildMaximalEdgeRings=function(n){for(var i=new nt,s=n.iterator();s.hasNext();){var l=s.next();if(l.isInResult()&&l.getLabel().isArea()&&l.getEdgeRing()===null){var h=new Lf(l,this._geometryFactory);i.add(h),h.setInResult()}}return i},Ei.prototype.placePolygonHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();l.isHole()&&l.setShell(n)}},Ei.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ei.prototype.findEdgeRingContaining=function(n,i){for(var s=n.getLinearRing(),l=s.getEnvelopeInternal(),h=s.getCoordinateN(0),v=null,S=null,R=i.iterator();R.hasNext();){var V=R.next(),ot=V.getLinearRing(),St=ot.getEnvelopeInternal();v!==null&&(S=v.getLinearRing().getEnvelopeInternal());var bt=!1;St.contains(l)&&rt.isPointInRing(h,ot.getCoordinates())&&(bt=!0),bt&&(v===null||S.contains(St))&&(v=V)}return v},Ei.prototype.findShell=function(n){for(var i=0,s=null,l=n.iterator();l.hasNext();){var h=l.next();h.isHole()||(s=h,i++)}return kt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),s},Ei.prototype.add=function(){if(arguments.length===1){var n=arguments[0];this.add(n.getEdgeEnds(),n.getNodes())}else if(arguments.length===2){var i=arguments[0],s=arguments[1];cr.linkResultDirectedEdges(s);var l=this.buildMaximalEdgeRings(i),h=new nt,v=this.buildMinimalEdgeRings(l,this._shellList,h);this.sortShellsAndHoles(v,this._shellList,h),this.placeFreeHoles(this._shellList,h)}},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var jn=function(){};jn.prototype.getBounds=function(){},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var Xe=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};Xe.prototype.getItem=function(){return this._item},Xe.prototype.getBounds=function(){return this._bounds},Xe.prototype.interfaces_=function(){return[jn,t]},Xe.prototype.getClass=function(){return Xe};var hs=function(){this._size=null,this._items=null,this._size=0,this._items=new nt,this._items.add(null)};hs.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n},hs.prototype.size=function(){return this._size},hs.prototype.reorder=function(n){for(var i=null,s=this._items.get(n);2*n<=this._size&&((i=2*n)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(s)<0);n=i)this._items.set(n,this._items.get(i));this._items.set(n,s)},hs.prototype.clear=function(){this._size=0,this._items.clear()},hs.prototype.isEmpty=function(){return this._size===0},hs.prototype.add=function(n){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)this._items.set(i,this._items.get(Math.trunc(i/2)));this._items.set(i,n)},hs.prototype.interfaces_=function(){return[]},hs.prototype.getClass=function(){return hs};var Rs=function(){};Rs.prototype.visitItem=function(n){},Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs};var Ea=function(){};Ea.prototype.insert=function(n,i){},Ea.prototype.remove=function(n,i){},Ea.prototype.query=function(){},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea};var Ar=function(){if(this._childBoundables=new nt,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._level=n}}},Nf={serialVersionUID:{configurable:!0}};Ar.prototype.getLevel=function(){return this._level},Ar.prototype.size=function(){return this._childBoundables.size()},Ar.prototype.getChildBoundables=function(){return this._childBoundables},Ar.prototype.addChildBoundable=function(n){kt.isTrue(this._bounds===null),this._childBoundables.add(n)},Ar.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ar.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ar.prototype.interfaces_=function(){return[jn,t]},Ar.prototype.getClass=function(){return Ar},Nf.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ar,Nf);var uo=function(){};uo.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},uo.min=function(n){return uo.sort(n),n.get(0)},uo.sort=function(n,i){var s=n.toArray();i?er.sort(s,i):er.sort(s);for(var l=n.iterator(),h=0,v=s.length;h<v;h++)l.next(),l.set(s[h])},uo.singletonList=function(n){var i=new nt;return i.add(n),i};var _r=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._boundable1=n,this._boundable2=i,this._itemDistance=s,this._distance=this.distance()};_r.prototype.expandToQueue=function(n,i){var s=_r.isComposite(this._boundable1),l=_r.isComposite(this._boundable2);if(s&&l)return _r.area(this._boundable1)>_r.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,i),null):(this.expand(this._boundable2,this._boundable1,n,i),null);if(s)return this.expand(this._boundable1,this._boundable2,n,i),null;if(l)return this.expand(this._boundable2,this._boundable1,n,i),null;throw new N("neither boundable is composite")},_r.prototype.isLeaves=function(){return!(_r.isComposite(this._boundable1)||_r.isComposite(this._boundable2))},_r.prototype.compareTo=function(n){var i=n;return this._distance<i._distance?-1:this._distance>i._distance?1:0},_r.prototype.expand=function(n,i,s,l){for(var h=n.getChildBoundables().iterator();h.hasNext();){var v=h.next(),S=new _r(v,i,this._itemDistance);S.getDistance()<l&&s.add(S)}},_r.prototype.getBoundable=function(n){return n===0?this._boundable1:this._boundable2},_r.prototype.getDistance=function(){return this._distance},_r.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},_r.prototype.interfaces_=function(){return[z]},_r.prototype.getClass=function(){return _r},_r.area=function(n){return n.getBounds().getArea()},_r.isComposite=function(n){return n instanceof Ar};var Fr=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new nt,this._nodeCapacity=null,arguments.length===0){var i=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var s=arguments[0];kt.isTrue(s>1,"Node capacity must be greater than 1"),this._nodeCapacity=s}},Ur={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Fr.prototype.getNodeCapacity=function(){return this._nodeCapacity},Fr.prototype.lastNode=function(n){return n.get(n.size()-1)},Fr.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Ar?n+=this.size(s):s instanceof Xe&&(n+=1)}return n}},Fr.prototype.removeItem=function(n,i){for(var s=null,l=n.getChildBoundables().iterator();l.hasNext();){var h=l.next();h instanceof Xe&&h.getItem()===i&&(s=h)}return s!==null&&(n.getChildBoundables().remove(s),!0)},Fr.prototype.itemsTree=function(){if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new nt:n}if(arguments.length===1){for(var i=arguments[0],s=new nt,l=i.getChildBoundables().iterator();l.hasNext();){var h=l.next();if(h instanceof Ar){var v=this.itemsTree(h);v!==null&&s.add(v)}else h instanceof Xe?s.add(h.getItem()):kt.shouldNeverReachHere()}return s.size()<=0?null:s}},Fr.prototype.insert=function(n,i){kt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Xe(n,i))},Fr.prototype.boundablesAtLevel=function(){if(arguments.length===1){var n=arguments[0],i=new nt;return this.boundablesAtLevel(n,this._root,i),i}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];if(kt.isTrue(s>-2),l.getLevel()===s)return h.add(l),null;for(var v=l.getChildBoundables().iterator();v.hasNext();){var S=v.next();S instanceof Ar?this.boundablesAtLevel(s,S,h):(kt.isTrue(S instanceof Xe),s===-1&&h.add(S))}return null}},Fr.prototype.query=function(){if(arguments.length===1){var n=arguments[0];this.build();var i=new nt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i),i}if(arguments.length===2){var s=arguments[0],l=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,l)}else if(arguments.length===3){if(et(arguments[2],Rs)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar)for(var h=arguments[0],v=arguments[1],S=arguments[2],R=v.getChildBoundables(),V=0;V<R.size();V++){var ot=R.get(V);this.getIntersectsOp().intersects(ot.getBounds(),h)&&(ot instanceof Ar?this.query(h,ot,S):ot instanceof Xe?S.visitItem(ot.getItem()):kt.shouldNeverReachHere())}else if(et(arguments[2],ut)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar)for(var St=arguments[0],bt=arguments[1],Yt=arguments[2],Jt=bt.getChildBoundables(),se=0;se<Jt.size();se++){var _e=Jt.get(se);this.getIntersectsOp().intersects(_e.getBounds(),St)&&(_e instanceof Ar?this.query(St,_e,Yt):_e instanceof Xe?Yt.add(_e.getItem()):kt.shouldNeverReachHere())}}},Fr.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Fr.prototype.getRoot=function(){return this.build(),this._root},Fr.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.remove(n,this._root,i)}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2],v=this.removeItem(l,h);if(v)return!0;for(var S=null,R=l.getChildBoundables().iterator();R.hasNext();){var V=R.next();if(this.getIntersectsOp().intersects(V.getBounds(),s)&&V instanceof Ar&&(v=this.remove(s,V,h))){S=V;break}}return S!==null&&S.getChildBoundables().isEmpty()&&l.getChildBoundables().remove(S),v}},Fr.prototype.createHigherLevels=function(n,i){kt.isTrue(!n.isEmpty());var s=this.createParentBoundables(n,i+1);return s.size()===1?s.get(0):this.createHigherLevels(s,i+1)},Fr.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Ar){var l=this.depth(s);l>n&&(n=l)}}return n+1}},Fr.prototype.createParentBoundables=function(n,i){kt.isTrue(!n.isEmpty());var s=new nt;s.add(this.createNode(i));var l=new nt(n);uo.sort(l,this.getComparator());for(var h=l.iterator();h.hasNext();){var v=h.next();this.lastNode(s).getChildBoundables().size()===this.getNodeCapacity()&&s.add(this.createNode(i)),this.lastNode(s).addChildBoundable(v)}return s},Fr.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Fr.prototype.interfaces_=function(){return[t]},Fr.prototype.getClass=function(){return Fr},Fr.compareDoubles=function(n,i){return n>i?1:n<i?-1:0},Ur.IntersectsOp.get=function(){return Pc},Ur.serialVersionUID.get=function(){return-3886435814360241e3},Ur.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Fr,Ur);var Pc=function(){},Ao=function(){};Ao.prototype.distance=function(n,i){},Ao.prototype.interfaces_=function(){return[]},Ao.prototype.getClass=function(){return Ao};var Ic=function(n){function i(l){l=l||i.DEFAULT_NODE_CAPACITY,n.call(this,l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(l,h){kt.isTrue(l.length>0);for(var v=new nt,S=0;S<l.length;S++)v.addAll(this.createParentBoundablesFromVerticalSlice(l[S],h));return v},i.prototype.createNode=function(l){return new vl(l)},i.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return n.prototype.insert.apply(this,arguments);var l=arguments[0],h=arguments[1];if(l.isNull())return null;n.prototype.insert.call(this,l,h)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(l,h){for(var v=Math.trunc(Math.ceil(l.size()/h)),S=new Array(h).fill(null),R=l.iterator(),V=0;V<h;V++){S[V]=new nt;for(var ot=0;R.hasNext()&&ot<v;){var St=R.next();S[V].add(St),ot++}}return S},i.prototype.query=function(){if(arguments.length===1){var l=arguments[0];return n.prototype.query.call(this,l)}if(arguments.length===2){var h=arguments[0],v=arguments[1];n.prototype.query.call(this,h,v)}else if(arguments.length===3){if(et(arguments[2],Rs)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar){var S=arguments[0],R=arguments[1],V=arguments[2];n.prototype.query.call(this,S,R,V)}else if(et(arguments[2],ut)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar){var ot=arguments[0],St=arguments[1],bt=arguments[2];n.prototype.query.call(this,ot,St,bt)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(l,h){return n.prototype.createParentBoundables.call(this,l,h)},i.prototype.remove=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return n.prototype.remove.call(this,l,h)}return n.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(l,h){kt.isTrue(!l.isEmpty());var v=Math.trunc(Math.ceil(l.size()/this.getNodeCapacity())),S=new nt(l);uo.sort(S,i.xComparator);var R=this.verticalSlices(S,Math.trunc(Math.ceil(Math.sqrt(v))));return this.createParentBoundablesFromVerticalSlices(R,h)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(et(arguments[0],Ao)){var l=arguments[0],h=new _r(this.getRoot(),this.getRoot(),l);return this.nearestNeighbour(h)}if(arguments[0]instanceof _r){var v=arguments[0];return this.nearestNeighbour(v,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&et(arguments[1],Ao)){var S=arguments[0],R=arguments[1],V=new _r(this.getRoot(),S.getRoot(),R);return this.nearestNeighbour(V)}if(arguments[0]instanceof _r&&typeof arguments[1]=="number"){var ot=arguments[0],St=arguments[1],bt=null,Yt=new hs;for(Yt.add(ot);!Yt.isEmpty()&&St>0;){var Jt=Yt.poll(),se=Jt.getDistance();if(se>=St)break;Jt.isLeaves()?(St=se,bt=Jt):Jt.expandToQueue(Yt,St)}return[bt.getBoundable(0).getItem(),bt.getBoundable(1).getItem()]}}else if(arguments.length===3){var _e=arguments[0],Cn=arguments[1],Xn=arguments[2],ui=new Xe(_e,Cn),rs=new _r(this.getRoot(),ui,Xn);return this.nearestNeighbour(rs)[0]}},i.prototype.interfaces_=function(){return[Ea,t]},i.prototype.getClass=function(){return i},i.centreX=function(l){return i.avg(l.getMinX(),l.getMaxX())},i.avg=function(l,h){return(l+h)/2},i.centreY=function(l){return i.avg(l.getMinY(),l.getMaxY())},s.STRtreeNode.get=function(){return vl},s.serialVersionUID.get=function(){return 0x39920f7d5f261e0},s.xComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(l,h){return n.compareDoubles(i.centreX(l.getBounds()),i.centreX(h.getBounds()))}}},s.yComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(l,h){return n.compareDoubles(i.centreY(l.getBounds()),i.centreY(h.getBounds()))}}},s.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(l,h){return l.intersects(h)}}},s.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,s),i}(Fr),vl=function(n){function i(){var s=arguments[0];n.call(this,s)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var s=null,l=this.getChildBoundables().iterator();l.hasNext();){var h=l.next();s===null?s=new Xt(h.getBounds()):s.expandToInclude(h.getBounds())}return s},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),ir=function(){};ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.relativeSign=function(n,i){return n<i?-1:n>i?1:0},ir.compare=function(n,i,s){if(i.equals2D(s))return 0;var l=ir.relativeSign(i.x,s.x),h=ir.relativeSign(i.y,s.y);switch(n){case 0:return ir.compareValue(l,h);case 1:return ir.compareValue(h,l);case 2:return ir.compareValue(h,-l);case 3:return ir.compareValue(-l,h);case 4:return ir.compareValue(-l,-h);case 5:return ir.compareValue(-h,-l);case 6:return ir.compareValue(-h,l);case 7:return ir.compareValue(l,-h)}return kt.shouldNeverReachHere("invalid octant value"),0},ir.compareValue=function(n,i){return n<0?-1:n>0?1:i<0?-1:i>0?1:0};var ps=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._segString=n,this.coord=new D(i),this.segmentIndex=s,this._segmentOctant=l,this._isInterior=!i.equals2D(n.getCoordinate(s))};ps.prototype.getCoordinate=function(){return this.coord},ps.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},ps.prototype.compareTo=function(n){var i=n;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:ir.compare(this._segmentOctant,this.coord,i.coord)},ps.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},ps.prototype.isInterior=function(){return this._isInterior},ps.prototype.interfaces_=function(){return[z]},ps.prototype.getClass=function(){return ps};var Qr=function(){this._nodeMap=new w,this._edge=null;var n=arguments[0];this._edge=n};Qr.prototype.getSplitCoordinates=function(){var n=new dt;this.addEndpoints();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next();this.addEdgeCoordinates(s,l,n),s=l}return n.toCoordinateArray()},Qr.prototype.addCollapsedNodes=function(){var n=new nt;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var i=n.iterator();i.hasNext();){var s=i.next().intValue();this.add(this._edge.getCoordinate(s),s)}},Qr.prototype.print=function(n){n.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(n)},Qr.prototype.findCollapsesFromExistingVertices=function(n){for(var i=0;i<this._edge.size()-2;i++){var s=this._edge.getCoordinate(i),l=this._edge.getCoordinate(i+2);s.equals2D(l)&&n.add(new Et(i+1))}},Qr.prototype.addEdgeCoordinates=function(n,i,s){var l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);s.add(new D(n.coord),!1);for(var v=n.segmentIndex+1;v<=i.segmentIndex;v++)s.add(this._edge.getCoordinate(v));h&&s.add(new D(i.coord))},Qr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qr.prototype.addSplitEdges=function(n){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next(),h=this.createSplitEdge(s,l);n.add(h),s=l}},Qr.prototype.findCollapseIndex=function(n,i,s){if(!n.coord.equals2D(i.coord))return!1;var l=i.segmentIndex-n.segmentIndex;return i.isInterior()||l--,l===1&&(s[0]=n.segmentIndex+1,!0)},Qr.prototype.findCollapsesFromInsertedNodes=function(n){for(var i=new Array(1).fill(null),s=this.iterator(),l=s.next();s.hasNext();){var h=s.next();this.findCollapseIndex(l,h,i)&&n.add(new Et(i[0])),l=h}},Qr.prototype.getEdge=function(){return this._edge},Qr.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(n),n)},Qr.prototype.createSplitEdge=function(n,i){var s=i.segmentIndex-n.segmentIndex+2,l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);h||s--;var v=new Array(s).fill(null),S=0;v[S++]=new D(n.coord);for(var R=n.segmentIndex+1;R<=i.segmentIndex;R++)v[S++]=this._edge.getCoordinate(R);return h&&(v[S]=new D(i.coord)),new dr(v,this._edge.getData())},Qr.prototype.add=function(n,i){var s=new ps(this._edge,n,i,this._edge.getSegmentOctant(i)),l=this._nodeMap.get(s);return l!==null?(kt.isTrue(l.coord.equals2D(n),"Found equal nodes with different coordinates"),l):(this._nodeMap.put(s,s),s)},Qr.prototype.checkSplitEdgesCorrectness=function(n){var i=this._edge.getCoordinates(),s=n.get(0).getCoordinate(0);if(!s.equals2D(i[0]))throw new Ue("bad split edge start point at "+s);var l=n.get(n.size()-1).getCoordinates(),h=l[l.length-1];if(!h.equals2D(i[i.length-1]))throw new Ue("bad split edge end point at "+h)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var Zs=function(){};Zs.prototype.interfaces_=function(){return[]},Zs.prototype.getClass=function(){return Zs},Zs.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new N("Cannot compute the octant for point ( "+n+", "+i+" )");var s=Math.abs(n),l=Math.abs(i);return n>=0?i>=0?s>=l?0:1:s>=l?7:6:i>=0?s>=l?3:2:s>=l?4:5}if(arguments[0]instanceof D&&arguments[1]instanceof D){var h=arguments[0],v=arguments[1],S=v.x-h.x,R=v.y-h.y;if(S===0&&R===0)throw new N("Cannot compute the octant for two identical points "+h);return Zs.octant(S,R)}};var Co=function(){};Co.prototype.getCoordinates=function(){},Co.prototype.size=function(){},Co.prototype.getCoordinate=function(n){},Co.prototype.isClosed=function(){},Co.prototype.setData=function(n){},Co.prototype.getData=function(){},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var tu=function(){};tu.prototype.addIntersection=function(n,i){},tu.prototype.interfaces_=function(){return[Co]},tu.prototype.getClass=function(){return tu};var dr=function(){this._nodeList=new Qr(this),this._pts=null,this._data=null;var n=arguments[0],i=arguments[1];this._pts=n,this._data=i};dr.prototype.getCoordinates=function(){return this._pts},dr.prototype.size=function(){return this._pts.length},dr.prototype.getCoordinate=function(n){return this._pts[n]},dr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dr.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},dr.prototype.setData=function(n){this._data=n},dr.prototype.safeOctant=function(n,i){return n.equals2D(i)?0:Zs.octant(n,i)},dr.prototype.getData=function(){return this._data},dr.prototype.addIntersection=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.addIntersectionNode(n,i)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],h=arguments[3],v=new D(s.getIntersection(h));this.addIntersection(v,l)}},dr.prototype.toString=function(){return de.toLineString(new De(this._pts))},dr.prototype.getNodeList=function(){return this._nodeList},dr.prototype.addIntersectionNode=function(n,i){var s=i,l=s+1;if(l<this._pts.length){var h=this._pts[l];n.equals2D(h)&&(s=l)}return this._nodeList.add(n,s)},dr.prototype.addIntersections=function(n,i,s){for(var l=0;l<n.getIntersectionNum();l++)this.addIntersection(n,i,s,l)},dr.prototype.interfaces_=function(){return[tu]},dr.prototype.getClass=function(){return dr},dr.getNodedSubstrings=function(){if(arguments.length===1){var n=arguments[0],i=new nt;return dr.getNodedSubstrings(n,i),i}if(arguments.length===2)for(var s=arguments[0],l=arguments[1],h=s.iterator();h.hasNext();)h.next().getNodeList().addSplitEdges(l)};var ne=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new D,this.p1=new D;else if(arguments.length===1){var n=arguments[0];this.p0=new D(n.p0),this.p1=new D(n.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],s=arguments[1],l=arguments[2],h=arguments[3];this.p0=new D(i,s),this.p1=new D(l,h)}},Of={serialVersionUID:{configurable:!0}};ne.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ne.prototype.orientationIndex=function(){if(arguments[0]instanceof ne){var n=arguments[0],i=rt.orientationIndex(this.p0,this.p1,n.p0),s=rt.orientationIndex(this.p0,this.p1,n.p1);return i>=0&&s>=0||i<=0&&s<=0?Math.max(i,s):0}if(arguments[0]instanceof D){var l=arguments[0];return rt.orientationIndex(this.p0,this.p1,l)}},ne.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])},ne.prototype.isVertical=function(){return this.p0.x===this.p1.x},ne.prototype.equals=function(n){if(!(n instanceof ne))return!1;var i=n;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},ne.prototype.intersection=function(n){var i=new $n;return i.computeIntersection(this.p0,this.p1,n.p0,n.p1),i.hasIntersection()?i.getIntersection(0):null},ne.prototype.project=function(){if(arguments[0]instanceof D){var n=arguments[0];if(n.equals(this.p0)||n.equals(this.p1))return new D(n);var i=this.projectionFactor(n),s=new D;return s.x=this.p0.x+i*(this.p1.x-this.p0.x),s.y=this.p0.y+i*(this.p1.y-this.p0.y),s}if(arguments[0]instanceof ne){var l=arguments[0],h=this.projectionFactor(l.p0),v=this.projectionFactor(l.p1);if(h>=1&&v>=1||h<=0&&v<=0)return null;var S=this.project(l.p0);h<0&&(S=this.p0),h>1&&(S=this.p1);var R=this.project(l.p1);return v<0&&(R=this.p0),v>1&&(R=this.p1),new ne(S,R)}},ne.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ne.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ne.prototype.getCoordinate=function(n){return n===0?this.p0:this.p1},ne.prototype.distancePerpendicular=function(n){return rt.distancePointLinePerpendicular(n,this.p0,this.p1)},ne.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ne.prototype.midPoint=function(){return ne.midPoint(this.p0,this.p1)},ne.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,l=i*i+s*s;return l<=0?A.NaN:((n.x-this.p0.x)*i+(n.y-this.p0.y)*s)/l},ne.prototype.closestPoints=function(n){var i=this.intersection(n);if(i!==null)return[i,i];var s=new Array(2).fill(null),l=A.MAX_VALUE,h=null,v=this.closestPoint(n.p0);l=v.distance(n.p0),s[0]=v,s[1]=n.p0;var S=this.closestPoint(n.p1);(h=S.distance(n.p1))<l&&(l=h,s[0]=S,s[1]=n.p1);var R=n.closestPoint(this.p0);(h=R.distance(this.p0))<l&&(l=h,s[0]=this.p0,s[1]=R);var V=n.closestPoint(this.p1);return(h=V.distance(this.p1))<l&&(l=h,s[0]=this.p1,s[1]=V),s},ne.prototype.closestPoint=function(n){var i=this.projectionFactor(n);return i>0&&i<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1},ne.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ne.prototype.getLength=function(){return this.p0.distance(this.p1)},ne.prototype.compareTo=function(n){var i=n,s=this.p0.compareTo(i.p0);return s!==0?s:this.p1.compareTo(i.p1)},ne.prototype.reverse=function(){var n=this.p0;this.p0=this.p1,this.p1=n},ne.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)},ne.prototype.lineIntersection=function(n){try{return me.intersection(this.p0,this.p1,n.p0,n.p1)}catch(i){if(!(i instanceof le))throw i}return null},ne.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ne.prototype.pointAlongOffset=function(n,i){var s=this.p0.x+n*(this.p1.x-this.p0.x),l=this.p0.y+n*(this.p1.y-this.p0.y),h=this.p1.x-this.p0.x,v=this.p1.y-this.p0.y,S=Math.sqrt(h*h+v*v),R=0,V=0;if(i!==0){if(S<=0)throw new Error("Cannot compute offset from zero-length line segment");R=i*h/S,V=i*v/S}return new D(s-V,l+R)},ne.prototype.setCoordinates=function(){if(arguments.length===1){var n=arguments[0];this.setCoordinates(n.p0,n.p1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=s.x,this.p1.y=s.y}},ne.prototype.segmentFraction=function(n){var i=this.projectionFactor(n);return i<0?i=0:(i>1||A.isNaN(i))&&(i=1),i},ne.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ne.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ne.prototype.distance=function(){if(arguments[0]instanceof ne){var n=arguments[0];return rt.distanceLineLine(this.p0,this.p1,n.p0,n.p1)}if(arguments[0]instanceof D){var i=arguments[0];return rt.distancePointLine(i,this.p0,this.p1)}},ne.prototype.pointAlong=function(n){var i=new D;return i.x=this.p0.x+n*(this.p1.x-this.p0.x),i.y=this.p0.y+n*(this.p1.y-this.p0.y),i},ne.prototype.hashCode=function(){var n=A.doubleToLongBits(this.p0.x);n^=31*A.doubleToLongBits(this.p0.y);var i=Math.trunc(n)^Math.trunc(n>>32),s=A.doubleToLongBits(this.p1.x);return s^=31*A.doubleToLongBits(this.p1.y),i^(Math.trunc(s)^Math.trunc(s>>32))},ne.prototype.interfaces_=function(){return[z,t]},ne.prototype.getClass=function(){return ne},ne.midPoint=function(n,i){return new D((n.x+i.x)/2,(n.y+i.y)/2)},Of.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ne,Of);var wi=function(){this.tempEnv1=new Xt,this.tempEnv2=new Xt,this._overlapSeg1=new ne,this._overlapSeg2=new ne};wi.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];n.getLineSegment(i,this._overlapSeg1),s.getLineSegment(l,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Mi=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._pts=n,this._start=i,this._end=s,this._context=l};Mi.prototype.getLineSegment=function(n,i){i.p0=this._pts[n],i.p1=this._pts[n+1]},Mi.prototype.computeSelect=function(n,i,s,l){var h=this._pts[i],v=this._pts[s];if(l.tempEnv1.init(h,v),s-i==1)return l.select(this,i),null;if(!n.intersects(l.tempEnv1))return null;var S=Math.trunc((i+s)/2);i<S&&this.computeSelect(n,i,S,l),S<s&&this.computeSelect(n,S,s,l)},Mi.prototype.getCoordinates=function(){for(var n=new Array(this._end-this._start+1).fill(null),i=0,s=this._start;s<=this._end;s++)n[i++]=this._pts[s];return n},Mi.prototype.computeOverlaps=function(n,i){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,i)},Mi.prototype.setId=function(n){this._id=n},Mi.prototype.select=function(n,i){this.computeSelect(n,this._start,this._end,i)},Mi.prototype.getEnvelope=function(){if(this._env===null){var n=this._pts[this._start],i=this._pts[this._end];this._env=new Xt(n,i)}return this._env},Mi.prototype.getEndIndex=function(){return this._end},Mi.prototype.getStartIndex=function(){return this._start},Mi.prototype.getContext=function(){return this._context},Mi.prototype.getId=function(){return this._id},Mi.prototype.computeOverlapsInternal=function(n,i,s,l,h,v){var S=this._pts[n],R=this._pts[i],V=s._pts[l],ot=s._pts[h];if(i-n==1&&h-l==1)return v.overlap(this,n,s,l),null;if(v.tempEnv1.init(S,R),v.tempEnv2.init(V,ot),!v.tempEnv1.intersects(v.tempEnv2))return null;var St=Math.trunc((n+i)/2),bt=Math.trunc((l+h)/2);n<St&&(l<bt&&this.computeOverlapsInternal(n,St,s,l,bt,v),bt<h&&this.computeOverlapsInternal(n,St,s,bt,h,v)),St<i&&(l<bt&&this.computeOverlapsInternal(St,i,s,l,bt,v),bt<h&&this.computeOverlapsInternal(St,i,s,bt,h,v))},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.getChainStartIndices=function(n){var i=0,s=new nt;s.add(new Et(i));do{var l=lo.findChainEnd(n,i);s.add(new Et(l)),i=l}while(i<n.length-1);return lo.toIntArray(s)},lo.findChainEnd=function(n,i){for(var s=i;s<n.length-1&&n[s].equals2D(n[s+1]);)s++;if(s>=n.length-1)return n.length-1;for(var l=kn.quadrant(n[s],n[s+1]),h=i+1;h<n.length&&!(!n[h-1].equals2D(n[h])&&kn.quadrant(n[h-1],n[h])!==l);)h++;return h-1},lo.getChains=function(){if(arguments.length===1){var n=arguments[0];return lo.getChains(n,null)}if(arguments.length===2){for(var i=arguments[0],s=arguments[1],l=new nt,h=lo.getChainStartIndices(i),v=0;v<h.length-1;v++){var S=new Mi(i,h[v],h[v+1],s);l.add(S)}return l}},lo.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),s=0;s<i.length;s++)i[s]=n.get(s).intValue();return i};var zi=function(){};zi.prototype.computeNodes=function(n){},zi.prototype.getNodedSubstrings=function(){},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi};var Js=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};Js.prototype.setSegmentIntersector=function(n){this._segInt=n},Js.prototype.interfaces_=function(){return[zi]},Js.prototype.getClass=function(){return Js};var zu=function(n){function i(l){l?n.call(this,l):n.call(this),this._monoChains=new nt,this._index=new Ic,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return dr.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(l){for(var h=lo.getChains(l.getCoordinates(),l).iterator();h.hasNext();){var v=h.next();v.setId(this._idCounter++),this._index.insert(v.getEnvelope(),v),this._monoChains.add(v)}},i.prototype.computeNodes=function(l){this._nodedSegStrings=l;for(var h=l.iterator();h.hasNext();)this.add(h.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var l=new xr(this._segInt),h=this._monoChains.iterator();h.hasNext();)for(var v=h.next(),S=this._index.query(v.getEnvelope()).iterator();S.hasNext();){var R=S.next();if(R.getId()>v.getId()&&(v.computeOverlaps(R,l),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.SegmentOverlapAction.get=function(){return xr},Object.defineProperties(i,s),i}(Js),xr=function(n){function i(){n.call(this),this._si=null;var s=arguments[0];this._si=s}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return n.prototype.overlap.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2],v=arguments[3],S=s.getContext(),R=h.getContext();this._si.processIntersections(S,l,R,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(wi),Fe=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.setQuadrantSegments(s),this.setEndCapStyle(l)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this.setQuadrantSegments(h),this.setEndCapStyle(v),this.setJoinStyle(S),this.setMitreLimit(R)}}},Po={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Fe.prototype.getEndCapStyle=function(){return this._endCapStyle},Fe.prototype.isSingleSided=function(){return this._isSingleSided},Fe.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n,this._quadrantSegments===0&&(this._joinStyle=Fe.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Fe.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),n<=0&&(this._quadrantSegments=1),this._joinStyle!==Fe.JOIN_ROUND&&(this._quadrantSegments=Fe.DEFAULT_QUADRANT_SEGMENTS)},Fe.prototype.getJoinStyle=function(){return this._joinStyle},Fe.prototype.setJoinStyle=function(n){this._joinStyle=n},Fe.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n},Fe.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Fe.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Fe.prototype.setEndCapStyle=function(n){this._endCapStyle=n},Fe.prototype.getMitreLimit=function(){return this._mitreLimit},Fe.prototype.setMitreLimit=function(n){this._mitreLimit=n},Fe.prototype.setSingleSided=function(n){this._isSingleSided=n},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.bufferDistanceError=function(n){var i=Math.PI/2/n;return 1-Math.cos(i/2)},Po.CAP_ROUND.get=function(){return 1},Po.CAP_FLAT.get=function(){return 2},Po.CAP_SQUARE.get=function(){return 3},Po.JOIN_ROUND.get=function(){return 1},Po.JOIN_MITRE.get=function(){return 2},Po.JOIN_BEVEL.get=function(){return 3},Po.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Po.DEFAULT_MITRE_LIMIT.get=function(){return 5},Po.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Fe,Po);var gr=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=rt.COUNTERCLOCKWISE,this._inputLine=n||null},wa={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};gr.prototype.isDeletable=function(n,i,s,l){var h=this._inputLine[n],v=this._inputLine[i],S=this._inputLine[s];return!!this.isConcave(h,v,S)&&!!this.isShallow(h,v,S,l)&&this.isShallowSampled(h,v,n,s,l)},gr.prototype.deleteShallowConcavities=function(){for(var n=1,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i),l=!1;s<this._inputLine.length;){var h=!1;this.isDeletable(n,i,s,this._distanceTol)&&(this._isDeleted[i]=gr.DELETE,h=!0,l=!0),n=h?s:i,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i)}return l},gr.prototype.isShallowConcavity=function(n,i,s,l){return rt.computeOrientation(n,i,s)!==this._angleOrientation?!1:rt.distancePointLine(i,n,s)<l},gr.prototype.isShallowSampled=function(n,i,s,l,h){var v=Math.trunc((l-s)/gr.NUM_PTS_TO_CHECK);v<=0&&(v=1);for(var S=s;S<l;S+=v)if(!this.isShallow(n,i,this._inputLine[S],h))return!1;return!0},gr.prototype.isConcave=function(n,i,s){var l=rt.computeOrientation(n,i,s)===this._angleOrientation;return l},gr.prototype.simplify=function(n){this._distanceTol=Math.abs(n),n<0&&(this._angleOrientation=rt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},gr.prototype.findNextNonDeletedIndex=function(n){for(var i=n+1;i<this._inputLine.length&&this._isDeleted[i]===gr.DELETE;)i++;return i},gr.prototype.isShallow=function(n,i,s,l){return rt.distancePointLine(i,n,s)<l},gr.prototype.collapseLine=function(){for(var n=new dt,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==gr.DELETE&&n.add(this._inputLine[i]);return n.toCoordinateArray()},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.simplify=function(n,i){return new gr(n).simplify(i)},wa.INIT.get=function(){return 0},wa.DELETE.get=function(){return 1},wa.KEEP.get=function(){return 1},wa.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(gr,wa);var Gi=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new nt},Df={COORDINATE_ARRAY_TYPE:{configurable:!0}};Gi.prototype.getCoordinates=function(){return this._ptList.toArray(Gi.COORDINATE_ARRAY_TYPE)},Gi.prototype.setPrecisionModel=function(n){this._precisionModel=n},Gi.prototype.addPt=function(n){var i=new D(n);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},Gi.prototype.revere=function(){},Gi.prototype.addPts=function(n,i){if(i)for(var s=0;s<n.length;s++)this.addPt(n[s]);else for(var l=n.length-1;l>=0;l--)this.addPt(n[l])},Gi.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return n.distance(i)<this._minimimVertexDistance},Gi.prototype.toString=function(){return new Ce().createLineString(this.getCoordinates()).toString()},Gi.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new D(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(n.equals(i))return null;this._ptList.add(n)},Gi.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi},Df.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Gi,Df);var Ge=function(){},Ks={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.toDegrees=function(n){return 180*n/Math.PI},Ge.normalize=function(n){for(;n>Math.PI;)n-=Ge.PI_TIMES_2;for(;n<=-Math.PI;)n+=Ge.PI_TIMES_2;return n},Ge.angle=function(){if(arguments.length===1){var n=arguments[0];return Math.atan2(n.y,n.x)}if(arguments.length===2){var i=arguments[0],s=arguments[1],l=s.x-i.x,h=s.y-i.y;return Math.atan2(h,l)}},Ge.isAcute=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)>0},Ge.isObtuse=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)<0},Ge.interiorAngle=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s);return Math.abs(h-l)},Ge.normalizePositive=function(n){if(n<0){for(;n<0;)n+=Ge.PI_TIMES_2;n>=Ge.PI_TIMES_2&&(n=0)}else{for(;n>=Ge.PI_TIMES_2;)n-=Ge.PI_TIMES_2;n<0&&(n=0)}return n},Ge.angleBetween=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s);return Ge.diff(l,h)},Ge.diff=function(n,i){var s=null;return(s=n<i?i-n:n-i)>Math.PI&&(s=2*Math.PI-s),s},Ge.toRadians=function(n){return n*Math.PI/180},Ge.getTurn=function(n,i){var s=Math.sin(i-n);return s>0?Ge.COUNTERCLOCKWISE:s<0?Ge.CLOCKWISE:Ge.NONE},Ge.angleBetweenOriented=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s)-l;return h<=-Math.PI?h+Ge.PI_TIMES_2:h>Math.PI?h-Ge.PI_TIMES_2:h},Ks.PI_TIMES_2.get=function(){return 2*Math.PI},Ks.PI_OVER_2.get=function(){return Math.PI/2},Ks.PI_OVER_4.get=function(){return Math.PI/4},Ks.COUNTERCLOCKWISE.get=function(){return rt.COUNTERCLOCKWISE},Ks.CLOCKWISE.get=function(){return rt.CLOCKWISE},Ks.NONE.get=function(){return rt.COLLINEAR},Object.defineProperties(Ge,Ks);var qn=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ne,this._seg1=new ne,this._offset0=new ne,this._offset1=new ne,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],s=arguments[1],l=arguments[2];this._precisionModel=i,this._bufParams=s,this._li=new $n,this._filletAngleQuantum=Math.PI/2/s.getQuadrantSegments(),s.getQuadrantSegments()>=8&&s.getJoinStyle()===Fe.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(l)},ds={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qn.prototype.addNextSegment=function(n,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,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 s=rt.computeOrientation(this._s0,this._s1,this._s2),l=s===rt.CLOCKWISE&&this._side===Ht.LEFT||s===rt.COUNTERCLOCKWISE&&this._side===Ht.RIGHT;s===0?this.addCollinear(i):l?this.addOutsideTurn(s,i):this.addInsideTurn(s,i)},qn.prototype.addLineEndCap=function(n,i){var s=new ne(n,i),l=new ne;this.computeOffsetSegment(s,Ht.LEFT,this._distance,l);var h=new ne;this.computeOffsetSegment(s,Ht.RIGHT,this._distance,h);var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v);switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:this._segList.addPt(l.p1),this.addFilletArc(i,R+Math.PI/2,R-Math.PI/2,rt.CLOCKWISE,this._distance),this._segList.addPt(h.p1);break;case Fe.CAP_FLAT:this._segList.addPt(l.p1),this._segList.addPt(h.p1);break;case Fe.CAP_SQUARE:var V=new D;V.x=Math.abs(this._distance)*Math.cos(R),V.y=Math.abs(this._distance)*Math.sin(R);var ot=new D(l.p1.x+V.x,l.p1.y+V.y),St=new D(h.p1.x+V.x,h.p1.y+V.y);this._segList.addPt(ot),this._segList.addPt(St)}},qn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},qn.prototype.addMitreJoin=function(n,i,s,l){var h=!0,v=null;try{v=me.intersection(i.p0,i.p1,s.p0,s.p1),(l<=0?1:v.distance(n)/Math.abs(l))>this._bufParams.getMitreLimit()&&(h=!1)}catch(S){if(!(S instanceof le))throw S;v=new D(0,0),h=!1}h?this._segList.addPt(v):this.addLimitedMitreJoin(i,s,l,this._bufParams.getMitreLimit())},qn.prototype.addFilletCorner=function(n,i,s,l,h){var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v),V=s.x-n.x,ot=s.y-n.y,St=Math.atan2(ot,V);l===rt.CLOCKWISE?R<=St&&(R+=2*Math.PI):R>=St&&(R-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(n,R,St,l,h),this._segList.addPt(s)},qn.prototype.addOutsideTurn=function(n,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(i&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))},qn.prototype.createSquare=function(n){this._segList.addPt(new D(n.x+this._distance,n.y+this._distance)),this._segList.addPt(new D(n.x+this._distance,n.y-this._distance)),this._segList.addPt(new D(n.x-this._distance,n.y-this._distance)),this._segList.addPt(new D(n.x-this._distance,n.y+this._distance)),this._segList.closeRing()},qn.prototype.addSegments=function(n,i){this._segList.addPts(n,i)},qn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qn.prototype.initSideSegments=function(n,i,s){this._s1=n,this._s2=i,this._side=s,this._seg1.setCoordinates(n,i),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)},qn.prototype.addLimitedMitreJoin=function(n,i,s,l){var h=this._seg0.p1,v=Ge.angle(h,this._seg0.p0),S=Ge.angleBetweenOriented(this._seg0.p0,h,this._seg1.p1)/2,R=Ge.normalize(v+S),V=Ge.normalize(R+Math.PI),ot=l*s,St=s-ot*Math.abs(Math.sin(S)),bt=h.x+ot*Math.cos(V),Yt=h.y+ot*Math.sin(V),Jt=new D(bt,Yt),se=new ne(h,Jt),_e=se.pointAlongOffset(1,St),Cn=se.pointAlongOffset(1,-St);this._side===Ht.LEFT?(this._segList.addPt(_e),this._segList.addPt(Cn)):(this._segList.addPt(Cn),this._segList.addPt(_e))},qn.prototype.computeOffsetSegment=function(n,i,s,l){var h=i===Ht.LEFT?1:-1,v=n.p1.x-n.p0.x,S=n.p1.y-n.p0.y,R=Math.sqrt(v*v+S*S),V=h*s*v/R,ot=h*s*S/R;l.p0.x=n.p0.x-ot,l.p0.y=n.p0.y+V,l.p1.x=n.p1.x-ot,l.p1.y=n.p1.y+V},qn.prototype.addFilletArc=function(n,i,s,l,h){var v=l===rt.CLOCKWISE?-1:1,S=Math.abs(i-s),R=Math.trunc(S/this._filletAngleQuantum+.5);if(R<1)return null;for(var V=S/R,ot=0,St=new D;ot<S;){var bt=i+v*ot;St.x=n.x+h*Math.cos(bt),St.y=n.y+h*Math.sin(bt),this._segList.addPt(St),ot+=V}},qn.prototype.addInsideTurn=function(n,i){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*qn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var s=new D((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(s);var l=new D((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(l)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qn.prototype.createCircle=function(n){var i=new D(n.x+this._distance,n.y);this._segList.addPt(i),this.addFilletArc(n,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qn.prototype.addBevelJoin=function(n,i){this._segList.addPt(n.p1),this._segList.addPt(i.p0)},qn.prototype.init=function(n){this._distance=n,this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Gi,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(n*qn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qn.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL||this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,rt.CLOCKWISE,this._distance))},qn.prototype.closeRing=function(){this._segList.closeRing()},qn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},ds.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},ds.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},ds.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ds.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qn,ds);var hi=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var n=arguments[0],i=arguments[1];this._precisionModel=n,this._bufParams=i};hi.prototype.getOffsetCurve=function(n,i){if(this._distance=i,i===0)return null;var s=i<0,l=Math.abs(i),h=this.getSegGen(l);n.length<=1?this.computePointCurve(n[0],h):this.computeOffsetCurve(n,s,h);var v=h.getCoordinates();return s&&at.reverse(v),v},hi.prototype.computeSingleSidedBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){s.addSegments(n,!0);var h=gr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Ht.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{s.addSegments(n,!1);var R=gr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Ht.LEFT),s.addFirstSegment();for(var ot=2;ot<=V;ot++)s.addNextSegment(R[ot],!0)}s.addLastSegment(),s.closeRing()},hi.prototype.computeRingBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);i===Ht.RIGHT&&(l=-l);var h=gr.simplify(n,l),v=h.length-1;s.initSideSegments(h[v-1],h[0],i);for(var S=1;S<=v;S++){var R=S!==1;s.addNextSegment(h[S],R)}s.closeRing()},hi.prototype.computeLineBufferCurve=function(n,i){var s=this.simplifyTolerance(this._distance),l=gr.simplify(n,s),h=l.length-1;i.initSideSegments(l[0],l[1],Ht.LEFT);for(var v=2;v<=h;v++)i.addNextSegment(l[v],!0);i.addLastSegment(),i.addLineEndCap(l[h-1],l[h]);var S=gr.simplify(n,-s),R=S.length-1;i.initSideSegments(S[R],S[R-1],Ht.LEFT);for(var V=R-2;V>=0;V--)i.addNextSegment(S[V],!0);i.addLastSegment(),i.addLineEndCap(S[1],S[0]),i.closeRing()},hi.prototype.computePointCurve=function(n,i){switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:i.createCircle(n);break;case Fe.CAP_SQUARE:i.createSquare(n)}},hi.prototype.getLineCurve=function(n,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var s=Math.abs(i),l=this.getSegGen(s);if(n.length<=1)this.computePointCurve(n[0],l);else if(this._bufParams.isSingleSided()){var h=i<0;this.computeSingleSidedBufferCurve(n,h,l)}else this.computeLineBufferCurve(n,l);return l.getCoordinates()},hi.prototype.getBufferParameters=function(){return this._bufParams},hi.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()},hi.prototype.getRingCurve=function(n,i,s){if(this._distance=s,n.length<=2)return this.getLineCurve(n,s);if(s===0)return hi.copyCoordinates(n);var l=this.getSegGen(s);return this.computeRingBufferCurve(n,i,l),l.getCoordinates()},hi.prototype.computeOffsetCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){var h=gr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Ht.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{var R=gr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Ht.LEFT),s.addFirstSegment();for(var ot=2;ot<=V;ot++)s.addNextSegment(R[ot],!0)}s.addLastSegment()},hi.prototype.getSegGen=function(n){return new qn(this._precisionModel,this._bufParams,n)},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},hi.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),s=0;s<i.length;s++)i[s]=new D(n[s]);return i};var Qs=function(){this._subgraphs=null,this._seg=new ne,this._cga=new rt;var n=arguments[0];this._subgraphs=n},Rc={DepthSegment:{configurable:!0}};Qs.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var n=arguments[0],i=new nt,s=this._subgraphs.iterator();s.hasNext();){var l=s.next(),h=l.getEnvelope();n.y<h.getMinY()||n.y>h.getMaxY()||this.findStabbedSegments(n,l.getDirectedEdges(),i)}return i}if(arguments.length===3){if(et(arguments[2],ut)&&arguments[0]instanceof D&&arguments[1]instanceof Cc){for(var v=arguments[0],S=arguments[1],R=arguments[2],V=S.getEdge().getCoordinates(),ot=0;ot<V.length-1;ot++)if(this._seg.p0=V[ot],this._seg.p1=V[ot+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<v.x)&&!(this._seg.isHorizontal()||v.y<this._seg.p0.y||v.y>this._seg.p1.y||rt.computeOrientation(this._seg.p0,this._seg.p1,v)===rt.RIGHT)){var St=S.getDepth(Ht.LEFT);this._seg.p0.equals(V[ot])||(St=S.getDepth(Ht.RIGHT));var bt=new gs(this._seg,St);R.add(bt)}}else if(et(arguments[2],ut)&&arguments[0]instanceof D&&et(arguments[1],ut))for(var Yt=arguments[0],Jt=arguments[1],se=arguments[2],_e=Jt.iterator();_e.hasNext();){var Cn=_e.next();Cn.isForward()&&this.findStabbedSegments(Yt,Cn,se)}}},Qs.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:uo.min(i)._leftDepth},Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs},Rc.DepthSegment.get=function(){return gs},Object.defineProperties(Qs,Rc);var gs=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new ne(n),this._leftDepth=i};gs.prototype.compareTo=function(n){var i=n;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var s=this._upwardSeg.orientationIndex(i._upwardSeg);return s!==0||(s=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?s:this._upwardSeg.compareTo(i._upwardSeg)},gs.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},gs.prototype.toString=function(){return this._upwardSeg.toString()},gs.prototype.interfaces_=function(){return[z]},gs.prototype.getClass=function(){return gs};var We=function(n,i,s){this.p0=n||null,this.p1=i||null,this.p2=s||null};We.prototype.area=function(){return We.area(this.p0,this.p1,this.p2)},We.prototype.signedArea=function(){return We.signedArea(this.p0,this.p1,this.p2)},We.prototype.interpolateZ=function(n){if(n===null)throw new N("Supplied point is null.");return We.interpolateZ(n,this.p0,this.p1,this.p2)},We.prototype.longestSideLength=function(){return We.longestSideLength(this.p0,this.p1,this.p2)},We.prototype.isAcute=function(){return We.isAcute(this.p0,this.p1,this.p2)},We.prototype.circumcentre=function(){return We.circumcentre(this.p0,this.p1,this.p2)},We.prototype.area3D=function(){return We.area3D(this.p0,this.p1,this.p2)},We.prototype.centroid=function(){return We.centroid(this.p0,this.p1,this.p2)},We.prototype.inCentre=function(){return We.inCentre(this.p0,this.p1,this.p2)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.area=function(n,i,s){return Math.abs(((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2)},We.signedArea=function(n,i,s){return((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2},We.det=function(n,i,s,l){return n*l-i*s},We.interpolateZ=function(n,i,s,l){var h=i.x,v=i.y,S=s.x-h,R=l.x-h,V=s.y-v,ot=l.y-v,St=S*ot-R*V,bt=n.x-h,Yt=n.y-v,Jt=(ot*bt-R*Yt)/St,se=(-V*bt+S*Yt)/St;return i.z+Jt*(s.z-i.z)+se*(l.z-i.z)},We.longestSideLength=function(n,i,s){var l=n.distance(i),h=i.distance(s),v=s.distance(n),S=l;return h>S&&(S=h),v>S&&(S=v),S},We.isAcute=function(n,i,s){return!!Ge.isAcute(n,i,s)&&!!Ge.isAcute(i,s,n)&&!!Ge.isAcute(s,n,i)},We.circumcentre=function(n,i,s){var l=s.x,h=s.y,v=n.x-l,S=n.y-h,R=i.x-l,V=i.y-h,ot=2*We.det(v,S,R,V),St=We.det(S,v*v+S*S,V,R*R+V*V),bt=We.det(v,v*v+S*S,R,R*R+V*V);return new D(l-St/ot,h+bt/ot)},We.perpendicularBisector=function(n,i){var s=i.x-n.x,l=i.y-n.y,h=new me(n.x+s/2,n.y+l/2,1),v=new me(n.x-l+s/2,n.y+s+l/2,1);return new me(h,v)},We.angleBisector=function(n,i,s){var l=i.distance(n),h=l/(l+i.distance(s)),v=s.x-n.x,S=s.y-n.y;return new D(n.x+h*v,n.y+h*S)},We.area3D=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=i.z-n.z,S=s.x-n.x,R=s.y-n.y,V=s.z-n.z,ot=h*V-v*R,St=v*S-l*V,bt=l*R-h*S,Yt=ot*ot+St*St+bt*bt,Jt=Math.sqrt(Yt)/2;return Jt},We.centroid=function(n,i,s){var l=(n.x+i.x+s.x)/3,h=(n.y+i.y+s.y)/3;return new D(l,h)},We.inCentre=function(n,i,s){var l=i.distance(s),h=n.distance(s),v=n.distance(i),S=l+h+v,R=(l*n.x+h*i.x+v*s.x)/S,V=(l*n.y+h*i.y+v*s.y)/S;return new D(R,V)};var ki=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new nt;var n=arguments[0],i=arguments[1],s=arguments[2];this._inputGeom=n,this._distance=i,this._curveBuilder=s};ki.prototype.addPoint=function(n){if(this._distance<=0)return null;var i=n.getCoordinates(),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,Z.EXTERIOR,Z.INTERIOR)},ki.prototype.addPolygon=function(n){var i=this._distance,s=Ht.LEFT;this._distance<0&&(i=-this._distance,s=Ht.RIGHT);var l=n.getExteriorRing(),h=at.removeRepeatedPoints(l.getCoordinates());if(this._distance<0&&this.isErodedCompletely(l,this._distance)||this._distance<=0&&h.length<3)return null;this.addPolygonRing(h,i,s,Z.EXTERIOR,Z.INTERIOR);for(var v=0;v<n.getNumInteriorRing();v++){var S=n.getInteriorRingN(v),R=at.removeRepeatedPoints(S.getCoordinates());this._distance>0&&this.isErodedCompletely(S,-this._distance)||this.addPolygonRing(R,i,Ht.opposite(s),Z.INTERIOR,Z.EXTERIOR)}},ki.prototype.isTriangleErodedCompletely=function(n,i){var s=new We(n[0],n[1],n[2]),l=s.inCentre();return rt.distancePointLine(l,s.p0,s.p1)<Math.abs(i)},ki.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=at.removeRepeatedPoints(n.getCoordinates()),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,Z.EXTERIOR,Z.INTERIOR)},ki.prototype.addCurve=function(n,i,s){if(n===null||n.length<2)return null;var l=new dr(n,new An(0,Z.BOUNDARY,i,s));this._curveList.add(l)},ki.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ki.prototype.addPolygonRing=function(n,i,s,l,h){if(i===0&&n.length<Tn.MINIMUM_VALID_SIZE)return null;var v=l,S=h;n.length>=Tn.MINIMUM_VALID_SIZE&&rt.isCCW(n)&&(v=h,S=l,s=Ht.opposite(s));var R=this._curveBuilder.getRingCurve(n,s,i);this.addCurve(R,v,S)},ki.prototype.add=function(n){if(n.isEmpty())return null;n instanceof pe?this.addPolygon(n):n instanceof jt?this.addLineString(n):n instanceof ge?this.addPoint(n):n instanceof Oe?this.addCollection(n):n instanceof K?this.addCollection(n):n instanceof Bn?this.addCollection(n):n instanceof Zn&&this.addCollection(n)},ki.prototype.isErodedCompletely=function(n,i){var s=n.getCoordinates();if(s.length<4)return i<0;if(s.length===4)return this.isTriangleErodedCompletely(s,i);var l=n.getEnvelopeInternal(),h=Math.min(l.getHeight(),l.getWidth());return i<0&&2*Math.abs(i)>h},ki.prototype.addCollection=function(n){for(var i=0;i<n.getNumGeometries();i++){var s=n.getGeometryN(i);this.add(s)}},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var eu=function(){};eu.prototype.locate=function(n){},eu.prototype.interfaces_=function(){return[]},eu.prototype.getClass=function(){return eu};var co=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var n=arguments[0];this._parent=n,this._atStart=!0,this._index=0,this._max=n.getNumGeometries()};co.prototype.next=function(){if(this._atStart)return this._atStart=!1,co.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 o;var n=this._parent.getGeometryN(this._index++);return n instanceof Zn?(this._subcollectionIterator=new co(n),this._subcollectionIterator.next()):n},co.prototype.remove=function(){throw new Error(this.getClass().getName())},co.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},co.prototype.interfaces_=function(){return[k]},co.prototype.getClass=function(){return co},co.isAtomic=function(n){return!(n instanceof Zn)};var pi=function(){this._geom=null;var n=arguments[0];this._geom=n};pi.prototype.locate=function(n){return pi.locate(n,this._geom)},pi.prototype.interfaces_=function(){return[eu]},pi.prototype.getClass=function(){return pi},pi.isPointInRing=function(n,i){return!!i.getEnvelopeInternal().intersects(n)&&rt.isPointInRing(n,i.getCoordinates())},pi.containsPointInPolygon=function(n,i){if(i.isEmpty())return!1;var s=i.getExteriorRing();if(!pi.isPointInRing(n,s))return!1;for(var l=0;l<i.getNumInteriorRing();l++){var h=i.getInteriorRingN(l);if(pi.isPointInRing(n,h))return!1}return!0},pi.containsPoint=function(n,i){if(i instanceof pe)return pi.containsPointInPolygon(n,i);if(i instanceof Zn)for(var s=new co(i);s.hasNext();){var l=s.next();if(l!==i&&pi.containsPoint(n,l))return!0}return!1},pi.locate=function(n,i){return i.isEmpty()?Z.EXTERIOR:pi.containsPoint(n,i)?Z.INTERIOR:Z.EXTERIOR};var jr=function(){this._edgeMap=new w,this._edgeList=null,this._ptInAreaLocation=[Z.NONE,Z.NONE]};jr.prototype.getNextCW=function(n){this.getEdges();var i=this._edgeList.indexOf(n),s=i-1;return i===0&&(s=this._edgeList.size()-1),this._edgeList.get(s)},jr.prototype.propagateSideLabels=function(n){for(var i=Z.NONE,s=this.iterator();s.hasNext();){var l=s.next().getLabel();l.isArea(n)&&l.getLocation(n,Ht.LEFT)!==Z.NONE&&(i=l.getLocation(n,Ht.LEFT))}if(i===Z.NONE)return null;for(var h=i,v=this.iterator();v.hasNext();){var S=v.next(),R=S.getLabel();if(R.getLocation(n,Ht.ON)===Z.NONE&&R.setLocation(n,Ht.ON,h),R.isArea(n)){var V=R.getLocation(n,Ht.LEFT),ot=R.getLocation(n,Ht.RIGHT);if(ot!==Z.NONE){if(ot!==h)throw new Zo("side location conflict",S.getCoordinate());V===Z.NONE&&kt.shouldNeverReachHere("found single null side (at "+S.getCoordinate()+")"),h=V}else kt.isTrue(R.getLocation(n,Ht.LEFT)===Z.NONE,"found single null side"),R.setLocation(n,Ht.RIGHT,h),R.setLocation(n,Ht.LEFT,h)}}},jr.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},jr.prototype.print=function(n){Qt.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(n)},jr.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jr.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges();if(i.size()<=0)return!0;var s=i.size()-1,l=i.get(s).getLabel().getLocation(n,Ht.LEFT);kt.isTrue(l!==Z.NONE,"Found unlabelled area edge");for(var h=l,v=this.iterator();v.hasNext();){var S=v.next().getLabel();kt.isTrue(S.isArea(n),"Found non-area edge");var R=S.getLocation(n,Ht.LEFT),V=S.getLocation(n,Ht.RIGHT);if(R===V||V!==h)return!1;h=R}return!0},jr.prototype.findIndex=function(n){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===n)return i;return-1},jr.prototype.iterator=function(){return this.getEdges().iterator()},jr.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new nt(this._edgeMap.values())),this._edgeList},jr.prototype.getLocation=function(n,i,s){return this._ptInAreaLocation[n]===Z.NONE&&(this._ptInAreaLocation[n]=pi.locate(i,s[n].getGeometry())),this._ptInAreaLocation[n]},jr.prototype.toString=function(){var n=new Pt;n.append("EdgeEndStar: "+this.getCoordinate()),n.append(\`
108
108
  \`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
@@ -3831,7 +3831,7 @@ three/build/three.module.js:
3831
3831
  * along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
3832
3832
  *)
3833
3833
  */
3834
- `)}var Ln=class extends Zr.EventDispatcher{worker=Rn();initRoadStatus=!1;constructor(){super()}async setRoadData(e,t){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:e,facilities:t}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n="",r){return new Promise((i,o)=>{let a=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:e,end:t,type:n,permission:r}).then(l=>{l?typeof l=="string"?o(l):i(l):o("no-path")})};if(this.initRoadStatus)a();else{let l=({status:u})=>{u&&(this.removeEventListener("init-road-status",l),a())};this.addEventListener("init-road-status",l)}})}getDirectionPath(e){return lt(this.worker,"get_direction_path",e)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Jr=require("three");function Nn(){return xe(`var $1=Object.create;var Rh=Object.defineProperty;var Z1=Object.getOwnPropertyDescriptor;var J1=Object.getOwnPropertyNames,fm=Object.getOwnPropertySymbols,K1=Object.getPrototypeOf,pm=Object.prototype.hasOwnProperty,j1=Object.prototype.propertyIsEnumerable;var Ih=(r,t,e)=>t in r?Rh(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Sl=(r,t)=>{for(var e in t||(t={}))pm.call(t,e)&&Ih(r,e,t[e]);if(fm)for(var e of fm(t))j1.call(t,e)&&Ih(r,e,t[e]);return r};var Ht=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Q1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of J1(t))!pm.call(r,a)&&a!==e&&Rh(r,a,{get:()=>t[a],enumerable:!(o=Z1(t,a))||o.enumerable});return r};var Wn=(r,t,e)=>(e=r!=null?$1(K1(r)):{},Q1(t||!r||!r.__esModule?Rh(e,"default",{value:r,enumerable:!0}):e,r));var Si=(r,t,e)=>Ih(r,typeof t!="symbol"?t+"":t,e);var mm=Ht((PR,dm)=>{var Lh=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};dm.exports=Lh});var vm=Ht((IR,ym)=>{function gm(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,gm(a,t)):o!==t&&e.set(o,a);return e}ym.exports=gm});var Em=Ht((RR,xm)=>{function tx(r){let t=Number(r);return!(isNaN(t)||t<=0)}function _m(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,_m(a));if(!tx(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}xm.exports=_m});var wm=Ht((LR,Sm)=>{function Mm(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Mm(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}Sm.exports=Mm});var Cm=Ht((NR,Am)=>{var ex=mm(),nx=vm(),bm=Em(),Tm=wm(),Nh=class{constructor(t){t instanceof Map?(Tm(t),this.graph=t):t?this.graph=bm(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(Tm(e),o=e):o=bm(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nx(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,l=new ex,h=new Map,f=[],p=0,d=[];if(o.avoid&&(d=[].concat(o.avoid)),d.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(d.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let g=l.next();if(g.key===e){p=g.priority;let y=g.key;for(;h.has(y);)f.push(y),y=h.get(y);break}a.add(g.key),(this.graph.get(g.key)||new Map).forEach((y,M)=>{if(a.has(M)||d.includes(M))return null;if(!l.has(M))return h.set(M,g.key),l.set(M,g.priority+y);let b=l.get(M).priority,T=g.priority+y;return T<b?(h.set(M,g.key),l.set(M,T)):null})}return f.length?(o.trim?f.shift():f=f.concat([t]),o.reverse||(f=f.reverse()),o.cost?{path:f,cost:p}:f):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};Am.exports=Nh});var dc=Ht((VR,v0)=>{"use strict";var y0=Object.getOwnPropertySymbols,rT=Object.prototype.hasOwnProperty,iT=Object.prototype.propertyIsEnumerable;function oT(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sT(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}v0.exports=sT()?Object.assign:function(r,t){for(var e,o=oT(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var h in e)rT.call(e,h)&&(o[h]=e[h]);if(y0){a=y0(e);for(var f=0;f<a.length;f++)iT.call(e,a[f])&&(o[a[f]]=e[a[f]])}}return o}});var sp=Ht((ip,op)=>{(function(r,t){typeof ip=="object"&&typeof op!="undefined"?op.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ip,function(){"use strict";function r(x,v,P,S,L){(function N(G,B,I,O,q){for(;O>I;){if(O-I>600){var st=O-I+1,V=B-I+1,Mt=Math.log(st),$=.5*Math.exp(2*Mt/3),ut=.5*Math.sqrt(Mt*$*(st-$)/st)*(V-st/2<0?-1:1),xt=Math.max(I,Math.floor(B-V*$/st+ut)),mt=Math.min(O,Math.floor(B+(st-V)*$/st+ut));N(G,B,xt,mt,q)}var lt=G[B],ht=I,k=O;for(t(G,I,B),q(G[O],lt)>0&&t(G,I,O);ht<k;){for(t(G,ht,k),ht++,k--;q(G[ht],lt)<0;)ht++;for(;q(G[k],lt)>0;)k--}q(G[I],lt)===0?t(G,I,k):t(G,++k,O),k<=B&&(I=k+1),B<=k&&(O=k-1)}})(x,v,P||0,S||x.length-1,L||e)}function t(x,v,P){var S=x[v];x[v]=x[P],x[P]=S}function e(x,v){return x<v?-1:x>v?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(x,v,P){if(!P)return v.indexOf(x);for(var S=0;S<v.length;S++)if(P(x,v[S]))return S;return-1}function l(x,v){h(x,0,x.children.length,v,x)}function h(x,v,P,S,L){L||(L=b(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var N=v;N<P;N++){var G=x.children[N];f(L,x.leaf?S(G):G)}return L}function f(x,v){return x.minX=Math.min(x.minX,v.minX),x.minY=Math.min(x.minY,v.minY),x.maxX=Math.max(x.maxX,v.maxX),x.maxY=Math.max(x.maxY,v.maxY),x}function p(x,v){return x.minX-v.minX}function d(x,v){return x.minY-v.minY}function g(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function _(x){return x.maxX-x.minX+(x.maxY-x.minY)}function y(x,v){return x.minX<=v.minX&&x.minY<=v.minY&&v.maxX<=x.maxX&&v.maxY<=x.maxY}function M(x,v){return v.minX<=x.maxX&&v.minY<=x.maxY&&v.maxX>=x.minX&&v.maxY>=x.minY}function b(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(x,v,P,S,L){for(var N=[v,P];N.length;)if(!((P=N.pop())-(v=N.pop())<=S)){var G=v+Math.ceil((P-v)/S/2)*S;r(x,G,v,P,L),N.push(v,G,G,P)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var v=this.data,P=[];if(!M(x,v))return P;for(var S=this.toBBox,L=[];v;){for(var N=0;N<v.children.length;N++){var G=v.children[N],B=v.leaf?S(G):G;M(x,B)&&(v.leaf?P.push(G):y(x,B)?this._all(G,P):L.push(G))}v=L.pop()}return P},o.prototype.collides=function(x){var v=this.data;if(!M(x,v))return!1;for(var P=[];v;){for(var S=0;S<v.children.length;S++){var L=v.children[S],N=v.leaf?this.toBBox(L):L;if(M(x,N)){if(v.leaf||y(x,N))return!0;P.push(L)}}v=P.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var v=0;v<x.length;v++)this.insert(x[v]);return this}var P=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var S=this.data;this.data=P,P=S}this._insert(P,this.data.height-P.height-1,!0)}else this.data=P;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=b([]),this},o.prototype.remove=function(x,v){if(!x)return this;for(var P,S,L,N=this.data,G=this.toBBox(x),B=[],I=[];N||B.length;){if(N||(N=B.pop(),S=B[B.length-1],P=I.pop(),L=!0),N.leaf){var O=a(x,N.children,v);if(O!==-1)return N.children.splice(O,1),B.push(N),this._condense(B),this}L||N.leaf||!y(N,G)?S?(P++,N=S.children[P],L=!1):N=null:(B.push(N),I.push(P),P=0,S=N,N=N.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,v){return x.minX-v.minX},o.prototype.compareMinY=function(x,v){return x.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,v){for(var P=[];x;)x.leaf?v.push.apply(v,x.children):P.push.apply(P,x.children),x=P.pop();return v},o.prototype._build=function(x,v,P,S){var L,N=P-v+1,G=this._maxEntries;if(N<=G)return l(L=b(x.slice(v,P+1)),this.toBBox),L;S||(S=Math.ceil(Math.log(N)/Math.log(G)),G=Math.ceil(N/Math.pow(G,S-1))),(L=b([])).leaf=!1,L.height=S;var B=Math.ceil(N/G),I=B*Math.ceil(Math.sqrt(G));T(x,v,P,I,this.compareMinX);for(var O=v;O<=P;O+=I){var q=Math.min(O+I-1,P);T(x,O,q,B,this.compareMinY);for(var st=O;st<=q;st+=B){var V=Math.min(st+B-1,q);L.children.push(this._build(x,st,V,S-1))}}return l(L,this.toBBox),L},o.prototype._chooseSubtree=function(x,v,P,S){for(;S.push(v),!v.leaf&&S.length-1!==P;){for(var L=1/0,N=1/0,G=void 0,B=0;B<v.children.length;B++){var I=v.children[B],O=g(I),q=(st=x,V=I,(Math.max(V.maxX,st.maxX)-Math.min(V.minX,st.minX))*(Math.max(V.maxY,st.maxY)-Math.min(V.minY,st.minY))-O);q<N?(N=q,L=O<L?O:L,G=I):q===N&&O<L&&(L=O,G=I)}v=G||v.children[0]}var st,V;return v},o.prototype._insert=function(x,v,P){var S=P?x:this.toBBox(x),L=[],N=this._chooseSubtree(S,this.data,v,L);for(N.children.push(x),f(N,S);v>=0&&L[v].children.length>this._maxEntries;)this._split(L,v),v--;this._adjustParentBBoxes(S,L,v)},o.prototype._split=function(x,v){var P=x[v],S=P.children.length,L=this._minEntries;this._chooseSplitAxis(P,L,S);var N=this._chooseSplitIndex(P,L,S),G=b(P.children.splice(N,P.children.length-N));G.height=P.height,G.leaf=P.leaf,l(P,this.toBBox),l(G,this.toBBox),v?x[v-1].children.push(G):this._splitRoot(P,G)},o.prototype._splitRoot=function(x,v){this.data=b([x,v]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,v,P){for(var S,L,N,G,B,I,O,q=1/0,st=1/0,V=v;V<=P-v;V++){var Mt=h(x,0,V,this.toBBox),$=h(x,V,P,this.toBBox),ut=(L=Mt,N=$,G=void 0,B=void 0,I=void 0,O=void 0,G=Math.max(L.minX,N.minX),B=Math.max(L.minY,N.minY),I=Math.min(L.maxX,N.maxX),O=Math.min(L.maxY,N.maxY),Math.max(0,I-G)*Math.max(0,O-B)),xt=g(Mt)+g($);ut<q?(q=ut,S=V,st=xt<st?xt:st):ut===q&&xt<st&&(st=xt,S=V)}return S||P-v},o.prototype._chooseSplitAxis=function(x,v,P){var S=x.leaf?this.compareMinX:p,L=x.leaf?this.compareMinY:d;this._allDistMargin(x,v,P,S)<this._allDistMargin(x,v,P,L)&&x.children.sort(S)},o.prototype._allDistMargin=function(x,v,P,S){x.children.sort(S);for(var L=this.toBBox,N=h(x,0,v,L),G=h(x,P-v,P,L),B=_(N)+_(G),I=v;I<P-v;I++){var O=x.children[I];f(N,x.leaf?L(O):O),B+=_(N)}for(var q=P-v-1;q>=v;q--){var st=x.children[q];f(G,x.leaf?L(st):st),B+=_(G)}return B},o.prototype._adjustParentBBoxes=function(x,v,P){for(var S=P;S>=0;S--)f(v[S],x)},o.prototype._condense=function(x){for(var v=x.length-1,P=void 0;v>=0;v--)x[v].children.length===0?v>0?(P=x[v-1].children).splice(P.indexOf(x[v]),1):this.clear():l(x[v],this.toBBox)},o})});var _0=Ht((ap,up)=>{(function(r,t){typeof ap=="object"&&typeof up!="undefined"?up.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(ap,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,l=a.data,h=a.compare,f=l[o];o>0;){var p=o-1>>1,d=l[p];if(h(f,d)>=0)break;l[o]=d,o=p}l[o]=f},r.prototype._down=function(o){for(var a=this,l=a.data,h=a.compare,f=this.length>>1,p=l[o];o<f;){var d=(o<<1)+1,g=l[d],_=d+1;if(_<this.length&&h(l[_],g)<0&&(d=_,g=l[_]),h(g,p)>=0)break;l[o]=g,o=d}l[o]=p};function t(e,o){return e<o?-1:e>o?1:0}return r})});var E0=Ht(($R,x0)=>{x0.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=(a-o)/2,d=0,g=p-1;d<p;g=d++){var _=e[o+d*2+0],y=e[o+d*2+1],M=e[o+g*2+0],b=e[o+g*2+1],T=y>h!=b>h&&l<(M-_)*(h-y)/(b-y)+_;T&&(f=!f)}return f}});var S0=Ht((ZR,M0)=>{M0.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=a-o,d=0,g=p-1;d<p;g=d++){var _=e[d+o][0],y=e[d+o][1],M=e[g+o][0],b=e[g+o][1],T=y>h!=b>h&&l<(M-_)*(h-y)/(b-y)+_;T&&(f=!f)}return f}});var T0=Ht((JR,yc)=>{var w0=E0(),b0=S0();yc.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?b0(t,e,o,a):w0(t,e,o,a)};yc.exports.nested=b0;yc.exports.flat=w0});var C0=Ht((vc,A0)=>{(function(r,t){typeof vc=="object"&&typeof A0!="undefined"?t(vc):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(vc,function(r){"use strict";let e=33306690738754706e-32;function o(M,b,T,x,v){let P,S,L,N,G=b[0],B=x[0],I=0,O=0;B>G==B>-G?(P=G,G=b[++I]):(P=B,B=x[++O]);let q=0;if(I<M&&O<T)for(B>G==B>-G?(L=P-((S=G+P)-G),G=b[++I]):(L=P-((S=B+P)-B),B=x[++O]),P=S,L!==0&&(v[q++]=L);I<M&&O<T;)B>G==B>-G?(L=P-((S=P+G)-(N=S-P))+(G-N),G=b[++I]):(L=P-((S=P+B)-(N=S-P))+(B-N),B=x[++O]),P=S,L!==0&&(v[q++]=L);for(;I<M;)L=P-((S=P+G)-(N=S-P))+(G-N),G=b[++I],P=S,L!==0&&(v[q++]=L);for(;O<T;)L=P-((S=P+B)-(N=S-P))+(B-N),B=x[++O],P=S,L!==0&&(v[q++]=L);return P===0&&q!==0||(v[q++]=P),q}function a(M){return new Float64Array(M)}let l=33306690738754716e-32,h=22204460492503146e-32,f=11093356479670487e-47,p=a(4),d=a(8),g=a(12),_=a(16),y=a(4);r.orient2d=function(M,b,T,x,v,P){let S=(b-P)*(T-v),L=(M-v)*(x-P),N=S-L;if(S===0||L===0||S>0!=L>0)return N;let G=Math.abs(S+L);return Math.abs(N)>=l*G?N:-function(B,I,O,q,st,V,Mt){let $,ut,xt,mt,lt,ht,k,nt,ft,Tt,gt,Lt,qt,Xt,Ft,Qt,Ct,ee,it=B-st,rn=O-st,Bt=I-V,Jt=q-V;lt=(Ft=(nt=it-(k=(ht=134217729*it)-(ht-it)))*(Tt=Jt-(ft=(ht=134217729*Jt)-(ht-Jt)))-((Xt=it*Jt)-k*ft-nt*ft-k*Tt))-(gt=Ft-(Ct=(nt=Bt-(k=(ht=134217729*Bt)-(ht-Bt)))*(Tt=rn-(ft=(ht=134217729*rn)-(ht-rn)))-((Qt=Bt*rn)-k*ft-nt*ft-k*Tt))),p[0]=Ft-(gt+lt)+(lt-Ct),lt=(qt=Xt-((Lt=Xt+gt)-(lt=Lt-Xt))+(gt-lt))-(gt=qt-Qt),p[1]=qt-(gt+lt)+(lt-Qt),lt=(ee=Lt+gt)-Lt,p[2]=Lt-(ee-lt)+(gt-lt),p[3]=ee;let Yt=function(yn,pn){let X=pn[0];for(let F=1;F<yn;F++)X+=pn[F];return X}(4,p),pe=h*Mt;if(Yt>=pe||-Yt>=pe||($=B-(it+(lt=B-it))+(lt-st),xt=O-(rn+(lt=O-rn))+(lt-st),ut=I-(Bt+(lt=I-Bt))+(lt-V),mt=q-(Jt+(lt=q-Jt))+(lt-V),$===0&&ut===0&&xt===0&&mt===0)||(pe=f*Mt+e*Math.abs(Yt),(Yt+=it*mt+Jt*$-(Bt*xt+rn*ut))>=pe||-Yt>=pe))return Yt;lt=(Ft=(nt=$-(k=(ht=134217729*$)-(ht-$)))*(Tt=Jt-(ft=(ht=134217729*Jt)-(ht-Jt)))-((Xt=$*Jt)-k*ft-nt*ft-k*Tt))-(gt=Ft-(Ct=(nt=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te-1]}(M,b,T,x,v,P,G)},r.orient2dfast=function(M,b,T,x,v,P){return(b-P)*(T-v)-(M-v)*(x-P)},Object.defineProperty(r,"__esModule",{value:!0})})});var O0=Ht((KR,fp)=>{"use strict";var P0=sp(),xc=_0(),uT=T0(),lT=C0().orient2d;xc.default&&(xc=xc.default);fp.exports=N0;fp.exports.default=N0;function N0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dT(r),a=new P0(16);a.toBBox=function(P){return{minX:P[0],minY:P[1],maxX:P[0],maxY:P[1]}},a.compareMinX=function(P,S){return P[0]-S[0]},a.compareMinY=function(P,S){return P[1]-S[1]},a.load(r);for(var l=[],h=0,f;h<o.length;h++){var p=o[h];a.remove(p),f=L0(p,f),l.push(f)}var d=new P0(16);for(h=0;h<l.length;h++)d.insert(lp(l[h]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,b=y.next.p,T=cp(M,b);if(!(T<_)){var x=T/g;p=cT(a,y.prev.p,M,b,y.next.next.p,x,d),p&&Math.min(cp(p,M),cp(p,b))<=x&&(l.push(y),l.push(L0(p,y)),a.remove(p),d.remove(y),d.insert(lp(y)),d.insert(lp(y.next)))}}y=f;var v=[];do v.push(y.p),y=y.next;while(y!==f);return v.push(y.p),v}function cT(r,t,e,o,a,l,h){for(var f=new xc([],hT),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?hp(g,e,o):fT(e,o,g);_>l||f.push({node:g,dist:_})}for(;f.length&&!f.peek().node.children;){var y=f.pop(),M=y.node,b=hp(M,t,e),T=hp(M,o,a);if(y.dist<b&&y.dist<T&&R0(e,M,h)&&R0(o,M,h))return M}p=f.pop(),p&&(p=p.node)}return null}function hT(r,t){return r.dist-t.dist}function fT(r,t,e){if(I0(r,e)||I0(t,e))return 0;var o=_c(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=_c(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=_c(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var h=_c(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return h===0?0:Math.min(o,a,l,h)}function I0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function R0(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),l=Math.max(r[0],t[0]),h=Math.max(r[1],t[1]),f=e.search({minX:o,minY:a,maxX:l,maxY:h}),p=0;p<f.length;p++)if(pT(f[p].p,f[p].next.p,r,t))return!1;return!0}function Ja(r,t,e){return lT(r[0],r[1],t[0],t[1],e[0],e[1])}function pT(r,t,e,o){return r!==o&&t!==e&&Ja(r,t,e)>0!=Ja(r,t,o)>0&&Ja(e,o,r)>0!=Ja(e,o,t)>0}function lp(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dT(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],l=0;l<r.length;l++){var h=r[l];h[0]<t[0]&&(t=h),h[0]>o[0]&&(o=h),h[1]<e[1]&&(e=h),h[1]>a[1]&&(a=h)}var f=[t,e,o,a],p=f.slice();for(l=0;l<r.length;l++)uT(r[l],f)||p.push(r[l]);return gT(p)}function L0(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function cp(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function hp(r,t,e){var o=t[0],a=t[1],l=e[0]-o,h=e[1]-a;if(l!==0||h!==0){var f=((r[0]-o)*l+(r[1]-a)*h)/(l*l+h*h);f>1?(o=e[0],a=e[1]):f>0&&(o+=l*f,a+=h*f)}return l=r[0]-o,h=r[1]-a,l*l+h*h}function _c(r,t,e,o,a,l,h,f){var p=e-r,d=o-t,g=h-a,_=f-l,y=r-a,M=t-l,b=p*p+d*d,T=p*g+d*_,x=g*g+_*_,v=p*y+d*M,P=g*y+_*M,S=b*x-T*T,L,N,G,B,I=S,O=S;S===0?(N=0,I=1,B=P,O=x):(N=T*P-x*v,B=b*P-T*v,N<0?(N=0,B=P,O=x):N>I&&(N=I,B=P+T,O=x)),B<0?(B=0,-v<0?N=0:-v>b?N=I:(N=-v,I=b)):B>O&&(B=O,-v+T<0?N=0:-v+T>b?N=I:(N=-v+T,I=b)),L=N===0?0:N/I,G=B===0?0:B/O;var q=(1-L)*r+L*e,st=(1-L)*t+L*o,V=(1-G)*a+G*h,Mt=(1-G)*l+G*f,$=V-q,ut=Mt-st;return $*$+ut*ut}function mT(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function gT(r){r.sort(mT);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Ja(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&Ja(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var k0=Ht((dp,mp)=>{(function(r,t){typeof dp=="object"&&typeof mp!="undefined"?mp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(dp,function(){"use strict";function r(a,l,h,f,p){t(a,l,h||0,f||a.length-1,p||o)}function t(a,l,h,f,p){for(;f>h;){if(f-h>600){var d=f-h+1,g=l-h+1,_=Math.log(d),y=.5*Math.exp(2*_/3),M=.5*Math.sqrt(_*y*(d-y)/d)*(g-d/2<0?-1:1),b=Math.max(h,Math.floor(l-g*y/d+M)),T=Math.min(f,Math.floor(l+(d-g)*y/d+M));t(a,l,b,T,p)}var x=a[l],v=h,P=f;for(e(a,h,l),p(a[f],x)>0&&e(a,h,f);v<P;){for(e(a,v,P),v++,P--;p(a[v],x)<0;)v++;for(;p(a[P],x)>0;)P--}p(a[h],x)===0?e(a,h,P):(P++,e(a,P,f)),P<=l&&(h=P+1),l<=P&&(f=P-1)}}function e(a,l,h){var f=a[l];a[l]=a[h],a[h]=f}function o(a,l){return a<l?-1:a>l?1:0}return r})});var _p=Ht((S2,vp)=>{"use strict";vp.exports=Xu;vp.exports.default=Xu;var PT=k0();function Xu(r,t){if(!(this instanceof Xu))return new Xu(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}Xu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!Mc(r,t))return e;for(var a=[],l,h,f,p;t;){for(l=0,h=t.children.length;l<h;l++)f=t.children[l],p=t.leaf?o(f):f,Mc(r,p)&&(t.leaf?e.push(f):yp(r,p)?this._all(f,e):a.push(f));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!Mc(r,t))return!1;for(var o=[],a,l,h,f;t;){for(a=0,l=t.children.length;a<l;a++)if(h=t.children[a],f=t.leaf?e(h):h,Mc(r,f)){if(t.leaf||yp(r,f))return!0;o.push(h)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=Qa([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],l=[],h,f,p,d;e||a.length;){if(e||(e=a.pop(),f=a[a.length-1],h=l.pop(),d=!0),e.leaf&&(p=IT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&yp(e,o)?(a.push(e),l.push(h),h=0,f=e,e=e.children[0]):f?(h++,e=f.children[h],d=!1):e=null}return this},toBBox:function(r){return r},compareMinX:G0,compareMinY:V0,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,l=this._maxEntries,h;if(a<=l)return h=Qa(r.slice(t,e+1)),ja(h,this.toBBox),h;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),h=Qa([]),h.leaf=!1,h.height=o;var f=Math.ceil(a/l),p=f*Math.ceil(Math.sqrt(l)),d,g,_,y;for(H0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),H0(r,d,_,f,this.compareMinY),g=d;g<=_;g+=f)y=Math.min(g+f-1,_),h.children.push(this._build(r,g,y,o-1));return ja(h,this.toBBox),h},_chooseSubtree:function(r,t,e,o){for(var a,l,h,f,p,d,g,_;o.push(t),!(t.leaf||o.length-1===e);){for(g=_=1/0,a=0,l=t.children.length;a<l;a++)h=t.children[a],p=gp(h),d=RT(r,h)-p,d<_?(_=d,g=p<g?p:g,f=h):d===_&&p<g&&(g=p,f=h);t=f||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),l=[],h=this._chooseSubtree(a,this.data,t,l);for(h.children.push(r),qu(h,a);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(a,l,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var l=this._chooseSplitIndex(e,a,o),h=Qa(e.children.splice(l,e.children.length-l));h.height=e.height,h.leaf=e.leaf,ja(e,this.toBBox),ja(h,this.toBBox),t?r[t-1].children.push(h):this._splitRoot(e,h)},_splitRoot:function(r,t){this.data=Qa([r,t]),this.data.height=r.height+1,this.data.leaf=!1,ja(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,l,h,f,p,d,g;for(p=d=1/0,o=t;o<=e-t;o++)a=Wu(r,0,o,this.toBBox),l=Wu(r,o,e,this.toBBox),h=LT(a,l),f=gp(a)+gp(l),h<p?(p=h,g=o,d=f<d?f:d):h===p&&f<d&&(d=f,g=o);return g},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:G0,a=r.leaf?this.compareMinY:V0,l=this._allDistMargin(r,t,e,o),h=this._allDistMargin(r,t,e,a);l<h&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,l=Wu(r,0,t,a),h=Wu(r,e-t,e,a),f=Ec(l)+Ec(h),p,d;for(p=t;p<e-t;p++)d=r.children[p],qu(l,r.leaf?a(d):d),f+=Ec(l);for(p=e-t-1;p>=t;p--)d=r.children[p],qu(h,r.leaf?a(d):d),f+=Ec(h);return f},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)qu(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():ja(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function IT(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function ja(r,t){Wu(r,0,r.children.length,t,r)}function Wu(r,t,e,o,a){a||(a=Qa(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var l=t,h;l<e;l++)h=r.children[l],qu(a,r.leaf?o(h):h);return a}function qu(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function G0(r,t){return r.minX-t.minX}function V0(r,t){return r.minY-t.minY}function gp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Ec(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RT(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LT(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),l=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,l-o)}function yp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Mc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Qa(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function H0(r,t,e,o,a){for(var l=[t,e],h;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(h=t+Math.ceil((e-t)/o/2)*o,PT(r,h,t,e,a),l.push(t,h,h,e))}});var Z0=Ht((FO,bp)=>{"use strict";bp.exports=Tc;bp.exports.default=Tc;function Tc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=X0(r,0,a,e,!0),h=[];if(!l||l.next===l.prev)return h;var f,p,d,g,_,y,M;if(o&&(l=VT(r,t,l,e)),r.length>80*e){f=d=r[0],p=g=r[1];for(var b=e;b<a;b+=e)_=r[b],y=r[b+1],_<f&&(f=_),y<p&&(p=y),_>d&&(d=_),y>g&&(g=y);M=Math.max(d-f,g-p),M=M!==0?32767/M:0}return Zu(l,h,e,f,p,M,0),h}function X0(r,t,e,o,a){var l,h;if(a===wp(r,t,e,o)>0)for(l=t;l<e;l+=o)h=q0(l,r[l],r[l+1],h);else for(l=e-o;l>=t;l-=o)h=q0(l,r[l],r[l+1],h);return h&&Ac(h,h.next)&&(Ku(h),h=h.next),h}function Qs(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Ac(e,e.next)||Yn(e.prev,e,e.next)===0)){if(Ku(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Zu(r,t,e,o,a,l,h){if(r){!h&&l&&YT(r,o,a,l);for(var f=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?zT(r,o,a,l):BT(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),Ku(r),r=d.next,f=d.next;continue}if(r=d,r===f){h?h===1?(r=kT(Qs(r),t,e),Zu(r,t,e,o,a,l,2)):h===2&&GT(r,t,e,o,a,l):Zu(Qs(r),t,e,o,a,l,1);break}}}}function BT(r){var t=r.prev,e=r,o=r.next;if(Yn(t,e,o)>=0)return!1;for(var a=t.x,l=e.x,h=o.x,f=t.y,p=e.y,d=o.y,g=a<l?a<h?a:h:l<h?l:h,_=f<p?f<d?f:d:p<d?p:d,y=a>l?a>h?a:h:l>h?l:h,M=f>p?f>d?f:d:p>d?p:d,b=o.next;b!==t;){if(b.x>=g&&b.x<=y&&b.y>=_&&b.y<=M&&nu(a,f,l,p,h,d,b.x,b.y)&&Yn(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function zT(r,t,e,o){var a=r.prev,l=r,h=r.next;if(Yn(a,l,h)>=0)return!1;for(var f=a.x,p=l.x,d=h.x,g=a.y,_=l.y,y=h.y,M=f<p?f<d?f:d:p<d?p:d,b=g<_?g<y?g:y:_<y?_:y,T=f>p?f>d?f:d:p>d?p:d,x=g>_?g>y?g:y:_>y?_:y,v=Mp(M,b,t,e,o),P=Mp(T,x,t,e,o),S=r.prevZ,L=r.nextZ;S&&S.z>=v&&L&&L.z<=P;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=x&&S!==a&&S!==h&&nu(f,g,p,_,d,y,S.x,S.y)&&Yn(S.prev,S,S.next)>=0||(S=S.prevZ,L.x>=M&&L.x<=T&&L.y>=b&&L.y<=x&&L!==a&&L!==h&&nu(f,g,p,_,d,y,L.x,L.y)&&Yn(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;S&&S.z>=v;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=x&&S!==a&&S!==h&&nu(f,g,p,_,d,y,S.x,S.y)&&Yn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;L&&L.z<=P;){if(L.x>=M&&L.x<=T&&L.y>=b&&L.y<=x&&L!==a&&L!==h&&nu(f,g,p,_,d,y,L.x,L.y)&&Yn(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function kT(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Ac(a,l)&&Y0(a,o,o.next,l)&&Ju(a,l)&&Ju(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),Ku(o),Ku(o.next),o=r=l),o=o.next}while(o!==r);return Qs(o)}function GT(r,t,e,o,a,l){var h=r;do{for(var f=h.next.next;f!==h.prev;){if(h.i!==f.i&&JT(h,f)){var p=$0(h,f);h=Qs(h,h.next),p=Qs(p,p.next),Zu(h,t,e,o,a,l,0),Zu(p,t,e,o,a,l,0);return}f=f.next}h=h.next}while(h!==r)}function VT(r,t,e,o){var a=[],l,h,f,p,d;for(l=0,h=t.length;l<h;l++)f=t[l]*o,p=l<h-1?t[l+1]*o:r.length,d=X0(r,f,p,o,!1),d===d.next&&(d.steiner=!0),a.push(ZT(d));for(a.sort(HT),l=0;l<a.length;l++)e=WT(a[l],e);return e}function HT(r,t){return r.x-t.x}function WT(r,t){var e=qT(r,t);if(!e)return t;var o=$0(e,r);return Qs(o,o.next),Qs(e,e.next)}function qT(r,t){var e=t,o=r.x,a=r.y,l=-1/0,h;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var f=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=o&&f>l&&(l=f,h=e.x<e.next.x?e:e.next,f===o))return h}e=e.next}while(e!==t);if(!h)return null;var p=h,d=h.x,g=h.y,_=1/0,y;e=h;do o>=e.x&&e.x>=d&&o!==e.x&&nu(a<g?o:l,a,d,g,a<g?l:o,a,e.x,e.y)&&(y=Math.abs(a-e.y)/(o-e.x),Ju(e,r)&&(y<_||y===_&&(e.x>h.x||e.x===h.x&&XT(h,e)))&&(h=e,_=y)),e=e.next;while(e!==p);return h}function XT(r,t){return Yn(r.prev,r,t.prev)<0&&Yn(t.next,r,r.next)<0}function YT(r,t,e,o){var a=r;do a.z===0&&(a.z=Mp(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$T(a)}function $T(r){var t,e,o,a,l,h,f,p,d=1;do{for(e=r,r=null,l=null,h=0;e;){for(h++,o=e,f=0,t=0;t<d&&(f++,o=o.nextZ,!!o);t++);for(p=d;f>0||p>0&&o;)f!==0&&(p===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,f--):(a=o,o=o.nextZ,p--),l?l.nextZ=a:r=a,a.prevZ=l,l=a;e=o}l.nextZ=null,d*=2}while(h>1);return r}function Mp(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZT(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function nu(r,t,e,o,a,l,h,f){return(a-h)*(t-f)>=(r-h)*(l-f)&&(r-h)*(o-f)>=(e-h)*(t-f)&&(e-h)*(l-f)>=(a-h)*(o-f)}function JT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KT(r,t)&&(Ju(r,t)&&Ju(t,r)&&jT(r,t)&&(Yn(r.prev,r,t.prev)||Yn(r,t.prev,t))||Ac(r,t)&&Yn(r.prev,r,r.next)>0&&Yn(t.prev,t,t.next)>0)}function Yn(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Ac(r,t){return r.x===t.x&&r.y===t.y}function Y0(r,t,e,o){var a=bc(Yn(r,t,e)),l=bc(Yn(r,t,o)),h=bc(Yn(e,o,r)),f=bc(Yn(e,o,t));return!!(a!==l&&h!==f||a===0&&wc(r,e,t)||l===0&&wc(r,o,t)||h===0&&wc(e,r,o)||f===0&&wc(e,t,o))}function wc(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function bc(r){return r>0?1:r<0?-1:0}function KT(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Y0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Ju(r,t){return Yn(r.prev,r,r.next)<0?Yn(r,t,r.next)>=0&&Yn(r,r.prev,t)>=0:Yn(r,t,r.prev)<0||Yn(r,r.next,t)<0}function jT(r,t){var e=r,o=!1,a=(r.x+t.x)/2,l=(r.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&a<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function $0(r,t){var e=new Sp(r.i,r.x,r.y),o=new Sp(t.i,t.x,t.y),a=r.next,l=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function q0(r,t,e,o){var a=new Sp(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function Ku(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Sp(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Tc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,h=Math.abs(wp(r,0,l,e));if(a)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:r.length;h-=Math.abs(wp(r,d,g,e))}var _=0;for(f=0;f<o.length;f+=3){var y=o[f]*e,M=o[f+1]*e,b=o[f+2]*e;_+=Math.abs((r[y]-r[b])*(r[M+1]-r[y+1])-(r[y]-r[M])*(r[b+1]-r[y+1]))}return h===0&&_===0?0:Math.abs((_-h)/h)};function wp(r,t,e,o){for(var a=0,l=t,h=e-o;l<e;l+=o)a+=(r[h]-r[l])*(r[l+1]+r[h+1]),h=l;return a}Tc.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var l=0;l<r[a].length;l++)for(var h=0;h<t;h++)e.vertices.push(r[a][l][h]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Ip=Ht(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.earthRadius=63710088e-1;ae.factors={centimeters:ae.earthRadius*100,centimetres:ae.earthRadius*100,degrees:ae.earthRadius/111325,feet:ae.earthRadius*3.28084,inches:ae.earthRadius*39.37,kilometers:ae.earthRadius/1e3,kilometres:ae.earthRadius/1e3,meters:ae.earthRadius,metres:ae.earthRadius,miles:ae.earthRadius/1609.344,millimeters:ae.earthRadius*1e3,millimetres:ae.earthRadius*1e3,nauticalmiles:ae.earthRadius/1852,radians:1,yards:ae.earthRadius*1.0936};ae.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ae.earthRadius,yards:1.0936133};ae.areaFactors={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ms(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}ae.feature=Ms;function tA(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Tp(t).geometry;case"LineString":return Cp(t).geometry;case"Polygon":return Ap(t).geometry;case"MultiPoint":return K0(t).geometry;case"MultiLineString":return J0(t).geometry;case"MultiPolygon":return j0(t).geometry;default:throw new Error(r+" is invalid")}}ae.geometry=tA;function Tp(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Cc(r[0])||!Cc(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Ms(o,t,e)}ae.point=Tp;function eA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Tp(o,t)}),e)}ae.points=eA;function Ap(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var l=a[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<l[l.length-1].length;h++)if(l[l.length-1][h]!==l[0][h])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:r};return Ms(f,t,e)}ae.polygon=Ap;function nA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Ap(o,t)}),e)}ae.polygons=nA;function Cp(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Ms(o,t,e)}ae.lineString=Cp;function rA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Cp(o,t)}),e)}ae.lineStrings=rA;function Pc(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}ae.featureCollection=Pc;function J0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Ms(o,t,e)}ae.multiLineString=J0;function K0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Ms(o,t,e)}ae.multiPoint=K0;function j0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Ms(o,t,e)}ae.multiPolygon=j0;function iA(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Ms(o,t,e)}ae.geometryCollection=iA;function oA(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}ae.round=oA;function Q0(r,t){t===void 0&&(t="kilometers");var e=ae.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}ae.radiansToLength=Q0;function Pp(r,t){t===void 0&&(t="kilometers");var e=ae.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}ae.lengthToRadians=Pp;function sA(r,t){return ty(Pp(r,t))}ae.lengthToDegrees=sA;function aA(r){var t=r%360;return t<0&&(t+=360),t}ae.bearingToAzimuth=aA;function ty(r){var t=r%(2*Math.PI);return t*180/Math.PI}ae.radiansToDegrees=ty;function uA(r){var t=r%360;return t*Math.PI/180}ae.degreesToRadians=uA;function lA(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Q0(Pp(r,t),e)}ae.convertLength=lA;function cA(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=ae.areaFactors[t];if(!o)throw new Error("invalid original units");var a=ae.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}ae.convertArea=cA;function Cc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ae.isNumber=Cc;function hA(r){return!!r&&r.constructor===Object}ae.isObject=hA;function fA(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Cc(t))throw new Error("bbox must only contain numbers")})}ae.validateBBox=fA;function pA(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}ae.validateId=pA});var Lp=Ht(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});var Zr=Ip();function ju(r,t,e){if(r!==null)for(var o,a,l,h,f,p,d,g=0,_=0,y,M=r.type,b=M==="FeatureCollection",T=M==="Feature",x=b?r.features.length:1,v=0;v<x;v++){d=b?r.features[v].geometry:T?r.geometry:r,y=d?d.type==="GeometryCollection":!1,f=y?d.geometries.length:1;for(var P=0;P<f;P++){var S=0,L=0;if(h=y?d.geometries[P]:d,h!==null){p=h.coordinates;var N=h.type;switch(g=e&&(N==="Polygon"||N==="MultiPolygon")?1:0,N){case null:break;case"Point":if(t(p,_,v,S,L)===!1)return!1;_++,S++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],_,v,S,L)===!1)return!1;_++,N==="MultiPoint"&&S++}N==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(a=0;a<p[o].length-g;a++){if(t(p[o][a],_,v,S,L)===!1)return!1;_++}N==="MultiLineString"&&S++,N==="Polygon"&&L++}N==="Polygon"&&S++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(L=0,a=0;a<p[o].length;a++){for(l=0;l<p[o][a].length-g;l++){if(t(p[o][a][l],_,v,S,L)===!1)return!1;_++}L++}S++}break;case"GeometryCollection":for(o=0;o<h.geometries.length;o++)if(ju(h.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function dA(r,t,e,o){var a=e;return ju(r,function(l,h,f,p,d){h===0&&e===void 0?a=l:a=t(a,l,h,f,p,d)},o),a}function ey(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function mA(r,t,e){var o=e;return ey(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function ny(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function gA(r,t,e){var o=e;return ny(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function yA(r){var t=[];return ju(r,function(e){t.push(e)}),t}function Rp(r,t){var e,o,a,l,h,f,p,d,g,_,y=0,M=r.type==="FeatureCollection",b=r.type==="Feature",T=M?r.features.length:1;for(e=0;e<T;e++){for(f=M?r.features[e].geometry:b?r.geometry:r,d=M?r.features[e].properties:b?r.properties:{},g=M?r.features[e].bbox:b?r.bbox:void 0,_=M?r.features[e].id:b?r.id:void 0,p=f?f.type==="GeometryCollection":!1,h=p?f.geometries.length:1,a=0;a<h;a++){if(l=p?f.geometries[a]:f,l===null){if(t(null,y,d,g,_)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,y,d,g,_)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],y,d,g,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function vA(r,t,e){var o=e;return Rp(r,function(a,l,h,f,p){l===0&&e===void 0?o=a:o=t(o,a,l,h,f,p)}),o}function Ic(r,t){Rp(r,function(e,o,a,l,h){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(Zr.feature(e,a,{bbox:l,id:h}),o,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],_={type:p,coordinates:g};if(t(Zr.feature(_,a),o,d)===!1)return!1}})}function _A(r,t,e){var o=e;return Ic(r,function(a,l,h){l===0&&h===0&&e===void 0?o=a:o=t(o,a,l,h)}),o}function ry(r,t){Ic(r,function(e,o,a){var l=0;if(e.geometry){var h=e.geometry.type;if(!(h==="Point"||h==="MultiPoint")){var f,p=0,d=0,g=0;if(ju(e,function(_,y,M,b,T){if(f===void 0||o>p||b>d||T>g){f=_,p=o,d=b,g=T,l=0;return}var x=Zr.lineString([f,_],e.properties);if(t(x,o,a,T,l)===!1)return!1;l++,f=_})===!1)return!1}}})}function xA(r,t,e){var o=e,a=!1;return ry(r,function(l,h,f,p,d){a===!1&&e===void 0?o=l:o=t(o,l,h,f,p,d),a=!0}),o}function iy(r,t){if(!r)throw new Error("geojson is required");Ic(r,function(e,o,a){if(e.geometry!==null){var l=e.geometry.type,h=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<h.length;f++)if(t(Zr.lineString(h[f],e.properties),o,a,f)===!1)return!1;break}}})}function EA(r,t,e){var o=e;return iy(r,function(a,l,h,f){l===0&&e===void 0?o=a:o=t(o,a,l,h,f)}),o}function MA(r,t){if(t=t||{},!Zr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.segmentIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=p.length+l-1),Zr.lineString([p[l],p[l+1]],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l-1),Zr.lineString([p[a][l],p[a][l+1]],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l-1),Zr.lineString([p[o][l],p[o][l+1]],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l-1),Zr.lineString([p[o][a][l],p[o][a][l+1]],h,t)}throw new Error("geojson is invalid")}function SA(r,t){if(t=t||{},!Zr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.coordIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return Zr.point(p,h,t);case"MultiPoint":return o<0&&(o=p.length+o),Zr.point(p[o],h,t);case"LineString":return l<0&&(l=p.length+l),Zr.point(p[l],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l),Zr.point(p[a][l],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l),Zr.point(p[o][l],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l),Zr.point(p[o][a][l],h,t)}throw new Error("geojson is invalid")}pr.coordAll=yA;pr.coordEach=ju;pr.coordReduce=dA;pr.featureEach=ny;pr.featureReduce=gA;pr.findPoint=SA;pr.findSegment=MA;pr.flattenEach=Ic;pr.flattenReduce=_A;pr.geomEach=Rp;pr.geomReduce=vA;pr.lineEach=iy;pr.lineReduce=EA;pr.propEach=ey;pr.propReduce=mA;pr.segmentEach=ry;pr.segmentReduce=xA});var oy=Ht(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var wA=Lp();function Np(r){var t=[1/0,1/0,-1/0,-1/0];return wA.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Np.default=Np;Op.default=Np});var Rc=Ht((jO,Dp)=>{var _o=sp(),ay=Ip(),uy=Lp(),ru=oy().default,bA=uy.featureEach,JO=uy.coordEach,KO=ay.polygon,sy=ay.featureCollection;function ly(r){var t=new _o(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ru(e),_o.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:ru(a),o.push(a)}):bA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:ru(a),o.push(a)}),_o.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ru(e),_o.prototype.remove.call(this,e,o)},t.clear=function(){return _o.prototype.clear.call(this)},t.search=function(e){var o=_o.prototype.search.call(this,this.toBBox(e));return sy(o)},t.collides=function(e){return _o.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=_o.prototype.all.call(this);return sy(e)},t.toJSON=function(){return _o.prototype.toJSON.call(this)},t.fromJSON=function(e){return _o.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=ru(e);else if(e.type==="FeatureCollection")o=ru(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Dp.exports=ly;Dp.exports.default=ly});var Gp=Ht((aF,_y)=>{"use strict";var vy=Object.prototype.toString;_y.exports=function(t){var e=vy.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&vy.call(t.callee)==="[object Function]"),o}});var Cy=Ht((uF,Ay)=>{"use strict";var Ty;Object.keys||(el=Object.prototype.hasOwnProperty,Vp=Object.prototype.toString,xy=Gp(),Hp=Object.prototype.propertyIsEnumerable,Ey=!Hp.call({toString:null},"toString"),My=Hp.call(function(){},"prototype"),nl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Fc=function(r){var t=r.constructor;return t&&t.prototype===r},Sy={$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},wy=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!Sy["$"+r]&&el.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Fc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),by=function(r){if(typeof window=="undefined"||!wy)return Fc(r);try{return Fc(r)}catch(t){return!1}},Ty=function(t){var e=t!==null&&typeof t=="object",o=Vp.call(t)==="[object Function]",a=xy(t),l=e&&Vp.call(t)==="[object String]",h=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var f=My&&o;if(l&&t.length>0&&!el.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var d=0;d<t.length;++d)h.push(String(d));else for(var g in t)!(f&&g==="prototype")&&el.call(t,g)&&h.push(String(g));if(Ey)for(var _=by(t),y=0;y<nl.length;++y)!(_&&nl[y]==="constructor")&&el.call(t,nl[y])&&h.push(nl[y]);return h});var el,Vp,xy,Hp,Ey,My,nl,Fc,Sy,wy,by;Ay.exports=Ty});var Wp=Ht((lF,Ry)=>{"use strict";var DA=Array.prototype.slice,FA=Gp(),Py=Object.keys,Uc=Py?function(t){return Py(t)}:Cy(),Iy=Object.keys;Uc.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return FA(o)?Iy(DA.call(o)):Iy(o)})}else Object.keys=Uc;return Object.keys||Uc};Ry.exports=Uc});var qp=Ht((cF,Ly)=>{"use strict";Ly.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==a||h.enumerable!==!0)return!1}return!0}});var Bc=Ht((hF,Ny)=>{"use strict";var UA=qp();Ny.exports=function(){return UA()&&!!Symbol.toStringTag}});var Dy=Ht((fF,Oy)=>{"use strict";Oy.exports=Error});var Uy=Ht((pF,Fy)=>{"use strict";Fy.exports=EvalError});var zy=Ht((dF,By)=>{"use strict";By.exports=RangeError});var Gy=Ht((mF,ky)=>{"use strict";ky.exports=ReferenceError});var Xp=Ht((gF,Vy)=>{"use strict";Vy.exports=SyntaxError});var ta=Ht((yF,Hy)=>{"use strict";Hy.exports=TypeError});var qy=Ht((vF,Wy)=>{"use strict";Wy.exports=URIError});var $y=Ht((_F,Yy)=>{"use strict";var Xy=typeof Symbol!="undefined"&&Symbol,BA=qp();Yy.exports=function(){return typeof Xy!="function"||typeof Symbol!="function"||typeof Xy("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:BA()}});var Jy=Ht((xF,Zy)=>{"use strict";var Yp={__proto__:null,foo:{}},zA=Object;Zy.exports=function(){return{__proto__:Yp}.foo===Yp.foo&&!(Yp instanceof zA)}});var Qy=Ht((EF,jy)=>{"use strict";var kA="Function.prototype.bind called on incompatible ",GA=Object.prototype.toString,VA=Math.max,HA="[object Function]",Ky=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},WA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},qA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};jy.exports=function(t){var e=this;if(typeof e!="function"||GA.apply(e)!==HA)throw new TypeError(kA+e);for(var o=WA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,Ky(o,arguments));return Object(g)===g?g:this}return e.apply(t,Ky(o,arguments))},h=VA(0,e.length-o.length),f=[],p=0;p<h;p++)f[p]="$"+p;if(a=Function("binder","return function ("+qA(f,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var d=function(){};d.prototype=e.prototype,a.prototype=new d,d.prototype=null}return a}});var zc=Ht((MF,tv)=>{"use strict";var XA=Qy();tv.exports=Function.prototype.bind||XA});var nv=Ht((SF,ev)=>{"use strict";var YA=Function.prototype.call,$A=Object.prototype.hasOwnProperty,ZA=zc();ev.exports=ZA.call(YA,$A)});var uu=Ht((wF,av)=>{"use strict";var en,JA=Dy(),KA=Uy(),jA=zy(),QA=Gy(),au=Xp(),su=ta(),tC=qy(),sv=Function,$p=function(r){try{return sv('"use strict"; return ('+r+").constructor;")()}catch(t){}},ea=Object.getOwnPropertyDescriptor;if(ea)try{ea({},"")}catch(r){ea=null}var Zp=function(){throw new su},eC=ea?function(){try{return arguments.callee,Zp}catch(r){try{return ea(arguments,"callee").get}catch(t){return Zp}}}():Zp,iu=$y()(),nC=Jy()(),Ar=Object.getPrototypeOf||(nC?function(r){return r.__proto__}:null),ou={},rC=typeof Uint8Array=="undefined"||!Ar?en:Ar(Uint8Array),na={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?en:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?en:ArrayBuffer,"%ArrayIteratorPrototype%":iu&&Ar?Ar([][Symbol.iterator]()):en,"%AsyncFromSyncIteratorPrototype%":en,"%AsyncFunction%":ou,"%AsyncGenerator%":ou,"%AsyncGeneratorFunction%":ou,"%AsyncIteratorPrototype%":ou,"%Atomics%":typeof Atomics=="undefined"?en:Atomics,"%BigInt%":typeof BigInt=="undefined"?en:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?en:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?en:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?en:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":JA,"%eval%":eval,"%EvalError%":KA,"%Float32Array%":typeof Float32Array=="undefined"?en:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?en:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?en:FinalizationRegistry,"%Function%":sv,"%GeneratorFunction%":ou,"%Int8Array%":typeof Int8Array=="undefined"?en:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?en:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?en:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":iu&&Ar?Ar(Ar([][Symbol.iterator]())):en,"%JSON%":typeof JSON=="object"?JSON:en,"%Map%":typeof Map=="undefined"?en:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!iu||!Ar?en:Ar(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?en:Promise,"%Proxy%":typeof Proxy=="undefined"?en:Proxy,"%RangeError%":jA,"%ReferenceError%":QA,"%Reflect%":typeof Reflect=="undefined"?en:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?en:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!iu||!Ar?en:Ar(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?en:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":iu&&Ar?Ar(""[Symbol.iterator]()):en,"%Symbol%":iu?Symbol:en,"%SyntaxError%":au,"%ThrowTypeError%":eC,"%TypedArray%":rC,"%TypeError%":su,"%Uint8Array%":typeof Uint8Array=="undefined"?en:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?en:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?en:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?en:Uint32Array,"%URIError%":tC,"%WeakMap%":typeof WeakMap=="undefined"?en:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?en:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?en:WeakSet};if(Ar)try{null.error}catch(r){rv=Ar(Ar(r)),na["%Error.prototype%"]=rv}var rv,iC=function r(t){var e;if(t==="%AsyncFunction%")e=$p("async function () {}");else if(t==="%GeneratorFunction%")e=$p("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=$p("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Ar&&(e=Ar(a.prototype))}return na[t]=e,e},iv={__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"]},rl=zc(),kc=nv(),oC=rl.call(Function.call,Array.prototype.concat),sC=rl.call(Function.apply,Array.prototype.splice),ov=rl.call(Function.call,String.prototype.replace),Gc=rl.call(Function.call,String.prototype.slice),aC=rl.call(Function.call,RegExp.prototype.exec),uC=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lC=/\\\\(\\\\)?/g,cC=function(t){var e=Gc(t,0,1),o=Gc(t,-1);if(e==="%"&&o!=="%")throw new au("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new au("invalid intrinsic syntax, expected opening \`%\`");var a=[];return ov(t,uC,function(l,h,f,p){a[a.length]=f?ov(p,lC,"$1"):h||l}),a},hC=function(t,e){var o=t,a;if(kc(iv,o)&&(a=iv[o],o="%"+a[0]+"%"),kc(na,o)){var l=na[o];if(l===ou&&(l=iC(o)),typeof l=="undefined"&&!e)throw new su("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new au("intrinsic "+t+" does not exist!")};av.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new su("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new su('"allowMissing" argument must be a boolean');if(aC(/^%?[^%]*%?$/,t)===null)throw new au("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cC(t),a=o.length>0?o[0]:"",l=hC("%"+a+"%",e),h=l.name,f=l.value,p=!1,d=l.alias;d&&(a=d[0],sC(o,oC([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Gc(y,0,1),b=Gc(y,-1);if((M==='"'||M==="'"||M==="\`"||b==='"'||b==="'"||b==="\`")&&M!==b)throw new au("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,h="%"+a+"%",kc(na,h))f=na[h];else if(f!=null){if(!(y in f)){if(!e)throw new su("base intrinsic for "+t+" exists, but the property is not available.");return}if(ea&&g+1>=o.length){var T=ea(f,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?f=T.get:f=f[y]}else _=kc(f,y),f=f[y];_&&!p&&(na[h]=f)}}return f}});var Hc=Ht((bF,uv)=>{"use strict";var fC=uu(),Vc=fC("%Object.defineProperty%",!0)||!1;if(Vc)try{Vc({},"a",{value:1})}catch(r){Vc=!1}uv.exports=Vc});var Jp=Ht((TF,lv)=>{"use strict";var pC=uu(),Wc=pC("%Object.getOwnPropertyDescriptor%",!0);if(Wc)try{Wc([],"length")}catch(r){Wc=null}lv.exports=Wc});var qc=Ht((AF,fv)=>{"use strict";var cv=Hc(),dC=Xp(),lu=ta(),hv=Jp();fv.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new lu("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new lu("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new lu("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new lu("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new lu("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new lu("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!hv&&hv(t,e);if(cv)cv(t,e,{configurable:h===null&&p?p.configurable:!h,enumerable:a===null&&p?p.enumerable:!a,value:o,writable:l===null&&p?p.writable:!l});else if(f||!a&&!l&&!h)t[e]=o;else throw new dC("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Xc=Ht((CF,dv)=>{"use strict";var Kp=Hc(),pv=function(){return!!Kp};pv.hasArrayLengthDefineBug=function(){if(!Kp)return null;try{return Kp([],"length",{value:1}).length!==1}catch(t){return!0}};dv.exports=pv});var _v=Ht((PF,vv)=>{"use strict";var mC=uu(),mv=qc(),gC=Xc()(),gv=Jp(),yv=ta(),yC=mC("%Math.floor%");vv.exports=function(t,e){if(typeof t!="function")throw new yv("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yC(e)!==e)throw new yv("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&gv){var h=gv(t,"length");h&&!h.configurable&&(a=!1),h&&!h.writable&&(l=!1)}return(a||l||!o)&&(gC?mv(t,"length",e,!0,!0):mv(t,"length",e)),t}});var Zc=Ht((IF,Yc)=>{"use strict";var jp=zc(),$c=uu(),vC=_v(),_C=ta(),Mv=$c("%Function.prototype.apply%"),Sv=$c("%Function.prototype.call%"),wv=$c("%Reflect.apply%",!0)||jp.call(Sv,Mv),xv=Hc(),xC=$c("%Math.max%");Yc.exports=function(t){if(typeof t!="function")throw new _C("a function is required");var e=wv(jp,Sv,arguments);return vC(e,1+xC(0,t.length-(arguments.length-1)),!0)};var Ev=function(){return wv(jp,Mv,arguments)};xv?xv(Yc.exports,"apply",{value:Ev}):Yc.exports.apply=Ev});var Qp=Ht((RF,Av)=>{"use strict";var bv=uu(),Tv=Zc(),EC=Tv(bv("String.prototype.indexOf"));Av.exports=function(t,e){var o=bv(t,!!e);return typeof o=="function"&&EC(t,".prototype.")>-1?Tv(o):o}});var Iv=Ht((LF,Pv)=>{"use strict";var MC=Bc()(),SC=Qp(),td=SC("Object.prototype.toString"),Jc=function(t){return MC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:td(t)==="[object Arguments]"},Cv=function(t){return Jc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&td(t)!=="[object Array]"&&td(t.callee)==="[object Function]"},wC=function(){return Jc(arguments)}();Jc.isLegacyArguments=Cv;Pv.exports=wC?Jc:Cv});var cu=Ht((NF,Ov)=>{"use strict";var bC=Wp(),TC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AC=Object.prototype.toString,CC=Array.prototype.concat,Rv=qc(),PC=function(r){return typeof r=="function"&&AC.call(r)==="[object Function]"},Lv=Xc()(),IC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PC(o)||!o())return}Lv?Rv(r,t,e,!0):Rv(r,t,e)},Nv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bC(t);TC&&(o=CC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IC(r,o[a],t[o[a]],e[o[a]])};Nv.supportsDescriptors=!!Lv;Ov.exports=Nv});var ed=Ht((OF,Fv)=>{"use strict";var Dv=function(r){return r!==r};Fv.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||Dv(t)&&Dv(e))}});var nd=Ht((DF,Uv)=>{"use strict";var RC=ed();Uv.exports=function(){return typeof Object.is=="function"?Object.is:RC}});var zv=Ht((FF,Bv)=>{"use strict";var LC=nd(),NC=cu();Bv.exports=function(){var t=LC();return NC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Hv=Ht((UF,Vv)=>{"use strict";var OC=cu(),DC=Zc(),FC=ed(),kv=nd(),UC=zv(),Gv=DC(kv(),Object);OC(Gv,{getPolyfill:kv,implementation:FC,shim:UC});Vv.exports=Gv});var $v=Ht((BF,Yv)=>{"use strict";var rd=Qp(),Wv=Bc()(),qv,Xv,id,od;Wv&&(qv=rd("Object.prototype.hasOwnProperty"),Xv=rd("RegExp.prototype.exec"),id={},Kc=function(){throw id},od={toString:Kc,valueOf:Kc},typeof Symbol.toPrimitive=="symbol"&&(od[Symbol.toPrimitive]=Kc));var Kc,BC=rd("Object.prototype.toString"),zC=Object.getOwnPropertyDescriptor,kC="[object RegExp]";Yv.exports=Wv?function(t){if(!t||typeof t!="object")return!1;var e=zC(t,"lastIndex"),o=e&&qv(e,"value");if(!o)return!1;try{Xv(t,od)}catch(a){return a===id}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BC(t)===kC}});var Jv=Ht((zF,Zv)=>{"use strict";var ol=function(){return typeof function(){}.name=="string"},il=Object.getOwnPropertyDescriptor;if(il)try{il([],"length")}catch(r){il=null}ol.functionsHaveConfigurableNames=function(){if(!ol()||!il)return!1;var t=il(function(){},"name");return!!t&&!!t.configurable};var GC=Function.prototype.bind;ol.boundFunctionsHaveNames=function(){return ol()&&typeof GC=="function"&&function(){}.bind().name!==""};Zv.exports=ol});var Qv=Ht((kF,jv)=>{"use strict";var Kv=qc(),VC=Xc()(),HC=Jv().functionsHaveConfigurableNames(),WC=ta();jv.exports=function(t,e){if(typeof t!="function")throw new WC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||HC)&&(VC?Kv(t,"name",e,!0,!0):Kv(t,"name",e)),t}});var sd=Ht((GF,t_)=>{"use strict";var qC=Qv(),XC=ta(),YC=Object;t_.exports=qC(function(){if(this==null||this!==YC(this))throw new XC("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var ad=Ht((VF,e_)=>{"use strict";var $C=sd(),ZC=cu().supportsDescriptors,JC=Object.getOwnPropertyDescriptor;e_.exports=function(){if(ZC&&/a/mig.flags==="gim"){var t=JC(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $C}});var i_=Ht((HF,r_)=>{"use strict";var KC=cu().supportsDescriptors,jC=ad(),QC=Object.getOwnPropertyDescriptor,tP=Object.defineProperty,eP=TypeError,n_=Object.getPrototypeOf,nP=/a/;r_.exports=function(){if(!KC||!n_)throw new eP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=jC(),e=n_(nP),o=QC(e,"flags");return(!o||o.get!==t)&&tP(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var u_=Ht((WF,a_)=>{"use strict";var rP=cu(),iP=Zc(),oP=sd(),o_=ad(),sP=i_(),s_=iP(o_());rP(s_,{getPolyfill:o_,implementation:oP,shim:sP});a_.exports=s_});var c_=Ht((qF,l_)=>{"use strict";var aP=Date.prototype.getDay,uP=function(t){try{return aP.call(t),!0}catch(e){return!1}},lP=Object.prototype.toString,cP="[object Date]",hP=Bc()();l_.exports=function(t){return typeof t!="object"||t===null?!1:hP?uP(t):lP.call(t)===cP}});var ud=Ht((XF,E_)=>{var h_=Wp(),f_=Iv(),p_=Hv(),d_=$v(),m_=u_(),g_=c_(),y_=Date.prototype.getTime;function x_(r,t,e){var o=e||{};return(o.strict?p_(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?p_(r,t):r==t:fP(r,t,o)}function v_(r){return r==null}function __(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function fP(r,t,e){var o,a;if(typeof r!=typeof t||v_(r)||v_(t)||r.prototype!==t.prototype||f_(r)!==f_(t))return!1;var l=d_(r),h=d_(t);if(l!==h)return!1;if(l||h)return r.source===t.source&&m_(r)===m_(t);if(g_(r)&&g_(t))return y_.call(r)===y_.call(t);var f=__(r),p=__(t);if(f!==p)return!1;if(f||p){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var d=h_(r),g=h_(t)}catch(_){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),o=d.length-1;o>=0;o--)if(d[o]!=g[o])return!1;for(o=d.length-1;o>=0;o--)if(a=d[o],!x_(r[a],t[a],e))return!1;return!0}E_.exports=x_});var xd=Ht((jB,C_)=>{var nI=ud(),xo=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rI};xo.prototype.compare=function(r,t){if(r.type!==t.type||!A_(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=T_(r),a=T_(t);return o.every(function(l){return this.some(function(h){return e.compare(l,h)})},a)}}return!1};function T_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function A_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}xo.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};xo.prototype.compareLine=function(r,t,e,o){if(!A_(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],l[0])&&(l=this.fixStartIndex(l,a),!l))){var h=this.compareCoord(a[e],l[e]);return this.direction||h?this.comparePath(a,l):this.compareCoord(a[e],l[l.length-(1+e)])?this.comparePath(a.slice().reverse(),l):!1}};xo.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};xo.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};xo.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(l){return this.some(function(h){return a.compareLine(l,h,1,!0)})},o)}else return!1};xo.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};xo.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};xo.prototype.removePseudo=function(r){return r};function rI(r,t){return nI(r,t,{strict:!0})}C_.exports=xo});var P_=Ht((cz,th)=>{function ws(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}ws.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var l=this._regionQuery(a);if(l.length<this.minPts)this.noise.push(a);else{var h=this.clusters.length;this.clusters.push([]),this._addToCluster(a,h),this._expandCluster(h,l)}}return this.clusters};ws.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};ws.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};ws.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};ws.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};ws.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};ws.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof th!="undefined"&&th.exports&&(th.exports=ws)});var I_=Ht((hz,eh)=>{function bs(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}bs.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};bs.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var l=0;l<this.k;l++){for(var h=new Array(g),f=0,p=0;p<g;p++)h[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(l===this.assignments[d]){for(var p=0;p<g;p++)h[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)h[p]/=f;this.centroids[l]=h}else this.centroids[l]=this.randomCentroid(),a=!0}}return this.getClusters()};bs.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};bs.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};bs.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};bs.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,l=t.length,h,f=0;f<l;f++)h=e(r,t[f]),h<o&&(o=h,a=f);return a};bs.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof eh!="undefined"&&eh.exports&&(eh.exports=bs)});var Ed=Ht((fz,nh)=>{function Eo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}Eo.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};Eo.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Eo.prototype.forEach=function(r){this._queue.forEach(r)};Eo.prototype.getElements=function(){return this._queue};Eo.prototype.getElementPriority=function(r){return this._priorities[r]};Eo.prototype.getPriorities=function(){return this._priorities};Eo.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};Eo.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};Eo.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof nh!="undefined"&&nh.exports&&(nh.exports=Eo)});var L_=Ht((pz,fu)=>{typeof fu!="undefined"&&fu.exports&&(R_=Ed());var R_;function jo(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}jo.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,l=this.dataset.length;a<l;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var h=this.clusters.length-1;this._orderedList.push(a);var f=new R_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,f),this._expandCluster(h,f))}return this.clusters};jo.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};jo.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};jo.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var l=o.distance(o.dataset[r],o.dataset[a]),h=Math.max(o._coreDistance,l);o._reachability[a]===void 0?(o._reachability[a]=h,e.insert(a,h)):h<o._reachability[a]&&(o._reachability[a]=h,e.remove(a),e.insert(a,h))}})};jo.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var l=e[o];if(this._processed[l]===void 0){var h=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,h,t),this._expandCluster(r,t))}}};jo.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};jo.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};jo.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof fu!="undefined"&&fu.exports&&(fu.exports=jo)});var N_=Ht((dz,rh)=>{typeof rh!="undefined"&&rh.exports&&(rh.exports={DBSCAN:P_(),KMEANS:I_(),OPTICS:L_(),PriorityQueue:Ed()})});var Md=Ht((xz,D_)=>{"use strict";D_.exports={eudist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++){var f=(t[h]||0)-(e[h]||0);l+=f*f}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++)l+=Math.abs((t[h]||0)-(e[h]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var B_=Ht((Ez,U_)=>{"use strict";var F_=Md(),lI=F_.eudist,cI=F_.dist;U_.exports={kmrand:function(t,e){for(var o={},a=[],l=e<<2,h=t.length,f=t[0].length>0;a.length<e&&l-- >0;){var p=t[Math.floor(Math.random()*h)],d=f?p.join("_"):""+p;o[d]||(o[d]=!0,a.push(p))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lI:cI,a=[],l=t.length,h=t[0].length>0,f={},p=t[Math.floor(Math.random()*l)],d=h?p.join("_"):""+p;for(a.push(p),f[d]=!0;a.length<e;){for(var g=[],_=a.length,y=0,M=[],b=0;b<l;b++){for(var T=1/0,x=0;x<_;x++){var v=o(t[b],a[x]);v<=T&&(T=v)}g[b]=T}for(var P=0;P<l;P++)y+=g[P];for(var S=0;S<l;S++)M[S]={i:S,v:t[S],pr:g[S]/y,cs:0};M.sort(function(B,I){return B.pr-I.pr}),M[0].cs=M[0].pr;for(var L=1;L<l;L++)M[L].cs=M[L-1].cs+M[L].pr;for(var N=Math.random(),G=0;G<l-1&&M[G++].cs<N;);a.push(M[G-1].v)}return a}}});var H_=Ht((wz,V_)=>{"use strict";var Sd=Md(),G_=B_(),hI=Sd.eudist,Mz=Sd.mandist,Sz=Sd.dist,fI=G_.kmrand,pI=G_.kmpp,z_=1e4;function k_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dI(r,t,e,o){var a=[],l=[],h=[],f=[],p=!1,d=o||z_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=fI(r,t):e=="kmpp"?a=pI(r,t):a=e;else for(var b={};a.length<t;){var T=Math.floor(Math.random()*g);b[T]||(b[T]=!0,a.push(r[T]))}do{k_(t,0,M);for(var x=0;x<g;x++){for(var v=1/0,P=0,S=0;S<t;S++){var f=y?hI(r[x],a[S]):Math.abs(r[x]-a[S]);f<=v&&(v=f,P=S)}h[x]=P,M[P]++}for(var L=[],l=[],N=0,G=0;G<t;G++)L[G]=y?k_(_,0,L[G]):0,l[G]=a[G];if(y){for(var B=0;B<t;B++)a[B]=[];for(var I=0;I<g;I++)for(var O=h[I],q=L[O],st=r[I],V=0;V<_;V++)q[V]+=st[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=a[Mt],ut=L[Mt],xt=l[Mt],mt=M[Mt],lt=0;lt<_;lt++)$[lt]=ut[lt]/mt||0;if(p){for(var ht=0;ht<_;ht++)if(xt[ht]!=$[ht]){p=!1;break}}}}else{for(var k=0;k<g;k++){var nt=h[k];L[nt]+=r[k]}for(var ft=0;ft<t;ft++)a[ft]=L[ft]/M[ft]||0;p=!0;for(var Tt=0;Tt<t;Tt++)if(l[Tt]!=a[Tt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:z_-d,k:t,idxs:h,centroids:a}}V_.exports=dI});var yu=Ht((Pd,Id)=>{(function(r,t){typeof Pd=="object"&&typeof Id!="undefined"?Id.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Pd,function(){"use strict";function r(Y,w){var C={label:0,sent:function(){if(z[0]&1)throw z[1];return z[1]},trys:[],ops:[]},R,H,z,rt;return rt={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function j(tt){return function(Z){return D([tt,Z])}}function D(tt){if(R)throw new TypeError("Generator is already executing.");for(;C;)try{if(R=1,H&&(z=tt[0]&2?H.return:tt[0]?H.throw||((z=H.return)&&z.call(H),0):H.next)&&!(z=z.call(H,tt[1])).done)return z;switch(H=0,z&&(tt=[tt[0]&2,z.value]),tt[0]){case 0:case 1:z=tt;break;case 4:return C.label++,{value:tt[1],done:!1};case 5:C.label++,H=tt[1],tt=[0];continue;case 7:tt=C.ops.pop(),C.trys.pop();continue;default:if(z=C.trys,!(z=z.length>0&&z[z.length-1])&&(tt[0]===6||tt[0]===2)){C=0;continue}if(tt[0]===3&&(!z||tt[1]>z[0]&&tt[1]<z[3])){C.label=tt[1];break}if(tt[0]===6&&C.label<z[1]){C.label=z[1],z=tt;break}if(z&&C.label<z[2]){C.label=z[2],C.ops.push(tt);break}z[2]&&C.ops.pop(),C.trys.pop();continue}tt=w.call(Y,C)}catch(Z){tt=[6,Z],H=0}finally{R=z=0}if(tt[0]&5)throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}}var t=function(){function Y(w,C){this.next=null,this.key=w,this.data=C,this.left=null,this.right=null}return Y}();function e(Y,w){return Y>w?1:Y<w?-1:0}function o(Y,w,C){for(var R=new t(null,null),H=R,z=R;;){var rt=C(Y,w.key);if(rt<0){if(w.left===null)break;if(C(Y,w.left.key)<0){var j=w.left;if(w.left=j.right,j.right=w,w=j,w.left===null)break}z.left=w,z=w,w=w.left}else if(rt>0){if(w.right===null)break;if(C(Y,w.right.key)>0){var j=w.right;if(w.right=j.left,j.left=w,w=j,w.right===null)break}H.right=w,H=w,w=w.right}else break}return H.right=w.left,z.left=w.right,w.left=R.right,w.right=R.left,w}function a(Y,w,C,R){var H=new t(Y,w);if(C===null)return H.left=H.right=null,H;C=o(Y,C,R);var z=R(Y,C.key);return z<0?(H.left=C.left,H.right=C,C.left=null):z>=0&&(H.right=C.right,H.left=C,C.right=null),H}function l(Y,w,C){var R=null,H=null;if(w){w=o(Y,w,C);var z=C(w.key,Y);z===0?(R=w.left,H=w.right):z<0?(H=w.right,w.right=null,R=w):(R=w.left,w.left=null,H=w)}return{left:R,right:H}}function h(Y,w,C){return w===null?Y:(Y===null||(w=o(Y.key,w,C),w.left=Y),w)}function f(Y,w,C,R,H){if(Y){R(""+w+(C?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+H(Y)+\`
3834
+ `)}var Ln=class extends Jr.EventDispatcher{worker=Rn();initRoadStatus=!1;constructor(){super()}async setRoadData(e,t){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await ut(this.worker,"set_road_info",{roadData:e,facilities:t}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n="",r){return new Promise((i,o)=>{let a=()=>{console.log("initRoadStatus",this.initRoadStatus),ut(this.worker,"get_path",{start:e,end:t,type:n,permission:r}).then(l=>{l?typeof l=="string"?o(l):i(l):o("no-path")})};if(this.initRoadStatus)a();else{let l=({status:u})=>{u&&(this.removeEventListener("init-road-status",l),a())};this.addEventListener("init-road-status",l)}})}getDirectionPath(e){return ut(this.worker,"get_direction_path",e)}async dispose(){ut(this.worker,"clear",""),this.worker.terminate()}};var Qr=require("three");function Nn(){return xe(`var $1=Object.create;var Rh=Object.defineProperty;var Z1=Object.getOwnPropertyDescriptor;var J1=Object.getOwnPropertyNames,fm=Object.getOwnPropertySymbols,K1=Object.getPrototypeOf,pm=Object.prototype.hasOwnProperty,j1=Object.prototype.propertyIsEnumerable;var Ih=(r,t,e)=>t in r?Rh(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Sl=(r,t)=>{for(var e in t||(t={}))pm.call(t,e)&&Ih(r,e,t[e]);if(fm)for(var e of fm(t))j1.call(t,e)&&Ih(r,e,t[e]);return r};var Ht=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Q1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of J1(t))!pm.call(r,a)&&a!==e&&Rh(r,a,{get:()=>t[a],enumerable:!(o=Z1(t,a))||o.enumerable});return r};var Wn=(r,t,e)=>(e=r!=null?$1(K1(r)):{},Q1(t||!r||!r.__esModule?Rh(e,"default",{value:r,enumerable:!0}):e,r));var Si=(r,t,e)=>Ih(r,typeof t!="symbol"?t+"":t,e);var mm=Ht((PR,dm)=>{var Lh=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};dm.exports=Lh});var vm=Ht((IR,ym)=>{function gm(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,gm(a,t)):o!==t&&e.set(o,a);return e}ym.exports=gm});var Em=Ht((RR,xm)=>{function tx(r){let t=Number(r);return!(isNaN(t)||t<=0)}function _m(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,_m(a));if(!tx(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}xm.exports=_m});var wm=Ht((LR,Sm)=>{function Mm(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Mm(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}Sm.exports=Mm});var Cm=Ht((NR,Am)=>{var ex=mm(),nx=vm(),bm=Em(),Tm=wm(),Nh=class{constructor(t){t instanceof Map?(Tm(t),this.graph=t):t?this.graph=bm(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(Tm(e),o=e):o=bm(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nx(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,l=new ex,h=new Map,f=[],p=0,d=[];if(o.avoid&&(d=[].concat(o.avoid)),d.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(d.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let g=l.next();if(g.key===e){p=g.priority;let y=g.key;for(;h.has(y);)f.push(y),y=h.get(y);break}a.add(g.key),(this.graph.get(g.key)||new Map).forEach((y,M)=>{if(a.has(M)||d.includes(M))return null;if(!l.has(M))return h.set(M,g.key),l.set(M,g.priority+y);let b=l.get(M).priority,T=g.priority+y;return T<b?(h.set(M,g.key),l.set(M,T)):null})}return f.length?(o.trim?f.shift():f=f.concat([t]),o.reverse||(f=f.reverse()),o.cost?{path:f,cost:p}:f):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};Am.exports=Nh});var dc=Ht((VR,v0)=>{"use strict";var y0=Object.getOwnPropertySymbols,rT=Object.prototype.hasOwnProperty,iT=Object.prototype.propertyIsEnumerable;function oT(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sT(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}v0.exports=sT()?Object.assign:function(r,t){for(var e,o=oT(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var h in e)rT.call(e,h)&&(o[h]=e[h]);if(y0){a=y0(e);for(var f=0;f<a.length;f++)iT.call(e,a[f])&&(o[a[f]]=e[a[f]])}}return o}});var sp=Ht((ip,op)=>{(function(r,t){typeof ip=="object"&&typeof op!="undefined"?op.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ip,function(){"use strict";function r(x,v,P,S,L){(function N(G,B,I,O,q){for(;O>I;){if(O-I>600){var st=O-I+1,V=B-I+1,Mt=Math.log(st),$=.5*Math.exp(2*Mt/3),ut=.5*Math.sqrt(Mt*$*(st-$)/st)*(V-st/2<0?-1:1),xt=Math.max(I,Math.floor(B-V*$/st+ut)),mt=Math.min(O,Math.floor(B+(st-V)*$/st+ut));N(G,B,xt,mt,q)}var lt=G[B],ht=I,k=O;for(t(G,I,B),q(G[O],lt)>0&&t(G,I,O);ht<k;){for(t(G,ht,k),ht++,k--;q(G[ht],lt)<0;)ht++;for(;q(G[k],lt)>0;)k--}q(G[I],lt)===0?t(G,I,k):t(G,++k,O),k<=B&&(I=k+1),B<=k&&(O=k-1)}})(x,v,P||0,S||x.length-1,L||e)}function t(x,v,P){var S=x[v];x[v]=x[P],x[P]=S}function e(x,v){return x<v?-1:x>v?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(x,v,P){if(!P)return v.indexOf(x);for(var S=0;S<v.length;S++)if(P(x,v[S]))return S;return-1}function l(x,v){h(x,0,x.children.length,v,x)}function h(x,v,P,S,L){L||(L=b(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var N=v;N<P;N++){var G=x.children[N];f(L,x.leaf?S(G):G)}return L}function f(x,v){return x.minX=Math.min(x.minX,v.minX),x.minY=Math.min(x.minY,v.minY),x.maxX=Math.max(x.maxX,v.maxX),x.maxY=Math.max(x.maxY,v.maxY),x}function p(x,v){return x.minX-v.minX}function d(x,v){return x.minY-v.minY}function g(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function _(x){return x.maxX-x.minX+(x.maxY-x.minY)}function y(x,v){return x.minX<=v.minX&&x.minY<=v.minY&&v.maxX<=x.maxX&&v.maxY<=x.maxY}function M(x,v){return v.minX<=x.maxX&&v.minY<=x.maxY&&v.maxX>=x.minX&&v.maxY>=x.minY}function b(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(x,v,P,S,L){for(var N=[v,P];N.length;)if(!((P=N.pop())-(v=N.pop())<=S)){var G=v+Math.ceil((P-v)/S/2)*S;r(x,G,v,P,L),N.push(v,G,G,P)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var v=this.data,P=[];if(!M(x,v))return P;for(var S=this.toBBox,L=[];v;){for(var N=0;N<v.children.length;N++){var G=v.children[N],B=v.leaf?S(G):G;M(x,B)&&(v.leaf?P.push(G):y(x,B)?this._all(G,P):L.push(G))}v=L.pop()}return P},o.prototype.collides=function(x){var v=this.data;if(!M(x,v))return!1;for(var P=[];v;){for(var S=0;S<v.children.length;S++){var L=v.children[S],N=v.leaf?this.toBBox(L):L;if(M(x,N)){if(v.leaf||y(x,N))return!0;P.push(L)}}v=P.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var v=0;v<x.length;v++)this.insert(x[v]);return this}var P=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var S=this.data;this.data=P,P=S}this._insert(P,this.data.height-P.height-1,!0)}else this.data=P;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=b([]),this},o.prototype.remove=function(x,v){if(!x)return this;for(var P,S,L,N=this.data,G=this.toBBox(x),B=[],I=[];N||B.length;){if(N||(N=B.pop(),S=B[B.length-1],P=I.pop(),L=!0),N.leaf){var O=a(x,N.children,v);if(O!==-1)return N.children.splice(O,1),B.push(N),this._condense(B),this}L||N.leaf||!y(N,G)?S?(P++,N=S.children[P],L=!1):N=null:(B.push(N),I.push(P),P=0,S=N,N=N.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,v){return x.minX-v.minX},o.prototype.compareMinY=function(x,v){return x.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,v){for(var P=[];x;)x.leaf?v.push.apply(v,x.children):P.push.apply(P,x.children),x=P.pop();return v},o.prototype._build=function(x,v,P,S){var L,N=P-v+1,G=this._maxEntries;if(N<=G)return l(L=b(x.slice(v,P+1)),this.toBBox),L;S||(S=Math.ceil(Math.log(N)/Math.log(G)),G=Math.ceil(N/Math.pow(G,S-1))),(L=b([])).leaf=!1,L.height=S;var B=Math.ceil(N/G),I=B*Math.ceil(Math.sqrt(G));T(x,v,P,I,this.compareMinX);for(var O=v;O<=P;O+=I){var q=Math.min(O+I-1,P);T(x,O,q,B,this.compareMinY);for(var st=O;st<=q;st+=B){var V=Math.min(st+B-1,q);L.children.push(this._build(x,st,V,S-1))}}return l(L,this.toBBox),L},o.prototype._chooseSubtree=function(x,v,P,S){for(;S.push(v),!v.leaf&&S.length-1!==P;){for(var L=1/0,N=1/0,G=void 0,B=0;B<v.children.length;B++){var I=v.children[B],O=g(I),q=(st=x,V=I,(Math.max(V.maxX,st.maxX)-Math.min(V.minX,st.minX))*(Math.max(V.maxY,st.maxY)-Math.min(V.minY,st.minY))-O);q<N?(N=q,L=O<L?O:L,G=I):q===N&&O<L&&(L=O,G=I)}v=G||v.children[0]}var st,V;return v},o.prototype._insert=function(x,v,P){var S=P?x:this.toBBox(x),L=[],N=this._chooseSubtree(S,this.data,v,L);for(N.children.push(x),f(N,S);v>=0&&L[v].children.length>this._maxEntries;)this._split(L,v),v--;this._adjustParentBBoxes(S,L,v)},o.prototype._split=function(x,v){var P=x[v],S=P.children.length,L=this._minEntries;this._chooseSplitAxis(P,L,S);var N=this._chooseSplitIndex(P,L,S),G=b(P.children.splice(N,P.children.length-N));G.height=P.height,G.leaf=P.leaf,l(P,this.toBBox),l(G,this.toBBox),v?x[v-1].children.push(G):this._splitRoot(P,G)},o.prototype._splitRoot=function(x,v){this.data=b([x,v]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,v,P){for(var S,L,N,G,B,I,O,q=1/0,st=1/0,V=v;V<=P-v;V++){var Mt=h(x,0,V,this.toBBox),$=h(x,V,P,this.toBBox),ut=(L=Mt,N=$,G=void 0,B=void 0,I=void 0,O=void 0,G=Math.max(L.minX,N.minX),B=Math.max(L.minY,N.minY),I=Math.min(L.maxX,N.maxX),O=Math.min(L.maxY,N.maxY),Math.max(0,I-G)*Math.max(0,O-B)),xt=g(Mt)+g($);ut<q?(q=ut,S=V,st=xt<st?xt:st):ut===q&&xt<st&&(st=xt,S=V)}return S||P-v},o.prototype._chooseSplitAxis=function(x,v,P){var S=x.leaf?this.compareMinX:p,L=x.leaf?this.compareMinY:d;this._allDistMargin(x,v,P,S)<this._allDistMargin(x,v,P,L)&&x.children.sort(S)},o.prototype._allDistMargin=function(x,v,P,S){x.children.sort(S);for(var L=this.toBBox,N=h(x,0,v,L),G=h(x,P-v,P,L),B=_(N)+_(G),I=v;I<P-v;I++){var O=x.children[I];f(N,x.leaf?L(O):O),B+=_(N)}for(var q=P-v-1;q>=v;q--){var st=x.children[q];f(G,x.leaf?L(st):st),B+=_(G)}return B},o.prototype._adjustParentBBoxes=function(x,v,P){for(var S=P;S>=0;S--)f(v[S],x)},o.prototype._condense=function(x){for(var v=x.length-1,P=void 0;v>=0;v--)x[v].children.length===0?v>0?(P=x[v-1].children).splice(P.indexOf(x[v]),1):this.clear():l(x[v],this.toBBox)},o})});var _0=Ht((ap,up)=>{(function(r,t){typeof ap=="object"&&typeof up!="undefined"?up.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(ap,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,l=a.data,h=a.compare,f=l[o];o>0;){var p=o-1>>1,d=l[p];if(h(f,d)>=0)break;l[o]=d,o=p}l[o]=f},r.prototype._down=function(o){for(var a=this,l=a.data,h=a.compare,f=this.length>>1,p=l[o];o<f;){var d=(o<<1)+1,g=l[d],_=d+1;if(_<this.length&&h(l[_],g)<0&&(d=_,g=l[_]),h(g,p)>=0)break;l[o]=g,o=d}l[o]=p};function t(e,o){return e<o?-1:e>o?1:0}return r})});var E0=Ht(($R,x0)=>{x0.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=(a-o)/2,d=0,g=p-1;d<p;g=d++){var _=e[o+d*2+0],y=e[o+d*2+1],M=e[o+g*2+0],b=e[o+g*2+1],T=y>h!=b>h&&l<(M-_)*(h-y)/(b-y)+_;T&&(f=!f)}return f}});var S0=Ht((ZR,M0)=>{M0.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=a-o,d=0,g=p-1;d<p;g=d++){var _=e[d+o][0],y=e[d+o][1],M=e[g+o][0],b=e[g+o][1],T=y>h!=b>h&&l<(M-_)*(h-y)/(b-y)+_;T&&(f=!f)}return f}});var T0=Ht((JR,yc)=>{var w0=E0(),b0=S0();yc.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?b0(t,e,o,a):w0(t,e,o,a)};yc.exports.nested=b0;yc.exports.flat=w0});var C0=Ht((vc,A0)=>{(function(r,t){typeof vc=="object"&&typeof A0!="undefined"?t(vc):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(vc,function(r){"use strict";let e=33306690738754706e-32;function o(M,b,T,x,v){let P,S,L,N,G=b[0],B=x[0],I=0,O=0;B>G==B>-G?(P=G,G=b[++I]):(P=B,B=x[++O]);let q=0;if(I<M&&O<T)for(B>G==B>-G?(L=P-((S=G+P)-G),G=b[++I]):(L=P-((S=B+P)-B),B=x[++O]),P=S,L!==0&&(v[q++]=L);I<M&&O<T;)B>G==B>-G?(L=P-((S=P+G)-(N=S-P))+(G-N),G=b[++I]):(L=P-((S=P+B)-(N=S-P))+(B-N),B=x[++O]),P=S,L!==0&&(v[q++]=L);for(;I<M;)L=P-((S=P+G)-(N=S-P))+(G-N),G=b[++I],P=S,L!==0&&(v[q++]=L);for(;O<T;)L=P-((S=P+B)-(N=S-P))+(B-N),B=x[++O],P=S,L!==0&&(v[q++]=L);return P===0&&q!==0||(v[q++]=P),q}function a(M){return new Float64Array(M)}let l=33306690738754716e-32,h=22204460492503146e-32,f=11093356479670487e-47,p=a(4),d=a(8),g=a(12),_=a(16),y=a(4);r.orient2d=function(M,b,T,x,v,P){let S=(b-P)*(T-v),L=(M-v)*(x-P),N=S-L;if(S===0||L===0||S>0!=L>0)return N;let G=Math.abs(S+L);return Math.abs(N)>=l*G?N:-function(B,I,O,q,st,V,Mt){let $,ut,xt,mt,lt,ht,k,nt,ft,Tt,gt,Lt,qt,Xt,Ft,Qt,Ct,ee,it=B-st,rn=O-st,Bt=I-V,Jt=q-V;lt=(Ft=(nt=it-(k=(ht=134217729*it)-(ht-it)))*(Tt=Jt-(ft=(ht=134217729*Jt)-(ht-Jt)))-((Xt=it*Jt)-k*ft-nt*ft-k*Tt))-(gt=Ft-(Ct=(nt=Bt-(k=(ht=134217729*Bt)-(ht-Bt)))*(Tt=rn-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=(ht=134217729*xt)-(ht-xt)))-((Qt=Bt*xt)-k*ft-nt*ft-k*Tt))),y[0]=Ft-(gt+lt)+(lt-Ct),lt=(qt=Xt-((Lt=Xt+gt)-(lt=Lt-Xt))+(gt-lt))-(gt=qt-Qt),y[1]=qt-(gt+lt)+(lt-Qt),lt=(ee=Lt+gt)-Lt,y[2]=Lt-(ee-lt)+(gt-lt),y[3]=ee;let Pt=o(le,d,4,y,g);lt=(Ft=(nt=$-(k=(ht=134217729*$)-(ht-$)))*(Tt=mt-(ft=(ht=134217729*mt)-(ht-mt)))-((Xt=$*mt)-k*ft-nt*ft-k*Tt))-(gt=Ft-(Ct=(nt=ut-(k=(ht=134217729*ut)-(ht-ut)))*(Tt=xt-(ft=(ht=134217729*xt)-(ht-xt)))-((Qt=ut*xt)-k*ft-nt*ft-k*Tt))),y[0]=Ft-(gt+lt)+(lt-Ct),lt=(qt=Xt-((Lt=Xt+gt)-(lt=Lt-Xt))+(gt-lt))-(gt=qt-Qt),y[1]=qt-(gt+lt)+(lt-Qt),lt=(ee=Lt+gt)-Lt,y[2]=Lt-(ee-lt)+(gt-lt),y[3]=ee;let te=o(Pt,g,4,y,_);return _[te-1]}(M,b,T,x,v,P,G)},r.orient2dfast=function(M,b,T,x,v,P){return(b-P)*(T-v)-(M-v)*(x-P)},Object.defineProperty(r,"__esModule",{value:!0})})});var O0=Ht((KR,fp)=>{"use strict";var P0=sp(),xc=_0(),uT=T0(),lT=C0().orient2d;xc.default&&(xc=xc.default);fp.exports=N0;fp.exports.default=N0;function N0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dT(r),a=new P0(16);a.toBBox=function(P){return{minX:P[0],minY:P[1],maxX:P[0],maxY:P[1]}},a.compareMinX=function(P,S){return P[0]-S[0]},a.compareMinY=function(P,S){return P[1]-S[1]},a.load(r);for(var l=[],h=0,f;h<o.length;h++){var p=o[h];a.remove(p),f=L0(p,f),l.push(f)}var d=new P0(16);for(h=0;h<l.length;h++)d.insert(lp(l[h]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,b=y.next.p,T=cp(M,b);if(!(T<_)){var x=T/g;p=cT(a,y.prev.p,M,b,y.next.next.p,x,d),p&&Math.min(cp(p,M),cp(p,b))<=x&&(l.push(y),l.push(L0(p,y)),a.remove(p),d.remove(y),d.insert(lp(y)),d.insert(lp(y.next)))}}y=f;var v=[];do v.push(y.p),y=y.next;while(y!==f);return v.push(y.p),v}function cT(r,t,e,o,a,l,h){for(var f=new xc([],hT),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?hp(g,e,o):fT(e,o,g);_>l||f.push({node:g,dist:_})}for(;f.length&&!f.peek().node.children;){var y=f.pop(),M=y.node,b=hp(M,t,e),T=hp(M,o,a);if(y.dist<b&&y.dist<T&&R0(e,M,h)&&R0(o,M,h))return M}p=f.pop(),p&&(p=p.node)}return null}function hT(r,t){return r.dist-t.dist}function fT(r,t,e){if(I0(r,e)||I0(t,e))return 0;var o=_c(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=_c(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=_c(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var h=_c(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return h===0?0:Math.min(o,a,l,h)}function I0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function R0(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),l=Math.max(r[0],t[0]),h=Math.max(r[1],t[1]),f=e.search({minX:o,minY:a,maxX:l,maxY:h}),p=0;p<f.length;p++)if(pT(f[p].p,f[p].next.p,r,t))return!1;return!0}function Ja(r,t,e){return lT(r[0],r[1],t[0],t[1],e[0],e[1])}function pT(r,t,e,o){return r!==o&&t!==e&&Ja(r,t,e)>0!=Ja(r,t,o)>0&&Ja(e,o,r)>0!=Ja(e,o,t)>0}function lp(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dT(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],l=0;l<r.length;l++){var h=r[l];h[0]<t[0]&&(t=h),h[0]>o[0]&&(o=h),h[1]<e[1]&&(e=h),h[1]>a[1]&&(a=h)}var f=[t,e,o,a],p=f.slice();for(l=0;l<r.length;l++)uT(r[l],f)||p.push(r[l]);return gT(p)}function L0(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function cp(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function hp(r,t,e){var o=t[0],a=t[1],l=e[0]-o,h=e[1]-a;if(l!==0||h!==0){var f=((r[0]-o)*l+(r[1]-a)*h)/(l*l+h*h);f>1?(o=e[0],a=e[1]):f>0&&(o+=l*f,a+=h*f)}return l=r[0]-o,h=r[1]-a,l*l+h*h}function _c(r,t,e,o,a,l,h,f){var p=e-r,d=o-t,g=h-a,_=f-l,y=r-a,M=t-l,b=p*p+d*d,T=p*g+d*_,x=g*g+_*_,v=p*y+d*M,P=g*y+_*M,S=b*x-T*T,L,N,G,B,I=S,O=S;S===0?(N=0,I=1,B=P,O=x):(N=T*P-x*v,B=b*P-T*v,N<0?(N=0,B=P,O=x):N>I&&(N=I,B=P+T,O=x)),B<0?(B=0,-v<0?N=0:-v>b?N=I:(N=-v,I=b)):B>O&&(B=O,-v+T<0?N=0:-v+T>b?N=I:(N=-v+T,I=b)),L=N===0?0:N/I,G=B===0?0:B/O;var q=(1-L)*r+L*e,st=(1-L)*t+L*o,V=(1-G)*a+G*h,Mt=(1-G)*l+G*f,$=V-q,ut=Mt-st;return $*$+ut*ut}function mT(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function gT(r){r.sort(mT);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Ja(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&Ja(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var k0=Ht((dp,mp)=>{(function(r,t){typeof dp=="object"&&typeof mp!="undefined"?mp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(dp,function(){"use strict";function r(a,l,h,f,p){t(a,l,h||0,f||a.length-1,p||o)}function t(a,l,h,f,p){for(;f>h;){if(f-h>600){var d=f-h+1,g=l-h+1,_=Math.log(d),y=.5*Math.exp(2*_/3),M=.5*Math.sqrt(_*y*(d-y)/d)*(g-d/2<0?-1:1),b=Math.max(h,Math.floor(l-g*y/d+M)),T=Math.min(f,Math.floor(l+(d-g)*y/d+M));t(a,l,b,T,p)}var x=a[l],v=h,P=f;for(e(a,h,l),p(a[f],x)>0&&e(a,h,f);v<P;){for(e(a,v,P),v++,P--;p(a[v],x)<0;)v++;for(;p(a[P],x)>0;)P--}p(a[h],x)===0?e(a,h,P):(P++,e(a,P,f)),P<=l&&(h=P+1),l<=P&&(f=P-1)}}function e(a,l,h){var f=a[l];a[l]=a[h],a[h]=f}function o(a,l){return a<l?-1:a>l?1:0}return r})});var _p=Ht((S2,vp)=>{"use strict";vp.exports=Xu;vp.exports.default=Xu;var PT=k0();function Xu(r,t){if(!(this instanceof Xu))return new Xu(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}Xu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!Mc(r,t))return e;for(var a=[],l,h,f,p;t;){for(l=0,h=t.children.length;l<h;l++)f=t.children[l],p=t.leaf?o(f):f,Mc(r,p)&&(t.leaf?e.push(f):yp(r,p)?this._all(f,e):a.push(f));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!Mc(r,t))return!1;for(var o=[],a,l,h,f;t;){for(a=0,l=t.children.length;a<l;a++)if(h=t.children[a],f=t.leaf?e(h):h,Mc(r,f)){if(t.leaf||yp(r,f))return!0;o.push(h)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=Qa([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],l=[],h,f,p,d;e||a.length;){if(e||(e=a.pop(),f=a[a.length-1],h=l.pop(),d=!0),e.leaf&&(p=IT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&yp(e,o)?(a.push(e),l.push(h),h=0,f=e,e=e.children[0]):f?(h++,e=f.children[h],d=!1):e=null}return this},toBBox:function(r){return r},compareMinX:G0,compareMinY:V0,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,l=this._maxEntries,h;if(a<=l)return h=Qa(r.slice(t,e+1)),ja(h,this.toBBox),h;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),h=Qa([]),h.leaf=!1,h.height=o;var f=Math.ceil(a/l),p=f*Math.ceil(Math.sqrt(l)),d,g,_,y;for(H0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),H0(r,d,_,f,this.compareMinY),g=d;g<=_;g+=f)y=Math.min(g+f-1,_),h.children.push(this._build(r,g,y,o-1));return ja(h,this.toBBox),h},_chooseSubtree:function(r,t,e,o){for(var a,l,h,f,p,d,g,_;o.push(t),!(t.leaf||o.length-1===e);){for(g=_=1/0,a=0,l=t.children.length;a<l;a++)h=t.children[a],p=gp(h),d=RT(r,h)-p,d<_?(_=d,g=p<g?p:g,f=h):d===_&&p<g&&(g=p,f=h);t=f||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),l=[],h=this._chooseSubtree(a,this.data,t,l);for(h.children.push(r),qu(h,a);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(a,l,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var l=this._chooseSplitIndex(e,a,o),h=Qa(e.children.splice(l,e.children.length-l));h.height=e.height,h.leaf=e.leaf,ja(e,this.toBBox),ja(h,this.toBBox),t?r[t-1].children.push(h):this._splitRoot(e,h)},_splitRoot:function(r,t){this.data=Qa([r,t]),this.data.height=r.height+1,this.data.leaf=!1,ja(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,l,h,f,p,d,g;for(p=d=1/0,o=t;o<=e-t;o++)a=Wu(r,0,o,this.toBBox),l=Wu(r,o,e,this.toBBox),h=LT(a,l),f=gp(a)+gp(l),h<p?(p=h,g=o,d=f<d?f:d):h===p&&f<d&&(d=f,g=o);return g},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:G0,a=r.leaf?this.compareMinY:V0,l=this._allDistMargin(r,t,e,o),h=this._allDistMargin(r,t,e,a);l<h&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,l=Wu(r,0,t,a),h=Wu(r,e-t,e,a),f=Ec(l)+Ec(h),p,d;for(p=t;p<e-t;p++)d=r.children[p],qu(l,r.leaf?a(d):d),f+=Ec(l);for(p=e-t-1;p>=t;p--)d=r.children[p],qu(h,r.leaf?a(d):d),f+=Ec(h);return f},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)qu(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():ja(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function IT(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function ja(r,t){Wu(r,0,r.children.length,t,r)}function Wu(r,t,e,o,a){a||(a=Qa(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var l=t,h;l<e;l++)h=r.children[l],qu(a,r.leaf?o(h):h);return a}function qu(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function G0(r,t){return r.minX-t.minX}function V0(r,t){return r.minY-t.minY}function gp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Ec(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RT(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LT(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),l=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,l-o)}function yp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Mc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Qa(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function H0(r,t,e,o,a){for(var l=[t,e],h;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(h=t+Math.ceil((e-t)/o/2)*o,PT(r,h,t,e,a),l.push(t,h,h,e))}});var Z0=Ht((FO,bp)=>{"use strict";bp.exports=Tc;bp.exports.default=Tc;function Tc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=X0(r,0,a,e,!0),h=[];if(!l||l.next===l.prev)return h;var f,p,d,g,_,y,M;if(o&&(l=VT(r,t,l,e)),r.length>80*e){f=d=r[0],p=g=r[1];for(var b=e;b<a;b+=e)_=r[b],y=r[b+1],_<f&&(f=_),y<p&&(p=y),_>d&&(d=_),y>g&&(g=y);M=Math.max(d-f,g-p),M=M!==0?32767/M:0}return Zu(l,h,e,f,p,M,0),h}function X0(r,t,e,o,a){var l,h;if(a===wp(r,t,e,o)>0)for(l=t;l<e;l+=o)h=q0(l,r[l],r[l+1],h);else for(l=e-o;l>=t;l-=o)h=q0(l,r[l],r[l+1],h);return h&&Ac(h,h.next)&&(Ku(h),h=h.next),h}function Qs(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Ac(e,e.next)||Yn(e.prev,e,e.next)===0)){if(Ku(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Zu(r,t,e,o,a,l,h){if(r){!h&&l&&YT(r,o,a,l);for(var f=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?zT(r,o,a,l):BT(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),Ku(r),r=d.next,f=d.next;continue}if(r=d,r===f){h?h===1?(r=kT(Qs(r),t,e),Zu(r,t,e,o,a,l,2)):h===2&&GT(r,t,e,o,a,l):Zu(Qs(r),t,e,o,a,l,1);break}}}}function BT(r){var t=r.prev,e=r,o=r.next;if(Yn(t,e,o)>=0)return!1;for(var a=t.x,l=e.x,h=o.x,f=t.y,p=e.y,d=o.y,g=a<l?a<h?a:h:l<h?l:h,_=f<p?f<d?f:d:p<d?p:d,y=a>l?a>h?a:h:l>h?l:h,M=f>p?f>d?f:d:p>d?p:d,b=o.next;b!==t;){if(b.x>=g&&b.x<=y&&b.y>=_&&b.y<=M&&nu(a,f,l,p,h,d,b.x,b.y)&&Yn(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function zT(r,t,e,o){var a=r.prev,l=r,h=r.next;if(Yn(a,l,h)>=0)return!1;for(var f=a.x,p=l.x,d=h.x,g=a.y,_=l.y,y=h.y,M=f<p?f<d?f:d:p<d?p:d,b=g<_?g<y?g:y:_<y?_:y,T=f>p?f>d?f:d:p>d?p:d,x=g>_?g>y?g:y:_>y?_:y,v=Mp(M,b,t,e,o),P=Mp(T,x,t,e,o),S=r.prevZ,L=r.nextZ;S&&S.z>=v&&L&&L.z<=P;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=x&&S!==a&&S!==h&&nu(f,g,p,_,d,y,S.x,S.y)&&Yn(S.prev,S,S.next)>=0||(S=S.prevZ,L.x>=M&&L.x<=T&&L.y>=b&&L.y<=x&&L!==a&&L!==h&&nu(f,g,p,_,d,y,L.x,L.y)&&Yn(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;S&&S.z>=v;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=x&&S!==a&&S!==h&&nu(f,g,p,_,d,y,S.x,S.y)&&Yn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;L&&L.z<=P;){if(L.x>=M&&L.x<=T&&L.y>=b&&L.y<=x&&L!==a&&L!==h&&nu(f,g,p,_,d,y,L.x,L.y)&&Yn(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function kT(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Ac(a,l)&&Y0(a,o,o.next,l)&&Ju(a,l)&&Ju(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),Ku(o),Ku(o.next),o=r=l),o=o.next}while(o!==r);return Qs(o)}function GT(r,t,e,o,a,l){var h=r;do{for(var f=h.next.next;f!==h.prev;){if(h.i!==f.i&&JT(h,f)){var p=$0(h,f);h=Qs(h,h.next),p=Qs(p,p.next),Zu(h,t,e,o,a,l,0),Zu(p,t,e,o,a,l,0);return}f=f.next}h=h.next}while(h!==r)}function VT(r,t,e,o){var a=[],l,h,f,p,d;for(l=0,h=t.length;l<h;l++)f=t[l]*o,p=l<h-1?t[l+1]*o:r.length,d=X0(r,f,p,o,!1),d===d.next&&(d.steiner=!0),a.push(ZT(d));for(a.sort(HT),l=0;l<a.length;l++)e=WT(a[l],e);return e}function HT(r,t){return r.x-t.x}function WT(r,t){var e=qT(r,t);if(!e)return t;var o=$0(e,r);return Qs(o,o.next),Qs(e,e.next)}function qT(r,t){var e=t,o=r.x,a=r.y,l=-1/0,h;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var f=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=o&&f>l&&(l=f,h=e.x<e.next.x?e:e.next,f===o))return h}e=e.next}while(e!==t);if(!h)return null;var p=h,d=h.x,g=h.y,_=1/0,y;e=h;do o>=e.x&&e.x>=d&&o!==e.x&&nu(a<g?o:l,a,d,g,a<g?l:o,a,e.x,e.y)&&(y=Math.abs(a-e.y)/(o-e.x),Ju(e,r)&&(y<_||y===_&&(e.x>h.x||e.x===h.x&&XT(h,e)))&&(h=e,_=y)),e=e.next;while(e!==p);return h}function XT(r,t){return Yn(r.prev,r,t.prev)<0&&Yn(t.next,r,r.next)<0}function YT(r,t,e,o){var a=r;do a.z===0&&(a.z=Mp(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$T(a)}function $T(r){var t,e,o,a,l,h,f,p,d=1;do{for(e=r,r=null,l=null,h=0;e;){for(h++,o=e,f=0,t=0;t<d&&(f++,o=o.nextZ,!!o);t++);for(p=d;f>0||p>0&&o;)f!==0&&(p===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,f--):(a=o,o=o.nextZ,p--),l?l.nextZ=a:r=a,a.prevZ=l,l=a;e=o}l.nextZ=null,d*=2}while(h>1);return r}function Mp(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZT(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function nu(r,t,e,o,a,l,h,f){return(a-h)*(t-f)>=(r-h)*(l-f)&&(r-h)*(o-f)>=(e-h)*(t-f)&&(e-h)*(l-f)>=(a-h)*(o-f)}function JT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KT(r,t)&&(Ju(r,t)&&Ju(t,r)&&jT(r,t)&&(Yn(r.prev,r,t.prev)||Yn(r,t.prev,t))||Ac(r,t)&&Yn(r.prev,r,r.next)>0&&Yn(t.prev,t,t.next)>0)}function Yn(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Ac(r,t){return r.x===t.x&&r.y===t.y}function Y0(r,t,e,o){var a=bc(Yn(r,t,e)),l=bc(Yn(r,t,o)),h=bc(Yn(e,o,r)),f=bc(Yn(e,o,t));return!!(a!==l&&h!==f||a===0&&wc(r,e,t)||l===0&&wc(r,o,t)||h===0&&wc(e,r,o)||f===0&&wc(e,t,o))}function wc(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function bc(r){return r>0?1:r<0?-1:0}function KT(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Y0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Ju(r,t){return Yn(r.prev,r,r.next)<0?Yn(r,t,r.next)>=0&&Yn(r,r.prev,t)>=0:Yn(r,t,r.prev)<0||Yn(r,r.next,t)<0}function jT(r,t){var e=r,o=!1,a=(r.x+t.x)/2,l=(r.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&a<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function $0(r,t){var e=new Sp(r.i,r.x,r.y),o=new Sp(t.i,t.x,t.y),a=r.next,l=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function q0(r,t,e,o){var a=new Sp(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function Ku(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Sp(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Tc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,h=Math.abs(wp(r,0,l,e));if(a)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:r.length;h-=Math.abs(wp(r,d,g,e))}var _=0;for(f=0;f<o.length;f+=3){var y=o[f]*e,M=o[f+1]*e,b=o[f+2]*e;_+=Math.abs((r[y]-r[b])*(r[M+1]-r[y+1])-(r[y]-r[M])*(r[b+1]-r[y+1]))}return h===0&&_===0?0:Math.abs((_-h)/h)};function wp(r,t,e,o){for(var a=0,l=t,h=e-o;l<e;l+=o)a+=(r[h]-r[l])*(r[l+1]+r[h+1]),h=l;return a}Tc.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var l=0;l<r[a].length;l++)for(var h=0;h<t;h++)e.vertices.push(r[a][l][h]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Ip=Ht(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.earthRadius=63710088e-1;ae.factors={centimeters:ae.earthRadius*100,centimetres:ae.earthRadius*100,degrees:ae.earthRadius/111325,feet:ae.earthRadius*3.28084,inches:ae.earthRadius*39.37,kilometers:ae.earthRadius/1e3,kilometres:ae.earthRadius/1e3,meters:ae.earthRadius,metres:ae.earthRadius,miles:ae.earthRadius/1609.344,millimeters:ae.earthRadius*1e3,millimetres:ae.earthRadius*1e3,nauticalmiles:ae.earthRadius/1852,radians:1,yards:ae.earthRadius*1.0936};ae.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ae.earthRadius,yards:1.0936133};ae.areaFactors={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,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ms(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}ae.feature=Ms;function tA(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Tp(t).geometry;case"LineString":return Cp(t).geometry;case"Polygon":return Ap(t).geometry;case"MultiPoint":return K0(t).geometry;case"MultiLineString":return J0(t).geometry;case"MultiPolygon":return j0(t).geometry;default:throw new Error(r+" is invalid")}}ae.geometry=tA;function Tp(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Cc(r[0])||!Cc(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Ms(o,t,e)}ae.point=Tp;function eA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Tp(o,t)}),e)}ae.points=eA;function Ap(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var l=a[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<l[l.length-1].length;h++)if(l[l.length-1][h]!==l[0][h])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:r};return Ms(f,t,e)}ae.polygon=Ap;function nA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Ap(o,t)}),e)}ae.polygons=nA;function Cp(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Ms(o,t,e)}ae.lineString=Cp;function rA(r,t,e){return e===void 0&&(e={}),Pc(r.map(function(o){return Cp(o,t)}),e)}ae.lineStrings=rA;function Pc(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}ae.featureCollection=Pc;function J0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Ms(o,t,e)}ae.multiLineString=J0;function K0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Ms(o,t,e)}ae.multiPoint=K0;function j0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Ms(o,t,e)}ae.multiPolygon=j0;function iA(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Ms(o,t,e)}ae.geometryCollection=iA;function oA(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}ae.round=oA;function Q0(r,t){t===void 0&&(t="kilometers");var e=ae.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}ae.radiansToLength=Q0;function Pp(r,t){t===void 0&&(t="kilometers");var e=ae.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}ae.lengthToRadians=Pp;function sA(r,t){return ty(Pp(r,t))}ae.lengthToDegrees=sA;function aA(r){var t=r%360;return t<0&&(t+=360),t}ae.bearingToAzimuth=aA;function ty(r){var t=r%(2*Math.PI);return t*180/Math.PI}ae.radiansToDegrees=ty;function uA(r){var t=r%360;return t*Math.PI/180}ae.degreesToRadians=uA;function lA(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Q0(Pp(r,t),e)}ae.convertLength=lA;function cA(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=ae.areaFactors[t];if(!o)throw new Error("invalid original units");var a=ae.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}ae.convertArea=cA;function Cc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ae.isNumber=Cc;function hA(r){return!!r&&r.constructor===Object}ae.isObject=hA;function fA(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Cc(t))throw new Error("bbox must only contain numbers")})}ae.validateBBox=fA;function pA(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}ae.validateId=pA});var Lp=Ht(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});var Zr=Ip();function ju(r,t,e){if(r!==null)for(var o,a,l,h,f,p,d,g=0,_=0,y,M=r.type,b=M==="FeatureCollection",T=M==="Feature",x=b?r.features.length:1,v=0;v<x;v++){d=b?r.features[v].geometry:T?r.geometry:r,y=d?d.type==="GeometryCollection":!1,f=y?d.geometries.length:1;for(var P=0;P<f;P++){var S=0,L=0;if(h=y?d.geometries[P]:d,h!==null){p=h.coordinates;var N=h.type;switch(g=e&&(N==="Polygon"||N==="MultiPolygon")?1:0,N){case null:break;case"Point":if(t(p,_,v,S,L)===!1)return!1;_++,S++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],_,v,S,L)===!1)return!1;_++,N==="MultiPoint"&&S++}N==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(a=0;a<p[o].length-g;a++){if(t(p[o][a],_,v,S,L)===!1)return!1;_++}N==="MultiLineString"&&S++,N==="Polygon"&&L++}N==="Polygon"&&S++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(L=0,a=0;a<p[o].length;a++){for(l=0;l<p[o][a].length-g;l++){if(t(p[o][a][l],_,v,S,L)===!1)return!1;_++}L++}S++}break;case"GeometryCollection":for(o=0;o<h.geometries.length;o++)if(ju(h.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function dA(r,t,e,o){var a=e;return ju(r,function(l,h,f,p,d){h===0&&e===void 0?a=l:a=t(a,l,h,f,p,d)},o),a}function ey(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function mA(r,t,e){var o=e;return ey(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function ny(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function gA(r,t,e){var o=e;return ny(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function yA(r){var t=[];return ju(r,function(e){t.push(e)}),t}function Rp(r,t){var e,o,a,l,h,f,p,d,g,_,y=0,M=r.type==="FeatureCollection",b=r.type==="Feature",T=M?r.features.length:1;for(e=0;e<T;e++){for(f=M?r.features[e].geometry:b?r.geometry:r,d=M?r.features[e].properties:b?r.properties:{},g=M?r.features[e].bbox:b?r.bbox:void 0,_=M?r.features[e].id:b?r.id:void 0,p=f?f.type==="GeometryCollection":!1,h=p?f.geometries.length:1,a=0;a<h;a++){if(l=p?f.geometries[a]:f,l===null){if(t(null,y,d,g,_)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,y,d,g,_)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],y,d,g,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function vA(r,t,e){var o=e;return Rp(r,function(a,l,h,f,p){l===0&&e===void 0?o=a:o=t(o,a,l,h,f,p)}),o}function Ic(r,t){Rp(r,function(e,o,a,l,h){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(Zr.feature(e,a,{bbox:l,id:h}),o,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],_={type:p,coordinates:g};if(t(Zr.feature(_,a),o,d)===!1)return!1}})}function _A(r,t,e){var o=e;return Ic(r,function(a,l,h){l===0&&h===0&&e===void 0?o=a:o=t(o,a,l,h)}),o}function ry(r,t){Ic(r,function(e,o,a){var l=0;if(e.geometry){var h=e.geometry.type;if(!(h==="Point"||h==="MultiPoint")){var f,p=0,d=0,g=0;if(ju(e,function(_,y,M,b,T){if(f===void 0||o>p||b>d||T>g){f=_,p=o,d=b,g=T,l=0;return}var x=Zr.lineString([f,_],e.properties);if(t(x,o,a,T,l)===!1)return!1;l++,f=_})===!1)return!1}}})}function xA(r,t,e){var o=e,a=!1;return ry(r,function(l,h,f,p,d){a===!1&&e===void 0?o=l:o=t(o,l,h,f,p,d),a=!0}),o}function iy(r,t){if(!r)throw new Error("geojson is required");Ic(r,function(e,o,a){if(e.geometry!==null){var l=e.geometry.type,h=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<h.length;f++)if(t(Zr.lineString(h[f],e.properties),o,a,f)===!1)return!1;break}}})}function EA(r,t,e){var o=e;return iy(r,function(a,l,h,f){l===0&&e===void 0?o=a:o=t(o,a,l,h,f)}),o}function MA(r,t){if(t=t||{},!Zr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.segmentIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=p.length+l-1),Zr.lineString([p[l],p[l+1]],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l-1),Zr.lineString([p[a][l],p[a][l+1]],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l-1),Zr.lineString([p[o][l],p[o][l+1]],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l-1),Zr.lineString([p[o][a][l],p[o][a][l+1]],h,t)}throw new Error("geojson is invalid")}function SA(r,t){if(t=t||{},!Zr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.coordIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return Zr.point(p,h,t);case"MultiPoint":return o<0&&(o=p.length+o),Zr.point(p[o],h,t);case"LineString":return l<0&&(l=p.length+l),Zr.point(p[l],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l),Zr.point(p[a][l],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l),Zr.point(p[o][l],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l),Zr.point(p[o][a][l],h,t)}throw new Error("geojson is invalid")}pr.coordAll=yA;pr.coordEach=ju;pr.coordReduce=dA;pr.featureEach=ny;pr.featureReduce=gA;pr.findPoint=SA;pr.findSegment=MA;pr.flattenEach=Ic;pr.flattenReduce=_A;pr.geomEach=Rp;pr.geomReduce=vA;pr.lineEach=iy;pr.lineReduce=EA;pr.propEach=ey;pr.propReduce=mA;pr.segmentEach=ry;pr.segmentReduce=xA});var oy=Ht(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var wA=Lp();function Np(r){var t=[1/0,1/0,-1/0,-1/0];return wA.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Np.default=Np;Op.default=Np});var Rc=Ht((jO,Dp)=>{var _o=sp(),ay=Ip(),uy=Lp(),ru=oy().default,bA=uy.featureEach,JO=uy.coordEach,KO=ay.polygon,sy=ay.featureCollection;function ly(r){var t=new _o(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ru(e),_o.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:ru(a),o.push(a)}):bA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:ru(a),o.push(a)}),_o.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ru(e),_o.prototype.remove.call(this,e,o)},t.clear=function(){return _o.prototype.clear.call(this)},t.search=function(e){var o=_o.prototype.search.call(this,this.toBBox(e));return sy(o)},t.collides=function(e){return _o.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=_o.prototype.all.call(this);return sy(e)},t.toJSON=function(){return _o.prototype.toJSON.call(this)},t.fromJSON=function(e){return _o.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=ru(e);else if(e.type==="FeatureCollection")o=ru(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Dp.exports=ly;Dp.exports.default=ly});var Gp=Ht((aF,_y)=>{"use strict";var vy=Object.prototype.toString;_y.exports=function(t){var e=vy.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&vy.call(t.callee)==="[object Function]"),o}});var Cy=Ht((uF,Ay)=>{"use strict";var Ty;Object.keys||(el=Object.prototype.hasOwnProperty,Vp=Object.prototype.toString,xy=Gp(),Hp=Object.prototype.propertyIsEnumerable,Ey=!Hp.call({toString:null},"toString"),My=Hp.call(function(){},"prototype"),nl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Fc=function(r){var t=r.constructor;return t&&t.prototype===r},Sy={$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},wy=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!Sy["$"+r]&&el.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Fc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),by=function(r){if(typeof window=="undefined"||!wy)return Fc(r);try{return Fc(r)}catch(t){return!1}},Ty=function(t){var e=t!==null&&typeof t=="object",o=Vp.call(t)==="[object Function]",a=xy(t),l=e&&Vp.call(t)==="[object String]",h=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var f=My&&o;if(l&&t.length>0&&!el.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var d=0;d<t.length;++d)h.push(String(d));else for(var g in t)!(f&&g==="prototype")&&el.call(t,g)&&h.push(String(g));if(Ey)for(var _=by(t),y=0;y<nl.length;++y)!(_&&nl[y]==="constructor")&&el.call(t,nl[y])&&h.push(nl[y]);return h});var el,Vp,xy,Hp,Ey,My,nl,Fc,Sy,wy,by;Ay.exports=Ty});var Wp=Ht((lF,Ry)=>{"use strict";var DA=Array.prototype.slice,FA=Gp(),Py=Object.keys,Uc=Py?function(t){return Py(t)}:Cy(),Iy=Object.keys;Uc.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return FA(o)?Iy(DA.call(o)):Iy(o)})}else Object.keys=Uc;return Object.keys||Uc};Ry.exports=Uc});var qp=Ht((cF,Ly)=>{"use strict";Ly.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==a||h.enumerable!==!0)return!1}return!0}});var Bc=Ht((hF,Ny)=>{"use strict";var UA=qp();Ny.exports=function(){return UA()&&!!Symbol.toStringTag}});var Dy=Ht((fF,Oy)=>{"use strict";Oy.exports=Error});var Uy=Ht((pF,Fy)=>{"use strict";Fy.exports=EvalError});var zy=Ht((dF,By)=>{"use strict";By.exports=RangeError});var Gy=Ht((mF,ky)=>{"use strict";ky.exports=ReferenceError});var Xp=Ht((gF,Vy)=>{"use strict";Vy.exports=SyntaxError});var ta=Ht((yF,Hy)=>{"use strict";Hy.exports=TypeError});var qy=Ht((vF,Wy)=>{"use strict";Wy.exports=URIError});var $y=Ht((_F,Yy)=>{"use strict";var Xy=typeof Symbol!="undefined"&&Symbol,BA=qp();Yy.exports=function(){return typeof Xy!="function"||typeof Symbol!="function"||typeof Xy("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:BA()}});var Jy=Ht((xF,Zy)=>{"use strict";var Yp={__proto__:null,foo:{}},zA=Object;Zy.exports=function(){return{__proto__:Yp}.foo===Yp.foo&&!(Yp instanceof zA)}});var Qy=Ht((EF,jy)=>{"use strict";var kA="Function.prototype.bind called on incompatible ",GA=Object.prototype.toString,VA=Math.max,HA="[object Function]",Ky=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},WA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},qA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};jy.exports=function(t){var e=this;if(typeof e!="function"||GA.apply(e)!==HA)throw new TypeError(kA+e);for(var o=WA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,Ky(o,arguments));return Object(g)===g?g:this}return e.apply(t,Ky(o,arguments))},h=VA(0,e.length-o.length),f=[],p=0;p<h;p++)f[p]="$"+p;if(a=Function("binder","return function ("+qA(f,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var d=function(){};d.prototype=e.prototype,a.prototype=new d,d.prototype=null}return a}});var zc=Ht((MF,tv)=>{"use strict";var XA=Qy();tv.exports=Function.prototype.bind||XA});var nv=Ht((SF,ev)=>{"use strict";var YA=Function.prototype.call,$A=Object.prototype.hasOwnProperty,ZA=zc();ev.exports=ZA.call(YA,$A)});var uu=Ht((wF,av)=>{"use strict";var en,JA=Dy(),KA=Uy(),jA=zy(),QA=Gy(),au=Xp(),su=ta(),tC=qy(),sv=Function,$p=function(r){try{return sv('"use strict"; return ('+r+").constructor;")()}catch(t){}},ea=Object.getOwnPropertyDescriptor;if(ea)try{ea({},"")}catch(r){ea=null}var Zp=function(){throw new su},eC=ea?function(){try{return arguments.callee,Zp}catch(r){try{return ea(arguments,"callee").get}catch(t){return Zp}}}():Zp,iu=$y()(),nC=Jy()(),Ar=Object.getPrototypeOf||(nC?function(r){return r.__proto__}:null),ou={},rC=typeof Uint8Array=="undefined"||!Ar?en:Ar(Uint8Array),na={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?en:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?en:ArrayBuffer,"%ArrayIteratorPrototype%":iu&&Ar?Ar([][Symbol.iterator]()):en,"%AsyncFromSyncIteratorPrototype%":en,"%AsyncFunction%":ou,"%AsyncGenerator%":ou,"%AsyncGeneratorFunction%":ou,"%AsyncIteratorPrototype%":ou,"%Atomics%":typeof Atomics=="undefined"?en:Atomics,"%BigInt%":typeof BigInt=="undefined"?en:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?en:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?en:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?en:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":JA,"%eval%":eval,"%EvalError%":KA,"%Float32Array%":typeof Float32Array=="undefined"?en:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?en:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?en:FinalizationRegistry,"%Function%":sv,"%GeneratorFunction%":ou,"%Int8Array%":typeof Int8Array=="undefined"?en:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?en:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?en:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":iu&&Ar?Ar(Ar([][Symbol.iterator]())):en,"%JSON%":typeof JSON=="object"?JSON:en,"%Map%":typeof Map=="undefined"?en:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!iu||!Ar?en:Ar(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?en:Promise,"%Proxy%":typeof Proxy=="undefined"?en:Proxy,"%RangeError%":jA,"%ReferenceError%":QA,"%Reflect%":typeof Reflect=="undefined"?en:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?en:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!iu||!Ar?en:Ar(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?en:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":iu&&Ar?Ar(""[Symbol.iterator]()):en,"%Symbol%":iu?Symbol:en,"%SyntaxError%":au,"%ThrowTypeError%":eC,"%TypedArray%":rC,"%TypeError%":su,"%Uint8Array%":typeof Uint8Array=="undefined"?en:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?en:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?en:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?en:Uint32Array,"%URIError%":tC,"%WeakMap%":typeof WeakMap=="undefined"?en:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?en:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?en:WeakSet};if(Ar)try{null.error}catch(r){rv=Ar(Ar(r)),na["%Error.prototype%"]=rv}var rv,iC=function r(t){var e;if(t==="%AsyncFunction%")e=$p("async function () {}");else if(t==="%GeneratorFunction%")e=$p("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=$p("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Ar&&(e=Ar(a.prototype))}return na[t]=e,e},iv={__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"]},rl=zc(),kc=nv(),oC=rl.call(Function.call,Array.prototype.concat),sC=rl.call(Function.apply,Array.prototype.splice),ov=rl.call(Function.call,String.prototype.replace),Gc=rl.call(Function.call,String.prototype.slice),aC=rl.call(Function.call,RegExp.prototype.exec),uC=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lC=/\\\\(\\\\)?/g,cC=function(t){var e=Gc(t,0,1),o=Gc(t,-1);if(e==="%"&&o!=="%")throw new au("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new au("invalid intrinsic syntax, expected opening \`%\`");var a=[];return ov(t,uC,function(l,h,f,p){a[a.length]=f?ov(p,lC,"$1"):h||l}),a},hC=function(t,e){var o=t,a;if(kc(iv,o)&&(a=iv[o],o="%"+a[0]+"%"),kc(na,o)){var l=na[o];if(l===ou&&(l=iC(o)),typeof l=="undefined"&&!e)throw new su("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new au("intrinsic "+t+" does not exist!")};av.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new su("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new su('"allowMissing" argument must be a boolean');if(aC(/^%?[^%]*%?$/,t)===null)throw new au("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cC(t),a=o.length>0?o[0]:"",l=hC("%"+a+"%",e),h=l.name,f=l.value,p=!1,d=l.alias;d&&(a=d[0],sC(o,oC([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Gc(y,0,1),b=Gc(y,-1);if((M==='"'||M==="'"||M==="\`"||b==='"'||b==="'"||b==="\`")&&M!==b)throw new au("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,h="%"+a+"%",kc(na,h))f=na[h];else if(f!=null){if(!(y in f)){if(!e)throw new su("base intrinsic for "+t+" exists, but the property is not available.");return}if(ea&&g+1>=o.length){var T=ea(f,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?f=T.get:f=f[y]}else _=kc(f,y),f=f[y];_&&!p&&(na[h]=f)}}return f}});var Hc=Ht((bF,uv)=>{"use strict";var fC=uu(),Vc=fC("%Object.defineProperty%",!0)||!1;if(Vc)try{Vc({},"a",{value:1})}catch(r){Vc=!1}uv.exports=Vc});var Jp=Ht((TF,lv)=>{"use strict";var pC=uu(),Wc=pC("%Object.getOwnPropertyDescriptor%",!0);if(Wc)try{Wc([],"length")}catch(r){Wc=null}lv.exports=Wc});var qc=Ht((AF,fv)=>{"use strict";var cv=Hc(),dC=Xp(),lu=ta(),hv=Jp();fv.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new lu("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new lu("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new lu("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new lu("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new lu("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new lu("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!hv&&hv(t,e);if(cv)cv(t,e,{configurable:h===null&&p?p.configurable:!h,enumerable:a===null&&p?p.enumerable:!a,value:o,writable:l===null&&p?p.writable:!l});else if(f||!a&&!l&&!h)t[e]=o;else throw new dC("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Xc=Ht((CF,dv)=>{"use strict";var Kp=Hc(),pv=function(){return!!Kp};pv.hasArrayLengthDefineBug=function(){if(!Kp)return null;try{return Kp([],"length",{value:1}).length!==1}catch(t){return!0}};dv.exports=pv});var _v=Ht((PF,vv)=>{"use strict";var mC=uu(),mv=qc(),gC=Xc()(),gv=Jp(),yv=ta(),yC=mC("%Math.floor%");vv.exports=function(t,e){if(typeof t!="function")throw new yv("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yC(e)!==e)throw new yv("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&gv){var h=gv(t,"length");h&&!h.configurable&&(a=!1),h&&!h.writable&&(l=!1)}return(a||l||!o)&&(gC?mv(t,"length",e,!0,!0):mv(t,"length",e)),t}});var Zc=Ht((IF,Yc)=>{"use strict";var jp=zc(),$c=uu(),vC=_v(),_C=ta(),Mv=$c("%Function.prototype.apply%"),Sv=$c("%Function.prototype.call%"),wv=$c("%Reflect.apply%",!0)||jp.call(Sv,Mv),xv=Hc(),xC=$c("%Math.max%");Yc.exports=function(t){if(typeof t!="function")throw new _C("a function is required");var e=wv(jp,Sv,arguments);return vC(e,1+xC(0,t.length-(arguments.length-1)),!0)};var Ev=function(){return wv(jp,Mv,arguments)};xv?xv(Yc.exports,"apply",{value:Ev}):Yc.exports.apply=Ev});var Qp=Ht((RF,Av)=>{"use strict";var bv=uu(),Tv=Zc(),EC=Tv(bv("String.prototype.indexOf"));Av.exports=function(t,e){var o=bv(t,!!e);return typeof o=="function"&&EC(t,".prototype.")>-1?Tv(o):o}});var Iv=Ht((LF,Pv)=>{"use strict";var MC=Bc()(),SC=Qp(),td=SC("Object.prototype.toString"),Jc=function(t){return MC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:td(t)==="[object Arguments]"},Cv=function(t){return Jc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&td(t)!=="[object Array]"&&td(t.callee)==="[object Function]"},wC=function(){return Jc(arguments)}();Jc.isLegacyArguments=Cv;Pv.exports=wC?Jc:Cv});var cu=Ht((NF,Ov)=>{"use strict";var bC=Wp(),TC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AC=Object.prototype.toString,CC=Array.prototype.concat,Rv=qc(),PC=function(r){return typeof r=="function"&&AC.call(r)==="[object Function]"},Lv=Xc()(),IC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PC(o)||!o())return}Lv?Rv(r,t,e,!0):Rv(r,t,e)},Nv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bC(t);TC&&(o=CC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IC(r,o[a],t[o[a]],e[o[a]])};Nv.supportsDescriptors=!!Lv;Ov.exports=Nv});var ed=Ht((OF,Fv)=>{"use strict";var Dv=function(r){return r!==r};Fv.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||Dv(t)&&Dv(e))}});var nd=Ht((DF,Uv)=>{"use strict";var RC=ed();Uv.exports=function(){return typeof Object.is=="function"?Object.is:RC}});var zv=Ht((FF,Bv)=>{"use strict";var LC=nd(),NC=cu();Bv.exports=function(){var t=LC();return NC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Hv=Ht((UF,Vv)=>{"use strict";var OC=cu(),DC=Zc(),FC=ed(),kv=nd(),UC=zv(),Gv=DC(kv(),Object);OC(Gv,{getPolyfill:kv,implementation:FC,shim:UC});Vv.exports=Gv});var $v=Ht((BF,Yv)=>{"use strict";var rd=Qp(),Wv=Bc()(),qv,Xv,id,od;Wv&&(qv=rd("Object.prototype.hasOwnProperty"),Xv=rd("RegExp.prototype.exec"),id={},Kc=function(){throw id},od={toString:Kc,valueOf:Kc},typeof Symbol.toPrimitive=="symbol"&&(od[Symbol.toPrimitive]=Kc));var Kc,BC=rd("Object.prototype.toString"),zC=Object.getOwnPropertyDescriptor,kC="[object RegExp]";Yv.exports=Wv?function(t){if(!t||typeof t!="object")return!1;var e=zC(t,"lastIndex"),o=e&&qv(e,"value");if(!o)return!1;try{Xv(t,od)}catch(a){return a===id}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BC(t)===kC}});var Jv=Ht((zF,Zv)=>{"use strict";var ol=function(){return typeof function(){}.name=="string"},il=Object.getOwnPropertyDescriptor;if(il)try{il([],"length")}catch(r){il=null}ol.functionsHaveConfigurableNames=function(){if(!ol()||!il)return!1;var t=il(function(){},"name");return!!t&&!!t.configurable};var GC=Function.prototype.bind;ol.boundFunctionsHaveNames=function(){return ol()&&typeof GC=="function"&&function(){}.bind().name!==""};Zv.exports=ol});var Qv=Ht((kF,jv)=>{"use strict";var Kv=qc(),VC=Xc()(),HC=Jv().functionsHaveConfigurableNames(),WC=ta();jv.exports=function(t,e){if(typeof t!="function")throw new WC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||HC)&&(VC?Kv(t,"name",e,!0,!0):Kv(t,"name",e)),t}});var sd=Ht((GF,t_)=>{"use strict";var qC=Qv(),XC=ta(),YC=Object;t_.exports=qC(function(){if(this==null||this!==YC(this))throw new XC("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var ad=Ht((VF,e_)=>{"use strict";var $C=sd(),ZC=cu().supportsDescriptors,JC=Object.getOwnPropertyDescriptor;e_.exports=function(){if(ZC&&/a/mig.flags==="gim"){var t=JC(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $C}});var i_=Ht((HF,r_)=>{"use strict";var KC=cu().supportsDescriptors,jC=ad(),QC=Object.getOwnPropertyDescriptor,tP=Object.defineProperty,eP=TypeError,n_=Object.getPrototypeOf,nP=/a/;r_.exports=function(){if(!KC||!n_)throw new eP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=jC(),e=n_(nP),o=QC(e,"flags");return(!o||o.get!==t)&&tP(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var u_=Ht((WF,a_)=>{"use strict";var rP=cu(),iP=Zc(),oP=sd(),o_=ad(),sP=i_(),s_=iP(o_());rP(s_,{getPolyfill:o_,implementation:oP,shim:sP});a_.exports=s_});var c_=Ht((qF,l_)=>{"use strict";var aP=Date.prototype.getDay,uP=function(t){try{return aP.call(t),!0}catch(e){return!1}},lP=Object.prototype.toString,cP="[object Date]",hP=Bc()();l_.exports=function(t){return typeof t!="object"||t===null?!1:hP?uP(t):lP.call(t)===cP}});var ud=Ht((XF,E_)=>{var h_=Wp(),f_=Iv(),p_=Hv(),d_=$v(),m_=u_(),g_=c_(),y_=Date.prototype.getTime;function x_(r,t,e){var o=e||{};return(o.strict?p_(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?p_(r,t):r==t:fP(r,t,o)}function v_(r){return r==null}function __(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function fP(r,t,e){var o,a;if(typeof r!=typeof t||v_(r)||v_(t)||r.prototype!==t.prototype||f_(r)!==f_(t))return!1;var l=d_(r),h=d_(t);if(l!==h)return!1;if(l||h)return r.source===t.source&&m_(r)===m_(t);if(g_(r)&&g_(t))return y_.call(r)===y_.call(t);var f=__(r),p=__(t);if(f!==p)return!1;if(f||p){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var d=h_(r),g=h_(t)}catch(_){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),o=d.length-1;o>=0;o--)if(d[o]!=g[o])return!1;for(o=d.length-1;o>=0;o--)if(a=d[o],!x_(r[a],t[a],e))return!1;return!0}E_.exports=x_});var xd=Ht((jB,C_)=>{var nI=ud(),xo=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rI};xo.prototype.compare=function(r,t){if(r.type!==t.type||!A_(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=T_(r),a=T_(t);return o.every(function(l){return this.some(function(h){return e.compare(l,h)})},a)}}return!1};function T_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function A_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}xo.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};xo.prototype.compareLine=function(r,t,e,o){if(!A_(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],l[0])&&(l=this.fixStartIndex(l,a),!l))){var h=this.compareCoord(a[e],l[e]);return this.direction||h?this.comparePath(a,l):this.compareCoord(a[e],l[l.length-(1+e)])?this.comparePath(a.slice().reverse(),l):!1}};xo.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};xo.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};xo.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(l){return this.some(function(h){return a.compareLine(l,h,1,!0)})},o)}else return!1};xo.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};xo.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};xo.prototype.removePseudo=function(r){return r};function rI(r,t){return nI(r,t,{strict:!0})}C_.exports=xo});var P_=Ht((cz,th)=>{function ws(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}ws.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var l=this._regionQuery(a);if(l.length<this.minPts)this.noise.push(a);else{var h=this.clusters.length;this.clusters.push([]),this._addToCluster(a,h),this._expandCluster(h,l)}}return this.clusters};ws.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};ws.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};ws.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};ws.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};ws.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};ws.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof th!="undefined"&&th.exports&&(th.exports=ws)});var I_=Ht((hz,eh)=>{function bs(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}bs.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};bs.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var l=0;l<this.k;l++){for(var h=new Array(g),f=0,p=0;p<g;p++)h[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(l===this.assignments[d]){for(var p=0;p<g;p++)h[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)h[p]/=f;this.centroids[l]=h}else this.centroids[l]=this.randomCentroid(),a=!0}}return this.getClusters()};bs.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};bs.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};bs.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};bs.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,l=t.length,h,f=0;f<l;f++)h=e(r,t[f]),h<o&&(o=h,a=f);return a};bs.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof eh!="undefined"&&eh.exports&&(eh.exports=bs)});var Ed=Ht((fz,nh)=>{function Eo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}Eo.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};Eo.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Eo.prototype.forEach=function(r){this._queue.forEach(r)};Eo.prototype.getElements=function(){return this._queue};Eo.prototype.getElementPriority=function(r){return this._priorities[r]};Eo.prototype.getPriorities=function(){return this._priorities};Eo.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};Eo.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};Eo.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof nh!="undefined"&&nh.exports&&(nh.exports=Eo)});var L_=Ht((pz,fu)=>{typeof fu!="undefined"&&fu.exports&&(R_=Ed());var R_;function jo(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}jo.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,l=this.dataset.length;a<l;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var h=this.clusters.length-1;this._orderedList.push(a);var f=new R_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,f),this._expandCluster(h,f))}return this.clusters};jo.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};jo.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};jo.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var l=o.distance(o.dataset[r],o.dataset[a]),h=Math.max(o._coreDistance,l);o._reachability[a]===void 0?(o._reachability[a]=h,e.insert(a,h)):h<o._reachability[a]&&(o._reachability[a]=h,e.remove(a),e.insert(a,h))}})};jo.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var l=e[o];if(this._processed[l]===void 0){var h=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,h,t),this._expandCluster(r,t))}}};jo.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};jo.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};jo.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof fu!="undefined"&&fu.exports&&(fu.exports=jo)});var N_=Ht((dz,rh)=>{typeof rh!="undefined"&&rh.exports&&(rh.exports={DBSCAN:P_(),KMEANS:I_(),OPTICS:L_(),PriorityQueue:Ed()})});var Md=Ht((xz,D_)=>{"use strict";D_.exports={eudist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++){var f=(t[h]||0)-(e[h]||0);l+=f*f}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++)l+=Math.abs((t[h]||0)-(e[h]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var B_=Ht((Ez,U_)=>{"use strict";var F_=Md(),lI=F_.eudist,cI=F_.dist;U_.exports={kmrand:function(t,e){for(var o={},a=[],l=e<<2,h=t.length,f=t[0].length>0;a.length<e&&l-- >0;){var p=t[Math.floor(Math.random()*h)],d=f?p.join("_"):""+p;o[d]||(o[d]=!0,a.push(p))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lI:cI,a=[],l=t.length,h=t[0].length>0,f={},p=t[Math.floor(Math.random()*l)],d=h?p.join("_"):""+p;for(a.push(p),f[d]=!0;a.length<e;){for(var g=[],_=a.length,y=0,M=[],b=0;b<l;b++){for(var T=1/0,x=0;x<_;x++){var v=o(t[b],a[x]);v<=T&&(T=v)}g[b]=T}for(var P=0;P<l;P++)y+=g[P];for(var S=0;S<l;S++)M[S]={i:S,v:t[S],pr:g[S]/y,cs:0};M.sort(function(B,I){return B.pr-I.pr}),M[0].cs=M[0].pr;for(var L=1;L<l;L++)M[L].cs=M[L-1].cs+M[L].pr;for(var N=Math.random(),G=0;G<l-1&&M[G++].cs<N;);a.push(M[G-1].v)}return a}}});var H_=Ht((wz,V_)=>{"use strict";var Sd=Md(),G_=B_(),hI=Sd.eudist,Mz=Sd.mandist,Sz=Sd.dist,fI=G_.kmrand,pI=G_.kmpp,z_=1e4;function k_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dI(r,t,e,o){var a=[],l=[],h=[],f=[],p=!1,d=o||z_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=fI(r,t):e=="kmpp"?a=pI(r,t):a=e;else for(var b={};a.length<t;){var T=Math.floor(Math.random()*g);b[T]||(b[T]=!0,a.push(r[T]))}do{k_(t,0,M);for(var x=0;x<g;x++){for(var v=1/0,P=0,S=0;S<t;S++){var f=y?hI(r[x],a[S]):Math.abs(r[x]-a[S]);f<=v&&(v=f,P=S)}h[x]=P,M[P]++}for(var L=[],l=[],N=0,G=0;G<t;G++)L[G]=y?k_(_,0,L[G]):0,l[G]=a[G];if(y){for(var B=0;B<t;B++)a[B]=[];for(var I=0;I<g;I++)for(var O=h[I],q=L[O],st=r[I],V=0;V<_;V++)q[V]+=st[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=a[Mt],ut=L[Mt],xt=l[Mt],mt=M[Mt],lt=0;lt<_;lt++)$[lt]=ut[lt]/mt||0;if(p){for(var ht=0;ht<_;ht++)if(xt[ht]!=$[ht]){p=!1;break}}}}else{for(var k=0;k<g;k++){var nt=h[k];L[nt]+=r[k]}for(var ft=0;ft<t;ft++)a[ft]=L[ft]/M[ft]||0;p=!0;for(var Tt=0;Tt<t;Tt++)if(l[Tt]!=a[Tt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:z_-d,k:t,idxs:h,centroids:a}}V_.exports=dI});var yu=Ht((Pd,Id)=>{(function(r,t){typeof Pd=="object"&&typeof Id!="undefined"?Id.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Pd,function(){"use strict";function r(Y,w){var C={label:0,sent:function(){if(z[0]&1)throw z[1];return z[1]},trys:[],ops:[]},R,H,z,rt;return rt={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function j(tt){return function(Z){return D([tt,Z])}}function D(tt){if(R)throw new TypeError("Generator is already executing.");for(;C;)try{if(R=1,H&&(z=tt[0]&2?H.return:tt[0]?H.throw||((z=H.return)&&z.call(H),0):H.next)&&!(z=z.call(H,tt[1])).done)return z;switch(H=0,z&&(tt=[tt[0]&2,z.value]),tt[0]){case 0:case 1:z=tt;break;case 4:return C.label++,{value:tt[1],done:!1};case 5:C.label++,H=tt[1],tt=[0];continue;case 7:tt=C.ops.pop(),C.trys.pop();continue;default:if(z=C.trys,!(z=z.length>0&&z[z.length-1])&&(tt[0]===6||tt[0]===2)){C=0;continue}if(tt[0]===3&&(!z||tt[1]>z[0]&&tt[1]<z[3])){C.label=tt[1];break}if(tt[0]===6&&C.label<z[1]){C.label=z[1],z=tt;break}if(z&&C.label<z[2]){C.label=z[2],C.ops.push(tt);break}z[2]&&C.ops.pop(),C.trys.pop();continue}tt=w.call(Y,C)}catch(Z){tt=[6,Z],H=0}finally{R=z=0}if(tt[0]&5)throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}}var t=function(){function Y(w,C){this.next=null,this.key=w,this.data=C,this.left=null,this.right=null}return Y}();function e(Y,w){return Y>w?1:Y<w?-1:0}function o(Y,w,C){for(var R=new t(null,null),H=R,z=R;;){var rt=C(Y,w.key);if(rt<0){if(w.left===null)break;if(C(Y,w.left.key)<0){var j=w.left;if(w.left=j.right,j.right=w,w=j,w.left===null)break}z.left=w,z=w,w=w.left}else if(rt>0){if(w.right===null)break;if(C(Y,w.right.key)>0){var j=w.right;if(w.right=j.left,j.left=w,w=j,w.right===null)break}H.right=w,H=w,w=w.right}else break}return H.right=w.left,z.left=w.right,w.left=R.right,w.right=R.left,w}function a(Y,w,C,R){var H=new t(Y,w);if(C===null)return H.left=H.right=null,H;C=o(Y,C,R);var z=R(Y,C.key);return z<0?(H.left=C.left,H.right=C,C.left=null):z>=0&&(H.right=C.right,H.left=C,C.right=null),H}function l(Y,w,C){var R=null,H=null;if(w){w=o(Y,w,C);var z=C(w.key,Y);z===0?(R=w.left,H=w.right):z<0?(H=w.right,w.right=null,R=w):(R=w.left,w.left=null,H=w)}return{left:R,right:H}}function h(Y,w,C){return w===null?Y:(Y===null||(w=o(Y.key,w,C),w.left=Y),w)}function f(Y,w,C,R,H){if(Y){R(""+w+(C?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+H(Y)+\`
3835
3835
  \`);var z=w+(C?" ":"\\u2502 ");Y.left&&f(Y.left,z,!1,R,H),Y.right&&f(Y.right,z,!0,R,H)}}var p=function(){function Y(w){w===void 0&&(w=e),this._root=null,this._size=0,this._comparator=w}return Y.prototype.insert=function(w,C){return this._size++,this._root=a(w,C,this._root,this._comparator)},Y.prototype.add=function(w,C){var R=new t(w,C);this._root===null&&(R.left=R.right=null,this._size++,this._root=R);var H=this._comparator,z=o(w,this._root,H),rt=H(w,z.key);return rt===0?this._root=z:(rt<0?(R.left=z.left,R.right=z,z.left=null):rt>0&&(R.right=z.right,R.left=z,z.right=null),this._size++,this._root=R),this._root},Y.prototype.remove=function(w){this._root=this._remove(w,this._root,this._comparator)},Y.prototype._remove=function(w,C,R){var H;if(C===null)return null;C=o(w,C,R);var z=R(w,C.key);return z===0?(C.left===null?H=C.right:(H=o(w,C.left,R),H.right=C.right),this._size--,H):C},Y.prototype.pop=function(){var w=this._root;if(w){for(;w.left;)w=w.left;return this._root=o(w.key,this._root,this._comparator),this._root=this._remove(w.key,this._root,this._comparator),{key:w.key,data:w.data}}return null},Y.prototype.findStatic=function(w){for(var C=this._root,R=this._comparator;C;){var H=R(w,C.key);if(H===0)return C;H<0?C=C.left:C=C.right}return null},Y.prototype.find=function(w){return this._root&&(this._root=o(w,this._root,this._comparator),this._comparator(w,this._root.key)!==0)?null:this._root},Y.prototype.contains=function(w){for(var C=this._root,R=this._comparator;C;){var H=R(w,C.key);if(H===0)return!0;H<0?C=C.left:C=C.right}return!1},Y.prototype.forEach=function(w,C){for(var R=this._root,H=[],z=!1;!z;)R!==null?(H.push(R),R=R.left):H.length!==0?(R=H.pop(),w.call(C,R),R=R.right):z=!0;return this},Y.prototype.range=function(w,C,R,H){for(var z=[],rt=this._comparator,j=this._root,D;z.length!==0||j;)if(j)z.push(j),j=j.left;else{if(j=z.pop(),D=rt(j.key,C),D>0)break;if(rt(j.key,w)>=0&&R.call(H,j))return this;j=j.right}return this},Y.prototype.keys=function(){var w=[];return this.forEach(function(C){var R=C.key;return w.push(R)}),w},Y.prototype.values=function(){var w=[];return this.forEach(function(C){var R=C.data;return w.push(R)}),w},Y.prototype.min=function(){return this._root?this.minNode(this._root).key:null},Y.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},Y.prototype.minNode=function(w){if(w===void 0&&(w=this._root),w)for(;w.left;)w=w.left;return w},Y.prototype.maxNode=function(w){if(w===void 0&&(w=this._root),w)for(;w.right;)w=w.right;return w},Y.prototype.at=function(w){for(var C=this._root,R=!1,H=0,z=[];!R;)if(C)z.push(C),C=C.left;else if(z.length>0){if(C=z.pop(),H===w)return C;H++,C=C.right}else R=!0;return null},Y.prototype.next=function(w){var C=this._root,R=null;if(w.right){for(R=w.right;R.left;)R=R.left;return R}for(var H=this._comparator;C;){var z=H(w.key,C.key);if(z===0)break;z<0?(R=C,C=C.left):C=C.right}return R},Y.prototype.prev=function(w){var C=this._root,R=null;if(w.left!==null){for(R=w.left;R.right;)R=R.right;return R}for(var H=this._comparator;C;){var z=H(w.key,C.key);if(z===0)break;z<0?C=C.left:(R=C,C=C.right)}return R},Y.prototype.clear=function(){return this._root=null,this._size=0,this},Y.prototype.toList=function(){return _(this._root)},Y.prototype.load=function(w,C,R){C===void 0&&(C=[]),R===void 0&&(R=!1);var H=w.length,z=this._comparator;if(R&&b(w,C,0,H-1,z),this._root===null)this._root=d(w,C,0,H),this._size=H;else{var rt=M(this.toList(),g(w,C),z);H=this._size+H,this._root=y({head:rt},0,H)}return this},Y.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(Y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Y.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Y.prototype.toString=function(w){w===void 0&&(w=function(R){return String(R.key)});var C=[];return f(this._root,"",!0,function(R){return C.push(R)},w),C.join("")},Y.prototype.update=function(w,C,R){var H=this._comparator,z=l(w,this._root,H),rt=z.left,j=z.right;H(w,C)<0?j=a(C,R,j,H):rt=a(C,R,rt,H),this._root=h(rt,j,H)},Y.prototype.split=function(w){return l(w,this._root,this._comparator)},Y.prototype[Symbol.iterator]=function(){var w,C,R;return r(this,function(H){switch(H.label){case 0:w=this._root,C=[],R=!1,H.label=1;case 1:return R?[3,6]:w===null?[3,2]:(C.push(w),w=w.left,[3,5]);case 2:return C.length===0?[3,4]:(w=C.pop(),[4,w]);case 3:return H.sent(),w=w.right,[3,5];case 4:R=!0,H.label=5;case 5:return[3,1];case 6:return[2]}})},Y}();function d(Y,w,C,R){var H=R-C;if(H>0){var z=C+Math.floor(H/2),rt=Y[z],j=w[z],D=new t(rt,j);return D.left=d(Y,w,C,z),D.right=d(Y,w,z+1,R),D}return null}function g(Y,w){for(var C=new t(null,null),R=C,H=0;H<Y.length;H++)R=R.next=new t(Y[H],w[H]);return R.next=null,C.next}function _(Y){for(var w=Y,C=[],R=!1,H=new t(null,null),z=H;!R;)w?(C.push(w),w=w.left):C.length>0?(w=z=z.next=C.pop(),w=w.right):R=!0;return z.next=null,H.next}function y(Y,w,C){var R=C-w;if(R>0){var H=w+Math.floor(R/2),z=y(Y,w,H),rt=Y.head;return rt.left=z,Y.head=Y.head.next,rt.right=y(Y,H+1,C),rt}return null}function M(Y,w,C){for(var R=new t(null,null),H=R,z=Y,rt=w;z!==null&&rt!==null;)C(z.key,rt.key)<0?(H.next=z,z=z.next):(H.next=rt,rt=rt.next),H=H.next;return z!==null?H.next=z:rt!==null&&(H.next=rt),R.next}function b(Y,w,C,R,H){if(!(C>=R)){for(var z=Y[C+R>>1],rt=C-1,j=R+1;;){do rt++;while(H(Y[rt],z)<0);do j--;while(H(Y[j],z)>0);if(rt>=j)break;var D=Y[rt];Y[rt]=Y[j],Y[j]=D,D=w[rt],w[rt]=w[j],w[j]=D}b(Y,w,C,j,H),b(Y,w,j+1,R,H)}}let T=(Y,w)=>Y.ll.x<=w.x&&w.x<=Y.ur.x&&Y.ll.y<=w.y&&w.y<=Y.ur.y,x=(Y,w)=>{if(w.ur.x<Y.ll.x||Y.ur.x<w.ll.x||w.ur.y<Y.ll.y||Y.ur.y<w.ll.y)return null;let C=Y.ll.x<w.ll.x?w.ll.x:Y.ll.x,R=Y.ur.x<w.ur.x?Y.ur.x:w.ur.x,H=Y.ll.y<w.ll.y?w.ll.y:Y.ll.y,z=Y.ur.y<w.ur.y?Y.ur.y:w.ur.y;return{ll:{x:C,y:H},ur:{x:R,y:z}}},v=Number.EPSILON;v===void 0&&(v=Math.pow(2,-52));let P=v*v,S=(Y,w)=>{if(-v<Y&&Y<v&&-v<w&&w<v)return 0;let C=Y-w;return C*C<P*Y*w?0:Y<w?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new N,this.yRounder=new N}round(w,C){return{x:this.xRounder.round(w),y:this.yRounder.round(C)}}}class N{constructor(){this.tree=new p,this.round(0)}round(w){let C=this.tree.add(w),R=this.tree.prev(C);if(R!==null&&S(C.key,R.key)===0)return this.tree.remove(w),R.key;let H=this.tree.next(C);return H!==null&&S(C.key,H.key)===0?(this.tree.remove(w),H.key):w}}let G=new L,B=11102230246251565e-32,I=134217729,O=(3+8*B)*B;function q(Y,w,C,R,H){let z,rt,j,D,tt=w[0],Z=R[0],et=0,ot=0;Z>tt==Z>-tt?(z=tt,tt=w[++et]):(z=Z,Z=R[++ot]);let Q=0;if(et<Y&&ot<C)for(Z>tt==Z>-tt?(rt=tt+z,j=z-(rt-tt),tt=w[++et]):(rt=Z+z,j=z-(rt-Z),Z=R[++ot]),z=rt,j!==0&&(H[Q++]=j);et<Y&&ot<C;)Z>tt==Z>-tt?(rt=z+tt,D=rt-z,j=z-(rt-D)+(tt-D),tt=w[++et]):(rt=z+Z,D=rt-z,j=z-(rt-D)+(Z-D),Z=R[++ot]),z=rt,j!==0&&(H[Q++]=j);for(;et<Y;)rt=z+tt,D=rt-z,j=z-(rt-D)+(tt-D),tt=w[++et],z=rt,j!==0&&(H[Q++]=j);for(;ot<C;)rt=z+Z,D=rt-z,j=z-(rt-D)+(Z-D),Z=R[++ot],z=rt,j!==0&&(H[Q++]=j);return(z!==0||Q===0)&&(H[Q++]=z),Q}function st(Y,w){let C=w[0];for(let R=1;R<Y;R++)C+=w[R];return C}function V(Y){return new Float64Array(Y)}let Mt=(3+16*B)*B,$=(2+12*B)*B,ut=(9+64*B)*B*B,xt=V(4),mt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Math.sqrt(gt(Y,Y)),Xt=(Y,w,C)=>{let R={x:w.x-Y.x,y:w.y-Y.y},H={x:C.x-Y.x,y:C.y-Y.y};return Tt(H,R)/qt(H)/qt(R)},Ft=(Y,w,C)=>{let R={x:w.x-Y.x,y:w.y-Y.y},H={x:C.x-Y.x,y:C.y-Y.y};return gt(H,R)/qt(H)/qt(R)},Qt=(Y,w,C)=>w.y===0?null:{x:Y.x+w.x/w.y*(C-Y.y),y:C},Ct=(Y,w,C)=>w.x===0?null:{x:C,y:Y.y+w.y/w.x*(C-Y.x)},ee=(Y,w,C,R)=>{if(w.x===0)return Ct(C,R,Y.x);if(R.x===0)return Ct(Y,w,C.x);if(w.y===0)return Qt(C,R,Y.y);if(R.y===0)return Qt(Y,w,C.y);let H=Tt(w,R);if(H==0)return null;let z={x:C.x-Y.x,y:C.y-Y.y},rt=Tt(z,w)/H,j=Tt(z,R)/H,D=Y.x+j*w.x,tt=C.x+rt*R.x,Z=Y.y+j*w.y,et=C.y+rt*R.y,ot=(D+tt)/2,Q=(Z+et)/2;return{x:ot,y:Q}};class it{static compare(w,C){let R=it.comparePoints(w.point,C.point);return R!==0?R:(w.point!==C.point&&w.link(C),w.isLeft!==C.isLeft?w.isLeft?1:-1:Bt.compare(w.segment,C.segment))}static comparePoints(w,C){return w.x<C.x?-1:w.x>C.x?1:w.y<C.y?-1:w.y>C.y?1:0}constructor(w,C){w.events===void 0?w.events=[this]:w.events.push(this),this.point=w,this.isLeft=C}link(w){if(w.point===this.point)throw new Error("Tried to link already linked events");let C=w.point.events;for(let R=0,H=C.length;R<H;R++){let z=C[R];this.point.events.push(z),z.point=this.point}this.checkForConsuming()}checkForConsuming(){let w=this.point.events.length;for(let C=0;C<w;C++){let R=this.point.events[C];if(R.segment.consumedBy===void 0)for(let H=C+1;H<w;H++){let z=this.point.events[H];z.consumedBy===void 0&&R.otherSE.point.events===z.otherSE.point.events&&R.segment.consume(z.segment)}}}getAvailableLinkedEvents(){let w=[];for(let C=0,R=this.point.events.length;C<R;C++){let H=this.point.events[C];H!==this&&!H.segment.ringOut&&H.segment.isInResult()&&w.push(H)}return w}getLeftmostComparator(w){let C=new Map,R=H=>{let z=H.otherSE;C.set(H,{sine:Xt(this.point,w.point,z.point),cosine:Ft(this.point,w.point,z.point)})};return(H,z)=>{C.has(H)||R(H),C.has(z)||R(z);let{sine:rt,cosine:j}=C.get(H),{sine:D,cosine:tt}=C.get(z);return rt>=0&&D>=0?j<tt?1:j>tt?-1:0:rt<0&&D<0?j<tt?-1:j>tt?1:0:D<rt?-1:D>rt?1:0}}}let rn=0;class Bt{static compare(w,C){let R=w.leftSE.point.x,H=C.leftSE.point.x,z=w.rightSE.point.x,rt=C.rightSE.point.x;if(rt<R)return 1;if(z<H)return-1;let j=w.leftSE.point.y,D=C.leftSE.point.y,tt=w.rightSE.point.y,Z=C.rightSE.point.y;if(R<H){if(D<j&&D<tt)return 1;if(D>j&&D>tt)return-1;let et=w.comparePoint(C.leftSE.point);if(et<0)return 1;if(et>0)return-1;let ot=C.comparePoint(w.rightSE.point);return ot!==0?ot:-1}if(R>H){if(j<D&&j<Z)return-1;if(j>D&&j>Z)return 1;let et=C.comparePoint(w.leftSE.point);if(et!==0)return et;let ot=w.comparePoint(C.rightSE.point);return ot<0?1:ot>0?-1:1}if(j<D)return-1;if(j>D)return 1;if(z<rt){let et=C.comparePoint(w.rightSE.point);if(et!==0)return et}if(z>rt){let et=w.comparePoint(C.rightSE.point);if(et<0)return 1;if(et>0)return-1}if(z!==rt){let et=tt-j,ot=z-R,Q=Z-D,St=rt-H;if(et>ot&&Q<St)return 1;if(et<ot&&Q>St)return-1}return z>rt?1:z<rt||tt<Z?-1:tt>Z?1:w.id<C.id?-1:w.id>C.id?1:0}constructor(w,C,R,H){this.id=++rn,this.leftSE=w,w.segment=this,w.otherSE=C,this.rightSE=C,C.segment=this,C.otherSE=w,this.rings=R,this.windings=H}static fromRing(w,C,R){let H,z,rt,j=it.comparePoints(w,C);if(j<0)H=w,z=C,rt=1;else if(j>0)H=C,z=w,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${w.x}, \${w.y}]\`);let D=new it(H,!0),tt=new it(z,!1);return new Bt(D,tt,[R],[rt])}replaceRightSE(w){this.rightSE=w,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let w=this.leftSE.point.y,C=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:w<C?w:C},ur:{x:this.rightSE.point.x,y:w>C?w:C}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(w){return w.x===this.leftSE.point.x&&w.y===this.leftSE.point.y||w.x===this.rightSE.point.x&&w.y===this.rightSE.point.y}comparePoint(w){if(this.isAnEndpoint(w))return 0;let C=this.leftSE.point,R=this.rightSE.point,H=this.vector();if(C.x===R.x)return w.x===C.x?0:w.x<C.x?1:-1;let z=(w.y-C.y)/H.y,rt=C.x+z*H.x;if(w.x===rt)return 0;let j=(w.x-C.x)/H.x,D=C.y+j*H.y;return w.y===D?0:w.y<D?-1:1}getIntersection(w){let C=this.bbox(),R=w.bbox(),H=x(C,R);if(H===null)return null;let z=this.leftSE.point,rt=this.rightSE.point,j=w.leftSE.point,D=w.rightSE.point,tt=T(C,j)&&this.comparePoint(j)===0,Z=T(R,z)&&w.comparePoint(z)===0,et=T(C,D)&&this.comparePoint(D)===0,ot=T(R,rt)&&w.comparePoint(rt)===0;if(Z&&tt)return ot&&!et?rt:!ot&&et?D:null;if(Z)return et&&z.x===D.x&&z.y===D.y?null:z;if(tt)return ot&&rt.x===j.x&&rt.y===j.y?null:j;if(ot&&et)return null;if(ot)return rt;if(et)return D;let Q=ee(z,this.vector(),j,w.vector());return Q===null||!T(H,Q)?null:G.round(Q.x,Q.y)}split(w){let C=[],R=w.events!==void 0,H=new it(w,!0),z=new it(w,!1),rt=this.rightSE;this.replaceRightSE(z),C.push(z),C.push(H);let j=new Bt(H,rt,this.rings.slice(),this.windings.slice());return it.comparePoints(j.leftSE.point,j.rightSE.point)>0&&j.swapEvents(),it.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),R&&(H.checkForConsuming(),z.checkForConsuming()),C}swapEvents(){let w=this.rightSE;this.rightSE=this.leftSE,this.leftSE=w,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let C=0,R=this.windings.length;C<R;C++)this.windings[C]*=-1}consume(w){let C=this,R=w;for(;C.consumedBy;)C=C.consumedBy;for(;R.consumedBy;)R=R.consumedBy;let H=Bt.compare(C,R);if(H!==0){if(H>0){let z=C;C=R,R=z}if(C.prev===R){let z=C;C=R,R=z}for(let z=0,rt=R.rings.length;z<rt;z++){let j=R.rings[z],D=R.windings[z],tt=C.rings.indexOf(j);tt===-1?(C.rings.push(j),C.windings.push(D)):C.windings[tt]+=D}R.rings=null,R.windings=null,R.consumedBy=C,R.leftSE.consumedBy=C.leftSE,R.rightSE.consumedBy=C.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{let w=this.prev.consumedBy||this.prev;this._beforeState=w.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let w=this.beforeState();this._afterState={rings:w.rings.slice(0),windings:w.windings.slice(0),multiPolys:[]};let C=this._afterState.rings,R=this._afterState.windings,H=this._afterState.multiPolys;for(let j=0,D=this.rings.length;j<D;j++){let tt=this.rings[j],Z=this.windings[j],et=C.indexOf(tt);et===-1?(C.push(tt),R.push(Z)):R[et]+=Z}let z=[],rt=[];for(let j=0,D=C.length;j<D;j++){if(R[j]===0)continue;let tt=C[j],Z=tt.poly;if(rt.indexOf(Z)===-1)if(tt.isExterior)z.push(Z);else{rt.indexOf(Z)===-1&&rt.push(Z);let et=z.indexOf(tt.poly);et!==-1&&z.splice(et,1)}}for(let j=0,D=z.length;j<D;j++){let tt=z[j].multiPoly;H.indexOf(tt)===-1&&H.push(tt)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let w=this.beforeState().multiPolys,C=this.afterState().multiPolys;switch(J.type){case"union":{let R=w.length===0,H=C.length===0;this._isInResult=R!==H;break}case"intersection":{let R,H;w.length<C.length?(R=w.length,H=C.length):(R=C.length,H=w.length),this._isInResult=H===J.numMultiPolys&&R<H;break}case"xor":{let R=Math.abs(w.length-C.length);this._isInResult=R%2===1;break}case"difference":{let R=H=>H.length===1&&H[0].isSubject;this._isInResult=R(w)!==R(C);break}default:throw new Error(\`Unrecognized operation type found \${J.type}\`)}return this._isInResult}}class Jt{constructor(w,C,R){if(!Array.isArray(w)||w.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=C,this.isExterior=R,this.segments=[],typeof w[0][0]!="number"||typeof w[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let H=G.round(w[0][0],w[0][1]);this.bbox={ll:{x:H.x,y:H.y},ur:{x:H.x,y:H.y}};let z=H;for(let rt=1,j=w.length;rt<j;rt++){if(typeof w[rt][0]!="number"||typeof w[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let D=G.round(w[rt][0],w[rt][1]);D.x===z.x&&D.y===z.y||(this.segments.push(Bt.fromRing(z,D,this)),D.x<this.bbox.ll.x&&(this.bbox.ll.x=D.x),D.y<this.bbox.ll.y&&(this.bbox.ll.y=D.y),D.x>this.bbox.ur.x&&(this.bbox.ur.x=D.x),D.y>this.bbox.ur.y&&(this.bbox.ur.y=D.y),z=D)}(H.x!==z.x||H.y!==z.y)&&this.segments.push(Bt.fromRing(z,H,this))}getSweepEvents(){let w=[];for(let C=0,R=this.segments.length;C<R;C++){let H=this.segments[C];w.push(H.leftSE),w.push(H.rightSE)}return w}}class Yt{constructor(w,C){if(!Array.isArray(w))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Jt(w[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 R=1,H=w.length;R<H;R++){let z=new Jt(w[R],this,!1);z.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=z.bbox.ll.x),z.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=z.bbox.ll.y),z.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=z.bbox.ur.x),z.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=z.bbox.ur.y),this.interiorRings.push(z)}this.multiPoly=C}getSweepEvents(){let w=this.exteriorRing.getSweepEvents();for(let C=0,R=this.interiorRings.length;C<R;C++){let H=this.interiorRings[C].getSweepEvents();for(let z=0,rt=H.length;z<rt;z++)w.push(H[z])}return w}}class pe{constructor(w,C){if(!Array.isArray(w))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof w[0][0][0]=="number"&&(w=[w])}catch(R){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let R=0,H=w.length;R<H;R++){let z=new Yt(w[R],this);z.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=z.bbox.ll.x),z.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=z.bbox.ll.y),z.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=z.bbox.ur.x),z.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=z.bbox.ur.y),this.polys.push(z)}this.isSubject=C}getSweepEvents(){let w=[];for(let C=0,R=this.polys.length;C<R;C++){let H=this.polys[C].getSweepEvents();for(let z=0,rt=H.length;z<rt;z++)w.push(H[z])}return w}}class le{static factory(w){let C=[];for(let R=0,H=w.length;R<H;R++){let z=w[R];if(!z.isInResult()||z.ringOut)continue;let rt=null,j=z.leftSE,D=z.rightSE,tt=[j],Z=j.point,et=[];for(;rt=j,j=D,tt.push(j),j.point!==Z;)for(;;){let ot=j.getAvailableLinkedEvents();if(ot.length===0){let At=tt[0].point,ne=tt[tt.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${At.x}, \${At.y}]. Last matching segment found ends at [\${ne.x}, \${ne.y}].\`)}if(ot.length===1){D=ot[0].otherSE;break}let Q=null;for(let At=0,ne=et.length;At<ne;At++)if(et[At].point===j.point){Q=At;break}if(Q!==null){let At=et.splice(Q)[0],ne=tt.splice(At.index);ne.unshift(ne[0].otherSE),C.push(new le(ne.reverse()));continue}et.push({index:tt.length,point:j.point});let St=j.getLeftmostComparator(rt);D=ot.sort(St)[0].otherSE;break}C.push(new le(tt))}return C}constructor(w){this.events=w;for(let C=0,R=w.length;C<R;C++)w[C].segment.ringOut=this;this.poly=null}getGeom(){let w=this.events[0].point,C=[w];for(let tt=1,Z=this.events.length-1;tt<Z;tt++){let et=this.events[tt].point,ot=this.events[tt+1].point;Lt(et,w,ot)!==0&&(C.push(et),w=et)}if(C.length===1)return null;let R=C[0],H=C[1];Lt(R,w,H)===0&&C.shift(),C.push(C[0]);let z=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:C.length-1,j=this.isExteriorRing()?C.length:-1,D=[];for(let tt=rt;tt!=j;tt+=z)D.push([C[tt].x,C[tt].y]);return D}isExteriorRing(){if(this._isExteriorRing===void 0){let w=this.enclosingRing();this._isExteriorRing=w?!w.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let w=this.events[0];for(let H=1,z=this.events.length;H<z;H++){let rt=this.events[H];it.compare(w,rt)>0&&(w=rt)}let C=w.segment.prevInResult(),R=C?C.prevInResult():null;for(;;){if(!C)return null;if(!R)return C.ringOut;if(R.ringOut!==C.ringOut)return R.ringOut.enclosingRing()!==C.ringOut?C.ringOut:C.ringOut.enclosingRing();C=R.prevInResult(),R=C?C.prevInResult():null}}}class Pt{constructor(w){this.exteriorRing=w,w.poly=this,this.interiorRings=[]}addInterior(w){this.interiorRings.push(w),w.poly=this}getGeom(){let w=[this.exteriorRing.getGeom()];if(w[0]===null)return null;for(let C=0,R=this.interiorRings.length;C<R;C++){let H=this.interiorRings[C].getGeom();H!==null&&w.push(H)}return w}}class te{constructor(w){this.rings=w,this.polys=this._composePolys(w)}getGeom(){let w=[];for(let C=0,R=this.polys.length;C<R;C++){let H=this.polys[C].getGeom();H!==null&&w.push(H)}return w}_composePolys(w){let C=[];for(let R=0,H=w.length;R<H;R++){let z=w[R];if(!z.poly)if(z.isExteriorRing())C.push(new Pt(z));else{let rt=z.enclosingRing();rt.poly||C.push(new Pt(rt)),rt.poly.addInterior(z)}}return C}}class yn{constructor(w){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bt.compare;this.queue=w,this.tree=new p(C),this.segments=[]}process(w){let C=w.segment,R=[];if(w.consumedBy)return w.isLeft?this.queue.remove(w.otherSE):this.tree.remove(C),R;let H=w.isLeft?this.tree.add(C):this.tree.find(C);if(!H)throw new Error(\`Unable to find segment #\${C.id} [\${C.leftSE.point.x}, \${C.leftSE.point.y}] -> [\${C.rightSE.point.x}, \${C.rightSE.point.y}] in SweepLine tree.\`);let z=H,rt=H,j,D;for(;j===void 0;)z=this.tree.prev(z),z===null?j=null:z.key.consumedBy===void 0&&(j=z.key);for(;D===void 0;)rt=this.tree.next(rt),rt===null?D=null:rt.key.consumedBy===void 0&&(D=rt.key);if(w.isLeft){let tt=null;if(j){let et=j.getIntersection(C);if(et!==null&&(C.isAnEndpoint(et)||(tt=et),!j.isAnEndpoint(et))){let ot=this._splitSafely(j,et);for(let Q=0,St=ot.length;Q<St;Q++)R.push(ot[Q])}}let Z=null;if(D){let et=D.getIntersection(C);if(et!==null&&(C.isAnEndpoint(et)||(Z=et),!D.isAnEndpoint(et))){let ot=this._splitSafely(D,et);for(let Q=0,St=ot.length;Q<St;Q++)R.push(ot[Q])}}if(tt!==null||Z!==null){let et=null;tt===null?et=Z:Z===null?et=tt:et=it.comparePoints(tt,Z)<=0?tt:Z,this.queue.remove(C.rightSE),R.push(C.rightSE);let ot=C.split(et);for(let Q=0,St=ot.length;Q<St;Q++)R.push(ot[Q])}R.length>0?(this.tree.remove(C),R.push(w)):(this.segments.push(C),C.prev=j)}else{if(j&&D){let tt=j.getIntersection(D);if(tt!==null){if(!j.isAnEndpoint(tt)){let Z=this._splitSafely(j,tt);for(let et=0,ot=Z.length;et<ot;et++)R.push(Z[et])}if(!D.isAnEndpoint(tt)){let Z=this._splitSafely(D,tt);for(let et=0,ot=Z.length;et<ot;et++)R.push(Z[et])}}}this.tree.remove(C)}return R}_splitSafely(w,C){this.tree.remove(w);let R=w.rightSE;this.queue.remove(R);let H=w.split(C);return H.push(R),w.consumedBy===void 0&&this.tree.add(w),H}}let pn=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,X=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class F{run(w,C,R){J.type=w,G.reset();let H=[new pe(C,!0)];for(let et=0,ot=R.length;et<ot;et++)H.push(new pe(R[et],!1));if(J.numMultiPolys=H.length,J.type==="difference"){let et=H[0],ot=1;for(;ot<H.length;)x(H[ot].bbox,et.bbox)!==null?ot++:H.splice(ot,1)}if(J.type==="intersection")for(let et=0,ot=H.length;et<ot;et++){let Q=H[et];for(let St=et+1,At=H.length;St<At;St++)if(x(Q.bbox,H[St].bbox)===null)return[]}let z=new p(it.compare);for(let et=0,ot=H.length;et<ot;et++){let Q=H[et].getSweepEvents();for(let St=0,At=Q.length;St<At;St++)if(z.insert(Q[St]),z.size>pn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new yn(z),j=z.size,D=z.pop();for(;D;){let et=D.key;if(z.size===j){let Q=et.segment;throw new Error(\`Unable to pop() \${et.isLeft?"left":"right"} SweepEvent [\${et.point.x}, \${et.point.y}] from segment #\${Q.id} [\${Q.leftSE.point.x}, \${Q.leftSE.point.y}] -> [\${Q.rightSE.point.x}, \${Q.rightSE.point.y}] from queue.\`)}if(z.size>pn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>X)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let ot=rt.process(et);for(let Q=0,St=ot.length;Q<St;Q++){let At=ot[Q];At.consumedBy===void 0&&z.insert(At)}j=z.size,D=z.pop()}G.reset();let tt=le.factory(rt.segments);return new te(tt).getGeom()}}let J=new F;var Dt={union:function(Y){for(var w=arguments.length,C=new Array(w>1?w-1:0),R=1;R<w;R++)C[R-1]=arguments[R];return J.run("union",Y,C)},intersection:function(Y){for(var w=arguments.length,C=new Array(w>1?w-1:0),R=1;R<w;R++)C[R-1]=arguments[R];return J.run("intersection",Y,C)},xor:function(Y){for(var w=arguments.length,C=new Array(w>1?w-1:0),R=1;R<w;R++)C[R-1]=arguments[R];return J.run("xor",Y,C)},difference:function(Y){for(var w=arguments.length,C=new Array(w>1?w-1:0),R=1;R<w;R++)C[R-1]=arguments[R];return J.run("difference",Y,C)}};return Dt})});var u1=Ht((ah,a1)=>{(function(r,t){typeof ah=="object"&&typeof a1!="undefined"?t(ah):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(ah,function(r){"use strict";function t(){}function e(n){this.message=n||""}function o(n){this.message=n||""}function a(n){this.message=n||""}function l(){}function h(n){return n===null?mn:n.color}function f(n){return n===null?null:n.parent}function p(n,i){n!==null&&(n.color=i)}function d(n){return n===null?null:n.left}function g(n){return n===null?null:n.right}function _(){this.root_=null,this.size_=0}function y(){}function M(){this.array_=[],arguments[0]instanceof j&&this.addAll(arguments[0])}function b(){}function T(n){this.message=n||""}function x(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),s=Math.max(Math.min(i.length,9007199254740991),0)||0,u=1 in arguments&&parseInt(Number(arguments[1]),10)||0;u=u<0?Math.max(s+u,0):Math.min(u,s);var c=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:s;for(c=c<0?Math.max(s+arguments[2],0):Math.min(c,s);u<c;)i[u]=n,++u;return i},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!=n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var v=function(){};v.prototype.interfaces_=function(){return[]},v.prototype.getClass=function(){return v},v.prototype.equalsWithTolerance=function(n,i,s){return Math.abs(n-i)<=s};var P=function(n){function i(s){n.call(this,s),this.name="IllegalArgumentException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),S=function(){},L={MAX_VALUE:{configurable:!0}};S.isNaN=function(n){return Number.isNaN(n)},S.doubleToLongBits=function(n){return n},S.longBitsToDouble=function(n){return n},S.isInfinite=function(n){return!Number.isFinite(n)},L.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(S,L);var N=function(){},G=function(){},B=function(){},I=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},O={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};I.prototype.setOrdinate=function(n,i){switch(n){case I.X:this.x=i;break;case I.Y:this.y=i;break;case I.Z:this.z=i;break;default:throw new P("Invalid ordinate index: "+n)}},I.prototype.equals2D=function(){if(arguments.length===1){var n=arguments[0];return this.x===n.x&&this.y===n.y}if(arguments.length===2){var i=arguments[0],s=arguments[1];return!!v.equalsWithTolerance(this.x,i.x,s)&&!!v.equalsWithTolerance(this.y,i.y,s)}},I.prototype.getOrdinate=function(n){switch(n){case I.X:return this.x;case I.Y:return this.y;case I.Z:return this.z}throw new P("Invalid ordinate index: "+n)},I.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||S.isNaN(this.z))&&S.isNaN(n.z)},I.prototype.equals=function(n){return n instanceof I&&this.equals2D(n)},I.prototype.equalInZ=function(n,i){return v.equalsWithTolerance(this.z,n.z,i)},I.prototype.compareTo=function(n){var i=n;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.prototype.distance3D=function(n){var i=this.x-n.x,s=this.y-n.y,u=this.z-n.z;return Math.sqrt(i*i+s*s+u*u)},I.prototype.distance=function(n){var i=this.x-n.x,s=this.y-n.y;return Math.sqrt(i*i+s*s)},I.prototype.hashCode=function(){var n=17;return n=37*n+I.hashCode(this.x),n=37*n+I.hashCode(this.y)},I.prototype.setCoordinate=function(n){this.x=n.x,this.y=n.y,this.z=n.z},I.prototype.interfaces_=function(){return[N,G,t]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(arguments.length===1){var n=arguments[0],i=S.doubleToLongBits(n);return Math.trunc((i^i)>>>32)}},O.DimensionalComparator.get=function(){return q},O.serialVersionUID.get=function(){return 6683108902428367e3},O.NULL_ORDINATE.get=function(){return S.NaN},O.X.get=function(){return 0},O.Y.get=function(){return 1},O.Z.get=function(){return 2},Object.defineProperties(I,O);var q=function(n){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new P("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};q.prototype.compare=function(n,i){var s=n,u=i,c=q.compare(s.x,u.x);if(c!==0)return c;var m=q.compare(s.y,u.y);return m!==0?m:this._dimensionsToTest<=2?0:q.compare(s.z,u.z)},q.prototype.interfaces_=function(){return[B]},q.prototype.getClass=function(){return q},q.compare=function(n,i){return n<i?-1:n>i?1:S.isNaN(n)?S.isNaN(i)?0:-1:S.isNaN(i)?1:0};var st=function(){};st.prototype.create=function(){},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(n){switch(n){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new P("Unknown location value: "+n)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var $=function(n,i){return n.interfaces_&&n.interfaces_().indexOf(i)>-1},ut=function(){},xt={LOG_10:{configurable:!0}};ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut},ut.log10=function(n){var i=Math.log(n);return S.isInfinite(i)||S.isNaN(i)?i:i/ut.LOG_10},ut.min=function(n,i,s,u){var c=n;return i<c&&(c=i),s<c&&(c=s),u<c&&(c=u),c},ut.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1],s=arguments[2];return n<i?i:n>s?s:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],c=arguments[1],m=arguments[2];return u<c?c:u>m?m:u}},ut.wrap=function(n,i){return n<0?i- -n%i:n%i},ut.max=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2],u=n;return i>u&&(u=i),s>u&&(u=s),u}if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3],U=c;return m>U&&(U=m),E>U&&(U=E),A>U&&(U=A),U}},ut.average=function(n,i){return(n+i)/2},xt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(ut,xt);var mt=function(n){this.str=n};mt.prototype.append=function(n){this.str+=n},mt.prototype.setCharAt=function(n,i){this.str=this.str.substr(0,n)+i+this.str.substr(n+1)},mt.prototype.toString=function(n){return this.str};var lt=function(n){this.value=n};lt.prototype.intValue=function(){return this.value},lt.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0},lt.isNaN=function(n){return Number.isNaN(n)};var ht=function(){};ht.isWhitespace=function(n){return n<=32&&n>=0||n===127},ht.toUpperCase=function(n){return n.toUpperCase()};var k=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}else if(typeof arguments[0]=="string"){var u=arguments[0];n.call(this,n.parse(u))}}else if(arguments.length===2){var c=arguments[0],m=arguments[1];this.init(c,m)}},nt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};k.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo},k.prototype.extractSignificantDigits=function(n,i){var s=this.abs(),u=k.magnitude(s._hi),c=k.TEN.pow(u);(s=s.divide(c)).gt(k.TEN)?(s=s.divide(k.TEN),u+=1):s.lt(k.ONE)&&(s=s.multiply(k.TEN),u-=1);for(var m=u+1,E=new mt,A=k.MAX_PRINT_DIGITS-1,U=0;U<=A;U++){n&&U===m&&E.append(".");var K=Math.trunc(s._hi);if(K<0)break;var pt=!1,dt=0;K>9?(pt=!0,dt="9"):dt="0"+K,E.append(dt),s=s.subtract(k.valueOf(K)).multiply(k.TEN),pt&&s.selfAdd(k.TEN);var Rt=!0,Ot=k.magnitude(s._hi);if(Ot<0&&Math.abs(Ot)>=A-U&&(Rt=!1),!Rt)break}return i[0]=u,E.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var n=arguments[0];return this.add(n.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},k.prototype.equals=function(){if(arguments.length===1){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}},k.prototype.isZero=function(){return this._hi===0&&this._lo===0},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(n){return this.le(n)?this:n},k.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof k){var n=arguments[0];return this.selfDivide(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1],c=null,m=null,E=null,A=null,U=null,K=null,pt=null,dt=null;return U=this._hi/s,K=k.SPLIT*U,c=K-U,dt=k.SPLIT*s,c=K-c,m=U-c,E=dt-s,pt=U*s,E=dt-E,A=s-E,dt=c*E-pt+c*A+m*E+m*A,K=(this._hi-pt-dt+this._lo-U*u)/s,dt=U+K,this._hi=dt,this._lo=U-dt+K,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var n=arguments[0],i=null,s=null,u=null,c=null,m=null,E=null,A=null,U=null;return s=(m=this._hi/n._hi)-(i=(E=k.SPLIT*m)-(i=E-m)),U=i*(u=(U=k.SPLIT*n._hi)-(u=U-n._hi))-(A=m*n._hi)+i*(c=n._hi-u)+s*u+s*c,E=(this._hi-A-U+this._lo-m*n._lo)/n._hi,new k(U=m+E,m-U+E)}if(typeof arguments[0]=="number"){var K=arguments[0];return S.isNaN(K)?k.createNaN():k.copy(this).selfDivide(K,0)}},k.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo},k.prototype.pow=function(n){if(n===0)return k.valueOf(1);var i=new k(this),s=k.valueOf(1),u=Math.abs(n);if(u>1)for(;u>0;)u%2==1&&s.selfMultiply(i),(u/=2)>0&&(i=i.sqr());else s=i;return n<0?s.reciprocal():s},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var n=Math.ceil(this._hi),i=0;return n===this._hi&&(i=Math.ceil(this._lo)),new k(n,i)},k.prototype.compareTo=function(n){var i=n;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var n=arguments[0];return this.init(n),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},k.prototype.max=function(n){return this.ge(n)?this:n},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,s=k.valueOf(i),u=this.subtract(s.sqr())._hi*(.5*n);return s.add(u)},k.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof k){var n=arguments[0];return this.selfAdd(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],s=null,u=null,c=null,m=null,E=null,A=null;return c=this._hi+i,E=c-this._hi,m=c-E,m=i-E+(this._hi-m),A=m+this._lo,s=c+A,u=A+(c-s),this._hi=s+u,this._lo=u+(s-this._hi),this}}else if(arguments.length===2){var U=arguments[0],K=arguments[1],pt=null,dt=null,Rt=null,Ot=null,Vt=null,jt=null,sn=null;Ot=this._hi+U,dt=this._lo+K,Vt=Ot-(jt=Ot-this._hi),Rt=dt-(sn=dt-this._lo);var kn=(pt=Ot+(jt=(Vt=U-jt+(this._hi-Vt))+dt))+(jt=(Rt=K-sn+(this._lo-Rt))+(jt+(Ot-pt))),Mr=jt+(pt-kn);return this._hi=kn,this._lo=Mr,this}},k.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof k){var n=arguments[0];return this.selfMultiply(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1],c=null,m=null,E=null,A=null,U=null,K=null;c=(U=k.SPLIT*this._hi)-this._hi,K=k.SPLIT*s,c=U-c,m=this._hi-c,E=K-s;var pt=(U=this._hi*s)+(K=c*(E=K-E)-U+c*(A=s-E)+m*E+m*A+(this._hi*u+this._lo*s)),dt=K+(c=U-pt);return this._hi=pt,this._lo=dt,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var n=Math.floor(this._hi),i=0;return n===this._hi&&(i=Math.floor(this._lo)),new k(n,i)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var n=arguments[0];return n.isNaN()?k.createNaN():k.copy(this).selfMultiply(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return S.isNaN(i)?k.createNaN():k.copy(this).selfMultiply(i,0)}},k.prototype.isNaN=function(){return S.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var n=k.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!0,i),u=i[0]+1,c=s;if(s.charAt(0)===".")c="0"+s;else if(u<0)c="0."+k.stringOfChar("0",-u)+s;else if(s.indexOf(".")===-1){var m=u-s.length;c=s+k.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+c:c},k.prototype.reciprocal=function(){var n=null,i=null,s=null,u=null,c=null,m=null,E=null,A=null;i=(c=1/this._hi)-(n=(m=k.SPLIT*c)-(n=m-c)),s=(A=k.SPLIT*this._hi)-this._hi;var U=c+(m=(1-(E=c*this._hi)-(A=n*(s=A-s)-E+n*(u=this._hi-s)+i*s+i*u)-c*this._lo)/this._hi);return new k(U,c-U+m)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!1,i),u=k.SCI_NOT_EXPONENT_CHAR+i[0];if(s.charAt(0)==="0")throw new Error("Found leading zero: "+s);var c="";s.length>1&&(c=s.substring(1));var m=s.charAt(0)+"."+c;return this.isNegative()?"-"+m+u:m+u},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},k.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var n=arguments[0];return k.copy(this).selfAdd(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return k.copy(this).selfAdd(i)}},k.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var n=arguments[0];this._hi=n,this._lo=0}else if(arguments[0]instanceof k){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this._hi=s,this._lo=u}},k.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo},k.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[t,N,G]},k.prototype.getClass=function(){return k},k.sqr=function(n){return k.valueOf(n).selfMultiply(n)},k.valueOf=function(){if(typeof arguments[0]=="string"){var n=arguments[0];return k.parse(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return new k(i)}},k.sqrt=function(n){return k.valueOf(n).sqrt()},k.parse=function(n){for(var i=0,s=n.length;ht.isWhitespace(n.charAt(i));)i++;var u=!1;if(i<s){var c=n.charAt(i);c!=="-"&&c!=="+"||(i++,c==="-"&&(u=!0))}for(var m=new k,E=0,A=0,U=0;!(i>=s);){var K=n.charAt(i);if(i++,ht.isDigit(K)){var pt=K-"0";m.selfMultiply(k.TEN),m.selfAdd(pt),E++}else{if(K!=="."){if(K==="e"||K==="E"){var dt=n.substring(i);try{U=lt.parseInt(dt)}catch(sn){throw sn instanceof Error?new Error("Invalid exponent "+dt+" in string "+n):sn}break}throw new Error("Unexpected character '"+K+"' at position "+i+" in string "+n)}A=E}}var Rt=m,Ot=E-A-U;if(Ot===0)Rt=m;else if(Ot>0){var Vt=k.TEN.pow(Ot);Rt=m.divide(Vt)}else if(Ot<0){var jt=k.TEN.pow(-Ot);Rt=m.multiply(jt)}return u?Rt.negate():Rt},k.createNaN=function(){return new k(S.NaN,S.NaN)},k.copy=function(n){return new k(n)},k.magnitude=function(n){var i=Math.abs(n),s=Math.log(i)/Math.log(10),u=Math.trunc(Math.floor(s));return 10*Math.pow(10,u)<=i&&(u+=1),u},k.stringOfChar=function(n,i){for(var s=new mt,u=0;u<i;u++)s.append(n);return s.toString()},nt.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},nt.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},nt.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},nt.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},nt.NaN.get=function(){return new k(S.NaN,S.NaN)},nt.EPS.get=function(){return 123259516440783e-46},nt.SPLIT.get=function(){return 134217729},nt.MAX_PRINT_DIGITS.get=function(){return 32},nt.TEN.get=function(){return k.valueOf(10)},nt.ONE.get=function(){return k.valueOf(1)},nt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},nt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,nt);var ft=function(){},Tt={DP_SAFE_EPSILON:{configurable:!0}};ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.orientationIndex=function(n,i,s){var u=ft.orientationIndexFilter(n,i,s);if(u<=1)return u;var c=k.valueOf(i.x).selfAdd(-n.x),m=k.valueOf(i.y).selfAdd(-n.y),E=k.valueOf(s.x).selfAdd(-i.x),A=k.valueOf(s.y).selfAdd(-i.y);return c.selfMultiply(A).selfSubtract(m.selfMultiply(E)).signum()},ft.signOfDet2x2=function(n,i,s,u){return n.multiply(u).selfSubtract(i.multiply(s)).signum()},ft.intersection=function(n,i,s,u){var c=k.valueOf(u.y).selfSubtract(s.y).selfMultiply(k.valueOf(i.x).selfSubtract(n.x)),m=k.valueOf(u.x).selfSubtract(s.x).selfMultiply(k.valueOf(i.y).selfSubtract(n.y)),E=c.subtract(m),A=k.valueOf(u.x).selfSubtract(s.x).selfMultiply(k.valueOf(n.y).selfSubtract(s.y)),U=k.valueOf(u.y).selfSubtract(s.y).selfMultiply(k.valueOf(n.x).selfSubtract(s.x)),K=A.subtract(U).selfDivide(E).doubleValue(),pt=k.valueOf(n.x).selfAdd(k.valueOf(i.x).selfSubtract(n.x).selfMultiply(K)).doubleValue(),dt=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(n.y).selfSubtract(s.y)),Rt=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(n.x).selfSubtract(s.x)),Ot=dt.subtract(Rt).selfDivide(E).doubleValue(),Vt=k.valueOf(s.y).selfAdd(k.valueOf(u.y).selfSubtract(s.y).selfMultiply(Ot)).doubleValue();return new I(pt,Vt)},ft.orientationIndexFilter=function(n,i,s){var u=null,c=(n.x-s.x)*(i.y-s.y),m=(n.y-s.y)*(i.x-s.x),E=c-m;if(c>0){if(m<=0)return ft.signum(E);u=c+m}else{if(!(c<0)||m>=0)return ft.signum(E);u=-c-m}var A=ft.DP_SAFE_EPSILON*u;return E>=A||-E>=A?ft.signum(E):2},ft.signum=function(n){return n>0?1:n<0?-1:0},Tt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(ft,Tt);var gt=function(){},Lt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Lt.X.get=function(){return 0},Lt.Y.get=function(){return 1},Lt.Z.get=function(){return 2},Lt.M.get=function(){return 3},gt.prototype.setOrdinate=function(n,i,s){},gt.prototype.size=function(){},gt.prototype.getOrdinate=function(n,i){},gt.prototype.getCoordinate=function(){},gt.prototype.getCoordinateCopy=function(n){},gt.prototype.getDimension=function(){},gt.prototype.getX=function(n){},gt.prototype.clone=function(){},gt.prototype.expandEnvelope=function(n){},gt.prototype.copy=function(){},gt.prototype.getY=function(n){},gt.prototype.toCoordinateArray=function(){},gt.prototype.interfaces_=function(){return[G]},gt.prototype.getClass=function(){return gt},Object.defineProperties(gt,Lt);var qt=function(){},Xt=function(n){function i(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(qt),Ft=function(){};Ft.arraycopy=function(n,i,s,u,c){for(var m=0,E=i;E<i+c;E++)s[u+m]=n[E],m++},Ft.getProperty=function(n){return{"line.separator":\`
3836
3836
  \`}[n]};var Qt=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],u=arguments[1];this.x=s,this.y=u,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var c=arguments[0],m=arguments[1];this.x=c.y*m.w-m.y*c.w,this.y=m.x*c.w-c.x*m.w,this.w=c.x*m.y-m.x*c.y}else if(arguments[0]instanceof I&&arguments[1]instanceof I){var E=arguments[0],A=arguments[1];this.x=E.y-A.y,this.y=A.x-E.x,this.w=E.x*A.y-A.x*E.y}}else if(arguments.length===3){var U=arguments[0],K=arguments[1],pt=arguments[2];this.x=U,this.y=K,this.w=pt}else if(arguments.length===4){var dt=arguments[0],Rt=arguments[1],Ot=arguments[2],Vt=arguments[3],jt=dt.y-Rt.y,sn=Rt.x-dt.x,kn=dt.x*Rt.y-Rt.x*dt.y,Mr=Ot.y-Vt.y,Ki=Vt.x-Ot.x,Uo=Ot.x*Vt.y-Vt.x*Ot.y;this.x=sn*Uo-Ki*kn,this.y=Mr*kn-jt*Uo,this.w=jt*Ki-Mr*sn}};Qt.prototype.getY=function(){var n=this.y/this.w;if(S.isNaN(n)||S.isInfinite(n))throw new Xt;return n},Qt.prototype.getX=function(){var n=this.x/this.w;if(S.isNaN(n)||S.isInfinite(n))throw new Xt;return n},Qt.prototype.getCoordinate=function(){var n=new I;return n.x=this.getX(),n.y=this.getY(),n},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.intersection=function(n,i,s,u){var c=n.y-i.y,m=i.x-n.x,E=n.x*i.y-i.x*n.y,A=s.y-u.y,U=u.x-s.x,K=s.x*u.y-u.x*s.y,pt=c*U-A*m,dt=(m*K-U*E)/pt,Rt=(A*E-c*K)/pt;if(S.isNaN(dt)||S.isInfinite(dt)||S.isNaN(Rt)||S.isInfinite(Rt))throw new Xt;return new I(dt,Rt)};var Ct=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof I){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];this.init(u.x,c.x,u.y,c.y)}else if(arguments.length===4){var m=arguments[0],E=arguments[1],A=arguments[2],U=arguments[3];this.init(m,E,A,U)}},ee={serialVersionUID:{configurable:!0}};Ct.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Ct.prototype.equals=function(n){if(!(n instanceof Ct))return!1;var i=n;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},Ct.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new Ct;var i=this._minx>n._minx?this._minx:n._minx,s=this._miny>n._miny?this._miny:n._miny,u=this._maxx<n._maxx?this._maxx:n._maxx,c=this._maxy<n._maxy?this._maxy:n._maxy;return new Ct(i,u,s,c)},Ct.prototype.isNull=function(){return this._maxx<this._minx},Ct.prototype.getMaxX=function(){return this._maxx},Ct.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof I){var n=arguments[0];return this.covers(n.x,n.y)}if(arguments[0]instanceof Ct){var i=arguments[0];return!this.isNull()&&!i.isNull()&&i.getMinX()>=this._minx&&i.getMaxX()<=this._maxx&&i.getMinY()>=this._miny&&i.getMaxY()<=this._maxy}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return!this.isNull()&&s>=this._minx&&s<=this._maxx&&u>=this._miny&&u<=this._maxy}},Ct.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Ct){var n=arguments[0];return!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny)}if(arguments[0]instanceof I){var i=arguments[0];return this.intersects(i.x,i.y)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return!this.isNull()&&!(s>this._maxx||s<this._minx||u>this._maxy||u<this._miny)}},Ct.prototype.getMinY=function(){return this._miny},Ct.prototype.getMinX=function(){return this._minx},Ct.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof I){var n=arguments[0];this.expandToInclude(n.x,n.y)}else if(arguments[0]instanceof Ct){var i=arguments[0];if(i.isNull())return null;this.isNull()?(this._minx=i.getMinX(),this._maxx=i.getMaxX(),this._miny=i.getMinY(),this._maxy=i.getMaxY()):(i._minx<this._minx&&(this._minx=i._minx),i._maxx>this._maxx&&(this._maxx=i._maxx),i._miny<this._miny&&(this._miny=i._miny),i._maxy>this._maxy&&(this._maxy=i._maxy))}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.isNull()?(this._minx=s,this._maxx=s,this._miny=u,this._maxy=u):(s<this._minx&&(this._minx=s),s>this._maxx&&(this._maxx=s),u<this._miny&&(this._miny=u),u>this._maxy&&(this._maxy=u))}},Ct.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n<i?n:i},Ct.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Ct.prototype.compareTo=function(n){var i=n;return this.isNull()?i.isNull()?0:-1:i.isNull()?1:this._minx<i._minx?-1:this._minx>i._minx?1:this._miny<i._miny?-1:this._miny>i._miny?1:this._maxx<i._maxx?-1:this._maxx>i._maxx?1:this._maxy<i._maxy?-1:this._maxy>i._maxy?1:0},Ct.prototype.translate=function(n,i){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+i,this.getMaxY()+i)},Ct.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Ct.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Ct.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Ct.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n>i?n:i},Ct.prototype.expandBy=function(){if(arguments.length===1){var n=arguments[0];this.expandBy(n,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=s,this._maxy+=s,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Ct.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Ct){var n=arguments[0];return this.covers(n)}if(arguments[0]instanceof I){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return this.covers(s,u)}},Ct.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Ct.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof I){var n=arguments[0];this.init(n.x,n.x,n.y,n.y)}else if(arguments[0]instanceof Ct){var i=arguments[0];this._minx=i._minx,this._maxx=i._maxx,this._miny=i._miny,this._maxy=i._maxy}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.init(s.x,u.x,s.y,u.y)}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];c<m?(this._minx=c,this._maxx=m):(this._minx=m,this._maxx=c),E<A?(this._miny=E,this._maxy=A):(this._miny=A,this._maxy=E)}},Ct.prototype.getMaxY=function(){return this._maxy},Ct.prototype.distance=function(n){if(this.intersects(n))return 0;var i=0;this._maxx<n._minx?i=n._minx-this._maxx:this._minx>n._maxx&&(i=this._minx-n._maxx);var s=0;return this._maxy<n._miny?s=n._miny-this._maxy:this._miny>n._maxy&&(s=this._miny-n._maxy),i===0?s:s===0?i:Math.sqrt(i*i+s*s)},Ct.prototype.hashCode=function(){var n=17;return n=37*n+I.hashCode(this._minx),n=37*n+I.hashCode(this._maxx),n=37*n+I.hashCode(this._miny),n=37*n+I.hashCode(this._maxy)},Ct.prototype.interfaces_=function(){return[N,t]},Ct.prototype.getClass=function(){return Ct},Ct.intersects=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];return s.x>=(n.x<i.x?n.x:i.x)&&s.x<=(n.x>i.x?n.x:i.x)&&s.y>=(n.y<i.y?n.y:i.y)&&s.y<=(n.y>i.y?n.y:i.y)}if(arguments.length===4){var u=arguments[0],c=arguments[1],m=arguments[2],E=arguments[3],A=Math.min(m.x,E.x),U=Math.max(m.x,E.x),K=Math.min(u.x,c.x),pt=Math.max(u.x,c.x);return!(K>U)&&!(pt<A)&&(A=Math.min(m.y,E.y),U=Math.max(m.y,E.y),K=Math.min(u.y,c.y),pt=Math.max(u.y,c.y),!(K>U)&&!(pt<A))}},ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Ct,ee);var it={typeStr:/^\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*$/,emptyTypeStr:/^\\s*(\\w+)\\s*EMPTY\\s*$/,spaces:/\\s+/,parenComma:/\\)\\s*,\\s*\\(/,doubleParenComma:/\\)\\s*\\)\\s*,\\s*\\(\\s*\\(/,trimParens:/^\\s*\\(?(.*?)\\)?\\s*$/},rn=function(n){this.geometryFactory=n||new ue};rn.prototype.read=function(n){var i,s,u;n=n.replace(/[\\n\\r]/g," ");var c=it.typeStr.exec(n);if(n.search("EMPTY")!==-1&&((c=it.emptyTypeStr.exec(n))[2]=void 0),c&&(s=c[1].toLowerCase(),u=c[2],Jt[s]&&(i=Jt[s].apply(this,[u]))),i===void 0)throw new Error("Could not parse WKT "+n);return i},rn.prototype.write=function(n){return this.extractGeometry(n)},rn.prototype.extractGeometry=function(n){var i=n.getGeometryType().toLowerCase();if(!Bt[i])return null;var s=i.toUpperCase();return n.isEmpty()?s+" EMPTY":s+"("+Bt[i].apply(this,[n])+")"};var Bt={coordinate:function(n){return n.x+" "+n.y},point:function(n){return Bt.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Bt.point.apply(this,[n._geometries[s]])+")");return i.join(",")},linestring:function(n){for(var i=[],s=0,u=n._points._coordinates.length;s<u;++s)i.push(Bt.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},linearring:function(n){for(var i=[],s=0,u=n._points._coordinates.length;s<u;++s)i.push(Bt.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},multilinestring:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Bt.linestring.apply(this,[n._geometries[s]])+")");return i.join(",")},polygon:function(n){var i=[];i.push("("+Bt.linestring.apply(this,[n._shell])+")");for(var s=0,u=n._holes.length;s<u;++s)i.push("("+Bt.linestring.apply(this,[n._holes[s]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Bt.polygon.apply(this,[n._geometries[s]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push(this.extractGeometry(n._geometries[s]));return i.join(",")}},Jt={point:function(n){if(n===void 0)return this.geometryFactory.createPoint();var i=n.trim().split(it.spaces);return this.geometryFactory.createPoint(new I(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(n){if(n===void 0)return this.geometryFactory.createMultiPoint();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(it.trimParens,"$1"),u.push(Jt.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(u)},linestring:function(n){if(n===void 0)return this.geometryFactory.createLineString();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].trim().split(it.spaces),u.push(new I(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(u)},linearring:function(n){if(n===void 0)return this.geometryFactory.createLinearRing();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].trim().split(it.spaces),u.push(new I(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(u)},multilinestring:function(n){if(n===void 0)return this.geometryFactory.createMultiLineString();for(var i,s=n.trim().split(it.parenComma),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(it.trimParens,"$1"),u.push(Jt.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(u)},polygon:function(n){if(n===void 0)return this.geometryFactory.createPolygon();for(var i,s,u,c,m=n.trim().split(it.parenComma),E=[],A=0,U=m.length;A<U;++A)i=m[A].replace(it.trimParens,"$1"),s=Jt.linestring.apply(this,[i]),u=this.geometryFactory.createLinearRing(s._points),A===0?c=u:E.push(u);return this.geometryFactory.createPolygon(c,E)},multipolygon:function(n){if(n===void 0)return this.geometryFactory.createMultiPolygon();for(var i,s=n.trim().split(it.doubleParenComma),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(it.trimParens,"$1"),u.push(Jt.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(u)},geometrycollection:function(n){if(n===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\\s*([A-Za-z])/g,"|$1")).trim().split("|"),s=[],u=0,c=i.length;u<c;++u)s.push(this.read(i[u]));return this.geometryFactory.createGeometryCollection(s)}},Yt=function(n){this.parser=new rn(n)};Yt.prototype.write=function(n){return this.parser.write(n)},Yt.toLineString=function(n,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+i.x+" "+i.y+" )"};var pe=function(n){function i(s){n.call(this,s),this.name="RuntimeException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),le=function(n){function i(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var s=arguments[0];n.call(this,s)}}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pe),Pt=function(){};Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.shouldNeverReachHere=function(){if(arguments.length===0)Pt.shouldNeverReachHere(null);else if(arguments.length===1){var n=arguments[0];throw new le("Should never reach here"+(n!==null?": "+n:""))}},Pt.isTrue=function(){var n,i;if(arguments.length===1)n=arguments[0],Pt.isTrue(n,null);else if(arguments.length===2&&(n=arguments[0],i=arguments[1],!n))throw i===null?new le:new le(i)},Pt.equals=function(){var n,i,s;if(arguments.length===2)n=arguments[0],i=arguments[1],Pt.equals(n,i,null);else if(arguments.length===3&&(n=arguments[0],i=arguments[1],s=arguments[2],!i.equals(n)))throw new le("Expected "+n+" but encountered "+i+(s!==null?": "+s:""))};var te=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 I,this._intPt[1]=new I,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},yn={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};te.prototype.getIndexAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intLineIndex[n][i]},te.prototype.getTopologySummary=function(){var n=new mt;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},te.prototype.computeIntersection=function(n,i,s,u){this._inputLines[0][0]=n,this._inputLines[0][1]=i,this._inputLines[1][0]=s,this._inputLines[1][1]=u,this._result=this.computeIntersect(n,i,s,u)},te.prototype.getIntersectionNum=function(){return this._result},te.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}},te.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},te.prototype.setPrecisionModel=function(n){this._precisionModel=n},te.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var n=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[n][0])&&!this._intPt[i].equals2D(this._inputLines[n][1]))return!0;return!1}},te.prototype.getIntersection=function(n){return this._intPt[n]},te.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},te.prototype.hasIntersection=function(){return this._result!==te.NO_INTERSECTION},te.prototype.getEdgeDistance=function(n,i){return te.computeEdgeDistance(this._intPt[i],this._inputLines[n][0],this._inputLines[n][1])},te.prototype.isCollinear=function(){return this._result===te.COLLINEAR_INTERSECTION},te.prototype.toString=function(){return Yt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Yt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},te.prototype.getEndpoint=function(n,i){return this._inputLines[n][i]},te.prototype.isIntersection=function(n){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(n))return!0;return!1},te.prototype.getIntersectionAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][i]]},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.computeEdgeDistance=function(n,i,s){var u=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y),m=-1;if(n.equals(i))m=0;else if(n.equals(s))m=u>c?u:c;else{var E=Math.abs(n.x-i.x),A=Math.abs(n.y-i.y);(m=u>c?E:A)!==0||n.equals(i)||(m=Math.max(E,A))}return Pt.isTrue(!(m===0&&!n.equals(i)),"Bad distance calculation"),m},te.nonRobustComputeEdgeDistance=function(n,i,s){var u=n.x-i.x,c=n.y-i.y,m=Math.sqrt(u*u+c*c);return Pt.isTrue(!(m===0&&!n.equals(i)),"Invalid distance calculation"),m},yn.DONT_INTERSECT.get=function(){return 0},yn.DO_INTERSECT.get=function(){return 1},yn.COLLINEAR.get=function(){return 2},yn.NO_INTERSECTION.get=function(){return 0},yn.POINT_INTERSECTION.get=function(){return 1},yn.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(te,yn);var pn=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(s){var u=new Ct(this._inputLines[0][0],this._inputLines[0][1]),c=new Ct(this._inputLines[1][0],this._inputLines[1][1]);return u.contains(s)&&c.contains(s)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return n.prototype.computeIntersection.apply(this,arguments);var s=arguments[0],u=arguments[1],c=arguments[2];if(this._isProper=!1,Ct.intersects(u,c,s)&&J.orientationIndex(u,c,s)===0&&J.orientationIndex(c,u,s)===0)return this._isProper=!0,(s.equals(u)||s.equals(c))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(s,u,c,m,E){E.x=this.smallestInAbsValue(s.x,u.x,c.x,m.x),E.y=this.smallestInAbsValue(s.y,u.y,c.y,m.y),s.x-=E.x,s.y-=E.y,u.x-=E.x,u.y-=E.y,c.x-=E.x,c.y-=E.y,m.x-=E.x,m.y-=E.y},i.prototype.safeHCoordinateIntersection=function(s,u,c,m){var E=null;try{E=Qt.intersection(s,u,c,m)}catch(A){if(!(A instanceof Xt))throw A;E=i.nearestEndpoint(s,u,c,m)}return E},i.prototype.intersection=function(s,u,c,m){var E=this.intersectionWithNormalization(s,u,c,m);return this.isInSegmentEnvelopes(E)||(E=new I(i.nearestEndpoint(s,u,c,m))),this._precisionModel!==null&&this._precisionModel.makePrecise(E),E},i.prototype.smallestInAbsValue=function(s,u,c,m){var E=s,A=Math.abs(E);return Math.abs(u)<A&&(E=u,A=Math.abs(u)),Math.abs(c)<A&&(E=c,A=Math.abs(c)),Math.abs(m)<A&&(E=m),E},i.prototype.checkDD=function(s,u,c,m,E){var A=ft.intersection(s,u,c,m),U=this.isInSegmentEnvelopes(A);Ft.out.println("DD in env = "+U+" --------------------- "+A),E.distance(A)>1e-4&&Ft.out.println("Distance = "+E.distance(A))},i.prototype.intersectionWithNormalization=function(s,u,c,m){var E=new I(s),A=new I(u),U=new I(c),K=new I(m),pt=new I;this.normalizeToEnvCentre(E,A,U,K,pt);var dt=this.safeHCoordinateIntersection(E,A,U,K);return dt.x+=pt.x,dt.y+=pt.y,dt},i.prototype.computeCollinearIntersection=function(s,u,c,m){var E=Ct.intersects(s,u,c),A=Ct.intersects(s,u,m),U=Ct.intersects(c,m,s),K=Ct.intersects(c,m,u);return E&&A?(this._intPt[0]=c,this._intPt[1]=m,n.COLLINEAR_INTERSECTION):U&&K?(this._intPt[0]=s,this._intPt[1]=u,n.COLLINEAR_INTERSECTION):E&&U?(this._intPt[0]=c,this._intPt[1]=s,!c.equals(s)||A||K?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):E&&K?(this._intPt[0]=c,this._intPt[1]=u,!c.equals(u)||A||U?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):A&&U?(this._intPt[0]=m,this._intPt[1]=s,!m.equals(s)||E||K?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):A&&K?(this._intPt[0]=m,this._intPt[1]=u,!m.equals(u)||E||U?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(s,u,c,m,E){var A=s.x<u.x?s.x:u.x,U=s.y<u.y?s.y:u.y,K=s.x>u.x?s.x:u.x,pt=s.y>u.y?s.y:u.y,dt=c.x<m.x?c.x:m.x,Rt=c.y<m.y?c.y:m.y,Ot=c.x>m.x?c.x:m.x,Vt=c.y>m.y?c.y:m.y,jt=((A>dt?A:dt)+(K<Ot?K:Ot))/2,sn=((U>Rt?U:Rt)+(pt<Vt?pt:Vt))/2;E.x=jt,E.y=sn,s.x-=E.x,s.y-=E.y,u.x-=E.x,u.y-=E.y,c.x-=E.x,c.y-=E.y,m.x-=E.x,m.y-=E.y},i.prototype.computeIntersect=function(s,u,c,m){if(this._isProper=!1,!Ct.intersects(s,u,c,m))return n.NO_INTERSECTION;var E=J.orientationIndex(s,u,c),A=J.orientationIndex(s,u,m);if(E>0&&A>0||E<0&&A<0)return n.NO_INTERSECTION;var U=J.orientationIndex(c,m,s),K=J.orientationIndex(c,m,u);return U>0&&K>0||U<0&&K<0?n.NO_INTERSECTION:E===0&&A===0&&U===0&&K===0?this.computeCollinearIntersection(s,u,c,m):(E===0||A===0||U===0||K===0?(this._isProper=!1,s.equals2D(c)||s.equals2D(m)?this._intPt[0]=s:u.equals2D(c)||u.equals2D(m)?this._intPt[0]=u:E===0?this._intPt[0]=new I(c):A===0?this._intPt[0]=new I(m):U===0?this._intPt[0]=new I(s):K===0&&(this._intPt[0]=new I(u))):(this._isProper=!0,this._intPt[0]=this.intersection(s,u,c,m)),n.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(s,u,c,m){var E=s,A=J.distancePointLine(s,c,m),U=J.distancePointLine(u,c,m);return U<A&&(A=U,E=u),(U=J.distancePointLine(c,s,u))<A&&(A=U,E=c),(U=J.distancePointLine(m,s,u))<A&&(A=U,E=m),E},i}(te),X=function(){};X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.orientationIndex=function(n,i,s){var u=i.x-n.x,c=i.y-n.y,m=s.x-i.x,E=s.y-i.y;return X.signOfDet2x2(u,c,m,E)},X.signOfDet2x2=function(n,i,s,u){var c=null,m=null,E=null;if(c=1,n===0||u===0)return i===0||s===0?0:i>0?s>0?-c:c:s>0?c:-c;if(i===0||s===0)return u>0?n>0?c:-c:n>0?-c:c;if(i>0?u>0?i<=u||(c=-c,m=n,n=s,s=m,m=i,i=u,u=m):i<=-u?(c=-c,s=-s,u=-u):(m=n,n=-s,s=m,m=i,i=-u,u=m):u>0?-i<=u?(c=-c,n=-n,i=-i):(m=-n,n=s,s=m,m=-i,i=u,u=m):i>=u?(n=-n,i=-i,s=-s,u=-u):(c=-c,m=-n,n=-s,s=m,m=-i,i=-u,u=m),n>0){if(!(s>0)||!(n<=s))return c}else{if(s>0||!(n>=s))return-c;c=-c,n=-n,s=-s}for(;;){if(E=Math.floor(s/n),s-=E*n,(u-=E*i)<0)return-c;if(u>i)return c;if(n>s+s){if(i<u+u)return c}else{if(i>u+u)return-c;s=n-s,u=i-u,c=-c}if(u===0)return s===0?0:-c;if(s===0||(E=Math.floor(n/s),n-=E*s,(i-=E*u)<0))return c;if(i>u)return-c;if(s>n+n){if(u<i+i)return-c}else{if(u>i+i)return c;n=s-n,i=u-i,c=-c}if(i===0)return n===0?0:c;if(n===0)return-c}};var F=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var n=arguments[0];this._p=n};F.prototype.countSegment=function(n,i){if(n.x<this._p.x&&i.x<this._p.x)return null;if(this._p.x===i.x&&this._p.y===i.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&i.y===this._p.y){var s=n.x,u=i.x;return s>u&&(s=i.x,u=n.x),this._p.x>=s&&this._p.x<=u&&(this._isPointOnSegment=!0),null}if(n.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&n.y<=this._p.y){var c=n.x-this._p.x,m=n.y-this._p.y,E=i.x-this._p.x,A=i.y-this._p.y,U=X.signOfDet2x2(c,m,E,A);if(U===0)return this._isPointOnSegment=!0,null;A<m&&(U=-U),U>0&&this._crossingCount++}},F.prototype.isPointInPolygon=function(){return this.getLocation()!==V.EXTERIOR},F.prototype.getLocation=function(){return this._isPointOnSegment?V.BOUNDARY:this._crossingCount%2==1?V.INTERIOR:V.EXTERIOR},F.prototype.isOnSegment=function(){return this._isPointOnSegment},F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.locatePointInRing=function(){if(arguments[0]instanceof I&&$(arguments[1],gt)){for(var n=arguments[0],i=arguments[1],s=new F(n),u=new I,c=new I,m=1;m<i.size();m++)if(i.getCoordinate(m,u),i.getCoordinate(m-1,c),s.countSegment(u,c),s.isOnSegment())return s.getLocation();return s.getLocation()}if(arguments[0]instanceof I&&arguments[1]instanceof Array){for(var E=arguments[0],A=arguments[1],U=new F(E),K=1;K<A.length;K++){var pt=A[K],dt=A[K-1];if(U.countSegment(pt,dt),U.isOnSegment())return U.getLocation()}return U.getLocation()}};var J=function(){},It={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.orientationIndex=function(n,i,s){return ft.orientationIndex(n,i,s)},J.signedArea=function(){if(arguments[0]instanceof Array){var n=arguments[0];if(n.length<3)return 0;for(var i=0,s=n[0].x,u=1;u<n.length-1;u++){var c=n[u].x-s,m=n[u+1].y;i+=c*(n[u-1].y-m)}return i/2}if($(arguments[0],gt)){var E=arguments[0],A=E.size();if(A<3)return 0;var U=new I,K=new I,pt=new I;E.getCoordinate(0,K),E.getCoordinate(1,pt);var dt=K.x;pt.x-=dt;for(var Rt=0,Ot=1;Ot<A-1;Ot++)U.y=K.y,K.x=pt.x,K.y=pt.y,E.getCoordinate(Ot+1,pt),pt.x-=dt,Rt+=K.x*(U.y-pt.y);return Rt/2}},J.distanceLineLine=function(n,i,s,u){if(n.equals(i))return J.distancePointLine(n,s,u);if(s.equals(u))return J.distancePointLine(u,n,i);var c=!1;if(Ct.intersects(n,i,s,u)){var m=(i.x-n.x)*(u.y-s.y)-(i.y-n.y)*(u.x-s.x);if(m===0)c=!0;else{var E=(n.y-s.y)*(u.x-s.x)-(n.x-s.x)*(u.y-s.y),A=((n.y-s.y)*(i.x-n.x)-(n.x-s.x)*(i.y-n.y))/m,U=E/m;(U<0||U>1||A<0||A>1)&&(c=!0)}}else c=!0;return c?ut.min(J.distancePointLine(n,s,u),J.distancePointLine(i,s,u),J.distancePointLine(s,n,i),J.distancePointLine(u,n,i)):0},J.isPointInRing=function(n,i){return J.locatePointInRing(n,i)!==V.EXTERIOR},J.computeLength=function(n){var i=n.size();if(i<=1)return 0;var s=0,u=new I;n.getCoordinate(0,u);for(var c=u.x,m=u.y,E=1;E<i;E++){n.getCoordinate(E,u);var A=u.x,U=u.y,K=A-c,pt=U-m;s+=Math.sqrt(K*K+pt*pt),c=A,m=U}return s},J.isCCW=function(n){var i=n.length-1;if(i<3)throw new P("Ring has fewer than 4 points, so orientation cannot be determined");for(var s=n[0],u=0,c=1;c<=i;c++){var m=n[c];m.y>s.y&&(s=m,u=c)}var E=u;do(E-=1)<0&&(E=i);while(n[E].equals2D(s)&&E!==u);var A=u;do A=(A+1)%i;while(n[A].equals2D(s)&&A!==u);var U=n[E],K=n[A];if(U.equals2D(s)||K.equals2D(s)||U.equals2D(K))return!1;var pt=J.computeOrientation(U,s,K),dt=!1;return dt=pt===0?U.x>K.x:pt>0,dt},J.locatePointInRing=function(n,i){return F.locatePointInRing(n,i)},J.distancePointLinePerpendicular=function(n,i,s){var u=(s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y),c=((i.y-n.y)*(s.x-i.x)-(i.x-n.x)*(s.y-i.y))/u;return Math.abs(c)*Math.sqrt(u)},J.computeOrientation=function(n,i,s){return J.orientationIndex(n,i,s)},J.distancePointLine=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(i.length===0)throw new P("Line array must contain at least one vertex");for(var s=n.distance(i[0]),u=0;u<i.length-1;u++){var c=J.distancePointLine(n,i[u],i[u+1]);c<s&&(s=c)}return s}if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];if(E.x===A.x&&E.y===A.y)return m.distance(E);var U=(A.x-E.x)*(A.x-E.x)+(A.y-E.y)*(A.y-E.y),K=((m.x-E.x)*(A.x-E.x)+(m.y-E.y)*(A.y-E.y))/U;if(K<=0)return m.distance(E);if(K>=1)return m.distance(A);var pt=((E.y-m.y)*(A.x-E.x)-(E.x-m.x)*(A.y-E.y))/U;return Math.abs(pt)*Math.sqrt(U)}},J.isOnLine=function(n,i){for(var s=new pn,u=1;u<i.length;u++){var c=i[u-1],m=i[u];if(s.computeIntersection(n,c,m),s.hasIntersection())return!0}return!1},It.CLOCKWISE.get=function(){return-1},It.RIGHT.get=function(){return J.CLOCKWISE},It.COUNTERCLOCKWISE.get=function(){return 1},It.LEFT.get=function(){return J.COUNTERCLOCKWISE},It.COLLINEAR.get=function(){return 0},It.STRAIGHT.get=function(){return J.COLLINEAR},Object.defineProperties(J,It);var wt=function(){};wt.prototype.filter=function(n){},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt};var yt=function(){var n=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=n,this._SRID=n.getSRID()},$t={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};yt.prototype.isGeometryCollection=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION},yt.prototype.getFactory=function(){return this._factory},yt.prototype.getGeometryN=function(n){return this},yt.prototype.getArea=function(){return 0},yt.prototype.isRectangle=function(){return!1},yt.prototype.equals=function(){if(arguments[0]instanceof yt){var n=arguments[0];return n!==null&&this.equalsTopo(n)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof yt))return!1;var s=i;return this.equalsExact(s)}},yt.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)},yt.prototype.geometryChanged=function(){this.apply(yt.geometryChangedFilter)},yt.prototype.geometryChangedAction=function(){this._envelope=null},yt.prototype.equalsNorm=function(n){return n!==null&&this.norm().equalsExact(n.norm())},yt.prototype.getLength=function(){return 0},yt.prototype.getNumGeometries=function(){return 1},yt.prototype.compareTo=function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(n)}if(arguments.length===2){var s=arguments[0],u=arguments[1];return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(s,u)}},yt.prototype.getUserData=function(){return this._userData},yt.prototype.getSRID=function(){return this._SRID},yt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},yt.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION)throw new P("This method does not support GeometryCollection arguments")},yt.prototype.equal=function(n,i,s){return s===0?n.equals(i):n.distance(i)<=s},yt.prototype.norm=function(){var n=this.copy();return n.normalize(),n},yt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},yt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Ct(this._envelope)},yt.prototype.setSRID=function(n){this._SRID=n},yt.prototype.setUserData=function(n){this._userData=n},yt.prototype.compare=function(n,i){for(var s=n.iterator(),u=i.iterator();s.hasNext()&&u.hasNext();){var c=s.next(),m=u.next(),E=c.compareTo(m);if(E!==0)return E}return s.hasNext()?1:u.hasNext()?-1:0},yt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},yt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===yt.SORTINDEX_MULTIPOINT||this.getSortIndex()===yt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===yt.SORTINDEX_MULTIPOLYGON},yt.prototype.interfaces_=function(){return[G,N,t]},yt.prototype.getClass=function(){return yt},yt.hasNonEmptyElements=function(n){for(var i=0;i<n.length;i++)if(!n[i].isEmpty())return!0;return!1},yt.hasNullElements=function(n){for(var i=0;i<n.length;i++)if(n[i]===null)return!0;return!1},$t.serialVersionUID.get=function(){return 8763622679187377e3},$t.SORTINDEX_POINT.get=function(){return 0},$t.SORTINDEX_MULTIPOINT.get=function(){return 1},$t.SORTINDEX_LINESTRING.get=function(){return 2},$t.SORTINDEX_LINEARRING.get=function(){return 3},$t.SORTINDEX_MULTILINESTRING.get=function(){return 4},$t.SORTINDEX_POLYGON.get=function(){return 5},$t.SORTINDEX_MULTIPOLYGON.get=function(){return 6},$t.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},$t.geometryChangedFilter.get=function(){return Dt},Object.defineProperties(yt,$t);var Dt=function(){};Dt.interfaces_=function(){return[wt]},Dt.filter=function(n){n.geometryChangedAction()};var Y=function(){};Y.prototype.filter=function(n){},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y};var w=function(){},C={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};w.prototype.isInBoundary=function(n){},w.prototype.interfaces_=function(){return[]},w.prototype.getClass=function(){return w},C.Mod2BoundaryNodeRule.get=function(){return R},C.EndPointBoundaryNodeRule.get=function(){return H},C.MultiValentEndPointBoundaryNodeRule.get=function(){return z},C.MonoValentEndPointBoundaryNodeRule.get=function(){return rt},C.MOD2_BOUNDARY_RULE.get=function(){return new R},C.ENDPOINT_BOUNDARY_RULE.get=function(){return new H},C.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new z},C.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new rt},C.OGC_SFS_BOUNDARY_RULE.get=function(){return w.MOD2_BOUNDARY_RULE},Object.defineProperties(w,C);var R=function(){};R.prototype.isInBoundary=function(n){return n%2==1},R.prototype.interfaces_=function(){return[w]},R.prototype.getClass=function(){return R};var H=function(){};H.prototype.isInBoundary=function(n){return n>0},H.prototype.interfaces_=function(){return[w]},H.prototype.getClass=function(){return H};var z=function(){};z.prototype.isInBoundary=function(n){return n>1},z.prototype.interfaces_=function(){return[w]},z.prototype.getClass=function(){return z};var rt=function(){};rt.prototype.isInBoundary=function(n){return n===1},rt.prototype.interfaces_=function(){return[w]},rt.prototype.getClass=function(){return rt};var j=function(){};j.prototype.add=function(){},j.prototype.addAll=function(){},j.prototype.isEmpty=function(){},j.prototype.iterator=function(){},j.prototype.size=function(){},j.prototype.toArray=function(){},j.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var D=function(){};D.prototype.hasNext=function(){},D.prototype.next=function(){},D.prototype.remove=function(){};var tt=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(j);(o.prototype=new Error).name="NoSuchElementException";var Z=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof j&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[n,j]},i.prototype.add=function(s){return arguments.length===1?this.array_.push(s):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(s){for(var u=s.iterator();u.hasNext();)this.add(u.next());return!0},i.prototype.set=function(s,u){var c=this.array_[s];return this.array_[s]=u,c},i.prototype.iterator=function(){return new et(this)},i.prototype.get=function(s){if(s<0||s>=this.size())throw new e;return this.array_[s]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var s=[],u=0,c=this.array_.length;u<c;u++)s.push(this.array_[u]);return s},i.prototype.remove=function(s){for(var u=!1,c=0,m=this.array_.length;c<m;c++)if(this.array_[c]===s){this.array_.splice(c,1),u=!0;break}return u},i}(tt),et=function(n){function i(s){n.call(this),this.arrayList_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new o;return this.arrayList_.get(this.position_++)},i.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},i.prototype.set=function(s){return this.arrayList_.set(this.position_-1,s)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(D),ot=function(n){function i(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var u=arguments[0];this.ensureCapacity(u.length),this.add(u,!0)}else if(arguments.length===2){var c=arguments[0],m=arguments[1];this.ensureCapacity(c.length),this.add(c,m)}}}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={coordArrayType:{configurable:!0}};return s.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(u){return this.get(u)},i.prototype.addAll=function(){if(arguments.length===2){for(var u=arguments[0],c=arguments[1],m=!1,E=u.iterator();E.hasNext();)this.add(E.next(),c),m=!0;return m}return n.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var u=n.prototype.clone.call(this),c=0;c<this.size();c++)u.add(c,this.get(c).copy());return u},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var u=arguments[0];n.prototype.add.call(this,u)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var c=arguments[0],m=arguments[1];return this.add(c,m,!0),!0}if(arguments[0]instanceof I&&typeof arguments[1]=="boolean"){var E=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(E))return null;n.prototype.add.call(this,E)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var A=arguments[0],U=arguments[1];return this.add(A,U),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var K=arguments[0],pt=arguments[1];if(arguments[2])for(var dt=0;dt<K.length;dt++)this.add(K[dt],pt);else for(var Rt=K.length-1;Rt>=0;Rt--)this.add(K[Rt],pt);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof I){var Ot=arguments[0],Vt=arguments[1];if(!arguments[2]){var jt=this.size();if(jt>0&&(Ot>0&&this.get(Ot-1).equals2D(Vt)||Ot<jt&&this.get(Ot).equals2D(Vt)))return null}n.prototype.add.call(this,Ot,Vt)}}else if(arguments.length===4){var sn=arguments[0],kn=arguments[1],Mr=arguments[2],Ki=arguments[3],Uo=1;Mr>Ki&&(Uo=-1);for(var Ph=Mr;Ph!==Ki;Ph+=Uo)this.add(sn[Ph],kn);return!0}},i.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},Object.defineProperties(i,s),i}(Z),Q=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};St.ForwardComparator.get=function(){return At},St.BidirectionalComparator.get=function(){return ne},St.coordArrayType.get=function(){return new Array(0).fill(null)},Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])},Q.ptNotInList=function(n,i){for(var s=0;s<n.length;s++){var u=n[s];if(Q.indexOf(u,i)<0)return u}return null},Q.scroll=function(n,i){var s=Q.indexOf(i,n);if(s<0)return null;var u=new Array(n.length).fill(null);Ft.arraycopy(n,s,u,0,n.length-s),Ft.arraycopy(n,0,u,n.length-s,s),Ft.arraycopy(u,0,n,0,n.length)},Q.equals=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(n===i)return!0;if(n===null||i===null||n.length!==i.length)return!1;for(var s=0;s<n.length;s++)if(!n[s].equals(i[s]))return!1;return!0}if(arguments.length===3){var u=arguments[0],c=arguments[1],m=arguments[2];if(u===c)return!0;if(u===null||c===null||u.length!==c.length)return!1;for(var E=0;E<u.length;E++)if(m.compare(u[E],c[E])!==0)return!1;return!0}},Q.intersection=function(n,i){for(var s=new ot,u=0;u<n.length;u++)i.intersects(n[u])&&s.add(n[u],!0);return s.toCoordinateArray()},Q.hasRepeatedPoints=function(n){for(var i=1;i<n.length;i++)if(n[i-1].equals(n[i]))return!0;return!1},Q.removeRepeatedPoints=function(n){return Q.hasRepeatedPoints(n)?new ot(n,!1).toCoordinateArray():n},Q.reverse=function(n){for(var i=n.length-1,s=Math.trunc(i/2),u=0;u<=s;u++){var c=n[u];n[u]=n[i-u],n[i-u]=c}},Q.removeNull=function(n){for(var i=0,s=0;s<n.length;s++)n[s]!==null&&i++;var u=new Array(i).fill(null);if(i===0)return u;for(var c=0,m=0;m<n.length;m++)n[m]!==null&&(u[c++]=n[m]);return u},Q.copyDeep=function(){if(arguments.length===1){for(var n=arguments[0],i=new Array(n.length).fill(null),s=0;s<n.length;s++)i[s]=new I(n[s]);return i}if(arguments.length===5)for(var u=arguments[0],c=arguments[1],m=arguments[2],E=arguments[3],A=arguments[4],U=0;U<A;U++)m[E+U]=new I(u[c+U])},Q.isEqualReversed=function(n,i){for(var s=0;s<n.length;s++){var u=n[s],c=i[n.length-s-1];if(u.compareTo(c)!==0)return!1}return!0},Q.envelope=function(n){for(var i=new Ct,s=0;s<n.length;s++)i.expandToInclude(n[s]);return i},Q.toCoordinateArray=function(n){return n.toArray(Q.coordArrayType)},Q.atLeastNCoordinatesOrNothing=function(n,i){return i.length>=n?i:[]},Q.indexOf=function(n,i){for(var s=0;s<i.length;s++)if(n.equals(i[s]))return s;return-1},Q.increasingDirection=function(n){for(var i=0;i<Math.trunc(n.length/2);i++){var s=n.length-1-i,u=n[i].compareTo(n[s]);if(u!==0)return u}return 1},Q.compare=function(n,i){for(var s=0;s<n.length&&s<i.length;){var u=n[s].compareTo(i[s]);if(u!==0)return u;s++}return s<i.length?-1:s<n.length?1:0},Q.minCoordinate=function(n){for(var i=null,s=0;s<n.length;s++)(i===null||i.compareTo(n[s])>0)&&(i=n[s]);return i},Q.extract=function(n,i,s){i=ut.clamp(i,0,n.length);var u=(s=ut.clamp(s,-1,n.length))-i+1;s<0&&(u=0),i>=n.length&&(u=0),s<i&&(u=0);var c=new Array(u).fill(null);if(u===0)return c;for(var m=0,E=i;E<=s;E++)c[m++]=n[E];return c},Object.defineProperties(Q,St);var At=function(){};At.prototype.compare=function(n,i){return Q.compare(n,i)},At.prototype.interfaces_=function(){return[B]},At.prototype.getClass=function(){return At};var ne=function(){};ne.prototype.compare=function(n,i){var s=n,u=i;if(s.length<u.length)return-1;if(s.length>u.length)return 1;if(s.length===0)return 0;var c=Q.compare(s,u);return Q.isEqualReversed(s,u)?0:c},ne.prototype.OLDcompare=function(n,i){var s=n,u=i;if(s.length<u.length)return-1;if(s.length>u.length)return 1;if(s.length===0)return 0;for(var c=Q.increasingDirection(s),m=Q.increasingDirection(u),E=c>0?0:s.length-1,A=m>0?0:s.length-1,U=0;U<s.length;U++){var K=s[E].compareTo(u[A]);if(K!==0)return K;E+=c,A+=m}return 0},ne.prototype.interfaces_=function(){return[B]},ne.prototype.getClass=function(){return ne};var Gt=function(){};Gt.prototype.get=function(){},Gt.prototype.put=function(){},Gt.prototype.size=function(){},Gt.prototype.values=function(){},Gt.prototype.entrySet=function(){};var He=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Gt);(a.prototype=new Error).name="OperationNotSupported",(l.prototype=new j).contains=function(){};var tn=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof j&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.contains=function(s){for(var u=0,c=this.array_.length;u<c;u++)if(this.array_[u]===s)return!0;return!1},i.prototype.add=function(s){return!this.contains(s)&&(this.array_.push(s),!0)},i.prototype.addAll=function(s){for(var u=s.iterator();u.hasNext();)this.add(u.next());return!0},i.prototype.remove=function(s){throw new Error},i.prototype.size=function(){return this.array_.length},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.toArray=function(){for(var s=[],u=0,c=this.array_.length;u<c;u++)s.push(this.array_[u]);return s},i.prototype.iterator=function(){return new Ln(this)},i}(l),Ln=function(n){function i(s){n.call(this),this.hashSet_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new o;return this.hashSet_.array_[this.position_++]},i.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},i.prototype.remove=function(){throw new a},i}(D),mn=0;(_.prototype=new He).get=function(n){for(var i=this.root_;i!==null;){var s=n.compareTo(i.key);if(s<0)i=i.left;else{if(!(s>0))return i.value;i=i.right}}return null},_.prototype.put=function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:mn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var s,u,c=this.root_;do if(s=c,(u=n.compareTo(c.key))<0)c=c.left;else{if(!(u>0)){var m=c.value;return c.value=i,m}c=c.right}while(c!==null);var E={key:n,left:null,right:null,value:i,parent:s,color:mn,getValue:function(){return this.value},getKey:function(){return this.key}};return u<0?s.left=E:s.right=E,this.fixAfterInsertion(E),this.size_++,null},_.prototype.fixAfterInsertion=function(n){for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)if(f(n)===d(f(f(n)))){var i=g(f(f(n)));h(i)===1?(p(f(n),mn),p(i,mn),p(f(f(n)),1),n=f(f(n))):(n===g(f(n))&&(n=f(n),this.rotateLeft(n)),p(f(n),mn),p(f(f(n)),1),this.rotateRight(f(f(n))))}else{var s=d(f(f(n)));h(s)===1?(p(f(n),mn),p(s,mn),p(f(f(n)),1),n=f(f(n))):(n===d(f(n))&&(n=f(n),this.rotateRight(n)),p(f(n),mn),p(f(f(n)),1),this.rotateLeft(f(f(n))))}this.root_.color=mn},_.prototype.values=function(){var n=new Z,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=_.successor(i))!==null;)n.add(i.value);return n},_.prototype.entrySet=function(){var n=new tn,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=_.successor(i))!==null;)n.add(i);return n},_.prototype.rotateLeft=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}},_.prototype.rotateRight=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}},_.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},_.successor=function(n){if(n===null)return null;if(n.right!==null){for(var i=n.right;i.left!==null;)i=i.left;return i}for(var s=n.parent,u=n;s!==null&&u===s.right;)u=s,s=s.parent;return s},_.prototype.size=function(){return this.size_};var Fn=function(){};Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},y.prototype=new l,(M.prototype=new y).contains=function(n){for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===0)return!0;return!1},M.prototype.add=function(n){if(this.contains(n))return!1;for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===1)return this.array_.splice(i,0,n),!0;return this.array_.push(n),!0},M.prototype.addAll=function(n){for(var i=n.iterator();i.hasNext();)this.add(i.next());return!0},M.prototype.remove=function(n){throw new a},M.prototype.size=function(){return this.array_.length},M.prototype.isEmpty=function(){return this.array_.length===0},M.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n},M.prototype.iterator=function(){return new $n(this)};var $n=function(n){this.treeSet_=n,this.position_=0};$n.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},$n.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},$n.prototype.remove=function(){throw new a};var xn=function(){};xn.sort=function(){var n,i,s,u,c=arguments[0];if(arguments.length===1)u=function(E,A){return E.compareTo(A)},c.sort(u);else if(arguments.length===2)s=arguments[1],u=function(E,A){return s.compare(E,A)},c.sort(u);else if(arguments.length===3){(i=c.slice(arguments[1],arguments[2])).sort();var m=c.slice(0,arguments[1]).concat(i,c.slice(arguments[2],c.length));for(c.splice(0,c.length),n=0;n<m.length;n++)c.push(m[n])}else if(arguments.length===4)for(i=c.slice(arguments[1],arguments[2]),s=arguments[3],u=function(E,A){return s.compare(E,A)},i.sort(u),m=c.slice(0,arguments[1]).concat(i,c.slice(arguments[2],c.length)),c.splice(0,c.length),n=0;n<m.length;n++)c.push(m[n])},xn.asList=function(n){for(var i=new Z,s=0,u=n.length;s<u;s++)i.add(n[s]);return i};var re=function(){},En={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};En.P.get=function(){return 0},En.L.get=function(){return 1},En.A.get=function(){return 2},En.FALSE.get=function(){return-1},En.TRUE.get=function(){return-2},En.DONTCARE.get=function(){return-3},En.SYM_FALSE.get=function(){return"F"},En.SYM_TRUE.get=function(){return"T"},En.SYM_DONTCARE.get=function(){return"*"},En.SYM_P.get=function(){return"0"},En.SYM_L.get=function(){return"1"},En.SYM_A.get=function(){return"2"},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.toDimensionSymbol=function(n){switch(n){case re.FALSE:return re.SYM_FALSE;case re.TRUE:return re.SYM_TRUE;case re.DONTCARE:return re.SYM_DONTCARE;case re.P:return re.SYM_P;case re.L:return re.SYM_L;case re.A:return re.SYM_A}throw new P("Unknown dimension value: "+n)},re.toDimensionValue=function(n){switch(ht.toUpperCase(n)){case re.SYM_FALSE:return re.FALSE;case re.SYM_TRUE:return re.TRUE;case re.SYM_DONTCARE:return re.DONTCARE;case re.SYM_P:return re.P;case re.SYM_L:return re.L;case re.SYM_A:return re.A}throw new P("Unknown dimension symbol: "+n)},Object.defineProperties(re,En);var Cn=function(){};Cn.prototype.filter=function(n){},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn};var wn=function(){};wn.prototype.filter=function(n,i){},wn.prototype.isDone=function(){},wn.prototype.isGeometryChanged=function(){},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var gn=function(n){function i(u,c){if(n.call(this,c),this._geometries=u||[],n.hasNullElements(this._geometries))throw new P("geometries must not contain null elements")}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var u=new Ct,c=0;c<this._geometries.length;c++)u.expandToInclude(this._geometries[c].getEnvelopeInternal());return u},i.prototype.getGeometryN=function(u){return this._geometries[u]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var u=new Array(this.getNumPoints()).fill(null),c=-1,m=0;m<this._geometries.length;m++)for(var E=this._geometries[m].getCoordinates(),A=0;A<E.length;A++)u[++c]=E[A];return u},i.prototype.getArea=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getArea();return u},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u;if(this._geometries.length!==m._geometries.length)return!1;for(var E=0;E<this._geometries.length;E++)if(!this._geometries[E].equalsExact(m._geometries[E],c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var u=0;u<this._geometries.length;u++)this._geometries[u].normalize();xn.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var u=re.FALSE,c=0;c<this._geometries.length;c++)u=Math.max(u,this._geometries[c].getBoundaryDimension());return u},i.prototype.getDimension=function(){for(var u=re.FALSE,c=0;c<this._geometries.length;c++)u=Math.max(u,this._geometries[c].getDimension());return u},i.prototype.getLength=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getLength();return u},i.prototype.getNumPoints=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getNumPoints();return u},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[m]=this._geometries[m].reverse();return this.getFactory().createGeometryCollection(c)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0],c=new M(xn.asList(this._geometries)),m=new M(xn.asList(u._geometries));return this.compare(c,m)}if(arguments.length===2){for(var E=arguments[0],A=arguments[1],U=E,K=this.getNumGeometries(),pt=U.getNumGeometries(),dt=0;dt<K&&dt<pt;){var Rt=this.getGeometryN(dt),Ot=U.getGeometryN(dt),Vt=Rt.compareToSameClass(Ot,A);if(Vt!==0)return Vt;dt++}return dt<K?1:dt<pt?-1:0}},i.prototype.apply=function(){if($(arguments[0],Y))for(var u=arguments[0],c=0;c<this._geometries.length;c++)this._geometries[c].apply(u);else if($(arguments[0],wn)){var m=arguments[0];if(this._geometries.length===0)return null;for(var E=0;E<this._geometries.length&&(this._geometries[E].apply(m),!m.isDone());E++);m.isGeometryChanged()&&this.geometryChanged()}else if($(arguments[0],Cn)){var A=arguments[0];A.filter(this);for(var U=0;U<this._geometries.length;U++)this._geometries[U].apply(A)}else if($(arguments[0],wt)){var K=arguments[0];K.filter(this);for(var pt=0;pt<this._geometries.length;pt++)this._geometries[pt].apply(K)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Pt.shouldNeverReachHere(),null},i.prototype.clone=function(){var u=n.prototype.clone.call(this);u._geometries=new Array(this._geometries.length).fill(null);for(var c=0;c<this._geometries.length;c++)u._geometries[c]=this._geometries[c].clone();return u},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.isEmpty=function(){for(var u=0;u<this._geometries.length;u++)if(!this._geometries[u].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,s),i}(yt),W=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return yt.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?re.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var u=0;u<this._geometries.length;u++)if(!this._geometries[u].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[u-1-m]=this._geometries[m].reverse();return this.getFactory().createMultiLineString(c)},i.prototype.getBoundary=function(){return new at(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[Fn]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,s),i}(gn),at=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var n=arguments[0],i=w.MOD2_BOUNDARY_RULE;this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this._geom=s,this._geomFact=s.getFactory(),this._bnRule=u}};at.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(n);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},at.prototype.getBoundary=function(){return this._geom instanceof zt?this.boundaryLineString(this._geom):this._geom instanceof W?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},at.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])},at.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},at.prototype.computeBoundaryCoordinates=function(n){var i=new Z;this._endpointMap=new _;for(var s=0;s<n.getNumGeometries();s++){var u=n.getGeometryN(s);u.getNumPoints()!==0&&(this.addEndpoint(u.getCoordinateN(0)),this.addEndpoint(u.getCoordinateN(u.getNumPoints()-1)))}for(var c=this._endpointMap.entrySet().iterator();c.hasNext();){var m=c.next(),E=m.getValue().count;this._bnRule.isInBoundary(E)&&i.add(m.getKey())}return Q.toCoordinateArray(i)},at.prototype.addEndpoint=function(n){var i=this._endpointMap.get(n);i===null&&(i=new _t,this._endpointMap.put(n,i)),i.count++},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.getBoundary=function(){if(arguments.length===1){var n=arguments[0];return new at(n).getBoundary()}if(arguments.length===2){var i=arguments[0],s=arguments[1];return new at(i,s).getBoundary()}};var _t=function(){this.count=null};_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t};var ct=function(){},Et={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct},ct.chars=function(n,i){for(var s=new Array(i).fill(null),u=0;u<i;u++)s[u]=n;return String(s)},ct.getStackTrace=function(){if(arguments.length===1){var n=arguments[0],i=new function(){},s=new function(){}(i);return n.printStackTrace(s),i.toString()}if(arguments.length===2){for(var u=arguments[0],c=arguments[1],m="",E=new function(){}(new function(){}(ct.getStackTrace(u))),A=0;A<c;A++)try{m+=E.readLine()+ct.NEWLINE}catch(U){if(!(U instanceof b))throw U;Pt.shouldNeverReachHere()}return m}},ct.split=function(n,i){for(var s=i.length,u=new Z,c=""+n,m=c.indexOf(i);m>=0;){var E=c.substring(0,m);u.add(E),m=(c=c.substring(m+s)).indexOf(i)}c.length>0&&u.add(c);for(var A=new Array(u.size()).fill(null),U=0;U<A.length;U++)A[U]=u.get(U);return A},ct.toString=function(){if(arguments.length===1){var n=arguments[0];return ct.SIMPLE_ORDINATE_FORMAT.format(n)}},ct.spaces=function(n){return ct.chars(" ",n)},Et.NEWLINE.get=function(){return Ft.getProperty("line.separator")},Et.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(ct,Et);var Nt=function(){};Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.copyCoord=function(n,i,s,u){for(var c=Math.min(n.getDimension(),s.getDimension()),m=0;m<c;m++)s.setOrdinate(u,m,n.getOrdinate(i,m))},Nt.isRing=function(n){var i=n.size();return i===0||!(i<=3)&&n.getOrdinate(0,gt.X)===n.getOrdinate(i-1,gt.X)&&n.getOrdinate(0,gt.Y)===n.getOrdinate(i-1,gt.Y)},Nt.isEqual=function(n,i){var s=n.size();if(s!==i.size())return!1;for(var u=Math.min(n.getDimension(),i.getDimension()),c=0;c<s;c++)for(var m=0;m<u;m++){var E=n.getOrdinate(c,m),A=i.getOrdinate(c,m);if(n.getOrdinate(c,m)!==i.getOrdinate(c,m)&&(!S.isNaN(E)||!S.isNaN(A)))return!1}return!0},Nt.extend=function(n,i,s){var u=n.create(s,i.getDimension()),c=i.size();if(Nt.copy(i,0,u,0,c),c>0)for(var m=c;m<s;m++)Nt.copy(i,c-1,u,m,1);return u},Nt.reverse=function(n){for(var i=n.size()-1,s=Math.trunc(i/2),u=0;u<=s;u++)Nt.swap(n,u,i-u)},Nt.swap=function(n,i,s){if(i===s)return null;for(var u=0;u<n.getDimension();u++){var c=n.getOrdinate(i,u);n.setOrdinate(i,u,n.getOrdinate(s,u)),n.setOrdinate(s,u,c)}},Nt.copy=function(n,i,s,u,c){for(var m=0;m<c;m++)Nt.copyCoord(n,i+m,s,u+m)},Nt.toString=function(){if(arguments.length===1){var n=arguments[0],i=n.size();if(i===0)return"()";var s=n.getDimension(),u=new mt;u.append("(");for(var c=0;c<i;c++){c>0&&u.append(" ");for(var m=0;m<s;m++)m>0&&u.append(","),u.append(ct.toString(n.getOrdinate(c,m)))}return u.append(")"),u.toString()}},Nt.ensureValidRing=function(n,i){var s=i.size();return s===0?i:s<=3?Nt.createClosedRing(n,i,4):i.getOrdinate(0,gt.X)===i.getOrdinate(s-1,gt.X)&&i.getOrdinate(0,gt.Y)===i.getOrdinate(s-1,gt.Y)?i:Nt.createClosedRing(n,i,s+1)},Nt.createClosedRing=function(n,i,s){var u=n.create(s,i.getDimension()),c=i.size();Nt.copy(i,0,u,0,c);for(var m=c;m<s;m++)Nt.copy(i,0,u,m,1);return u};var zt=function(n){function i(u,c){n.call(this,c),this._points=null,this.init(u)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Ct:this._points.expandEnvelope(new Ct)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u;if(this._points.size()!==m._points.size())return!1;for(var E=0;E<this._points.size();E++)if(!this.equal(this._points.getCoordinate(E),m._points.getCoordinate(E),c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var u=0;u<Math.trunc(this._points.size()/2);u++){var c=this._points.size()-1-u;if(!this._points.getCoordinate(u).equals(this._points.getCoordinate(c)))return this._points.getCoordinate(u).compareTo(this._points.getCoordinate(c))>0&&Nt.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?re.FALSE:0},i.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},i.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},i.prototype.getDimension=function(){return 1},i.prototype.getLength=function(){return J.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var u=this._points.copy();return Nt.reverse(u),this.getFactory().createLineString(u)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var u=arguments[0],c=0,m=0;c<this._points.size()&&m<u._points.size();){var E=this._points.getCoordinate(c).compareTo(u._points.getCoordinate(m));if(E!==0)return E;c++,m++}return c<this._points.size()?1:m<u._points.size()?-1:0}if(arguments.length===2){var A=arguments[0];return arguments[1].compare(this._points,A._points)}},i.prototype.apply=function(){if($(arguments[0],Y))for(var u=arguments[0],c=0;c<this._points.size();c++)u.filter(this._points.getCoordinate(c));else if($(arguments[0],wn)){var m=arguments[0];if(this._points.size()===0)return null;for(var E=0;E<this._points.size()&&(m.filter(this._points,E),!m.isDone());E++);m.isGeometryChanged()&&this.geometryChanged()}else $(arguments[0],Cn)?arguments[0].filter(this):$(arguments[0],wt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new at(this).getBoundary()},i.prototype.isEquivalentClass=function(u){return u instanceof i},i.prototype.clone=function(){var u=n.prototype.clone.call(this);return u._points=this._points.clone(),u},i.prototype.getCoordinateN=function(u){return this._points.getCoordinate(u)},i.prototype.getGeometryType=function(){return"LineString"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._points},i.prototype.isEmpty=function(){return this._points.size()===0},i.prototype.init=function(u){if(u===null&&(u=this.getFactory().getCoordinateSequenceFactory().create([])),u.size()===1)throw new P("Invalid number of points in LineString (found "+u.size()+" - must be 0 or >= 2)");this._points=u},i.prototype.isCoordinate=function(u){for(var c=0;c<this._points.size();c++)if(this._points.getCoordinate(c).equals(u))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(u){return this.getFactory().createPoint(this._points.getCoordinate(u))},i.prototype.interfaces_=function(){return[Fn]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,s),i}(yt),oe=function(){};oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe};var Kt=function(n){function i(u,c){n.call(this,c),this._coordinates=u||null,this.init(this._coordinates)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Ct;var u=new Ct;return u.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),u},i.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&(!(!this.isEmpty()||!u.isEmpty())||this.isEmpty()===u.isEmpty()&&this.equal(u.getCoordinate(),this.getCoordinate(),c))}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){},i.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},i.prototype.getBoundaryDimension=function(){return re.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getNumPoints=function(){return this.isEmpty()?0:1},i.prototype.reverse=function(){return this.copy()},i.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0];return this.getCoordinate().compareTo(u.getCoordinate())}if(arguments.length===2){var c=arguments[0];return arguments[1].compare(this._coordinates,c._coordinates)}},i.prototype.apply=function(){if($(arguments[0],Y)){var u=arguments[0];if(this.isEmpty())return null;u.filter(this.getCoordinate())}else if($(arguments[0],wn)){var c=arguments[0];if(this.isEmpty())return null;c.filter(this._coordinates,0),c.isGeometryChanged()&&this.geometryChanged()}else $(arguments[0],Cn)?arguments[0].filter(this):$(arguments[0],wt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var u=n.prototype.clone.call(this);return u._coordinates=this._coordinates.clone(),u},i.prototype.getGeometryType=function(){return"Point"},i.prototype.copy=function(){return new i(this._coordinates.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._coordinates},i.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},i.prototype.isEmpty=function(){return this._coordinates.size()===0},i.prototype.init=function(u){u===null&&(u=this.getFactory().getCoordinateSequenceFactory().create([])),Pt.isTrue(u.size()<=1),this._coordinates=u},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[oe]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,s),i}(yt),ce=function(){};ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce};var Wt=function(n){function i(u,c,m){if(n.call(this,m),this._shell=null,this._holes=null,u===null&&(u=this.getFactory().createLinearRing()),c===null&&(c=[]),n.hasNullElements(c))throw new P("holes must not contain null elements");if(u.isEmpty()&&n.hasNonEmptyElements(c))throw new P("shell is empty but holes are not");this._shell=u,this._holes=c}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var u=new Array(this.getNumPoints()).fill(null),c=-1,m=this._shell.getCoordinates(),E=0;E<m.length;E++)u[++c]=m[E];for(var A=0;A<this._holes.length;A++)for(var U=this._holes[A].getCoordinates(),K=0;K<U.length;K++)u[++c]=U[K];return u},i.prototype.getArea=function(){var u=0;u+=Math.abs(J.signedArea(this._shell.getCoordinateSequence()));for(var c=0;c<this._holes.length;c++)u-=Math.abs(J.signedArea(this._holes[c].getCoordinateSequence()));return u},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var u=this._shell.getCoordinateSequence(),c=this.getEnvelopeInternal(),m=0;m<5;m++){var E=u.getX(m);if(E!==c.getMinX()&&E!==c.getMaxX())return!1;var A=u.getY(m);if(A!==c.getMinY()&&A!==c.getMaxY())return!1}for(var U=u.getX(0),K=u.getY(0),pt=1;pt<=4;pt++){var dt=u.getX(pt),Rt=u.getY(pt);if(dt!==U==(Rt!==K))return!1;U=dt,K=Rt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u,E=this._shell,A=m._shell;if(!E.equalsExact(A,c)||this._holes.length!==m._holes.length)return!1;for(var U=0;U<this._holes.length;U++)if(!this._holes[U].equalsExact(m._holes[U],c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var u=0;u<this._holes.length;u++)this.normalize(this._holes[u],!1);xn.sort(this._holes)}else if(arguments.length===2){var c=arguments[0],m=arguments[1];if(c.isEmpty())return null;var E=new Array(c.getCoordinates().length-1).fill(null);Ft.arraycopy(c.getCoordinates(),0,E,0,E.length);var A=Q.minCoordinate(c.getCoordinates());Q.scroll(E,A),Ft.arraycopy(E,0,c.getCoordinates(),0,E.length),c.getCoordinates()[E.length]=E[0],J.isCCW(c.getCoordinates())===m&&Q.reverse(c.getCoordinates())}},i.prototype.getCoordinate=function(){return this._shell.getCoordinate()},i.prototype.getNumInteriorRing=function(){return this._holes.length},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.getLength=function(){var u=0;u+=this._shell.getLength();for(var c=0;c<this._holes.length;c++)u+=this._holes[c].getLength();return u},i.prototype.getNumPoints=function(){for(var u=this._shell.getNumPoints(),c=0;c<this._holes.length;c++)u+=this._holes[c].getNumPoints();return u},i.prototype.reverse=function(){var u=this.copy();u._shell=this._shell.copy().reverse(),u._holes=new Array(this._holes.length).fill(null);for(var c=0;c<this._holes.length;c++)u._holes[c]=this._holes[c].copy().reverse();return u},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0],c=this._shell,m=u._shell;return c.compareToSameClass(m)}if(arguments.length===2){var E=arguments[0],A=arguments[1],U=E,K=this._shell,pt=U._shell,dt=K.compareToSameClass(pt,A);if(dt!==0)return dt;for(var Rt=this.getNumInteriorRing(),Ot=U.getNumInteriorRing(),Vt=0;Vt<Rt&&Vt<Ot;){var jt=this.getInteriorRingN(Vt),sn=U.getInteriorRingN(Vt),kn=jt.compareToSameClass(sn,A);if(kn!==0)return kn;Vt++}return Vt<Rt?1:Vt<Ot?-1:0}},i.prototype.apply=function(u){if($(u,Y)){this._shell.apply(u);for(var c=0;c<this._holes.length;c++)this._holes[c].apply(u)}else if($(u,wn)){if(this._shell.apply(u),!u.isDone())for(var m=0;m<this._holes.length&&(this._holes[m].apply(u),!u.isDone());m++);u.isGeometryChanged()&&this.geometryChanged()}else if($(u,Cn))u.filter(this);else if($(u,wt)){u.filter(this),this._shell.apply(u);for(var E=0;E<this._holes.length;E++)this._holes[E].apply(u)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var u=new Array(this._holes.length+1).fill(null);u[0]=this._shell;for(var c=0;c<this._holes.length;c++)u[c+1]=this._holes[c];return u.length<=1?this.getFactory().createLinearRing(u[0].getCoordinateSequence()):this.getFactory().createMultiLineString(u)},i.prototype.clone=function(){var u=n.prototype.clone.call(this);u._shell=this._shell.clone(),u._holes=new Array(this._holes.length).fill(null);for(var c=0;c<this._holes.length;c++)u._holes[c]=this._holes[c].clone();return u},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var u=this._shell.copy(),c=new Array(this._holes.length).fill(null),m=0;m<c.length;m++)c[m]=this._holes[m].copy();return new i(u,c,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(u){return this._holes[u]},i.prototype.interfaces_=function(){return[ce]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,s),i}(yt),he=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return yt.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var u=arguments[0];return this._geometries[u].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return re.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.getGeometryType=function(){return"MultiPoint"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[oe]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,s),i}(gn),an=function(n){function i(u,c){u instanceof I&&c instanceof ue&&(u=c.getCoordinateSequenceFactory().create(u)),n.call(this,u,c),this.validateConstruction()}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return yt.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return re.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},i.prototype.reverse=function(){var u=this._points.copy();return Nt.reverse(u),this.getFactory().createLinearRing(u)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new P("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new P("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},i.prototype.getGeometryType=function(){return"LinearRing"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.MINIMUM_VALID_SIZE.get=function(){return 4},s.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,s),i}(zt),ln=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return yt.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[m]=this._geometries[m].reverse();return this.getFactory().createMultiPolygon(c)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var u=new Z,c=0;c<this._geometries.length;c++)for(var m=this._geometries[c].getBoundary(),E=0;E<m.getNumGeometries();E++)u.add(m.getGeometryN(E));var A=new Array(u.size()).fill(null);return this.getFactory().createMultiLineString(u.toArray(A))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[ce]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,s),i}(gn),bn=function(n){this._factory=n||null,this._isUserDataCopied=!1},ui={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};bn.prototype.setCopyUserData=function(n){this._isUserDataCopied=n},bn.prototype.edit=function(n,i){if(n===null)return null;var s=this.editInternal(n,i);return this._isUserDataCopied&&s.setUserData(n.getUserData()),s},bn.prototype.editInternal=function(n,i){return this._factory===null&&(this._factory=n.getFactory()),n instanceof gn?this.editGeometryCollection(n,i):n instanceof Wt?this.editPolygon(n,i):n instanceof Kt?i.edit(n,this._factory):n instanceof zt?i.edit(n,this._factory):(Pt.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},bn.prototype.editGeometryCollection=function(n,i){for(var s=i.edit(n,this._factory),u=new Z,c=0;c<s.getNumGeometries();c++){var m=this.edit(s.getGeometryN(c),i);m===null||m.isEmpty()||u.add(m)}return s.getClass()===he?this._factory.createMultiPoint(u.toArray([])):s.getClass()===W?this._factory.createMultiLineString(u.toArray([])):s.getClass()===ln?this._factory.createMultiPolygon(u.toArray([])):this._factory.createGeometryCollection(u.toArray([]))},bn.prototype.editPolygon=function(n,i){var s=i.edit(n,this._factory);if(s===null&&(s=this._factory.createPolygon(null)),s.isEmpty())return s;var u=this.edit(s.getExteriorRing(),i);if(u===null||u.isEmpty())return this._factory.createPolygon();for(var c=new Z,m=0;m<s.getNumInteriorRing();m++){var E=this.edit(s.getInteriorRingN(m),i);E===null||E.isEmpty()||c.add(E)}return this._factory.createPolygon(u,c.toArray([]))},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},bn.GeometryEditorOperation=function(){},ui.NoOpGeometryOperation.get=function(){return Pn},ui.CoordinateOperation.get=function(){return de},ui.CoordinateSequenceOperation.get=function(){return bo},Object.defineProperties(bn,ui);var Pn=function(){};Pn.prototype.edit=function(n,i){return n},Pn.prototype.interfaces_=function(){return[bn.GeometryEditorOperation]},Pn.prototype.getClass=function(){return Pn};var de=function(){};de.prototype.edit=function(n,i){var s=this.editCoordinates(n.getCoordinates(),n);return s===null?n:n instanceof an?i.createLinearRing(s):n instanceof zt?i.createLineString(s):n instanceof Kt?s.length>0?i.createPoint(s[0]):i.createPoint():n},de.prototype.interfaces_=function(){return[bn.GeometryEditorOperation]},de.prototype.getClass=function(){return de};var bo=function(){};bo.prototype.edit=function(n,i){return n instanceof an?i.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof zt?i.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof Kt?i.createPoint(this.edit(n.getCoordinateSequence(),n)):n},bo.prototype.interfaces_=function(){return[bn.GeometryEditorOperation]},bo.prototype.getClass=function(){return bo};var fe=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var i=0;i<n;i++)this._coordinates[i]=new I}else if($(arguments[0],gt)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._coordinates=new Array(s.size()).fill(null);for(var u=0;u<this._coordinates.length;u++)this._coordinates[u]=s.getCoordinateCopy(u)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var c=arguments[0],m=arguments[1];this._coordinates=c,this._dimension=m,c===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var E=arguments[0],A=arguments[1];this._coordinates=new Array(E).fill(null),this._dimension=A;for(var U=0;U<E;U++)this._coordinates[U]=new I}}},ao={serialVersionUID:{configurable:!0}};fe.prototype.setOrdinate=function(n,i,s){switch(i){case gt.X:this._coordinates[n].x=s;break;case gt.Y:this._coordinates[n].y=s;break;case gt.Z:this._coordinates[n].z=s;break;default:throw new P("invalid ordinateIndex")}},fe.prototype.size=function(){return this._coordinates.length},fe.prototype.getOrdinate=function(n,i){switch(i){case gt.X:return this._coordinates[n].x;case gt.Y:return this._coordinates[n].y;case gt.Z:return this._coordinates[n].z}return S.NaN},fe.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._coordinates[n]}if(arguments.length===2){var i=arguments[0],s=arguments[1];s.x=this._coordinates[i].x,s.y=this._coordinates[i].y,s.z=this._coordinates[i].z}},fe.prototype.getCoordinateCopy=function(n){return new I(this._coordinates[n])},fe.prototype.getDimension=function(){return this._dimension},fe.prototype.getX=function(n){return this._coordinates[n].x},fe.prototype.clone=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].clone();return new fe(n,this._dimension)},fe.prototype.expandEnvelope=function(n){for(var i=0;i<this._coordinates.length;i++)n.expandToInclude(this._coordinates[i]);return n},fe.prototype.copy=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].copy();return new fe(n,this._dimension)},fe.prototype.toString=function(){if(this._coordinates.length>0){var n=new mt(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)n.append(", "),n.append(this._coordinates[i]);return n.append(")"),n.toString()}return"()"},fe.prototype.getY=function(n){return this._coordinates[n].y},fe.prototype.toCoordinateArray=function(){return this._coordinates},fe.prototype.interfaces_=function(){return[gt,t]},fe.prototype.getClass=function(){return fe},ao.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(fe,ao);var li=function(){},To={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};li.prototype.readResolve=function(){return li.instance()},li.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new fe(n)}if($(arguments[0],gt)){var i=arguments[0];return new fe(i)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return u>3&&(u=3),u<2?new fe(s):new fe(s,u)}},li.prototype.interfaces_=function(){return[st,t]},li.prototype.getClass=function(){return li},li.instance=function(){return li.instanceObject},To.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},To.instanceObject.get=function(){return new li},Object.defineProperties(li,To);var ua=function(n){function i(){n.call(this),this.map_=new Map}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(s){return this.map_.get(s)||null},i.prototype.put=function(s,u){return this.map_.set(s,u),u},i.prototype.values=function(){for(var s=new Z,u=this.map_.values(),c=u.next();!c.done;)s.add(c.value),c=u.next();return s},i.prototype.entrySet=function(){var s=new tn;return this.map_.entries().forEach(function(u){return s.add(u)}),s},i.prototype.size=function(){return this.map_.size()},i}(Gt),ie=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof kr){var i=arguments[0];this._modelType=i,i===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var s=arguments[0];this._modelType=n.FIXED,this.setScale(s)}else if(arguments[0]instanceof n){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}},Vi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};ie.prototype.equals=function(n){if(!(n instanceof ie))return!1;var i=n;return this._modelType===i._modelType&&this._scale===i._scale},ie.prototype.compareTo=function(n){var i=n,s=this.getMaximumSignificantDigits(),u=i.getMaximumSignificantDigits();return new lt(s).compareTo(new lt(u))},ie.prototype.getScale=function(){return this._scale},ie.prototype.isFloating=function(){return this._modelType===ie.FLOATING||this._modelType===ie.FLOATING_SINGLE},ie.prototype.getType=function(){return this._modelType},ie.prototype.toString=function(){var n="UNKNOWN";return this._modelType===ie.FLOATING?n="Floating":this._modelType===ie.FLOATING_SINGLE?n="Floating-Single":this._modelType===ie.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},ie.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var n=arguments[0];return S.isNaN(n)||this._modelType===ie.FLOATING_SINGLE?n:this._modelType===ie.FIXED?Math.round(n*this._scale)/this._scale:n}if(arguments[0]instanceof I){var i=arguments[0];if(this._modelType===ie.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},ie.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===ie.FLOATING?n=16:this._modelType===ie.FLOATING_SINGLE?n=6:this._modelType===ie.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},ie.prototype.setScale=function(n){this._scale=Math.abs(n)},ie.prototype.interfaces_=function(){return[t,N]},ie.prototype.getClass=function(){return ie},ie.mostPrecise=function(n,i){return n.compareTo(i)>=0?n:i},Vi.serialVersionUID.get=function(){return 7777263578777804e3},Vi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ie,Vi);var kr=function n(i){this._name=i||null,n.nameToTypeMap.put(i,this)},Pr={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};kr.prototype.readResolve=function(){return kr.nameToTypeMap.get(this._name)},kr.prototype.toString=function(){return this._name},kr.prototype.interfaces_=function(){return[t]},kr.prototype.getClass=function(){return kr},Pr.serialVersionUID.get=function(){return-552860263173159e4},Pr.nameToTypeMap.get=function(){return new ua},Object.defineProperties(kr,Pr),ie.Type=kr,ie.FIXED=new kr("FIXED"),ie.FLOATING=new kr("FLOATING"),ie.FLOATING_SINGLE=new kr("FLOATING SINGLE");var ue=function n(){this._precisionModel=new ie,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?$(arguments[0],st)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof ie&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},dl={serialVersionUID:{configurable:!0}};ue.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new I(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new I(n.getMinX(),n.getMinY()),new I(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new I(n.getMinX(),n.getMinY()),new I(n.getMinX(),n.getMaxY()),new I(n.getMaxX(),n.getMaxY()),new I(n.getMaxX(),n.getMinY()),new I(n.getMinX(),n.getMinY())]),null)},ue.prototype.createLineString=function(n){return n?n instanceof Array?new zt(this.getCoordinateSequenceFactory().create(n),this):$(n,gt)?new zt(n,this):void 0:new zt(this.getCoordinateSequenceFactory().create([]),this)},ue.prototype.createMultiLineString=function(){if(arguments.length===0)return new W(null,this);if(arguments.length===1){var n=arguments[0];return new W(n,this)}},ue.prototype.buildGeometry=function(n){for(var i=null,s=!1,u=!1,c=n.iterator();c.hasNext();){var m=c.next(),E=m.getClass();i===null&&(i=E),E!==i&&(s=!0),m.isGeometryCollectionOrDerived()&&(u=!0)}if(i===null)return this.createGeometryCollection();if(s||u)return this.createGeometryCollection(ue.toGeometryArray(n));var A=n.iterator().next();if(n.size()>1){if(A instanceof Wt)return this.createMultiPolygon(ue.toPolygonArray(n));if(A instanceof zt)return this.createMultiLineString(ue.toLineStringArray(n));if(A instanceof Kt)return this.createMultiPoint(ue.toPointArray(n));Pt.shouldNeverReachHere("Unhandled class: "+A.getClass().getName())}return A},ue.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)},ue.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof I){var n=arguments[0];return this.createPoint(n!==null?this.getCoordinateSequenceFactory().create([n]):null)}if($(arguments[0],gt)){var i=arguments[0];return new Kt(i,this)}}},ue.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ue.prototype.createPolygon=function(){if(arguments.length===0)return new Wt(null,null,this);if(arguments.length===1){if($(arguments[0],gt)){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof an){var s=arguments[0];return this.createPolygon(s,null)}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];return new Wt(u,c,this)}},ue.prototype.getSRID=function(){return this._SRID},ue.prototype.createGeometryCollection=function(){if(arguments.length===0)return new gn(null,this);if(arguments.length===1){var n=arguments[0];return new gn(n,this)}},ue.prototype.createGeometry=function(n){return new bn(this).edit(n,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},ue.prototype.getPrecisionModel=function(){return this._precisionModel},ue.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(n!==null?this.getCoordinateSequenceFactory().create(n):null)}if($(arguments[0],gt)){var i=arguments[0];return new an(i,this)}}},ue.prototype.createMultiPolygon=function(){if(arguments.length===0)return new ln(null,this);if(arguments.length===1){var n=arguments[0];return new ln(n,this)}},ue.prototype.createMultiPoint=function(){if(arguments.length===0)return new he(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new he(n,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if($(arguments[0],gt)){var s=arguments[0];if(s===null)return this.createMultiPoint(new Array(0).fill(null));for(var u=new Array(s.size()).fill(null),c=0;c<s.size();c++){var m=this.getCoordinateSequenceFactory().create(1,s.getDimension());Nt.copy(s,c,m,0,1),u[c]=this.createPoint(m)}return this.createMultiPoint(u)}}},ue.prototype.interfaces_=function(){return[t]},ue.prototype.getClass=function(){return ue},ue.toMultiPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toGeometryArray=function(n){if(n===null)return null;var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.getDefaultCoordinateSequenceFactory=function(){return li.instance()},ue.toMultiLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toMultiPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toLinearRingArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.toPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},ue.createPointFromInternalCoord=function(n,i){return i.getPrecisionModel().makePrecise(n),i.getFactory().createPoint(n)},dl.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(ue,dl);var ml=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],gl=function(n){this.geometryFactory=n||new ue};gl.prototype.read=function(n){var i,s=(i=typeof n=="string"?JSON.parse(n):n).type;if(!Ci[s])throw new Error("Unknown GeoJSON type: "+i.type);return ml.indexOf(s)!==-1?Ci[s].apply(this,[i.coordinates]):s==="GeometryCollection"?Ci[s].apply(this,[i.geometries]):Ci[s].apply(this,[i])},gl.prototype.write=function(n){var i=n.getGeometryType();if(!uo[i])throw new Error("Geometry is not supported");return uo[i].apply(this,[n])};var Ci={Feature:function(n){var i={};for(var s in n)i[s]=n[s];if(n.geometry){var u=n.geometry.type;if(!Ci[u])throw new Error("Unknown GeoJSON type: "+n.type);i.geometry=this.read(n.geometry)}return n.bbox&&(i.bbox=Ci.bbox.apply(this,[n.bbox])),i},FeatureCollection:function(n){var i={};if(n.features){i.features=[];for(var s=0;s<n.features.length;++s)i.features.push(this.read(n.features[s]))}return n.bbox&&(i.bbox=this.parse.bbox.apply(this,[n.bbox])),i},coordinates:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(new I(u[0],u[1]))}return i},bbox:function(n){return this.geometryFactory.createLinearRing([new I(n[0],n[1]),new I(n[2],n[1]),new I(n[2],n[3]),new I(n[0],n[3]),new I(n[0],n[1])])},Point:function(n){var i=new I(n[0],n[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(n){for(var i=[],s=0;s<n.length;++s)i.push(Ci.Point.apply(this,[n[s]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var i=Ci.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(i)},MultiLineString:function(n){for(var i=[],s=0;s<n.length;++s)i.push(Ci.LineString.apply(this,[n[s]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var i=Ci.coordinates.apply(this,[n[0]]),s=this.geometryFactory.createLinearRing(i),u=[],c=1;c<n.length;++c){var m=n[c],E=Ci.coordinates.apply(this,[m]),A=this.geometryFactory.createLinearRing(E);u.push(A)}return this.geometryFactory.createPolygon(s,u)},MultiPolygon:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(Ci.Polygon.apply(this,[u]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(this.read(u))}return this.geometryFactory.createGeometryCollection(i)}},uo={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:uo.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=uo.Point.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var i=[],s=n.getCoordinates(),u=0;u<s.length;++u){var c=s[u];i.push(uo.coordinate.apply(this,[c]))}return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=uo.LineString.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=uo.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var u=0;u<n._holes.length;++u){var c=n._holes[u],m=uo.LineString.apply(this,[c]);i.push(m.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=uo.Polygon.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=u.getGeometryType();i.push(uo[c].apply(this,[u]))}return{type:"GeometryCollection",geometries:i}}},_h=function(n){this.geometryFactory=n||new ue,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new gl(this.geometryFactory)};_h.prototype.read=function(n){var i=this.parser.read(n);return this.precisionModel.getType()===ie.FIXED&&this.reducePrecision(i),i},_h.prototype.reducePrecision=function(n){var i,s;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(i=0,s=n.points.length;i<s;i++)this.precisionModel.makePrecise(n.points[i]);else if(n.geometries)for(i=0,s=n.geometries.length;i<s;i++)this.reducePrecision(n.geometries[i])};var Xd=function(){this.parser=new gl(this.geometryFactory)};Xd.prototype.write=function(n){return this.parser.write(n)};var bt=function(){},yl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt},bt.opposite=function(n){return n===bt.LEFT?bt.RIGHT:n===bt.RIGHT?bt.LEFT:n},yl.ON.get=function(){return 0},yl.LEFT.get=function(){return 1},yl.RIGHT.get=function(){return 2},Object.defineProperties(bt,yl),(T.prototype=new Error).name="EmptyStackException",(x.prototype=new tt).add=function(n){return this.array_.push(n),!0},x.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},x.prototype.push=function(n){return this.array_.push(n),n},x.prototype.pop=function(n){if(this.array_.length===0)throw new T;return this.array_.pop()},x.prototype.peek=function(){if(this.array_.length===0)throw new T;return this.array_[this.array_.length-1]},x.prototype.empty=function(){return this.array_.length===0},x.prototype.isEmpty=function(){return this.empty()},x.prototype.search=function(n){return this.array_.indexOf(n)},x.prototype.size=function(){return this.array_.length},x.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n};var Pi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Pi.prototype.getCoordinate=function(){return this._minCoord},Pi.prototype.getRightmostSide=function(n,i){var s=this.getRightmostSideOfSegment(n,i);return s<0&&(s=this.getRightmostSideOfSegment(n,i-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),s},Pi.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();Pt.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var i=n[this._minIndex-1],s=n[this._minIndex+1],u=J.computeOrientation(this._minCoord,s,i),c=!1;(i.y<this._minCoord.y&&s.y<this._minCoord.y&&u===J.COUNTERCLOCKWISE||i.y>this._minCoord.y&&s.y>this._minCoord.y&&u===J.CLOCKWISE)&&(c=!0),c&&(this._minIndex=this._minIndex-1)},Pi.prototype.getRightmostSideOfSegment=function(n,i){var s=n.getEdge().getCoordinates();if(i<0||i+1>=s.length||s[i].y===s[i+1].y)return-1;var u=bt.LEFT;return s[i].y<s[i+1].y&&(u=bt.RIGHT),u},Pi.prototype.getEdge=function(){return this._orientedDe},Pi.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)(this._minCoord===null||i[s].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=s,this._minCoord=i[s])},Pi.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Pi.prototype.findEdge=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();s.isForward()&&this.checkForRightmostCoordinate(s)}Pt.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)===bt.LEFT&&(this._orientedDe=this._minDe.getSym())},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var lo=function(n){function i(s,u){n.call(this,i.msgWithCoord(s,u)),this.pt=u?new I(u):null,this.name="TopologyException"}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getCoordinate=function(){return this.pt},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.msgWithCoord=function(s,u){return u?s:s+" [ "+u+" ]"},i}(pe),vl=function(){this.array_=[]};vl.prototype.addLast=function(n){this.array_.push(n)},vl.prototype.removeFirst=function(){return this.array_.shift()},vl.prototype.isEmpty=function(){return this.array_.length===0};var mr=function(){this._finder=null,this._dirEdgeList=new Z,this._nodes=new Z,this._rightMostCoord=null,this._env=null,this._finder=new Pi};mr.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},mr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},mr.prototype.computeNodeDepth=function(n){for(var i=null,s=n.getEdges().iterator();s.hasNext();){var u=s.next();if(u.isVisited()||u.getSym().isVisited()){i=u;break}}if(i===null)throw new lo("unable to find edge to compute depths at "+n.getCoordinate());n.getEdges().computeDepths(i);for(var c=n.getEdges().iterator();c.hasNext();){var m=c.next();m.setVisited(!0),this.copySymDepths(m)}},mr.prototype.computeDepth=function(n){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(bt.RIGHT,n),this.copySymDepths(i),this.computeDepths(i)},mr.prototype.create=function(n){this.addReachable(n),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},mr.prototype.findResultEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();){var i=n.next();i.getDepth(bt.RIGHT)>=1&&i.getDepth(bt.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},mr.prototype.computeDepths=function(n){var i=new tn,s=new vl,u=n.getNode();for(s.addLast(u),i.add(u),n.setVisited(!0);!s.isEmpty();){var c=s.removeFirst();i.add(c),this.computeNodeDepth(c);for(var m=c.getEdges().iterator();m.hasNext();){var E=m.next().getSym();if(!E.isVisited()){var A=E.getNode();i.contains(A)||(s.addLast(A),i.add(A))}}}},mr.prototype.compareTo=function(n){var i=n;return this._rightMostCoord.x<i._rightMostCoord.x?-1:this._rightMostCoord.x>i._rightMostCoord.x?1:0},mr.prototype.getEnvelope=function(){if(this._env===null){for(var n=new Ct,i=this._dirEdgeList.iterator();i.hasNext();)for(var s=i.next().getEdge().getCoordinates(),u=0;u<s.length-1;u++)n.expandToInclude(s[u]);this._env=n}return this._env},mr.prototype.addReachable=function(n){var i=new x;for(i.add(n);!i.empty();){var s=i.pop();this.add(s,i)}},mr.prototype.copySymDepths=function(n){var i=n.getSym();i.setDepth(bt.LEFT,n.getDepth(bt.RIGHT)),i.setDepth(bt.RIGHT,n.getDepth(bt.LEFT))},mr.prototype.add=function(n,i){n.setVisited(!0),this._nodes.add(n);for(var s=n.getEdges().iterator();s.hasNext();){var u=s.next();this._dirEdgeList.add(u);var c=u.getSym().getNode();c.isVisited()||i.push(c)}},mr.prototype.getNodes=function(){return this._nodes},mr.prototype.getDirectedEdges=function(){return this._dirEdgeList},mr.prototype.interfaces_=function(){return[N]},mr.prototype.getClass=function(){return mr};var dn=function n(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}else if(Number.isInteger(arguments[0])){var s=arguments[0];this.init(1),this.location[bt.ON]=s}else if(arguments[0]instanceof n){var u=arguments[0];if(this.init(u.location.length),u!==null)for(var c=0;c<this.location.length;c++)this.location[c]=u.location[c]}}else if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];this.init(3),this.location[bt.ON]=m,this.location[bt.LEFT]=E,this.location[bt.RIGHT]=A}};dn.prototype.setAllLocations=function(n){for(var i=0;i<this.location.length;i++)this.location[i]=n},dn.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==V.NONE)return!1;return!0},dn.prototype.setAllLocationsIfNull=function(n){for(var i=0;i<this.location.length;i++)this.location[i]===V.NONE&&(this.location[i]=n)},dn.prototype.isLine=function(){return this.location.length===1},dn.prototype.merge=function(n){if(n.location.length>this.location.length){var i=new Array(3).fill(null);i[bt.ON]=this.location[bt.ON],i[bt.LEFT]=V.NONE,i[bt.RIGHT]=V.NONE,this.location=i}for(var s=0;s<this.location.length;s++)this.location[s]===V.NONE&&s<n.location.length&&(this.location[s]=n.location[s])},dn.prototype.getLocations=function(){return this.location},dn.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[bt.LEFT];this.location[bt.LEFT]=this.location[bt.RIGHT],this.location[bt.RIGHT]=n},dn.prototype.toString=function(){var n=new mt;return this.location.length>1&&n.append(V.toLocationSymbol(this.location[bt.LEFT])),n.append(V.toLocationSymbol(this.location[bt.ON])),this.location.length>1&&n.append(V.toLocationSymbol(this.location[bt.RIGHT])),n.toString()},dn.prototype.setLocations=function(n,i,s){this.location[bt.ON]=n,this.location[bt.LEFT]=i,this.location[bt.RIGHT]=s},dn.prototype.get=function(n){return n<this.location.length?this.location[n]:V.NONE},dn.prototype.isArea=function(){return this.location.length>1},dn.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===V.NONE)return!0;return!1},dn.prototype.setLocation=function(){if(arguments.length===1){var n=arguments[0];this.setLocation(bt.ON,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.location[i]=s}},dn.prototype.init=function(n){this.location=new Array(n).fill(null),this.setAllLocations(V.NONE)},dn.prototype.isEqualOnSide=function(n,i){return this.location[i]===n.location[i]},dn.prototype.allPositionsEqual=function(n){for(var i=0;i<this.location.length;i++)if(this.location[i]!==n)return!1;return!0},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var on=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new dn(i),this.elt[1]=new dn(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.elt[0]=new dn(s.elt[0]),this.elt[1]=new dn(s.elt[1])}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];this.elt[0]=new dn(V.NONE),this.elt[1]=new dn(V.NONE),this.elt[u].setLocation(c)}else if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];this.elt[0]=new dn(m,E,A),this.elt[1]=new dn(m,E,A)}else if(arguments.length===4){var U=arguments[0],K=arguments[1],pt=arguments[2],dt=arguments[3];this.elt[0]=new dn(V.NONE,V.NONE,V.NONE),this.elt[1]=new dn(V.NONE,V.NONE,V.NONE),this.elt[U].setLocations(K,pt,dt)}};on.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},on.prototype.setAllLocations=function(n,i){this.elt[n].setAllLocations(i)},on.prototype.isNull=function(n){return this.elt[n].isNull()},on.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var n=arguments[0];this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.elt[i].setAllLocationsIfNull(s)}},on.prototype.isLine=function(n){return this.elt[n].isLine()},on.prototype.merge=function(n){for(var i=0;i<2;i++)this.elt[i]===null&&n.elt[i]!==null?this.elt[i]=new dn(n.elt[i]):this.elt[i].merge(n.elt[i])},on.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},on.prototype.getLocation=function(){if(arguments.length===1){var n=arguments[0];return this.elt[n].get(bt.ON)}if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.elt[i].get(s)}},on.prototype.toString=function(){var n=new mt;return this.elt[0]!==null&&(n.append("A:"),n.append(this.elt[0].toString())),this.elt[1]!==null&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()},on.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var n=arguments[0];return this.elt[n].isArea()}},on.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()},on.prototype.setLocation=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[n].setLocation(bt.ON,i)}else if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2];this.elt[s].setLocation(u,c)}},on.prototype.isEqualOnSide=function(n,i){return this.elt[0].isEqualOnSide(n.elt[0],i)&&this.elt[1].isEqualOnSide(n.elt[1],i)},on.prototype.allPositionsEqual=function(n,i){return this.elt[n].allPositionsEqual(i)},on.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new dn(this.elt[n].location[0]))},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},on.toLineLabel=function(n){for(var i=new on(V.NONE),s=0;s<2;s++)i.setLocation(s,n.getLocation(s));return i};var Un=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Z,this._pts=new Z,this._label=new on(V.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Z,this._geometryFactory=null;var n=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(n),this.computeRing()};Un.prototype.computeRing=function(){if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)n[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=J.isCCW(this._ring.getCoordinates())},Un.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Un.prototype.computePoints=function(n){this._startDe=n;var i=n,s=!0;do{if(i===null)throw new lo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new lo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var u=i.getLabel();Pt.isTrue(u.isArea()),this.mergeLabel(u),this.addPoints(i.getEdge(),i.isForward(),s),s=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},Un.prototype.getLinearRing=function(){return this._ring},Un.prototype.getCoordinate=function(n){return this._pts.get(n)},Un.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var n=this._startDe;do{var i=n.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),n=this.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2},Un.prototype.addPoints=function(n,i,s){var u=n.getCoordinates();if(i){var c=1;s&&(c=0);for(var m=c;m<u.length;m++)this._pts.add(u[m])}else{var E=u.length-2;s&&(E=u.length-1);for(var A=E;A>=0;A--)this._pts.add(u[A])}},Un.prototype.isHole=function(){return this._isHole},Un.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)},Un.prototype.containsPoint=function(n){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(n)||!J.isPointInRing(n,i.getCoordinates()))return!1;for(var s=this._holes.iterator();s.hasNext();)if(s.next().containsPoint(n))return!1;return!0},Un.prototype.addHole=function(n){this._holes.add(n)},Un.prototype.isShell=function(){return this._shell===null},Un.prototype.getLabel=function(){return this._label},Un.prototype.getEdges=function(){return this._edges},Un.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Un.prototype.getShell=function(){return this._shell},Un.prototype.mergeLabel=function(){if(arguments.length===1){var n=arguments[0];this.mergeLabel(n,0),this.mergeLabel(n,1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1],u=i.getLocation(s,bt.RIGHT);if(u===V.NONE)return null;if(this._label.getLocation(s)===V.NONE)return this._label.setLocation(s,u),null}},Un.prototype.setShell=function(n){this._shell=n,n!==null&&n.addHole(this)},Un.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),s=0;s<this._holes.size();s++)i[s]=this._holes.get(s).getLinearRing();return n.createPolygon(this.getLinearRing(),i)},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var G1=function(n){function i(){var s=arguments[0],u=arguments[1];n.call(this,s,u)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(s,u){s.setMinEdgeRing(u)},i.prototype.getNext=function(s){return s.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Un),V1=function(n){function i(){var s=arguments[0],u=arguments[1];n.call(this,s,u)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var s=new Z,u=this._startDe;do{if(u.getMinEdgeRing()===null){var c=new G1(u,this._geometryFactory);s.add(c)}u=u.getNext()}while(u!==this._startDe);return s},i.prototype.setEdgeRing=function(s,u){s.setEdgeRing(u)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var s=this._startDe;do s.getNode().getEdges().linkMinimalDirectedEdges(this),s=s.getNext();while(s!==this._startDe)},i.prototype.getNext=function(s){return s.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Un),Jr=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 n=arguments[0];this._label=n}}};Jr.prototype.setVisited=function(n){this._isVisited=n},Jr.prototype.setInResult=function(n){this._isInResult=n},Jr.prototype.isCovered=function(){return this._isCovered},Jr.prototype.isCoveredSet=function(){return this._isCoveredSet},Jr.prototype.setLabel=function(n){this._label=n},Jr.prototype.getLabel=function(){return this._label},Jr.prototype.setCovered=function(n){this._isCovered=n,this._isCoveredSet=!0},Jr.prototype.updateIM=function(n){Pt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(n)},Jr.prototype.isInResult=function(){return this._isInResult},Jr.prototype.isVisited=function(){return this._isVisited},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr};var _l=function(n){function i(){n.call(this),this._coord=null,this._edges=null;var s=arguments[0],u=arguments[1];this._coord=s,this._edges=u,this._label=new on(0,V.NONE)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var s=this.getEdges().getEdges().iterator();s.hasNext();)if(s.next().getEdge().isInResult())return!0;return!1},i.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},i.prototype.getCoordinate=function(){return this._coord},i.prototype.print=function(s){s.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(s){},i.prototype.computeMergedLocation=function(s,u){var c=V.NONE;if(c=this._label.getLocation(u),!s.isNull(u)){var m=s.getLocation(u);c!==V.BOUNDARY&&(c=m)}return c},i.prototype.setLabel=function(){if(arguments.length!==2)return n.prototype.setLabel.apply(this,arguments);var s=arguments[0],u=arguments[1];this._label===null?this._label=new on(s,u):this._label.setLocation(s,u)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var s=arguments[0];this.mergeLabel(s._label)}else if(arguments[0]instanceof on)for(var u=arguments[0],c=0;c<2;c++){var m=this.computeMergedLocation(u,c);this._label.getLocation(c)===V.NONE&&this._label.setLocation(c,m)}},i.prototype.add=function(s){this._edges.insert(s),s.setNode(this)},i.prototype.setLabelBoundary=function(s){if(this._label===null)return null;var u=V.NONE;this._label!==null&&(u=this._label.getLocation(s));var c=null;switch(u){case V.BOUNDARY:c=V.INTERIOR;break;case V.INTERIOR:default:c=V.BOUNDARY}this._label.setLocation(s,c)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Jr),Ii=function(){this.nodeMap=new _,this.nodeFact=null;var n=arguments[0];this.nodeFact=n};Ii.prototype.find=function(n){return this.nodeMap.get(n)},Ii.prototype.addNode=function(){if(arguments[0]instanceof I){var n=arguments[0],i=this.nodeMap.get(n);return i===null&&(i=this.nodeFact.createNode(n),this.nodeMap.put(n,i)),i}if(arguments[0]instanceof _l){var s=arguments[0],u=this.nodeMap.get(s.getCoordinate());return u===null?(this.nodeMap.put(s.getCoordinate(),s),s):(u.mergeLabel(s),u)}},Ii.prototype.print=function(n){for(var i=this.iterator();i.hasNext();)i.next().print(n)},Ii.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ii.prototype.values=function(){return this.nodeMap.values()},Ii.prototype.getBoundaryNodes=function(n){for(var i=new Z,s=this.iterator();s.hasNext();){var u=s.next();u.getLabel().getLocation(n)===V.BOUNDARY&&i.add(u)}return i},Ii.prototype.add=function(n){var i=n.getCoordinate();this.addNode(i).add(n)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var cn=function(){},_u={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},cn.isNorthern=function(n){return n===cn.NE||n===cn.NW},cn.isOpposite=function(n,i){return n===i?!1:(n-i+4)%4===2},cn.commonHalfPlane=function(n,i){if(n===i)return n;if((n-i+4)%4===2)return-1;var s=n<i?n:i;return s===0&&(n>i?n:i)===3?3:s},cn.isInHalfPlane=function(n,i){return i===cn.SE?n===cn.SE||n===cn.SW:n===i||n===i+1},cn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new P("Cannot compute the quadrant for point ( "+n+", "+i+" )");return n>=0?i>=0?cn.NE:cn.SE:i>=0?cn.NW:cn.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var s=arguments[0],u=arguments[1];if(u.x===s.x&&u.y===s.y)throw new P("Cannot compute the quadrant for two identical points "+s);return u.x>=s.x?u.y>=s.y?cn.NE:cn.SE:u.y>=s.y?cn.NW:cn.SW}},_u.NE.get=function(){return 0},_u.NW.get=function(){return 1},_u.SW.get=function(){return 2},_u.SE.get=function(){return 3},Object.defineProperties(cn,_u);var sr=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 n=arguments[0];this._edge=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],u=arguments[2];this._edge=i,this.init(s,u),this._label=null}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];this._edge=c,this.init(m,E),this._label=A}};sr.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:J.computeOrientation(n._p0,n._p1,this._p1)},sr.prototype.getDy=function(){return this._dy},sr.prototype.getCoordinate=function(){return this._p0},sr.prototype.setNode=function(n){this._node=n},sr.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),u=s.lastIndexOf("."),c=s.substring(u+1);n.print(" "+c+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},sr.prototype.compareTo=function(n){var i=n;return this.compareDirection(i)},sr.prototype.getDirectedCoordinate=function(){return this._p1},sr.prototype.getDx=function(){return this._dx},sr.prototype.getLabel=function(){return this._label},sr.prototype.getEdge=function(){return this._edge},sr.prototype.getQuadrant=function(){return this._quadrant},sr.prototype.getNode=function(){return this._node},sr.prototype.toString=function(){var n=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf(".");return" "+i.substring(s+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label},sr.prototype.computeLabel=function(n){},sr.prototype.init=function(n,i){this._p0=n,this._p1=i,this._dx=i.x-n.x,this._dy=i.y-n.y,this._quadrant=cn.quadrant(this._dx,this._dy),Pt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},sr.prototype.interfaces_=function(){return[N]},sr.prototype.getClass=function(){return sr};var xh=function(n){function i(){var s=arguments[0],u=arguments[1];if(n.call(this,s),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=u,u)this.init(s.getCoordinate(0),s.getCoordinate(1));else{var c=s.getNumPoints()-1;this.init(s.getCoordinate(c),s.getCoordinate(c-1))}this.computeDirectedLabel()}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(s){return this._depth[s]},i.prototype.setVisited=function(s){this._isVisited=s},i.prototype.computeDirectedLabel=function(){this._label=new on(this._edge.getLabel()),this._isForward||this._label.flip()},i.prototype.getNext=function(){return this._next},i.prototype.setDepth=function(s,u){if(this._depth[s]!==-999&&this._depth[s]!==u)throw new lo("assigned depths do not match",this.getCoordinate());this._depth[s]=u},i.prototype.isInteriorAreaEdge=function(){for(var s=!0,u=0;u<2;u++)this._label.isArea(u)&&this._label.getLocation(u,bt.LEFT)===V.INTERIOR&&this._label.getLocation(u,bt.RIGHT)===V.INTERIOR||(s=!1);return s},i.prototype.setNextMin=function(s){this._nextMin=s},i.prototype.print=function(s){n.prototype.print.call(this,s),s.print(" "+this._depth[bt.LEFT]+"/"+this._depth[bt.RIGHT]),s.print(" ("+this.getDepthDelta()+")"),this._isInResult&&s.print(" inResult")},i.prototype.setMinEdgeRing=function(s){this._minEdgeRing=s},i.prototype.isLineEdge=function(){var s=this._label.isLine(0)||this._label.isLine(1),u=!this._label.isArea(0)||this._label.allPositionsEqual(0,V.EXTERIOR),c=!this._label.isArea(1)||this._label.allPositionsEqual(1,V.EXTERIOR);return s&&u&&c},i.prototype.setEdgeRing=function(s){this._edgeRing=s},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var s=this._edge.getDepthDelta();return this._isForward||(s=-s),s},i.prototype.setInResult=function(s){this._isInResult=s},i.prototype.getSym=function(){return this._sym},i.prototype.isForward=function(){return this._isForward},i.prototype.getEdge=function(){return this._edge},i.prototype.printEdge=function(s){this.print(s),s.print(" "),this._isForward?this._edge.print(s):this._edge.printReverse(s)},i.prototype.setSym=function(s){this._sym=s},i.prototype.setVisitedEdge=function(s){this.setVisited(s),this._sym.setVisited(s)},i.prototype.setEdgeDepths=function(s,u){var c=this.getEdge().getDepthDelta();this._isForward||(c=-c);var m=1;s===bt.LEFT&&(m=-1);var E=bt.opposite(s),A=u+c*m;this.setDepth(s,u),this.setDepth(E,A)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(s){this._next=s},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(s,u){return s===V.EXTERIOR&&u===V.INTERIOR?1:s===V.INTERIOR&&u===V.EXTERIOR?-1:0},i}(sr),la=function(){};la.prototype.createNode=function(n){return new _l(n,null)},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var Tn=function(){if(this._edges=new Z,this._nodes=null,this._edgeEndList=new Z,arguments.length===0)this._nodes=new Ii(new la);else if(arguments.length===1){var n=arguments[0];this._nodes=new Ii(n)}};Tn.prototype.printEdges=function(n){n.println("Edges:");for(var i=0;i<this._edges.size();i++){n.println("edge "+i+":");var s=this._edges.get(i);s.print(n),s.eiList.print(n)}},Tn.prototype.find=function(n){return this._nodes.find(n)},Tn.prototype.addNode=function(){if(arguments[0]instanceof _l){var n=arguments[0];return this._nodes.addNode(n)}if(arguments[0]instanceof I){var i=arguments[0];return this._nodes.addNode(i)}},Tn.prototype.getNodeIterator=function(){return this._nodes.iterator()},Tn.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},Tn.prototype.debugPrintln=function(n){Ft.out.println(n)},Tn.prototype.isBoundaryNode=function(n,i){var s=this._nodes.find(i);if(s===null)return!1;var u=s.getLabel();return u!==null&&u.getLocation(n)===V.BOUNDARY},Tn.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},Tn.prototype.matchInSameDirection=function(n,i,s,u){return!!n.equals(s)&&J.computeOrientation(n,i,u)===J.COLLINEAR&&cn.quadrant(n,i)===cn.quadrant(s,u)},Tn.prototype.getEdgeEnds=function(){return this._edgeEndList},Tn.prototype.debugPrint=function(n){Ft.out.print(n)},Tn.prototype.getEdgeIterator=function(){return this._edges.iterator()},Tn.prototype.findEdgeInSameDirection=function(n,i){for(var s=0;s<this._edges.size();s++){var u=this._edges.get(s),c=u.getCoordinates();if(this.matchInSameDirection(n,i,c[0],c[1])||this.matchInSameDirection(n,i,c[c.length-1],c[c.length-2]))return u}return null},Tn.prototype.insertEdge=function(n){this._edges.add(n)},Tn.prototype.findEdgeEnd=function(n){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var s=i.next();if(s.getEdge()===n)return s}return null},Tn.prototype.addEdges=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();this._edges.add(s);var u=new xh(s,!0),c=new xh(s,!1);u.setSym(c),c.setSym(u),this.add(u),this.add(c)}},Tn.prototype.add=function(n){this._nodes.add(n),this._edgeEndList.add(n)},Tn.prototype.getNodes=function(){return this._nodes.values()},Tn.prototype.findEdge=function(n,i){for(var s=0;s<this._edges.size();s++){var u=this._edges.get(s),c=u.getCoordinates();if(n.equals(c[0])&&i.equals(c[1]))return u}return null},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.linkResultDirectedEdges=function(n){for(var i=n.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Gr=function(){this._geometryFactory=null,this._shellList=new Z;var n=arguments[0];this._geometryFactory=n};Gr.prototype.sortShellsAndHoles=function(n,i,s){for(var u=n.iterator();u.hasNext();){var c=u.next();c.isHole()?s.add(c):i.add(c)}},Gr.prototype.computePolygons=function(n){for(var i=new Z,s=n.iterator();s.hasNext();){var u=s.next().toPolygon(this._geometryFactory);i.add(u)}return i},Gr.prototype.placeFreeHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var u=s.next();if(u.getShell()===null){var c=this.findEdgeRingContaining(u,n);if(c===null)throw new lo("unable to assign hole to a shell",u.getCoordinate(0));u.setShell(c)}}},Gr.prototype.buildMinimalEdgeRings=function(n,i,s){for(var u=new Z,c=n.iterator();c.hasNext();){var m=c.next();if(m.getMaxNodeDegree()>2){m.linkDirectedEdgesForMinimalEdgeRings();var E=m.buildMinimalRings(),A=this.findShell(E);A!==null?(this.placePolygonHoles(A,E),i.add(A)):s.addAll(E)}else u.add(m)}return u},Gr.prototype.containsPoint=function(n){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(n))return!0;return!1},Gr.prototype.buildMaximalEdgeRings=function(n){for(var i=new Z,s=n.iterator();s.hasNext();){var u=s.next();if(u.isInResult()&&u.getLabel().isArea()&&u.getEdgeRing()===null){var c=new V1(u,this._geometryFactory);i.add(c),c.setInResult()}}return i},Gr.prototype.placePolygonHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var u=s.next();u.isHole()&&u.setShell(n)}},Gr.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Gr.prototype.findEdgeRingContaining=function(n,i){for(var s=n.getLinearRing(),u=s.getEnvelopeInternal(),c=s.getCoordinateN(0),m=null,E=null,A=i.iterator();A.hasNext();){var U=A.next(),K=U.getLinearRing(),pt=K.getEnvelopeInternal();m!==null&&(E=m.getLinearRing().getEnvelopeInternal());var dt=!1;pt.contains(u)&&J.isPointInRing(c,K.getCoordinates())&&(dt=!0),dt&&(m===null||E.contains(pt))&&(m=U)}return m},Gr.prototype.findShell=function(n){for(var i=0,s=null,u=n.iterator();u.hasNext();){var c=u.next();c.isHole()||(s=c,i++)}return Pt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),s},Gr.prototype.add=function(){if(arguments.length===1){var n=arguments[0];this.add(n.getEdgeEnds(),n.getNodes())}else if(arguments.length===2){var i=arguments[0],s=arguments[1];Tn.linkResultDirectedEdges(s);var u=this.buildMaximalEdgeRings(i),c=new Z,m=this.buildMinimalEdgeRings(u,this._shellList,c);this.sortShellsAndHoles(m,this._shellList,c),this.placeFreeHoles(this._shellList,c)}},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr};var ca=function(){};ca.prototype.getBounds=function(){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var vi=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};vi.prototype.getItem=function(){return this._item},vi.prototype.getBounds=function(){return this._bounds},vi.prototype.interfaces_=function(){return[ca,t]},vi.prototype.getClass=function(){return vi};var co=function(){this._size=null,this._items=null,this._size=0,this._items=new Z,this._items.add(null)};co.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n},co.prototype.size=function(){return this._size},co.prototype.reorder=function(n){for(var i=null,s=this._items.get(n);2*n<=this._size&&((i=2*n)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(s)<0);n=i)this._items.set(n,this._items.get(i));this._items.set(n,s)},co.prototype.clear=function(){this._size=0,this._items.clear()},co.prototype.isEmpty=function(){return this._size===0},co.prototype.add=function(n){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)this._items.set(i,this._items.get(Math.trunc(i/2)));this._items.set(i,n)},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var Ao=function(){};Ao.prototype.visitItem=function(n){},Ao.prototype.interfaces_=function(){return[]},Ao.prototype.getClass=function(){return Ao};var Ps=function(){};Ps.prototype.insert=function(n,i){},Ps.prototype.remove=function(n,i){},Ps.prototype.query=function(){},Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps};var Hn=function(){if(this._childBoundables=new Z,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._level=n}}},Yd={serialVersionUID:{configurable:!0}};Hn.prototype.getLevel=function(){return this._level},Hn.prototype.size=function(){return this._childBoundables.size()},Hn.prototype.getChildBoundables=function(){return this._childBoundables},Hn.prototype.addChildBoundable=function(n){Pt.isTrue(this._bounds===null),this._childBoundables.add(n)},Hn.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Hn.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Hn.prototype.interfaces_=function(){return[ca,t]},Hn.prototype.getClass=function(){return Hn},Yd.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Hn,Yd);var _i=function(){};_i.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},_i.min=function(n){return _i.sort(n),n.get(0)},_i.sort=function(n,i){var s=n.toArray();i?xn.sort(s,i):xn.sort(s);for(var u=n.iterator(),c=0,m=s.length;c<m;c++)u.next(),u.set(s[c])},_i.singletonList=function(n){var i=new Z;return i.add(n),i};var Bn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._boundable1=n,this._boundable2=i,this._itemDistance=s,this._distance=this.distance()};Bn.prototype.expandToQueue=function(n,i){var s=Bn.isComposite(this._boundable1),u=Bn.isComposite(this._boundable2);if(s&&u)return Bn.area(this._boundable1)>Bn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,i),null):(this.expand(this._boundable2,this._boundable1,n,i),null);if(s)return this.expand(this._boundable1,this._boundable2,n,i),null;if(u)return this.expand(this._boundable2,this._boundable1,n,i),null;throw new P("neither boundable is composite")},Bn.prototype.isLeaves=function(){return!(Bn.isComposite(this._boundable1)||Bn.isComposite(this._boundable2))},Bn.prototype.compareTo=function(n){var i=n;return this._distance<i._distance?-1:this._distance>i._distance?1:0},Bn.prototype.expand=function(n,i,s,u){for(var c=n.getChildBoundables().iterator();c.hasNext();){var m=c.next(),E=new Bn(m,i,this._itemDistance);E.getDistance()<u&&s.add(E)}},Bn.prototype.getBoundable=function(n){return n===0?this._boundable1:this._boundable2},Bn.prototype.getDistance=function(){return this._distance},Bn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Bn.prototype.interfaces_=function(){return[N]},Bn.prototype.getClass=function(){return Bn},Bn.area=function(n){return n.getBounds().getArea()},Bn.isComposite=function(n){return n instanceof Hn};var Jn=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new Z,this._nodeCapacity=null,arguments.length===0){var i=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var s=arguments[0];Pt.isTrue(s>1,"Node capacity must be greater than 1"),this._nodeCapacity=s}},xl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Jn.prototype.getNodeCapacity=function(){return this._nodeCapacity},Jn.prototype.lastNode=function(n){return n.get(n.size()-1)},Jn.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Hn?n+=this.size(s):s instanceof vi&&(n+=1)}return n}},Jn.prototype.removeItem=function(n,i){for(var s=null,u=n.getChildBoundables().iterator();u.hasNext();){var c=u.next();c instanceof vi&&c.getItem()===i&&(s=c)}return s!==null&&(n.getChildBoundables().remove(s),!0)},Jn.prototype.itemsTree=function(){if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new Z:n}if(arguments.length===1){for(var i=arguments[0],s=new Z,u=i.getChildBoundables().iterator();u.hasNext();){var c=u.next();if(c instanceof Hn){var m=this.itemsTree(c);m!==null&&s.add(m)}else c instanceof vi?s.add(c.getItem()):Pt.shouldNeverReachHere()}return s.size()<=0?null:s}},Jn.prototype.insert=function(n,i){Pt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new vi(n,i))},Jn.prototype.boundablesAtLevel=function(){if(arguments.length===1){var n=arguments[0],i=new Z;return this.boundablesAtLevel(n,this._root,i),i}if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2];if(Pt.isTrue(s>-2),u.getLevel()===s)return c.add(u),null;for(var m=u.getChildBoundables().iterator();m.hasNext();){var E=m.next();E instanceof Hn?this.boundablesAtLevel(s,E,c):(Pt.isTrue(E instanceof vi),s===-1&&c.add(E))}return null}},Jn.prototype.query=function(){if(arguments.length===1){var n=arguments[0];this.build();var i=new Z;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i),i}if(arguments.length===2){var s=arguments[0],u=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,u)}else if(arguments.length===3){if($(arguments[2],Ao)&&arguments[0]instanceof Object&&arguments[1]instanceof Hn)for(var c=arguments[0],m=arguments[1],E=arguments[2],A=m.getChildBoundables(),U=0;U<A.size();U++){var K=A.get(U);this.getIntersectsOp().intersects(K.getBounds(),c)&&(K instanceof Hn?this.query(c,K,E):K instanceof vi?E.visitItem(K.getItem()):Pt.shouldNeverReachHere())}else if($(arguments[2],tt)&&arguments[0]instanceof Object&&arguments[1]instanceof Hn)for(var pt=arguments[0],dt=arguments[1],Rt=arguments[2],Ot=dt.getChildBoundables(),Vt=0;Vt<Ot.size();Vt++){var jt=Ot.get(Vt);this.getIntersectsOp().intersects(jt.getBounds(),pt)&&(jt instanceof Hn?this.query(pt,jt,Rt):jt instanceof vi?Rt.add(jt.getItem()):Pt.shouldNeverReachHere())}}},Jn.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Jn.prototype.getRoot=function(){return this.build(),this._root},Jn.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.remove(n,this._root,i)}if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2],m=this.removeItem(u,c);if(m)return!0;for(var E=null,A=u.getChildBoundables().iterator();A.hasNext();){var U=A.next();if(this.getIntersectsOp().intersects(U.getBounds(),s)&&U instanceof Hn&&(m=this.remove(s,U,c))){E=U;break}}return E!==null&&E.getChildBoundables().isEmpty()&&u.getChildBoundables().remove(E),m}},Jn.prototype.createHigherLevels=function(n,i){Pt.isTrue(!n.isEmpty());var s=this.createParentBoundables(n,i+1);return s.size()===1?s.get(0):this.createHigherLevels(s,i+1)},Jn.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Hn){var u=this.depth(s);u>n&&(n=u)}}return n+1}},Jn.prototype.createParentBoundables=function(n,i){Pt.isTrue(!n.isEmpty());var s=new Z;s.add(this.createNode(i));var u=new Z(n);_i.sort(u,this.getComparator());for(var c=u.iterator();c.hasNext();){var m=c.next();this.lastNode(s).getChildBoundables().size()===this.getNodeCapacity()&&s.add(this.createNode(i)),this.lastNode(s).addChildBoundable(m)}return s},Jn.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Jn.prototype.interfaces_=function(){return[t]},Jn.prototype.getClass=function(){return Jn},Jn.compareDoubles=function(n,i){return n>i?1:n<i?-1:0},xl.IntersectsOp.get=function(){return H1},xl.serialVersionUID.get=function(){return-3886435814360241e3},xl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Jn,xl);var H1=function(){},ha=function(){};ha.prototype.distance=function(n,i){},ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha};var $d=function(n){function i(u){u=u||i.DEFAULT_NODE_CAPACITY,n.call(this,u)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(u,c){Pt.isTrue(u.length>0);for(var m=new Z,E=0;E<u.length;E++)m.addAll(this.createParentBoundablesFromVerticalSlice(u[E],c));return m},i.prototype.createNode=function(u){return new Zd(u)},i.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return n.prototype.insert.apply(this,arguments);var u=arguments[0],c=arguments[1];if(u.isNull())return null;n.prototype.insert.call(this,u,c)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(u,c){for(var m=Math.trunc(Math.ceil(u.size()/c)),E=new Array(c).fill(null),A=u.iterator(),U=0;U<c;U++){E[U]=new Z;for(var K=0;A.hasNext()&&K<m;){var pt=A.next();E[U].add(pt),K++}}return E},i.prototype.query=function(){if(arguments.length===1){var u=arguments[0];return n.prototype.query.call(this,u)}if(arguments.length===2){var c=arguments[0],m=arguments[1];n.prototype.query.call(this,c,m)}else if(arguments.length===3){if($(arguments[2],Ao)&&arguments[0]instanceof Object&&arguments[1]instanceof Hn){var E=arguments[0],A=arguments[1],U=arguments[2];n.prototype.query.call(this,E,A,U)}else if($(arguments[2],tt)&&arguments[0]instanceof Object&&arguments[1]instanceof Hn){var K=arguments[0],pt=arguments[1],dt=arguments[2];n.prototype.query.call(this,K,pt,dt)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(u,c){return n.prototype.createParentBoundables.call(this,u,c)},i.prototype.remove=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return n.prototype.remove.call(this,u,c)}return n.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(u,c){Pt.isTrue(!u.isEmpty());var m=Math.trunc(Math.ceil(u.size()/this.getNodeCapacity())),E=new Z(u);_i.sort(E,i.xComparator);var A=this.verticalSlices(E,Math.trunc(Math.ceil(Math.sqrt(m))));return this.createParentBoundablesFromVerticalSlices(A,c)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if($(arguments[0],ha)){var u=arguments[0],c=new Bn(this.getRoot(),this.getRoot(),u);return this.nearestNeighbour(c)}if(arguments[0]instanceof Bn){var m=arguments[0];return this.nearestNeighbour(m,S.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&$(arguments[1],ha)){var E=arguments[0],A=arguments[1],U=new Bn(this.getRoot(),E.getRoot(),A);return this.nearestNeighbour(U)}if(arguments[0]instanceof Bn&&typeof arguments[1]=="number"){var K=arguments[0],pt=arguments[1],dt=null,Rt=new co;for(Rt.add(K);!Rt.isEmpty()&&pt>0;){var Ot=Rt.poll(),Vt=Ot.getDistance();if(Vt>=pt)break;Ot.isLeaves()?(pt=Vt,dt=Ot):Ot.expandToQueue(Rt,pt)}return[dt.getBoundable(0).getItem(),dt.getBoundable(1).getItem()]}}else if(arguments.length===3){var jt=arguments[0],sn=arguments[1],kn=arguments[2],Mr=new vi(jt,sn),Ki=new Bn(this.getRoot(),Mr,kn);return this.nearestNeighbour(Ki)[0]}},i.prototype.interfaces_=function(){return[Ps,t]},i.prototype.getClass=function(){return i},i.centreX=function(u){return i.avg(u.getMinX(),u.getMaxX())},i.avg=function(u,c){return(u+c)/2},i.centreY=function(u){return i.avg(u.getMinY(),u.getMaxY())},s.STRtreeNode.get=function(){return Zd},s.serialVersionUID.get=function(){return 0x39920f7d5f261e0},s.xComparator.get=function(){return{interfaces_:function(){return[B]},compare:function(u,c){return n.compareDoubles(i.centreX(u.getBounds()),i.centreX(c.getBounds()))}}},s.yComparator.get=function(){return{interfaces_:function(){return[B]},compare:function(u,c){return n.compareDoubles(i.centreY(u.getBounds()),i.centreY(c.getBounds()))}}},s.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(u,c){return u.intersects(c)}}},s.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,s),i}(Jn),Zd=function(n){function i(){var s=arguments[0];n.call(this,s)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var s=null,u=this.getChildBoundables().iterator();u.hasNext();){var c=u.next();s===null?s=new Ct(c.getBounds()):s.expandToInclude(c.getBounds())}return s},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Hn),Ir=function(){};Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},Ir.relativeSign=function(n,i){return n<i?-1:n>i?1:0},Ir.compare=function(n,i,s){if(i.equals2D(s))return 0;var u=Ir.relativeSign(i.x,s.x),c=Ir.relativeSign(i.y,s.y);switch(n){case 0:return Ir.compareValue(u,c);case 1:return Ir.compareValue(c,u);case 2:return Ir.compareValue(c,-u);case 3:return Ir.compareValue(-u,c);case 4:return Ir.compareValue(-u,-c);case 5:return Ir.compareValue(-c,-u);case 6:return Ir.compareValue(-c,u);case 7:return Ir.compareValue(u,-c)}return Pt.shouldNeverReachHere("invalid octant value"),0},Ir.compareValue=function(n,i){return n<0?-1:n>0?1:i<0?-1:i>0?1:0};var Co=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];this._segString=n,this.coord=new I(i),this.segmentIndex=s,this._segmentOctant=u,this._isInterior=!i.equals2D(n.getCoordinate(s))};Co.prototype.getCoordinate=function(){return this.coord},Co.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},Co.prototype.compareTo=function(n){var i=n;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:Ir.compare(this._segmentOctant,this.coord,i.coord)},Co.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},Co.prototype.isInterior=function(){return this._isInterior},Co.prototype.interfaces_=function(){return[N]},Co.prototype.getClass=function(){return Co};var gr=function(){this._nodeMap=new _,this._edge=null;var n=arguments[0];this._edge=n};gr.prototype.getSplitCoordinates=function(){var n=new ot;this.addEndpoints();for(var i=this.iterator(),s=i.next();i.hasNext();){var u=i.next();this.addEdgeCoordinates(s,u,n),s=u}return n.toCoordinateArray()},gr.prototype.addCollapsedNodes=function(){var n=new Z;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var i=n.iterator();i.hasNext();){var s=i.next().intValue();this.add(this._edge.getCoordinate(s),s)}},gr.prototype.print=function(n){n.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(n)},gr.prototype.findCollapsesFromExistingVertices=function(n){for(var i=0;i<this._edge.size()-2;i++){var s=this._edge.getCoordinate(i),u=this._edge.getCoordinate(i+2);s.equals2D(u)&&n.add(new lt(i+1))}},gr.prototype.addEdgeCoordinates=function(n,i,s){var u=this._edge.getCoordinate(i.segmentIndex),c=i.isInterior()||!i.coord.equals2D(u);s.add(new I(n.coord),!1);for(var m=n.segmentIndex+1;m<=i.segmentIndex;m++)s.add(this._edge.getCoordinate(m));c&&s.add(new I(i.coord))},gr.prototype.iterator=function(){return this._nodeMap.values().iterator()},gr.prototype.addSplitEdges=function(n){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),s=i.next();i.hasNext();){var u=i.next(),c=this.createSplitEdge(s,u);n.add(c),s=u}},gr.prototype.findCollapseIndex=function(n,i,s){if(!n.coord.equals2D(i.coord))return!1;var u=i.segmentIndex-n.segmentIndex;return i.isInterior()||u--,u===1&&(s[0]=n.segmentIndex+1,!0)},gr.prototype.findCollapsesFromInsertedNodes=function(n){for(var i=new Array(1).fill(null),s=this.iterator(),u=s.next();s.hasNext();){var c=s.next();this.findCollapseIndex(u,c,i)&&n.add(new lt(i[0])),u=c}},gr.prototype.getEdge=function(){return this._edge},gr.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(n),n)},gr.prototype.createSplitEdge=function(n,i){var s=i.segmentIndex-n.segmentIndex+2,u=this._edge.getCoordinate(i.segmentIndex),c=i.isInterior()||!i.coord.equals2D(u);c||s--;var m=new Array(s).fill(null),E=0;m[E++]=new I(n.coord);for(var A=n.segmentIndex+1;A<=i.segmentIndex;A++)m[E++]=this._edge.getCoordinate(A);return c&&(m[E]=new I(i.coord)),new Nn(m,this._edge.getData())},gr.prototype.add=function(n,i){var s=new Co(this._edge,n,i,this._edge.getSegmentOctant(i)),u=this._nodeMap.get(s);return u!==null?(Pt.isTrue(u.coord.equals2D(n),"Found equal nodes with different coordinates"),u):(this._nodeMap.put(s,s),s)},gr.prototype.checkSplitEdgesCorrectness=function(n){var i=this._edge.getCoordinates(),s=n.get(0).getCoordinate(0);if(!s.equals2D(i[0]))throw new pe("bad split edge start point at "+s);var u=n.get(n.size()-1).getCoordinates(),c=u[u.length-1];if(!c.equals2D(i[i.length-1]))throw new pe("bad split edge end point at "+c)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Is=function(){};Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is},Is.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new P("Cannot compute the octant for point ( "+n+", "+i+" )");var s=Math.abs(n),u=Math.abs(i);return n>=0?i>=0?s>=u?0:1:s>=u?7:6:i>=0?s>=u?3:2:s>=u?4:5}if(arguments[0]instanceof I&&arguments[1]instanceof I){var c=arguments[0],m=arguments[1],E=m.x-c.x,A=m.y-c.y;if(E===0&&A===0)throw new P("Cannot compute the octant for two identical points "+c);return Is.octant(E,A)}};var Hi=function(){};Hi.prototype.getCoordinates=function(){},Hi.prototype.size=function(){},Hi.prototype.getCoordinate=function(n){},Hi.prototype.isClosed=function(){},Hi.prototype.setData=function(n){},Hi.prototype.getData=function(){},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var xu=function(){};xu.prototype.addIntersection=function(n,i){},xu.prototype.interfaces_=function(){return[Hi]},xu.prototype.getClass=function(){return xu};var Nn=function(){this._nodeList=new gr(this),this._pts=null,this._data=null;var n=arguments[0],i=arguments[1];this._pts=n,this._data=i};Nn.prototype.getCoordinates=function(){return this._pts},Nn.prototype.size=function(){return this._pts.length},Nn.prototype.getCoordinate=function(n){return this._pts[n]},Nn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Nn.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},Nn.prototype.setData=function(n){this._data=n},Nn.prototype.safeOctant=function(n,i){return n.equals2D(i)?0:Is.octant(n,i)},Nn.prototype.getData=function(){return this._data},Nn.prototype.addIntersection=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.addIntersectionNode(n,i)}else if(arguments.length===4){var s=arguments[0],u=arguments[1],c=arguments[3],m=new I(s.getIntersection(c));this.addIntersection(m,u)}},Nn.prototype.toString=function(){return Yt.toLineString(new fe(this._pts))},Nn.prototype.getNodeList=function(){return this._nodeList},Nn.prototype.addIntersectionNode=function(n,i){var s=i,u=s+1;if(u<this._pts.length){var c=this._pts[u];n.equals2D(c)&&(s=u)}return this._nodeList.add(n,s)},Nn.prototype.addIntersections=function(n,i,s){for(var u=0;u<n.getIntersectionNum();u++)this.addIntersection(n,i,s,u)},Nn.prototype.interfaces_=function(){return[xu]},Nn.prototype.getClass=function(){return Nn},Nn.getNodedSubstrings=function(){if(arguments.length===1){var n=arguments[0],i=new Z;return Nn.getNodedSubstrings(n,i),i}if(arguments.length===2)for(var s=arguments[0],u=arguments[1],c=s.iterator();c.hasNext();)c.next().getNodeList().addSplitEdges(u)};var Zt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new I,this.p1=new I;else if(arguments.length===1){var n=arguments[0];this.p0=new I(n.p0),this.p1=new I(n.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],s=arguments[1],u=arguments[2],c=arguments[3];this.p0=new I(i,s),this.p1=new I(u,c)}},Jd={serialVersionUID:{configurable:!0}};Zt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Zt.prototype.orientationIndex=function(){if(arguments[0]instanceof Zt){var n=arguments[0],i=J.orientationIndex(this.p0,this.p1,n.p0),s=J.orientationIndex(this.p0,this.p1,n.p1);return i>=0&&s>=0||i<=0&&s<=0?Math.max(i,s):0}if(arguments[0]instanceof I){var u=arguments[0];return J.orientationIndex(this.p0,this.p1,u)}},Zt.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])},Zt.prototype.isVertical=function(){return this.p0.x===this.p1.x},Zt.prototype.equals=function(n){if(!(n instanceof Zt))return!1;var i=n;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},Zt.prototype.intersection=function(n){var i=new pn;return i.computeIntersection(this.p0,this.p1,n.p0,n.p1),i.hasIntersection()?i.getIntersection(0):null},Zt.prototype.project=function(){if(arguments[0]instanceof I){var n=arguments[0];if(n.equals(this.p0)||n.equals(this.p1))return new I(n);var i=this.projectionFactor(n),s=new I;return s.x=this.p0.x+i*(this.p1.x-this.p0.x),s.y=this.p0.y+i*(this.p1.y-this.p0.y),s}if(arguments[0]instanceof Zt){var u=arguments[0],c=this.projectionFactor(u.p0),m=this.projectionFactor(u.p1);if(c>=1&&m>=1||c<=0&&m<=0)return null;var E=this.project(u.p0);c<0&&(E=this.p0),c>1&&(E=this.p1);var A=this.project(u.p1);return m<0&&(A=this.p0),m>1&&(A=this.p1),new Zt(E,A)}},Zt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Zt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Zt.prototype.getCoordinate=function(n){return n===0?this.p0:this.p1},Zt.prototype.distancePerpendicular=function(n){return J.distancePointLinePerpendicular(n,this.p0,this.p1)},Zt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Zt.prototype.midPoint=function(){return Zt.midPoint(this.p0,this.p1)},Zt.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,u=i*i+s*s;return u<=0?S.NaN:((n.x-this.p0.x)*i+(n.y-this.p0.y)*s)/u},Zt.prototype.closestPoints=function(n){var i=this.intersection(n);if(i!==null)return[i,i];var s=new Array(2).fill(null),u=S.MAX_VALUE,c=null,m=this.closestPoint(n.p0);u=m.distance(n.p0),s[0]=m,s[1]=n.p0;var E=this.closestPoint(n.p1);(c=E.distance(n.p1))<u&&(u=c,s[0]=E,s[1]=n.p1);var A=n.closestPoint(this.p0);(c=A.distance(this.p0))<u&&(u=c,s[0]=this.p0,s[1]=A);var U=n.closestPoint(this.p1);return(c=U.distance(this.p1))<u&&(u=c,s[0]=this.p1,s[1]=U),s},Zt.prototype.closestPoint=function(n){var i=this.projectionFactor(n);return i>0&&i<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1},Zt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Zt.prototype.getLength=function(){return this.p0.distance(this.p1)},Zt.prototype.compareTo=function(n){var i=n,s=this.p0.compareTo(i.p0);return s!==0?s:this.p1.compareTo(i.p1)},Zt.prototype.reverse=function(){var n=this.p0;this.p0=this.p1,this.p1=n},Zt.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)},Zt.prototype.lineIntersection=function(n){try{return Qt.intersection(this.p0,this.p1,n.p0,n.p1)}catch(i){if(!(i instanceof Xt))throw i}return null},Zt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Zt.prototype.pointAlongOffset=function(n,i){var s=this.p0.x+n*(this.p1.x-this.p0.x),u=this.p0.y+n*(this.p1.y-this.p0.y),c=this.p1.x-this.p0.x,m=this.p1.y-this.p0.y,E=Math.sqrt(c*c+m*m),A=0,U=0;if(i!==0){if(E<=0)throw new Error("Cannot compute offset from zero-length line segment");A=i*c/E,U=i*m/E}return new I(s-U,u+A)},Zt.prototype.setCoordinates=function(){if(arguments.length===1){var n=arguments[0];this.setCoordinates(n.p0,n.p1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=s.x,this.p1.y=s.y}},Zt.prototype.segmentFraction=function(n){var i=this.projectionFactor(n);return i<0?i=0:(i>1||S.isNaN(i))&&(i=1),i},Zt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Zt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Zt.prototype.distance=function(){if(arguments[0]instanceof Zt){var n=arguments[0];return J.distanceLineLine(this.p0,this.p1,n.p0,n.p1)}if(arguments[0]instanceof I){var i=arguments[0];return J.distancePointLine(i,this.p0,this.p1)}},Zt.prototype.pointAlong=function(n){var i=new I;return i.x=this.p0.x+n*(this.p1.x-this.p0.x),i.y=this.p0.y+n*(this.p1.y-this.p0.y),i},Zt.prototype.hashCode=function(){var n=S.doubleToLongBits(this.p0.x);n^=31*S.doubleToLongBits(this.p0.y);var i=Math.trunc(n)^Math.trunc(n>>32),s=S.doubleToLongBits(this.p1.x);return s^=31*S.doubleToLongBits(this.p1.y),i^(Math.trunc(s)^Math.trunc(s>>32))},Zt.prototype.interfaces_=function(){return[N,t]},Zt.prototype.getClass=function(){return Zt},Zt.midPoint=function(n,i){return new I((n.x+i.x)/2,(n.y+i.y)/2)},Jd.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Zt,Jd);var Eu=function(){this.tempEnv1=new Ct,this.tempEnv2=new Ct,this._overlapSeg1=new Zt,this._overlapSeg2=new Zt};Eu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];n.getLineSegment(i,this._overlapSeg1),s.getLineSegment(u,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu};var Vr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];this._pts=n,this._start=i,this._end=s,this._context=u};Vr.prototype.getLineSegment=function(n,i){i.p0=this._pts[n],i.p1=this._pts[n+1]},Vr.prototype.computeSelect=function(n,i,s,u){var c=this._pts[i],m=this._pts[s];if(u.tempEnv1.init(c,m),s-i==1)return u.select(this,i),null;if(!n.intersects(u.tempEnv1))return null;var E=Math.trunc((i+s)/2);i<E&&this.computeSelect(n,i,E,u),E<s&&this.computeSelect(n,E,s,u)},Vr.prototype.getCoordinates=function(){for(var n=new Array(this._end-this._start+1).fill(null),i=0,s=this._start;s<=this._end;s++)n[i++]=this._pts[s];return n},Vr.prototype.computeOverlaps=function(n,i){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,i)},Vr.prototype.setId=function(n){this._id=n},Vr.prototype.select=function(n,i){this.computeSelect(n,this._start,this._end,i)},Vr.prototype.getEnvelope=function(){if(this._env===null){var n=this._pts[this._start],i=this._pts[this._end];this._env=new Ct(n,i)}return this._env},Vr.prototype.getEndIndex=function(){return this._end},Vr.prototype.getStartIndex=function(){return this._start},Vr.prototype.getContext=function(){return this._context},Vr.prototype.getId=function(){return this._id},Vr.prototype.computeOverlapsInternal=function(n,i,s,u,c,m){var E=this._pts[n],A=this._pts[i],U=s._pts[u],K=s._pts[c];if(i-n==1&&c-u==1)return m.overlap(this,n,s,u),null;if(m.tempEnv1.init(E,A),m.tempEnv2.init(U,K),!m.tempEnv1.intersects(m.tempEnv2))return null;var pt=Math.trunc((n+i)/2),dt=Math.trunc((u+c)/2);n<pt&&(u<dt&&this.computeOverlapsInternal(n,pt,s,u,dt,m),dt<c&&this.computeOverlapsInternal(n,pt,s,dt,c,m)),pt<i&&(u<dt&&this.computeOverlapsInternal(pt,i,s,u,dt,m),dt<c&&this.computeOverlapsInternal(pt,i,s,dt,c,m))},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr};var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.getChainStartIndices=function(n){var i=0,s=new Z;s.add(new lt(i));do{var u=Ri.findChainEnd(n,i);s.add(new lt(u)),i=u}while(i<n.length-1);return Ri.toIntArray(s)},Ri.findChainEnd=function(n,i){for(var s=i;s<n.length-1&&n[s].equals2D(n[s+1]);)s++;if(s>=n.length-1)return n.length-1;for(var u=cn.quadrant(n[s],n[s+1]),c=i+1;c<n.length&&!(!n[c-1].equals2D(n[c])&&cn.quadrant(n[c-1],n[c])!==u);)c++;return c-1},Ri.getChains=function(){if(arguments.length===1){var n=arguments[0];return Ri.getChains(n,null)}if(arguments.length===2){for(var i=arguments[0],s=arguments[1],u=new Z,c=Ri.getChainStartIndices(i),m=0;m<c.length-1;m++){var E=new Vr(i,c[m],c[m+1],s);u.add(E)}return u}},Ri.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),s=0;s<i.length;s++)i[s]=n.get(s).intValue();return i};var Qo=function(){};Qo.prototype.computeNodes=function(n){},Qo.prototype.getNodedSubstrings=function(){},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo};var Mu=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};Mu.prototype.setSegmentIntersector=function(n){this._segInt=n},Mu.prototype.interfaces_=function(){return[Qo]},Mu.prototype.getClass=function(){return Mu};var Eh=function(n){function i(u){u?n.call(this,u):n.call(this),this._monoChains=new Z,this._index=new $d,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return Nn.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(u){for(var c=Ri.getChains(u.getCoordinates(),u).iterator();c.hasNext();){var m=c.next();m.setId(this._idCounter++),this._index.insert(m.getEnvelope(),m),this._monoChains.add(m)}},i.prototype.computeNodes=function(u){this._nodedSegStrings=u;for(var c=u.iterator();c.hasNext();)this.add(c.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var u=new Kd(this._segInt),c=this._monoChains.iterator();c.hasNext();)for(var m=c.next(),E=this._index.query(m.getEnvelope()).iterator();E.hasNext();){var A=E.next();if(A.getId()>m.getId()&&(m.computeOverlaps(A,u),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.SegmentOverlapAction.get=function(){return Kd},Object.defineProperties(i,s),i}(Mu),Kd=function(n){function i(){n.call(this),this._si=null;var s=arguments[0];this._si=s}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return n.prototype.overlap.apply(this,arguments);var s=arguments[0],u=arguments[1],c=arguments[2],m=arguments[3],E=s.getContext(),A=c.getContext();this._si.processIntersections(E,u,A,m)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Eu),We=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.setQuadrantSegments(s),this.setEndCapStyle(u)}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];this.setQuadrantSegments(c),this.setEndCapStyle(m),this.setJoinStyle(E),this.setMitreLimit(A)}}},ho={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};We.prototype.getEndCapStyle=function(){return this._endCapStyle},We.prototype.isSingleSided=function(){return this._isSingleSided},We.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n,this._quadrantSegments===0&&(this._joinStyle=We.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=We.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),n<=0&&(this._quadrantSegments=1),this._joinStyle!==We.JOIN_ROUND&&(this._quadrantSegments=We.DEFAULT_QUADRANT_SEGMENTS)},We.prototype.getJoinStyle=function(){return this._joinStyle},We.prototype.setJoinStyle=function(n){this._joinStyle=n},We.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n},We.prototype.getSimplifyFactor=function(){return this._simplifyFactor},We.prototype.getQuadrantSegments=function(){return this._quadrantSegments},We.prototype.setEndCapStyle=function(n){this._endCapStyle=n},We.prototype.getMitreLimit=function(){return this._mitreLimit},We.prototype.setMitreLimit=function(n){this._mitreLimit=n},We.prototype.setSingleSided=function(n){this._isSingleSided=n},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.bufferDistanceError=function(n){var i=Math.PI/2/n;return 1-Math.cos(i/2)},ho.CAP_ROUND.get=function(){return 1},ho.CAP_FLAT.get=function(){return 2},ho.CAP_SQUARE.get=function(){return 3},ho.JOIN_ROUND.get=function(){return 1},ho.JOIN_MITRE.get=function(){return 2},ho.JOIN_BEVEL.get=function(){return 3},ho.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ho.DEFAULT_MITRE_LIMIT.get=function(){return 5},ho.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(We,ho);var In=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=J.COUNTERCLOCKWISE,this._inputLine=n||null},Su={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};In.prototype.isDeletable=function(n,i,s,u){var c=this._inputLine[n],m=this._inputLine[i],E=this._inputLine[s];return!!this.isConcave(c,m,E)&&!!this.isShallow(c,m,E,u)&&this.isShallowSampled(c,m,n,s,u)},In.prototype.deleteShallowConcavities=function(){for(var n=1,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i),u=!1;s<this._inputLine.length;){var c=!1;this.isDeletable(n,i,s,this._distanceTol)&&(this._isDeleted[i]=In.DELETE,c=!0,u=!0),n=c?s:i,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i)}return u},In.prototype.isShallowConcavity=function(n,i,s,u){return J.computeOrientation(n,i,s)!==this._angleOrientation?!1:J.distancePointLine(i,n,s)<u},In.prototype.isShallowSampled=function(n,i,s,u,c){var m=Math.trunc((u-s)/In.NUM_PTS_TO_CHECK);m<=0&&(m=1);for(var E=s;E<u;E+=m)if(!this.isShallow(n,i,this._inputLine[E],c))return!1;return!0},In.prototype.isConcave=function(n,i,s){var u=J.computeOrientation(n,i,s)===this._angleOrientation;return u},In.prototype.simplify=function(n){this._distanceTol=Math.abs(n),n<0&&(this._angleOrientation=J.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},In.prototype.findNextNonDeletedIndex=function(n){for(var i=n+1;i<this._inputLine.length&&this._isDeleted[i]===In.DELETE;)i++;return i},In.prototype.isShallow=function(n,i,s,u){return J.distancePointLine(i,n,s)<u},In.prototype.collapseLine=function(){for(var n=new ot,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==In.DELETE&&n.add(this._inputLine[i]);return n.toCoordinateArray()},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.simplify=function(n,i){return new In(n).simplify(i)},Su.INIT.get=function(){return 0},Su.DELETE.get=function(){return 1},Su.KEEP.get=function(){return 1},Su.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(In,Su);var Kr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Z},jd={COORDINATE_ARRAY_TYPE:{configurable:!0}};Kr.prototype.getCoordinates=function(){return this._ptList.toArray(Kr.COORDINATE_ARRAY_TYPE)},Kr.prototype.setPrecisionModel=function(n){this._precisionModel=n},Kr.prototype.addPt=function(n){var i=new I(n);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},Kr.prototype.revere=function(){},Kr.prototype.addPts=function(n,i){if(i)for(var s=0;s<n.length;s++)this.addPt(n[s]);else for(var u=n.length-1;u>=0;u--)this.addPt(n[u])},Kr.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return n.distance(i)<this._minimimVertexDistance},Kr.prototype.toString=function(){return new ue().createLineString(this.getCoordinates()).toString()},Kr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new I(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(n.equals(i))return null;this._ptList.add(n)},Kr.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},jd.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Kr,jd);var me=function(){},Rs={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.toDegrees=function(n){return 180*n/Math.PI},me.normalize=function(n){for(;n>Math.PI;)n-=me.PI_TIMES_2;for(;n<=-Math.PI;)n+=me.PI_TIMES_2;return n},me.angle=function(){if(arguments.length===1){var n=arguments[0];return Math.atan2(n.y,n.x)}if(arguments.length===2){var i=arguments[0],s=arguments[1],u=s.x-i.x,c=s.y-i.y;return Math.atan2(c,u)}},me.isAcute=function(n,i,s){var u=n.x-i.x,c=n.y-i.y;return u*(s.x-i.x)+c*(s.y-i.y)>0},me.isObtuse=function(n,i,s){var u=n.x-i.x,c=n.y-i.y;return u*(s.x-i.x)+c*(s.y-i.y)<0},me.interiorAngle=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s);return Math.abs(c-u)},me.normalizePositive=function(n){if(n<0){for(;n<0;)n+=me.PI_TIMES_2;n>=me.PI_TIMES_2&&(n=0)}else{for(;n>=me.PI_TIMES_2;)n-=me.PI_TIMES_2;n<0&&(n=0)}return n},me.angleBetween=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s);return me.diff(u,c)},me.diff=function(n,i){var s=null;return(s=n<i?i-n:n-i)>Math.PI&&(s=2*Math.PI-s),s},me.toRadians=function(n){return n*Math.PI/180},me.getTurn=function(n,i){var s=Math.sin(i-n);return s>0?me.COUNTERCLOCKWISE:s<0?me.CLOCKWISE:me.NONE},me.angleBetweenOriented=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s)-u;return c<=-Math.PI?c+me.PI_TIMES_2:c>Math.PI?c-me.PI_TIMES_2:c},Rs.PI_TIMES_2.get=function(){return 2*Math.PI},Rs.PI_OVER_2.get=function(){return Math.PI/2},Rs.PI_OVER_4.get=function(){return Math.PI/4},Rs.COUNTERCLOCKWISE.get=function(){return J.COUNTERCLOCKWISE},Rs.CLOCKWISE.get=function(){return J.CLOCKWISE},Rs.NONE.get=function(){return J.COLLINEAR},Object.defineProperties(me,Rs);var vn=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Zt,this._seg1=new Zt,this._offset0=new Zt,this._offset1=new Zt,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],s=arguments[1],u=arguments[2];this._precisionModel=i,this._bufParams=s,this._li=new pn,this._filletAngleQuantum=Math.PI/2/s.getQuadrantSegments(),s.getQuadrantSegments()>=8&&s.getJoinStyle()===We.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(u)},wu={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};vn.prototype.addNextSegment=function(n,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,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 s=J.computeOrientation(this._s0,this._s1,this._s2),u=s===J.CLOCKWISE&&this._side===bt.LEFT||s===J.COUNTERCLOCKWISE&&this._side===bt.RIGHT;s===0?this.addCollinear(i):u?this.addOutsideTurn(s,i):this.addInsideTurn(s,i)},vn.prototype.addLineEndCap=function(n,i){var s=new Zt(n,i),u=new Zt;this.computeOffsetSegment(s,bt.LEFT,this._distance,u);var c=new Zt;this.computeOffsetSegment(s,bt.RIGHT,this._distance,c);var m=i.x-n.x,E=i.y-n.y,A=Math.atan2(E,m);switch(this._bufParams.getEndCapStyle()){case We.CAP_ROUND:this._segList.addPt(u.p1),this.addFilletArc(i,A+Math.PI/2,A-Math.PI/2,J.CLOCKWISE,this._distance),this._segList.addPt(c.p1);break;case We.CAP_FLAT:this._segList.addPt(u.p1),this._segList.addPt(c.p1);break;case We.CAP_SQUARE:var U=new I;U.x=Math.abs(this._distance)*Math.cos(A),U.y=Math.abs(this._distance)*Math.sin(A);var K=new I(u.p1.x+U.x,u.p1.y+U.y),pt=new I(c.p1.x+U.x,c.p1.y+U.y);this._segList.addPt(K),this._segList.addPt(pt)}},vn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},vn.prototype.addMitreJoin=function(n,i,s,u){var c=!0,m=null;try{m=Qt.intersection(i.p0,i.p1,s.p0,s.p1),(u<=0?1:m.distance(n)/Math.abs(u))>this._bufParams.getMitreLimit()&&(c=!1)}catch(E){if(!(E instanceof Xt))throw E;m=new I(0,0),c=!1}c?this._segList.addPt(m):this.addLimitedMitreJoin(i,s,u,this._bufParams.getMitreLimit())},vn.prototype.addFilletCorner=function(n,i,s,u,c){var m=i.x-n.x,E=i.y-n.y,A=Math.atan2(E,m),U=s.x-n.x,K=s.y-n.y,pt=Math.atan2(K,U);u===J.CLOCKWISE?A<=pt&&(A+=2*Math.PI):A>=pt&&(A-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(n,A,pt,u,c),this._segList.addPt(s)},vn.prototype.addOutsideTurn=function(n,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*vn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===We.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===We.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(i&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))},vn.prototype.createSquare=function(n){this._segList.addPt(new I(n.x+this._distance,n.y+this._distance)),this._segList.addPt(new I(n.x+this._distance,n.y-this._distance)),this._segList.addPt(new I(n.x-this._distance,n.y-this._distance)),this._segList.addPt(new I(n.x-this._distance,n.y+this._distance)),this._segList.closeRing()},vn.prototype.addSegments=function(n,i){this._segList.addPts(n,i)},vn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},vn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},vn.prototype.initSideSegments=function(n,i,s){this._s1=n,this._s2=i,this._side=s,this._seg1.setCoordinates(n,i),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)},vn.prototype.addLimitedMitreJoin=function(n,i,s,u){var c=this._seg0.p1,m=me.angle(c,this._seg0.p0),E=me.angleBetweenOriented(this._seg0.p0,c,this._seg1.p1)/2,A=me.normalize(m+E),U=me.normalize(A+Math.PI),K=u*s,pt=s-K*Math.abs(Math.sin(E)),dt=c.x+K*Math.cos(U),Rt=c.y+K*Math.sin(U),Ot=new I(dt,Rt),Vt=new Zt(c,Ot),jt=Vt.pointAlongOffset(1,pt),sn=Vt.pointAlongOffset(1,-pt);this._side===bt.LEFT?(this._segList.addPt(jt),this._segList.addPt(sn)):(this._segList.addPt(sn),this._segList.addPt(jt))},vn.prototype.computeOffsetSegment=function(n,i,s,u){var c=i===bt.LEFT?1:-1,m=n.p1.x-n.p0.x,E=n.p1.y-n.p0.y,A=Math.sqrt(m*m+E*E),U=c*s*m/A,K=c*s*E/A;u.p0.x=n.p0.x-K,u.p0.y=n.p0.y+U,u.p1.x=n.p1.x-K,u.p1.y=n.p1.y+U},vn.prototype.addFilletArc=function(n,i,s,u,c){var m=u===J.CLOCKWISE?-1:1,E=Math.abs(i-s),A=Math.trunc(E/this._filletAngleQuantum+.5);if(A<1)return null;for(var U=E/A,K=0,pt=new I;K<E;){var dt=i+m*K;pt.x=n.x+c*Math.cos(dt),pt.y=n.y+c*Math.sin(dt),this._segList.addPt(pt),K+=U}},vn.prototype.addInsideTurn=function(n,i){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*vn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var s=new I((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(s);var u=new I((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(u)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},vn.prototype.createCircle=function(n){var i=new I(n.x+this._distance,n.y);this._segList.addPt(i),this.addFilletArc(n,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},vn.prototype.addBevelJoin=function(n,i){this._segList.addPt(n.p1),this._segList.addPt(i.p0)},vn.prototype.init=function(n){this._distance=n,this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Kr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(n*vn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},vn.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===We.JOIN_BEVEL||this._bufParams.getJoinStyle()===We.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,J.CLOCKWISE,this._distance))},vn.prototype.closeRing=function(){this._segList.closeRing()},vn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},wu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},wu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},wu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},wu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(vn,wu);var Rr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var n=arguments[0],i=arguments[1];this._precisionModel=n,this._bufParams=i};Rr.prototype.getOffsetCurve=function(n,i){if(this._distance=i,i===0)return null;var s=i<0,u=Math.abs(i),c=this.getSegGen(u);n.length<=1?this.computePointCurve(n[0],c):this.computeOffsetCurve(n,s,c);var m=c.getCoordinates();return s&&Q.reverse(m),m},Rr.prototype.computeSingleSidedBufferCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);if(i){s.addSegments(n,!0);var c=In.simplify(n,-u),m=c.length-1;s.initSideSegments(c[m],c[m-1],bt.LEFT),s.addFirstSegment();for(var E=m-2;E>=0;E--)s.addNextSegment(c[E],!0)}else{s.addSegments(n,!1);var A=In.simplify(n,u),U=A.length-1;s.initSideSegments(A[0],A[1],bt.LEFT),s.addFirstSegment();for(var K=2;K<=U;K++)s.addNextSegment(A[K],!0)}s.addLastSegment(),s.closeRing()},Rr.prototype.computeRingBufferCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);i===bt.RIGHT&&(u=-u);var c=In.simplify(n,u),m=c.length-1;s.initSideSegments(c[m-1],c[0],i);for(var E=1;E<=m;E++){var A=E!==1;s.addNextSegment(c[E],A)}s.closeRing()},Rr.prototype.computeLineBufferCurve=function(n,i){var s=this.simplifyTolerance(this._distance),u=In.simplify(n,s),c=u.length-1;i.initSideSegments(u[0],u[1],bt.LEFT);for(var m=2;m<=c;m++)i.addNextSegment(u[m],!0);i.addLastSegment(),i.addLineEndCap(u[c-1],u[c]);var E=In.simplify(n,-s),A=E.length-1;i.initSideSegments(E[A],E[A-1],bt.LEFT);for(var U=A-2;U>=0;U--)i.addNextSegment(E[U],!0);i.addLastSegment(),i.addLineEndCap(E[1],E[0]),i.closeRing()},Rr.prototype.computePointCurve=function(n,i){switch(this._bufParams.getEndCapStyle()){case We.CAP_ROUND:i.createCircle(n);break;case We.CAP_SQUARE:i.createSquare(n)}},Rr.prototype.getLineCurve=function(n,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var s=Math.abs(i),u=this.getSegGen(s);if(n.length<=1)this.computePointCurve(n[0],u);else if(this._bufParams.isSingleSided()){var c=i<0;this.computeSingleSidedBufferCurve(n,c,u)}else this.computeLineBufferCurve(n,u);return u.getCoordinates()},Rr.prototype.getBufferParameters=function(){return this._bufParams},Rr.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()},Rr.prototype.getRingCurve=function(n,i,s){if(this._distance=s,n.length<=2)return this.getLineCurve(n,s);if(s===0)return Rr.copyCoordinates(n);var u=this.getSegGen(s);return this.computeRingBufferCurve(n,i,u),u.getCoordinates()},Rr.prototype.computeOffsetCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);if(i){var c=In.simplify(n,-u),m=c.length-1;s.initSideSegments(c[m],c[m-1],bt.LEFT),s.addFirstSegment();for(var E=m-2;E>=0;E--)s.addNextSegment(c[E],!0)}else{var A=In.simplify(n,u),U=A.length-1;s.initSideSegments(A[0],A[1],bt.LEFT),s.addFirstSegment();for(var K=2;K<=U;K++)s.addNextSegment(A[K],!0)}s.addLastSegment()},Rr.prototype.getSegGen=function(n){return new vn(this._precisionModel,this._bufParams,n)},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),s=0;s<i.length;s++)i[s]=new I(n[s]);return i};var Ls=function(){this._subgraphs=null,this._seg=new Zt,this._cga=new J;var n=arguments[0];this._subgraphs=n},Qd={DepthSegment:{configurable:!0}};Ls.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var n=arguments[0],i=new Z,s=this._subgraphs.iterator();s.hasNext();){var u=s.next(),c=u.getEnvelope();n.y<c.getMinY()||n.y>c.getMaxY()||this.findStabbedSegments(n,u.getDirectedEdges(),i)}return i}if(arguments.length===3){if($(arguments[2],tt)&&arguments[0]instanceof I&&arguments[1]instanceof xh){for(var m=arguments[0],E=arguments[1],A=arguments[2],U=E.getEdge().getCoordinates(),K=0;K<U.length-1;K++)if(this._seg.p0=U[K],this._seg.p1=U[K+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<m.x)&&!(this._seg.isHorizontal()||m.y<this._seg.p0.y||m.y>this._seg.p1.y||J.computeOrientation(this._seg.p0,this._seg.p1,m)===J.RIGHT)){var pt=E.getDepth(bt.LEFT);this._seg.p0.equals(U[K])||(pt=E.getDepth(bt.RIGHT));var dt=new ts(this._seg,pt);A.add(dt)}}else if($(arguments[2],tt)&&arguments[0]instanceof I&&$(arguments[1],tt))for(var Rt=arguments[0],Ot=arguments[1],Vt=arguments[2],jt=Ot.iterator();jt.hasNext();){var sn=jt.next();sn.isForward()&&this.findStabbedSegments(Rt,sn,Vt)}}},Ls.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:_i.min(i)._leftDepth},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls},Qd.DepthSegment.get=function(){return ts},Object.defineProperties(Ls,Qd);var ts=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new Zt(n),this._leftDepth=i};ts.prototype.compareTo=function(n){var i=n;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var s=this._upwardSeg.orientationIndex(i._upwardSeg);return s!==0||(s=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?s:this._upwardSeg.compareTo(i._upwardSeg)},ts.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},ts.prototype.toString=function(){return this._upwardSeg.toString()},ts.prototype.interfaces_=function(){return[N]},ts.prototype.getClass=function(){return ts};var qe=function(n,i,s){this.p0=n||null,this.p1=i||null,this.p2=s||null};qe.prototype.area=function(){return qe.area(this.p0,this.p1,this.p2)},qe.prototype.signedArea=function(){return qe.signedArea(this.p0,this.p1,this.p2)},qe.prototype.interpolateZ=function(n){if(n===null)throw new P("Supplied point is null.");return qe.interpolateZ(n,this.p0,this.p1,this.p2)},qe.prototype.longestSideLength=function(){return qe.longestSideLength(this.p0,this.p1,this.p2)},qe.prototype.isAcute=function(){return qe.isAcute(this.p0,this.p1,this.p2)},qe.prototype.circumcentre=function(){return qe.circumcentre(this.p0,this.p1,this.p2)},qe.prototype.area3D=function(){return qe.area3D(this.p0,this.p1,this.p2)},qe.prototype.centroid=function(){return qe.centroid(this.p0,this.p1,this.p2)},qe.prototype.inCentre=function(){return qe.inCentre(this.p0,this.p1,this.p2)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.area=function(n,i,s){return Math.abs(((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2)},qe.signedArea=function(n,i,s){return((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2},qe.det=function(n,i,s,u){return n*u-i*s},qe.interpolateZ=function(n,i,s,u){var c=i.x,m=i.y,E=s.x-c,A=u.x-c,U=s.y-m,K=u.y-m,pt=E*K-A*U,dt=n.x-c,Rt=n.y-m,Ot=(K*dt-A*Rt)/pt,Vt=(-U*dt+E*Rt)/pt;return i.z+Ot*(s.z-i.z)+Vt*(u.z-i.z)},qe.longestSideLength=function(n,i,s){var u=n.distance(i),c=i.distance(s),m=s.distance(n),E=u;return c>E&&(E=c),m>E&&(E=m),E},qe.isAcute=function(n,i,s){return!!me.isAcute(n,i,s)&&!!me.isAcute(i,s,n)&&!!me.isAcute(s,n,i)},qe.circumcentre=function(n,i,s){var u=s.x,c=s.y,m=n.x-u,E=n.y-c,A=i.x-u,U=i.y-c,K=2*qe.det(m,E,A,U),pt=qe.det(E,m*m+E*E,U,A*A+U*U),dt=qe.det(m,m*m+E*E,A,A*A+U*U);return new I(u-pt/K,c+dt/K)},qe.perpendicularBisector=function(n,i){var s=i.x-n.x,u=i.y-n.y,c=new Qt(n.x+s/2,n.y+u/2,1),m=new Qt(n.x-u+s/2,n.y+s+u/2,1);return new Qt(c,m)},qe.angleBisector=function(n,i,s){var u=i.distance(n),c=u/(u+i.distance(s)),m=s.x-n.x,E=s.y-n.y;return new I(n.x+c*m,n.y+c*E)},qe.area3D=function(n,i,s){var u=i.x-n.x,c=i.y-n.y,m=i.z-n.z,E=s.x-n.x,A=s.y-n.y,U=s.z-n.z,K=c*U-m*A,pt=m*E-u*U,dt=u*A-c*E,Rt=K*K+pt*pt+dt*dt,Ot=Math.sqrt(Rt)/2;return Ot},qe.centroid=function(n,i,s){var u=(n.x+i.x+s.x)/3,c=(n.y+i.y+s.y)/3;return new I(u,c)},qe.inCentre=function(n,i,s){var u=i.distance(s),c=n.distance(s),m=n.distance(i),E=u+c+m,A=(u*n.x+c*i.x+m*s.x)/E,U=(u*n.y+c*i.y+m*s.y)/E;return new I(A,U)};var ci=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Z;var n=arguments[0],i=arguments[1],s=arguments[2];this._inputGeom=n,this._distance=i,this._curveBuilder=s};ci.prototype.addPoint=function(n){if(this._distance<=0)return null;var i=n.getCoordinates(),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,V.EXTERIOR,V.INTERIOR)},ci.prototype.addPolygon=function(n){var i=this._distance,s=bt.LEFT;this._distance<0&&(i=-this._distance,s=bt.RIGHT);var u=n.getExteriorRing(),c=Q.removeRepeatedPoints(u.getCoordinates());if(this._distance<0&&this.isErodedCompletely(u,this._distance)||this._distance<=0&&c.length<3)return null;this.addPolygonRing(c,i,s,V.EXTERIOR,V.INTERIOR);for(var m=0;m<n.getNumInteriorRing();m++){var E=n.getInteriorRingN(m),A=Q.removeRepeatedPoints(E.getCoordinates());this._distance>0&&this.isErodedCompletely(E,-this._distance)||this.addPolygonRing(A,i,bt.opposite(s),V.INTERIOR,V.EXTERIOR)}},ci.prototype.isTriangleErodedCompletely=function(n,i){var s=new qe(n[0],n[1],n[2]),u=s.inCentre();return J.distancePointLine(u,s.p0,s.p1)<Math.abs(i)},ci.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=Q.removeRepeatedPoints(n.getCoordinates()),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,V.EXTERIOR,V.INTERIOR)},ci.prototype.addCurve=function(n,i,s){if(n===null||n.length<2)return null;var u=new Nn(n,new on(0,V.BOUNDARY,i,s));this._curveList.add(u)},ci.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ci.prototype.addPolygonRing=function(n,i,s,u,c){if(i===0&&n.length<an.MINIMUM_VALID_SIZE)return null;var m=u,E=c;n.length>=an.MINIMUM_VALID_SIZE&&J.isCCW(n)&&(m=c,E=u,s=bt.opposite(s));var A=this._curveBuilder.getRingCurve(n,s,i);this.addCurve(A,m,E)},ci.prototype.add=function(n){if(n.isEmpty())return null;n instanceof Wt?this.addPolygon(n):n instanceof zt?this.addLineString(n):n instanceof Kt?this.addPoint(n):n instanceof he?this.addCollection(n):n instanceof W?this.addCollection(n):n instanceof ln?this.addCollection(n):n instanceof gn&&this.addCollection(n)},ci.prototype.isErodedCompletely=function(n,i){var s=n.getCoordinates();if(s.length<4)return i<0;if(s.length===4)return this.isTriangleErodedCompletely(s,i);var u=n.getEnvelopeInternal(),c=Math.min(u.getHeight(),u.getWidth());return i<0&&2*Math.abs(i)>c},ci.prototype.addCollection=function(n){for(var i=0;i<n.getNumGeometries();i++){var s=n.getGeometryN(i);this.add(s)}},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var fa=function(){};fa.prototype.locate=function(n){},fa.prototype.interfaces_=function(){return[]},fa.prototype.getClass=function(){return fa};var Wi=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var n=arguments[0];this._parent=n,this._atStart=!0,this._index=0,this._max=n.getNumGeometries()};Wi.prototype.next=function(){if(this._atStart)return this._atStart=!1,Wi.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 o;var n=this._parent.getGeometryN(this._index++);return n instanceof gn?(this._subcollectionIterator=new Wi(n),this._subcollectionIterator.next()):n},Wi.prototype.remove=function(){throw new Error(this.getClass().getName())},Wi.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Wi.prototype.interfaces_=function(){return[D]},Wi.prototype.getClass=function(){return Wi},Wi.isAtomic=function(n){return!(n instanceof gn)};var jr=function(){this._geom=null;var n=arguments[0];this._geom=n};jr.prototype.locate=function(n){return jr.locate(n,this._geom)},jr.prototype.interfaces_=function(){return[fa]},jr.prototype.getClass=function(){return jr},jr.isPointInRing=function(n,i){return!!i.getEnvelopeInternal().intersects(n)&&J.isPointInRing(n,i.getCoordinates())},jr.containsPointInPolygon=function(n,i){if(i.isEmpty())return!1;var s=i.getExteriorRing();if(!jr.isPointInRing(n,s))return!1;for(var u=0;u<i.getNumInteriorRing();u++){var c=i.getInteriorRingN(u);if(jr.isPointInRing(n,c))return!1}return!0},jr.containsPoint=function(n,i){if(i instanceof Wt)return jr.containsPointInPolygon(n,i);if(i instanceof gn)for(var s=new Wi(i);s.hasNext();){var u=s.next();if(u!==i&&jr.containsPoint(n,u))return!0}return!1},jr.locate=function(n,i){return i.isEmpty()?V.EXTERIOR:jr.containsPoint(n,i)?V.INTERIOR:V.EXTERIOR};var ar=function(){this._edgeMap=new _,this._edgeList=null,this._ptInAreaLocation=[V.NONE,V.NONE]};ar.prototype.getNextCW=function(n){this.getEdges();var i=this._edgeList.indexOf(n),s=i-1;return i===0&&(s=this._edgeList.size()-1),this._edgeList.get(s)},ar.prototype.propagateSideLabels=function(n){for(var i=V.NONE,s=this.iterator();s.hasNext();){var u=s.next().getLabel();u.isArea(n)&&u.getLocation(n,bt.LEFT)!==V.NONE&&(i=u.getLocation(n,bt.LEFT))}if(i===V.NONE)return null;for(var c=i,m=this.iterator();m.hasNext();){var E=m.next(),A=E.getLabel();if(A.getLocation(n,bt.ON)===V.NONE&&A.setLocation(n,bt.ON,c),A.isArea(n)){var U=A.getLocation(n,bt.LEFT),K=A.getLocation(n,bt.RIGHT);if(K!==V.NONE){if(K!==c)throw new lo("side location conflict",E.getCoordinate());U===V.NONE&&Pt.shouldNeverReachHere("found single null side (at "+E.getCoordinate()+")"),c=U}else Pt.isTrue(A.getLocation(n,bt.LEFT)===V.NONE,"found single null side"),A.setLocation(n,bt.RIGHT,c),A.setLocation(n,bt.LEFT,c)}}},ar.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},ar.prototype.print=function(n){Ft.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(n)},ar.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ar.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges();if(i.size()<=0)return!0;var s=i.size()-1,u=i.get(s).getLabel().getLocation(n,bt.LEFT);Pt.isTrue(u!==V.NONE,"Found unlabelled area edge");for(var c=u,m=this.iterator();m.hasNext();){var E=m.next().getLabel();Pt.isTrue(E.isArea(n),"Found non-area edge");var A=E.getLocation(n,bt.LEFT),U=E.getLocation(n,bt.RIGHT);if(A===U||U!==c)return!1;c=A}return!0},ar.prototype.findIndex=function(n){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===n)return i;return-1},ar.prototype.iterator=function(){return this.getEdges().iterator()},ar.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Z(this._edgeMap.values())),this._edgeList},ar.prototype.getLocation=function(n,i,s){return this._ptInAreaLocation[n]===V.NONE&&(this._ptInAreaLocation[n]=jr.locate(i,s[n].getGeometry())),this._ptInAreaLocation[n]},ar.prototype.toString=function(){var n=new mt;n.append("EdgeEndStar: "+this.getCoordinate()),n.append(\`
3837
3837
  \`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
@@ -7531,5 +7531,5 @@ three/build/three.module.js:
7531
7531
  * along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
7532
7532
  *)
7533
7533
  */
7534
- `)}var Dn=class extends Jr.EventDispatcher{worker=Nn();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:e,end:t,type:n}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(e){return lt(this.worker,"get_direction_path",e)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Qr=require("three"),Ve=class extends J{startPoint;endPoint;rect;frustum=new Qr.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),B(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);B(this.rect,n.x,n.y,r,i)}else B(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=y(this.startPoint,t,n,r),o=y(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof R&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=y(p,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=y(l,r,i,o),h=y(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var ji={boxSelection:!1,elements:["graphic","poi"]},On=class extends dt{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...ji,...t},this.boxSelection=new Ve(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:r,y:i}=this.downPoint;if(Math.sqrt((r-t)**2+(i-n)**2)>3)return;let o=new Set,a=[],l=[];if(this.options.elements.includes("graphic")){let{graphics:u}=this.bmap.context.getGraphicsByDeviceXy(t,n);u.map(c=>o.add(c.options.id)),a.push(...u)}if(this.options.elements.includes("poi")){let u=this.bmap.context.getPoisByDeviceXy(t,n);l.push(...u),u.forEach(c=>{if(!o.has(c.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&(o.add(c.options.id),a.push(h))}})}(!this.options.boxSelection||!(It?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),a.forEach(u=>this._list.add(u)),l.forEach(u=>this._poiList.add(u)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Rt(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Rt(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var Y=require("lodash");var ei=require("three");var Yi={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Ee=class extends ei.EventDispatcher{options;gpsTimer=null;data=[];timer=new D;dispatchTimer=null;constructor(e={}){super(),this.options={...Yi,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,Y.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,Y.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,Y.throttle)(e=>{let t=Date.now(),{alpha:n,beta:r,gamma:i}=e;if((0,Y.isNil)(n)||(0,Y.isNil)(r)||(0,Y.isNil)(i))return;let o;Ht?o=e.webkitCompassHeading:o=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,r,i]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:o})},200);listenDeviceOrientation(){Ht?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,Y.isNil)(t)||(0,Y.isNil)(t.x)||(0,Y.isNil)(t.y)||(0,Y.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{e.coords.accuracy<=10&&this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Ht)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Ht?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,Y.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var ri=require("three");function He(s,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(s,2)/(2*Math.pow(e,2)))}function be(s){return(s+360)%360}function ni(s,e){let n=6378137*s*Math.PI/180,r=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:r}}function $t(s,e,t,n){return Math.sqrt(Math.pow(Math.abs(s-t),2)+Math.pow(Math.abs(e-n),2))}var Xe=Zt(require("mathjs"),1),We=class{NumParticle;reSampNumParticle;initial_xy_uncertainty;initial_yaw_uncertainty;step_noise_sigma;yaw_noise_sigma;compass_update_interval;sigmaCompass;delta_yaw;sigmaBeacon;unaccess_weight;particle_PosInitFlag;particle_yawInitFlag;xEst;particleX;particleWeight;last_compass_time;last_yaw_compass=0;compass_consecutive_offset_count=0;constructor(e){this.NumParticle=e.NumParticle,this.reSampNumParticle=e.reSampNumParticle,this.initial_xy_uncertainty=e.initial_xy_uncertainty,this.initial_yaw_uncertainty=e.initial_yaw_uncertainty,this.step_noise_sigma=e.step_noise_sigma,this.yaw_noise_sigma=e.yaw_noise_sigma,this.compass_update_interval=e.compass_update_interval,this.sigmaCompass=e.sigmaCompass,this.delta_yaw=e.delta_yaw,this.sigmaBeacon=e.sigmaBeacon,this.unaccess_weight=e.unaccess_weight,this.particle_PosInitFlag=!1,this.particle_yawInitFlag=!1,this.xEst=[[0],[0],[0]],this.particleX=Array.from({length:3},()=>Array(this.NumParticle).fill(0)),this.particleWeight=Array.from({length:1},()=>Array(this.NumParticle).fill(1/this.NumParticle)),this.last_compass_time=0}motionModelRotYaw(e){if(!(Math.abs(e)<.001)){this.last_yaw_compass=be(this.last_yaw_compass+e);for(let t=0;t<this.NumParticle;t++){let n=Math.random()*this.yaw_noise_sigma;this.particleX[2][t]=this.particleX[2][t]+e+n,this.particleX[2][t]=be(this.particleX[2][t])}}}motionModelStepLength(e,t){if(e===0)return;for(let r=0;r<this.NumParticle;r++){let i=Math.random()*this.step_noise_sigma;this.particleX[0][r]+=(.65+i)*Math.sin(-this.particleX[2][r]/180*Math.PI),this.particleX[1][r]+=(.65+i)*Math.cos(this.particleX[2][r]/180*Math.PI),t(this.particleX[0][r],this.particleX[1][r])||(this.particleWeight[0][r]*=this.unaccess_weight)}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}motionModelCompassYaw(e,t){if(t-this.last_compass_time>this.compass_update_interval){let n=360-e;n+=this.delta_yaw,n=be(n),Math.abs(n-this.last_yaw_compass)>60?this.compass_consecutive_offset_count++:this.compass_consecutive_offset_count=0;for(let i=0;i<this.NumParticle;i++){let o=Math.abs(this.particleX[2][i]-n);o>180&&(o=360-o),this.particleWeight[0][i]*=He(o,this.sigmaCompass)}let r=this.particleWeight[0].reduce((i,o)=>i+o,0);this.particleWeight[0]=this.particleWeight[0].map(i=>i/r),this.setLastCompassTime(t)}}resampling(){if(1/this.particleWeight[0].reduce((t,n)=>t+n*n,0)<this.reSampNumParticle){let t=this.particleWeight[0].reduce((a,l,u)=>a.concat(a[u]+l),[0]),r=this.particleWeight[0].map(()=>1/this.NumParticle).map((a,l)=>a+Math.random()/this.NumParticle),i=[],o=0;for(let a=0;a<this.NumParticle;a++){for(;r[a]>t[o];)o++;i.push(o)}this.particleX=this.particleX.map((a,l)=>i.map(u=>a[u])),this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle)}}update(e,t){for(let r=0;r<this.NumParticle;r++){let i=$t(this.particleX[0][r],this.particleX[1][r],e.x,e.y);this.particleWeight[0][r]=Math.max(1e-7,this.particleWeight[0][r]*He(i,t))}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}updateCar(e,t){let n=e.x-this.xEst[0][0],r=e.y-this.xEst[1][0];for(let o=0;o<this.NumParticle;o++){let a=$t(this.particleX[0][o],this.particleX[1][o],e.x,e.y);this.particleWeight[0][o]=Math.max(1e-7,this.particleWeight[0][o]*He(a,t)),this.particleX[0][o]+=n,this.particleX[1][o]+=r}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i)}getPosInitFlag(){return this.particle_PosInitFlag}getYawInitFlag(){return this.particle_yawInitFlag}setPosInitFlag(e){this.particle_PosInitFlag=e}setYawInitFlag(e){this.particle_yawInitFlag=e}getResultX(){let e=Xe.reshape(this.particleWeight,[this.NumParticle,1]),t=Xe.multiply(this.particleX,e);return this.xEst=t,this.xEst[0][0]}getResultY(){return this.xEst[1][0]}getResultYaw(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0]));return this.particleX[2][e]}getEstConfidence(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0])),t=this.particleWeight[0].indexOf(Math.min(...this.particleWeight[0])),n=[this.particleX[0][e],this.particleX[1][e]],r=[this.particleX[0][t],this.particleX[1][t]],i=$t(n[0],n[1],r[0],r[1]),o=i*.67;return console.log(i,o),o}getParticleNum(){return this.NumParticle}getParticleX(){return this.particleX}setLastCompassTime(e){this.last_compass_time=e}getLastCompassTime(){return this.last_compass_time}initParticlesByPos(e,t,n){if(!this.particle_PosInitFlag){this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle);let r=0;for(;r<this.NumParticle;){let o=(2*Math.random()-1)*this.initial_xy_uncertainty,a=(2*Math.random()-1)*this.initial_xy_uncertainty;n(e+o,t+a)||(this.particleWeight[0][r]*=this.unaccess_weight),this.particleX[0][r]=e+o,this.particleX[1][r]=t+a,r++}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i),this.particle_PosInitFlag=!0,this.xEst[0][0]=e,this.xEst[1][0]=t,this.xEst[2][0]=0}}initParticlesByCompass(e){console.log(`Init compass: ${e}`);let t=360-e;t+=this.delta_yaw,t=be(t),console.log(`Init Yaw: ${t}`);for(let n=0;n<this.NumParticle;n++){let r=(2*Math.random()-1)*this.initial_yaw_uncertainty;this.particleX[2][n]=t+r}this.particle_yawInitFlag=!0,this.xEst[2][0]=t,this.last_yaw_compass=t,this.compass_consecutive_offset_count=0}};var je=Zt(require("mathjs"),1),qe=class{fre=100;accH_fifo=[];accH_time_fifo=[];accH_fifo_len=Math.floor(1*this.fre)+1;step_count=0;state_count=0;last_valley_time=0;last_peak_time=0;last_step_time=0;min_step_time=.3;max_step_time=1;min_peak=10.5;max_valley=9.5;peak_num=0;valley_num=0;fft_min_amp=.3;fft_min_fre=0;fft_max_fre=4;last_fft_amp=0;abnor_start_time=0;abnor_fft_detected=!1;abnor_time_threshold=4;abnor_peak_time=0;abnor_peak_accH=0;const_step_length=.65;last_rot=[];delta_rot=[];last_yaw=0;delta_yaw=null;delta_rot_sum_fifo=[];delta_rot_sum_time_fifo=[];delta_yaw_accum=0;delta_yaw_accum_timestamp=0;delta_yaw_time_threshold=.5;last_px=0;last_py=0;delta_px=0;delta_py=0;init(){this.fre=100,this.accH_fifo=[],this.accH_time_fifo=[],this.accH_fifo_len=Math.floor(1*this.fre)+1,this.step_count=0,this.state_count=0,this.last_valley_time=0,this.last_peak_time=0,this.last_step_time=0,this.min_step_time=.3,this.max_step_time=1,this.min_peak=10+.5,this.max_valley=10-.5,this.peak_num=0,this.valley_num=0,this.fft_min_amp=.3,this.fft_min_fre=0,this.fft_max_fre=4,this.last_fft_amp=0,this.abnor_start_time=0,this.abnor_fft_detected=!1,this.abnor_peak_time=0,this.abnor_peak_accH=0,this.const_step_length=.65,this.last_rot=[0,0,0],this.delta_rot=[0,0,0],this.last_yaw=0,this.delta_yaw=null,this.delta_rot_sum_fifo=[],this.delta_rot_sum_time_fifo=[],this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=0,this.delta_yaw_time_threshold=.5,this.last_px=0,this.last_py=0,this.delta_px=0,this.delta_py=0}reset(){this.init()}setInitPose(e=[0,0]){this.last_px=e[0],this.last_py=e[1],console.info(`pdr init pos: ${this.last_px}, ${this.last_py}`)}setInitYaw(e=0){this.last_yaw=e}getPos(e,t,n){let r=0;return n.length===3&&(this.delta_yaw=this.getDeltaYawFromRot(e,n)),t.length===3&&(r=this.getStepLength(e,t)),r!==0&&(this.last_px+=this.delta_px,this.last_py+=this.delta_py),[this.last_px,this.last_py]}getDeltaPose(){return[this.delta_px,this.delta_py]}getStepLength(e,t){if(t.length<3)return console.warn("acc data less than 3"),0;let n=!1,r=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2));if(this.accH_fifo.push(r),this.accH_time_fifo.push(e),this.imuFreUpdate(),this.accH_fifo.length<this.accH_fifo_len+1)n=!1;else{for(;this.accH_fifo.length>=this.accH_fifo_len+1;)this.accH_fifo.shift(),this.accH_time_fifo.shift();let i=this.PVStepDetec(),o=this.FFTStepDetec(),a=this.recheckState(),l=this.accH_time_fifo[Math.floor(this.accH_time_fifo.length*3/4)];Math.abs(this.abnor_start_time)<.001&&this.abnor_fft_detected?this.abnor_start_time=l:this.abnor_fft_detected||(this.abnor_start_time=0),i&&o&&a?(this.step_count+=1,this.last_step_time=l,n=!0):Math.abs(this.abnor_start_time)>.001&&this.abnor_peak_time-this.abnor_start_time>this.abnor_time_threshold&&this.step_count>1&&this.abnor_peak_time-this.last_step_time>1?(this.step_count+=1,this.last_step_time=l,n=!0):(l-this.last_step_time>2&&(this.state_count=0),n=!1)}if(n){let i=this.last_yaw/180*Math.PI;return this.delta_px=this.const_step_length*Math.cos(i),this.delta_py=this.const_step_length*Math.sin(i),this.const_step_length}else return 0}imuFreUpdate(){if(this.accH_time_fifo.length>2&&(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]<0||this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]>10||this.accH_time_fifo[this.accH_time_fifo.length-1]===this.accH_time_fifo[0])&&(console.warn(`pdr reset last one time ${this.accH_time_fifo[this.accH_time_fifo.length-1]} last two time ${this.accH_time_fifo[this.accH_time_fifo.length-2]}`),this.reset()),this.accH_fifo.length>9||this.fre<15){let e=(this.accH_fifo.length-1)/(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[0]);Math.abs(this.fre-e)>8&&(this.fre=Math.round((e-3)/10)*10,(this.fre<=10||this.fre>=100)&&(console.warn(`Frequency Error ${this.fre}`),this.fre=100),console.debug(`Frequency change to ${this.fre}`),this.accH_fifo_len=Math.floor(1*this.fre)+1)}}recheckState(){return!0}PVStepDetec(){let e=!1,t=this.accH_fifo.slice(Math.floor(this.accH_fifo_len/2)),n=this.accH_time_fifo.slice(Math.floor(this.accH_fifo_len/2)),r=t[Math.floor(t.length/2)],i=n[Math.floor(n.length/2)],o=Math.max(...t),a=Math.min(...t),l=!1,u=!1;return Math.abs(r-a)<.01&&r<this.max_valley&&this.valley_num<=this.peak_num&&(this.last_valley_time===0?u=!0:u=i-this.last_valley_time>this.min_step_time,u&&(this.last_valley_time=i,this.valley_num+=1)),Math.abs(r-o)<.01&&r>this.min_peak&&this.peak_num<=this.valley_num&&(this.last_peak_time===0?l=!0:l=i-this.last_peak_time>this.min_step_time,l&&(this.last_peak_time=i,this.peak_num+=1)),r===o&&r>this.min_peak&&(this.abnor_peak_time=i,this.abnor_peak_accH=r),this.peak_num===this.valley_num&&(l||u)&&(e=!0),e}FFTStepDetec(){return!0}getDeltaYawFromRot(e,t){if(t.length<3)return console.warn("rot data less than 3"),0;let n=[0,0,0];this.last_rot.length===3&&(n=t.map((a,l)=>a-this.last_rot[l]));for(let a=0;a<t.length;a++)n[a]<-180?n[a]+=360:n[a]>180&&(n[a]-=360);let r=.2;this.delta_rot.length===3?this.delta_rot=this.delta_rot.map((a,l)=>r*a+(1-r)*n[l]):this.delta_rot=n,this.last_rot=t,this.delta_yaw=this.delta_rot[0],this.last_yaw+=this.delta_yaw,this.last_yaw=this.limitYaw(this.last_yaw);let i=this.delta_rot.reduce((a,l)=>a+Math.abs(l),0);this.delta_rot_sum_fifo.push(i),this.delta_rot_sum_time_fifo.push(e),Math.abs(this.delta_rot_sum_time_fifo[this.delta_rot_sum_time_fifo.length-1]-this.delta_rot_sum_time_fifo[0])>1&&(this.delta_rot_sum_fifo.shift(),this.delta_rot_sum_time_fifo.shift()),this.delta_yaw_accum+=this.delta_yaw;let o=0;return Math.abs(this.delta_yaw_accum_timestamp-e)>this.delta_yaw_time_threshold?(o=this.delta_yaw_accum,this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=e,o):null}limitYaw(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};var Ye=class{particleFilter;pdr;sigmaBeacon=5;gps_horizontalAccuracy=10;using_gps=!0;last_beacon_time=null;last_pos_time;position_count=0;gps_max_horizontalAccuracy=20;MaxEstimateErr=5;outTrustRegionNum=0;TrustNum=4;cacheSensorData=[];constructor(){this.particleFilter=new We({NumParticle:200,reSampNumParticle:.65,initial_xy_uncertainty:12,initial_yaw_uncertainty:100,step_noise_sigma:.5,yaw_noise_sigma:2,compass_update_interval:3e3,sigmaCompass:80,delta_yaw:2,sigmaBeacon:5,unaccess_weight:.7}),this.pdr=new qe}pfFusionPDRiBeacon(e){let{type:t,timestamp:n,res:r}=e,i=!1;if(this.particleFilter.getPosInitFlag()&&this.particleFilter.getYawInitFlag()){if(t==="acceleration"){let o=r,a=this.pdr.getStepLength(n/1e3,o);a!==0&&(this.particleFilter.motionModelStepLength(a,()=>!0),this.particleFilter.resampling(),this.position_count+=1,i=!0)}if(this.using_gps&&t==="gps"&&(this.last_beacon_time===null||n-this.last_beacon_time>5e3)){let o=this.getGpsPosition(r);i=o!==null,o&&(this.particleFilter.update(o,this.gps_horizontalAccuracy),this.resetParticleFilterDist(o),this.particleFilter.resampling(),this.position_count+=1)}if(t==="deviceMotion"){let o=this.pdr.getDeltaYawFromRot(n/1e3,r);o!==null&&this.particleFilter.motionModelRotYaw(o)}t==="compass"&&this.particleFilter.motionModelCompassYaw(r,n),this.last_pos_time&&n-this.last_pos_time>500&&(this.position_count+=1,i=!0)}else if(!this.particleFilter.getPosInitFlag()&&this.using_gps&&t==="gps"){let o=this.getGpsPosition(r);i=o!==null,o?(this.particleFilter.initParticlesByPos(o.x,o.y,()=>!0),this.last_pos_time=n,console.log(`init Pos by gps success time ${n}`),this.cacheSensorData.length=0):console.log(`init Pos by gps fail time ${n}`)}else if(!this.particleFilter.getYawInitFlag()&&t==="compass"){let o=r;this.particleFilter.initParticlesByCompass(o),this.particleFilter.setLastCompassTime(n),console.log(`init yaw by compass success time ${n}`)}else this.cacheSensorData.push(e);return i&&(this.last_pos_time=n),[i,this.particleFilter.getResultX(),this.particleFilter.getResultY()]}setBeaconPosition(e,t){return this.last_beacon_time=t,this.particleFilter.getPosInitFlag()?this.particleFilter.update(e,this.sigmaBeacon):this.particleFilter.initParticlesByPos(e.x,e.y,()=>!0),this.resetParticleFilterDist(e),this.particleFilter.resampling(),this.position_count+=1,this.cacheSensorData.filter(r=>r.timestamp>t).map(r=>this.pfFusionPDRiBeacon(r)),this.cacheSensorData.length=0,[this.particleFilter.getResultX(),this.particleFilter.getResultY()]}getGpsPosition(e){return e[2]>this.gps_max_horizontalAccuracy?null:ni(e[0],e[1])}resetParticleFilterDist(e){let t=this.particleFilter.getResultX(),n=this.particleFilter.getResultY();$t(t,n,e.x,e.y)>this.MaxEstimateErr?(this.outTrustRegionNum+=1,this.outTrustRegionNum>=this.TrustNum&&(console.info(`\u8D85\u51FA\u53EF\u4FE1\u533A\u57DF\uFF0C\u91CD\u7F6E\u7C92\u5B50\u8FC7\u6EE4\u5668\u5230: ${e.x}, ${e.y}`),this.particleFilter.setPosInitFlag(!1),this.particleFilter.setYawInitFlag(!1),this.outTrustRegionNum=0)):this.outTrustRegionNum=0}};var Fn=class extends ri.EventDispatcher{sensor;pdr;_pause=!1;constructor(e={}){super(),this.sensor=new Ee(e.sensor),this.pdr=new Ye}checkSensor(){return this.sensor.checkSensor()}start(){this.sensor.start(),this.sensor.addEventListener("add-data-item",({item:e})=>{this.getPositionBySensorItem(e,!this._pause)})}pause(){this._pause=!0}continue(){this._pause=!1}getPositionBySensorItem(e,t=!0){let[n,r,i]=this.pdr.pfFusionPDRiBeacon(e);return n&&t&&this.dispatchEvent({type:"position",x:r,y:i,_type:e.type==="gps"?"gps":"pdr"}),[n,r,i]}setBeaconPosition(e,t){let[n,r]=this.pdr.setBeaconPosition(e,t);this.dispatchEvent({type:"position",x:n,y:r,_type:"beacon"})}dispose(){this.sensor.stop()}};async function Un({brand:s,project:e},t){let{apiDomain:n,apiPath:{floorRange:r},apiInfo:i}=t,o=`${n}${r}?brand=${s}&project=${e}&phase=${e}&building=${e}`;return await fetch(o,i).then(l=>l.json()).then(l=>l.data).then(l=>{let u=(l||[])[0];return u&&(u.info=JSON.parse(u.info)),u})}async function Bn({brand:s,project:e,floor:t,ts:n,resource_type_list:r},i){let{apiDomain:o,apiPath:{floorGraphic:a},apiInfo:l}=i,u=`${o}${a}?brand=${s}&project=${e}&phase=${e}&building=${e}&floor=${t}&ts=${n}&resource_type_list=${r}`;return await fetch(u,l).then(h=>h.json()).then(h=>h.data).then(h=>((h||[]).map(p=>p.info=JSON.parse(p.info)),h||[]))}async function $i({project:s,floor:e},t){let{apiDomain:n,apiInfo:r}=t,i=`${n}/api/inception-map/external_street/get?projectCode=${s}&floorCode=${e}`;return await fetch(i,r).then(a=>a.json()).then(a=>a.data).then(a=>JSON.parse(a[0].streetInfo||"{}")).then(a=>a.fileId?Ki(a.fileId,t):null)}async function Ki(s,e){let{apiDomain:t,apiInfo:n}=e;return fetch(`${t}/api/inception-map/file/getFileStream?fileId=${s}`,n).then(r=>r.arrayBuffer()).then(r=>{let o=new TextDecoder("utf-8").decode(r);return o?JSON.parse(o):null})}var ht;function ii(s="aibee_map",e=1){return new Promise((t,n)=>{if(ht)return t({db:ht,type:"success"});let r=indexedDB.open(s,e);r.onupgradeneeded=function(i){ht=i.target.result,console.log("onupgradeneeded"),t({db:ht,type:"onupgradeneeded"})},r.onsuccess=i=>{ht=i.target.result,t({db:ht,type:"success"})},r.onerror=i=>{n(i)}})}function Gn(s,e,t=ht){return new Promise((n,r)=>{t||r("\u6CA1\u6709db");let o=t.transaction([s],"readonly").objectStore(s).get(e);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=a=>{console.log("[getVersionByKey]",a),n(null)}})}function oi(s,e,t,n=ht){return new Promise((r,i)=>(n||i("\u6CA1\u6709db"),new Promise(async(o,a)=>{let l=await Gn(s,e),u=n.transaction([s],"readwrite").objectStore(s),c=l!==null?u.put({key:e,value:t}):u.add({key:e,value:t});c.onsuccess=function(h){o(h)},c.onerror=function(h){a(h)}})))}function zt(s,e=ht){e&&(e.objectStoreNames.contains(s)||e.createObjectStore(s,{keyPath:"key"}))}function si(s=ht){s?.close(),ht=null}var ai="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAGQCAYAAAAUdV17AAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAABLKADAAQAAAABAAABkAAAAAAun0XIAAAtt0lEQVR4Ae2dB9glRZm2ZxyyMiTJA0oaQFlgCJKzxEVZlCgiCJhYWBXDyqLrirL/qqy4oLD4iyQRFARFUGFILiBhJC1Z0iBRsuQwMHs/w3eY84WTu7uqup66rvc753Soet+7up+vqrq7evw4p6gIzJw5c04cWhlbbcjey+cK2NzYXE2m7Z7B7semN9ldfL92/Pjxr/LpZAK1IjC+VtEkGgwitSKu74J9GFsTmwMbJL3AzpdhF2AXIl538ulkAiZgAv0RQKQmY4dhN2Blp+kU8G/Y4v15671MwASyJIBoTMHOxUKklyn0RGz1LOE7aBMwge4IIBJrYOdgsaSLcWT97rz3ViZgAlkQQBSWxc7C3sBiS6/j0A+xiVlUhoM0ARNoTQAh2AN7Gos9PYSDGvB3MgETyI0AJ/9E7JTYVWoM/37NsoVyqy/Hmw4B39ZQcF1xwm9AlqdhyxWcdVXZ6RaIHbgV4t6qCnQ5JtAtAQtWt6S62A6x2pHNzsTm6WLzmDd5HOd2QrSuitlJ+5YfgbflF3I5ESNWuvHzbCx1sRKgRbFLiGk3/XAygVgIWLAKqAlO7L3J5gxMj8vUJUl4zyC2T9QlIMeRPgF3CQes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5VfLiVCAAIQgMAoAtM8hzxBG/8iWXjUTn5CAAIQgEA5BLwA08S36GZkr7Hw+XLKpBQIQAACEGhB4BjF4sc9ZTFGX76hj2+2yMQmCEAAAhAojoDXtDhBMfj7LmLEHRaavthd274qead3kiAAAQhAoDACN8nycQrG04dLGBGQhzcqML9D3zeSZFl+c1iNTwhAAAIQ6ExgePnNGxWI7+qclb0QgAAEINA3Av8fPece3M0Z0YQAAAAASUVORK5CYII=";var ci='data:image/svg+xml,<svg viewBox="12 22 54 38" xmlns="http://www.w3.org/2000/svg">%0A%09<g fill="%23ffffff">%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 14.25,32.165L 20.479,49.0255L 25.7981,49.0255L 32.1671,32.165L 26.568,32.165L 24.3633,39.9922C 23.9959,41.4233 23.681,42.8056 23.4185,44.139L 23.3135,44.139C 23.0569,42.8182 22.7303,41.4454 22.3337,40.0207L 20.0241,32.165L 14.25,32.165 Z "/>%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 39.915,49.0255L 39.915,32.165L 34.6763,32.165L 34.6763,49.0255L 39.915,49.0255 Z M 37.4891,24.4171C 36.6275,24.4336 35.946,24.6849 35.4446,25.1711C 34.9433,25.6573 34.6872,26.2791 34.6763,27.0366C 34.6865,27.7789 34.9353,28.3964 35.4229,28.8889C 35.9105,29.3814 36.5761,29.637 37.4196,29.6557C 38.3131,29.637 39.0091,29.3814 39.5075,28.8889C 40.006,28.3964 40.2592,27.7789 40.2677,27.0366C 40.2426,26.2791 39.9879,25.6573 39.5032,25.1711C 39.0185,24.6849 38.3471,24.4336 37.4891,24.4171 Z "/>%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 44.1851,56.0691L 49.4238,56.0691L 49.4238,47.5447L 49.4957,47.5447C 49.8997,48.0793 50.4949,48.5157 51.2811,48.854C 52.0674,49.1922 52.9953,49.3668 54.0649,49.3777C 56.0656,49.3912 57.8266,48.6768 59.3479,47.2346C 60.8692,45.7923 61.6699,43.5413 61.75,40.4814C 61.6918,37.7576 60.9918,35.6378 59.6502,34.122C 58.3085,32.6062 56.6746,31.8365 54.7485,31.8126C 52.1604,31.842 50.213,32.7675 48.9065,34.5891L 48.8375,34.5891L 48.5963,32.165L 44.0443,32.165C 44.1264,33.761 44.1734,35.6713 44.1851,37.8958L 44.1851,56.0691 Z M 49.4238,39.5729C 49.4238,39.272 49.4598,38.971 49.5317,38.6699C 49.7288,37.8746 50.1261,37.2334 50.7235,36.7462C 51.3209,36.2591 52.0149,36.0087 52.8057,35.9949C 54.0304,36.0239 54.9538,36.4784 55.576,37.3585C 56.1981,38.2386 56.5099,39.3704 56.5114,40.7541C 56.5024,42.2152 56.1696,43.3745 55.513,44.2321C 54.8564,45.0896 53.93,45.5282 52.7337,45.5477C 51.9302,45.5325 51.2437,45.2937 50.674,44.8313C 50.1044,44.3689 49.7236,43.774 49.5317,43.0467C 49.4598,42.7109 49.4238,42.3404 49.4238,41.9352L 49.4238,39.5729 Z "/>%0A%09</g>%0A</svg>%0A';var pi=require("three"),eo={loadRoadNetwork:!1},zn="map_version",kn="route_version",Vn="facility_version",Hn="map_data",$e="road_network_data",Wn="facility_data",hi={half:ai,power:li,mechanical:ui,vip:ci},Xn=class{constructor(e){this.bmap=e;this.initDbPromise=this.initDb()}floors=[];initDbPromise=Promise.resolve();db=null;async initDb(){try{let{db:e,type:t}=await ii("aibee_map",2);t==="onupgradeneeded"&&(zt(zn),zt(kn),zt(Vn),zt(Hn),zt($e),zt(Wn)),this.db=e}catch(e){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",e)}}async load(e){if(Array.isArray(e))this.floors=e;else{let t=await fetch(e).then(n=>n.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(e,t,n){return this.initDbPromise.then(()=>oi(e,`${t}`,n,this.db))}getCacheData(e,t){return this.initDbPromise.then(()=>Gn(e,`${t}`,this.db))}getFloorCacheKey(e){return`${e.floor_id}`}async getFloorData(e){let t=this.floors.find(r=>r.floor===e);if(!t)return null;let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(zn,n)===t.version_id){let i=await this.getCacheData(Hn,n);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch(r){return console.log("[get floor data error]",r),this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(e){let t=this.getFloorCacheKey(e);console.time("zstd_json");let n=await fetch(e.map_url).then(r=>r.json());return n.floor=e.floor,console.timeEnd("zstd_json"),this.setCacheData(Hn,t,n),this.setCacheData(zn,t,e.version_id),this.getDataByJson(n)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(kn,n)===t.version_id){let o=await this.getCacheData($e,n);if(o)return o}let i=await fetch(t.route_url).then(o=>o.json());return this.setCacheData($e,n,i),this.setCacheData(kn,n,t.version_id),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return this.setCacheData($e,n,r),r}}))).filter(t=>t.points)}async getFacilitiesData(){let e=this.floors[0];if(!e)return null;let t=this.getFloorCacheKey(e),n=async()=>{let r=await fetch(e.entry_infra_url).then(i=>i.json());return r&&(this.setCacheData(Wn,t,r),this.setCacheData(Vn,t,e.version_id)),r};try{if(await this.getCacheData(Vn,t)===e.version_id){let i=await this.getCacheData(Wn,t);if(i)return i}return n()}catch(r){return console.log("[get facility error]",r),n()}}async getOtherDataByFreeTime(){}async getMulFloorsData(e){return Promise.all(e.map(t=>this.getFloorData(t))).then(t=>t.filter(n=>n))}async getDataByUrl(e){let t=await fetch(e).then(n=>n.json());return this.getDataByJson(t)}getDataByJson(e){let t=new ct(this.bmap.context);t.userData.graphics=[],t.userData.graphicMap=new Map;let n=[0,0];return e.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y];break;case"graph":X(r.elements,n);let o=[];r.elements.forEach(f=>{f.group==="ground"?t.createGround(f):o.push(f)});let a=o.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b,height:T,airHeight:k}=g,$=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}-${T}-${k}`;return b===0&&($=`${E.toLowerCase()}-${x}-${T}-${k}`),f[$]?f[$].push(g):f[$]=[g],f},{});Object.values(a).forEach(f=>{let g=new fe(this.bmap.context,f);t.mergeGraphicLayer.add(g)});break;case"ground":X(r.elements,n);let l=r.elements.map(f=>new R(this.bmap.context,f));t.addGrounds(l);break;case"wall":X(r.elements,n);let u=r.elements.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b,height:T}=g,k=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}-${T}`;return b===0&&(k=`${E.toLowerCase()}-${x}-${T}`),f[k]?f[k].push(g):f[k]=[g],f},{});Object.values(u).forEach(f=>{let g=new ce(this.bmap.context,f);t.wallLayer.add(g)});break;case"lane":X(r.elements,n);let c=r.elements.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b}=g,T=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}`;return b===0&&(T=`${E.toLowerCase()}-${x}`),f[T]?f[T].push(g):f[T]=[g],f},{});Object.values(c).forEach(f=>{let g=new pe(this.bmap.context,f);t.laneLayer.add(g)});break;case"texture2d":case"texture3d":if(X(r.elements,n),r.elements.length){let f=new qt(this.bmap.context,r.elements);t.textureLayer.add(f)}break;case"glb":X(r.elements,n),r.elements.forEach(f=>{let g=rt([f.center_x,f.center_y],n),E=new he(this.bmap.context,{...f,url:f.secondUrl,rotate:f.secondRotate,width:f.secondWidth,center_x:g[0],center_y:g[1]});t.glbModelLayer.add(E)});break;case"store":X(r.elements,n),r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n),E=t.addGraphic(f);t.userData.graphics.push(E),t.userData.graphicMap.set(f.id,E);try{let x=new q(this.bmap.context,{id:f.id,icon:f.poi_info.icon,text:f.poi_info.showName||f.store_name||f.poi_info.text,position:{x:g[0],y:g[1],z:f.airHeight+f.height},icon_size:[18,18],level:f.poi_info.level||0});t.poiLayer2.pushPoi(x),x&&(x.userData.type="store",x.userData.data=f)}catch(x){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",x,f)}});break;case"facility":X(r.elements,n),r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n),E=t.addGraphic(f);if(t.userData.graphics.push(E),t.userData.graphicMap.set(f.id,E),f.poi_info){let x=new q(this.bmap.context,{id:f.id,icon:f.poi_info.icon,text:f.poi_info.showName||f.store_name||f.poi_info.text,position:{x:g[0],y:g[1],z:f.airHeight+f.height},icon_size:[18,18],level:f.poi_info.level||0});t.poiLayer2.pushPoi(x),x.userData.type="facility",x.userData.data=f}else console.log("\u6DFB\u52A0facility\u5931\u8D25\u6CA1\u6709poi_info",f)});break;case"parkingSpace":X(r.elements,n);let h=[],p=new Map;r.elements.forEach(f=>{let g=t.addGraphic(f);h.push(g),p.set(f.id,g);let E=rt([f.center_x,f.center_y],n);if(f.texts[0]){let x=new q(this.bmap.context,{id:f.id,text:f.texts[0],position:{x:E[0],y:E[1],z:f.airHeight+f.height}});x&&(x.userData.type="parkingSpace",x.userData.data=f),t.poiLayer2.pushPoi(x)}});let d=r.elements.filter(f=>hi[f.parkingType]).map(f=>{let g=rt([f.center_x,f.center_y],n),E=en(f.geometry.coords,g);return{uuid:f.id,iconUrl:hi[f.parkingType],name:f.texts[0],deltaHeight:f.deltaHeight,airHeight:f.airHeight,height:f.height,geometry:{...f.geometry,coords:E},opacity:f.fillOpacity,visible:!0}});if(d.length){let f=new qt(this.bmap.context,d);t.textureLayer.add(f)}t.userData.parkingSpaces=h,t.userData.parkingSpacesGraphicMap=p;break;case"text":X(r.elements,n);let m=new de(this.bmap.context,r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n);return{...f,center_x:g[0],center_y:g[1]}}));t.textTextureLayer.add(m);break}}),t.updateBox(),t.userData.center=n,t.userData.height=t.box.getSize(new pi.Vector3).z+e.floorHeight*10,t.name=e.floor,t.userData.data=e,t}async clear(){si(this.db??void 0)}dispose(){this.clear()}};var qn=class{constructor(e){this.bmap=e}cacheData=new Map;floorDataLengthMap=new Map;buildingGroundMap=new Map;externalStreetMap=new Map;async load(e){let t=Lt(e);if(this.cacheData.has(t))return this.cacheData.get(t);let[,n]=await Promise.all([this.loadBuildGround(e),Bn(e,this.bmap.config)]),r=Lt({floor:e.floor,ts:e.ts});X(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(t,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),this.loadExternalStreet(e),n}async loadExternalStreet(e){}switchFloorByData(e,t){if(!e.length)return;let n=t.userData.legacyToGraphicMap||new Map,r=t.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:a}=this.bmap.config;for(let l=0;l<e.length;l++){let u=e[l];u.info.group==="ground"?(u.info.fillColor=i.color,u.info.fillOpacity=i.opacity,u.info.height=i.height,u.info.stroke=i.stroke,u.info.strokeColor=i.strokeColor,u.info.strokeOpacity=i.strokeOpacity):u.info.userData.mark?(u.info.height=o.height,u.info.fillColor=o.color,u.info.fillOpacity=o.opacity,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity):(u.info.fillOpacity=a.fillOpacity,this.bmap.config.initTransToMark&&(u.info.height=o.height,u.info.fillColor=o.color,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity))}for(let l of e){if(l.info.group==="ground")t.createGround(l.info);else{let u=t.addGraphic(l.info);u.userData.data=l,n.set(l.legacy_id,u)}r.set(l.element_uuid,l)}t.userData.legacyToGraphicMap=n,t.userData.graphicMap=r,t.updateBox(),t===this.bmap.context.currentFloor?(this.bmap.triggerHooks("switch_floor_before",{curFloor:t,graphics:t.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:t,graphics:t.graphicLayer.children})):this.bmap.switchFloorByFloor(t)}filterData(e,t){let n=t.userData.graphicMap||new Map;return e.filter(r=>!n.has(r.element_uuid))}async switchFloorByStoreData(e,t){let n=await this.load({...e,resource_type_list:"6"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async switchFloorByOtherData(e,t){let n=await this.load({...e,resource_type_list:"1,2,3,4"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async loadBuildGround({brand:e,project:t}){let n=await this.loadBuildingGround({brand:e,project:t});return this.bmap.currentBuildGround=n,this.bmap.changeBuildingCenter(n,{brand:e,project:t}),this.bmap.currentBuildGround}async loadBuildingGround({brand:e,project:t}){let n=Lt({brand:e,project:t});if(this.buildingGroundMap.has(n))return this.buildingGroundMap.get(n);let r=Un({brand:e,project:t},this.bmap.config).then(i=>(this.buildingGroundMap.set(n,i),i));return this.buildingGroundMap.set(n,r),r}async switchFloor(e){let t=new ct(this.bmap.context);t.name=e.floor;try{await Promise.all([this.switchFloorByStoreData(e,t),this.switchFloorByOtherData(e,t)])}catch(n){console.log(n)}return t}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}};
7534
+ `)}var Dn=class extends Qr.EventDispatcher{worker=Nn();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await ut(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),ut(this.worker,"get_path",{start:e,end:t,type:n}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(e){return ut(this.worker,"get_direction_path",e)}async dispose(){ut(this.worker,"clear",""),this.worker.terminate()}};var ti=require("three"),Ve=class extends J{startPoint;endPoint;rect;frustum=new ti.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),B(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);B(this.rect,n.x,n.y,r,i)}else B(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=y(this.startPoint,t,n,r),o=y(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof R&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=y(p,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=y(l,r,i,o),h=y(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var Yi={boxSelection:!1,elements:["graphic","poi"]},On=class extends st{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Yi,...t},this.boxSelection=new Ve(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:r,y:i}=this.downPoint;if(Math.sqrt((r-t)**2+(i-n)**2)>3)return;let o=new Set,a=[],l=[];if(this.options.elements.includes("graphic")){let{graphics:u}=this.bmap.context.getGraphicsByDeviceXy(t,n);u.map(c=>o.add(c.options.id)),a.push(...u)}if(this.options.elements.includes("poi")){let u=this.bmap.context.getPoisByDeviceXy(t,n);l.push(...u),u.forEach(c=>{if(!o.has(c.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&(o.add(c.options.id),a.push(h))}})}(!this.options.boxSelection||!(It?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),a.forEach(u=>this._list.add(u)),l.forEach(u=>this._poiList.add(u)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Rt(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Rt(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),this._poiList.clear(),e.forEach(t=>{if(this.options.elements.includes("graphic")&&this._list.add(t),this.options.elements.includes("poi")){let n=this.bmap.getPoiById(t.options.id);n&&this._poiList.add(n)}}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var Y=require("lodash");var ni=require("three");var $i={time:1e3,elements:["compass","deviceMotion","acceleration","gps"]},Ee=class extends ni.EventDispatcher{options;gpsTimer=null;data=[];timer=new D;dispatchTimer=null;constructor(e={}){super(),this.options={...$i,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,Y.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addAcceleration=(0,Y.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=(0,Y.throttle)(e=>{let t=Date.now(),{alpha:n,beta:r,gamma:i}=e;if((0,Y.isNil)(n)||(0,Y.isNil)(r)||(0,Y.isNil)(i))return;let o;Ht?o=e.webkitCompassHeading:o=360-n,this.options.elements.includes("deviceMotion")&&this.addDataItem({type:"deviceMotion",timestamp:t,res:[n,r,i]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:o})},200);listenDeviceOrientation(){Ht?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,Y.isNil)(t)||(0,Y.isNil)(t.x)||(0,Y.isNil)(t.y)||(0,Y.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{e.coords.accuracy<=10&&this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!Ht)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),Ht?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,Y.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var ii=require("three");function He(s,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(s,2)/(2*Math.pow(e,2)))}function be(s){return(s+360)%360}function ri(s,e){let n=6378137*s*Math.PI/180,r=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:r}}function $t(s,e,t,n){return Math.sqrt(Math.pow(Math.abs(s-t),2)+Math.pow(Math.abs(e-n),2))}var Xe=Zt(require("mathjs"),1),We=class{NumParticle;reSampNumParticle;initial_xy_uncertainty;initial_yaw_uncertainty;step_noise_sigma;yaw_noise_sigma;compass_update_interval;sigmaCompass;delta_yaw;sigmaBeacon;unaccess_weight;particle_PosInitFlag;particle_yawInitFlag;xEst;particleX;particleWeight;last_compass_time;last_yaw_compass=0;compass_consecutive_offset_count=0;constructor(e){this.NumParticle=e.NumParticle,this.reSampNumParticle=e.reSampNumParticle,this.initial_xy_uncertainty=e.initial_xy_uncertainty,this.initial_yaw_uncertainty=e.initial_yaw_uncertainty,this.step_noise_sigma=e.step_noise_sigma,this.yaw_noise_sigma=e.yaw_noise_sigma,this.compass_update_interval=e.compass_update_interval,this.sigmaCompass=e.sigmaCompass,this.delta_yaw=e.delta_yaw,this.sigmaBeacon=e.sigmaBeacon,this.unaccess_weight=e.unaccess_weight,this.particle_PosInitFlag=!1,this.particle_yawInitFlag=!1,this.xEst=[[0],[0],[0]],this.particleX=Array.from({length:3},()=>Array(this.NumParticle).fill(0)),this.particleWeight=Array.from({length:1},()=>Array(this.NumParticle).fill(1/this.NumParticle)),this.last_compass_time=0}motionModelRotYaw(e){if(!(Math.abs(e)<.001)){this.last_yaw_compass=be(this.last_yaw_compass+e);for(let t=0;t<this.NumParticle;t++){let n=Math.random()*this.yaw_noise_sigma;this.particleX[2][t]=this.particleX[2][t]+e+n,this.particleX[2][t]=be(this.particleX[2][t])}}}motionModelStepLength(e,t){if(e===0)return;for(let r=0;r<this.NumParticle;r++){let i=Math.random()*this.step_noise_sigma;this.particleX[0][r]+=(.65+i)*Math.sin(-this.particleX[2][r]/180*Math.PI),this.particleX[1][r]+=(.65+i)*Math.cos(this.particleX[2][r]/180*Math.PI),t(this.particleX[0][r],this.particleX[1][r])||(this.particleWeight[0][r]*=this.unaccess_weight)}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}motionModelCompassYaw(e,t){if(t-this.last_compass_time>this.compass_update_interval){let n=360-e;n+=this.delta_yaw,n=be(n),Math.abs(n-this.last_yaw_compass)>60?this.compass_consecutive_offset_count++:this.compass_consecutive_offset_count=0;for(let i=0;i<this.NumParticle;i++){let o=Math.abs(this.particleX[2][i]-n);o>180&&(o=360-o),this.particleWeight[0][i]*=He(o,this.sigmaCompass)}let r=this.particleWeight[0].reduce((i,o)=>i+o,0);this.particleWeight[0]=this.particleWeight[0].map(i=>i/r),this.setLastCompassTime(t)}}resampling(){if(1/this.particleWeight[0].reduce((t,n)=>t+n*n,0)<this.reSampNumParticle){let t=this.particleWeight[0].reduce((a,l,u)=>a.concat(a[u]+l),[0]),r=this.particleWeight[0].map(()=>1/this.NumParticle).map((a,l)=>a+Math.random()/this.NumParticle),i=[],o=0;for(let a=0;a<this.NumParticle;a++){for(;r[a]>t[o];)o++;i.push(o)}this.particleX=this.particleX.map((a,l)=>i.map(u=>a[u])),this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle)}}update(e,t){for(let r=0;r<this.NumParticle;r++){let i=$t(this.particleX[0][r],this.particleX[1][r],e.x,e.y);this.particleWeight[0][r]=Math.max(1e-7,this.particleWeight[0][r]*He(i,t))}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}updateCar(e,t){let n=e.x-this.xEst[0][0],r=e.y-this.xEst[1][0];for(let o=0;o<this.NumParticle;o++){let a=$t(this.particleX[0][o],this.particleX[1][o],e.x,e.y);this.particleWeight[0][o]=Math.max(1e-7,this.particleWeight[0][o]*He(a,t)),this.particleX[0][o]+=n,this.particleX[1][o]+=r}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i)}getPosInitFlag(){return this.particle_PosInitFlag}getYawInitFlag(){return this.particle_yawInitFlag}setPosInitFlag(e){this.particle_PosInitFlag=e}setYawInitFlag(e){this.particle_yawInitFlag=e}getResultX(){let e=Xe.reshape(this.particleWeight,[this.NumParticle,1]),t=Xe.multiply(this.particleX,e);return this.xEst=t,this.xEst[0][0]}getResultY(){return this.xEst[1][0]}getResultYaw(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0]));return this.particleX[2][e]}getEstConfidence(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0])),t=this.particleWeight[0].indexOf(Math.min(...this.particleWeight[0])),n=[this.particleX[0][e],this.particleX[1][e]],r=[this.particleX[0][t],this.particleX[1][t]],i=$t(n[0],n[1],r[0],r[1]),o=i*.67;return console.log(i,o),o}getParticleNum(){return this.NumParticle}getParticleX(){return this.particleX}setLastCompassTime(e){this.last_compass_time=e}getLastCompassTime(){return this.last_compass_time}initParticlesByPos(e,t,n){if(!this.particle_PosInitFlag){this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle);let r=0;for(;r<this.NumParticle;){let o=(2*Math.random()-1)*this.initial_xy_uncertainty,a=(2*Math.random()-1)*this.initial_xy_uncertainty;n(e+o,t+a)||(this.particleWeight[0][r]*=this.unaccess_weight),this.particleX[0][r]=e+o,this.particleX[1][r]=t+a,r++}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i),this.particle_PosInitFlag=!0,this.xEst[0][0]=e,this.xEst[1][0]=t,this.xEst[2][0]=0}}initParticlesByCompass(e){console.log(`Init compass: ${e}`);let t=360-e;t+=this.delta_yaw,t=be(t),console.log(`Init Yaw: ${t}`);for(let n=0;n<this.NumParticle;n++){let r=(2*Math.random()-1)*this.initial_yaw_uncertainty;this.particleX[2][n]=t+r}this.particle_yawInitFlag=!0,this.xEst[2][0]=t,this.last_yaw_compass=t,this.compass_consecutive_offset_count=0}};var je=Zt(require("mathjs"),1),qe=class{fre=100;accH_fifo=[];accH_time_fifo=[];accH_fifo_len=Math.floor(1*this.fre)+1;step_count=0;state_count=0;last_valley_time=0;last_peak_time=0;last_step_time=0;min_step_time=.3;max_step_time=1;min_peak=10.5;max_valley=9.5;peak_num=0;valley_num=0;fft_min_amp=.3;fft_min_fre=0;fft_max_fre=4;last_fft_amp=0;abnor_start_time=0;abnor_fft_detected=!1;abnor_time_threshold=4;abnor_peak_time=0;abnor_peak_accH=0;const_step_length=.65;last_rot=[];delta_rot=[];last_yaw=0;delta_yaw=null;delta_rot_sum_fifo=[];delta_rot_sum_time_fifo=[];delta_yaw_accum=0;delta_yaw_accum_timestamp=0;delta_yaw_time_threshold=.5;last_px=0;last_py=0;delta_px=0;delta_py=0;init(){this.fre=100,this.accH_fifo=[],this.accH_time_fifo=[],this.accH_fifo_len=Math.floor(1*this.fre)+1,this.step_count=0,this.state_count=0,this.last_valley_time=0,this.last_peak_time=0,this.last_step_time=0,this.min_step_time=.3,this.max_step_time=1,this.min_peak=10+.5,this.max_valley=10-.5,this.peak_num=0,this.valley_num=0,this.fft_min_amp=.3,this.fft_min_fre=0,this.fft_max_fre=4,this.last_fft_amp=0,this.abnor_start_time=0,this.abnor_fft_detected=!1,this.abnor_peak_time=0,this.abnor_peak_accH=0,this.const_step_length=.65,this.last_rot=[0,0,0],this.delta_rot=[0,0,0],this.last_yaw=0,this.delta_yaw=null,this.delta_rot_sum_fifo=[],this.delta_rot_sum_time_fifo=[],this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=0,this.delta_yaw_time_threshold=.5,this.last_px=0,this.last_py=0,this.delta_px=0,this.delta_py=0}reset(){this.init()}setInitPose(e=[0,0]){this.last_px=e[0],this.last_py=e[1],console.info(`pdr init pos: ${this.last_px}, ${this.last_py}`)}setInitYaw(e=0){this.last_yaw=e}getPos(e,t,n){let r=0;return n.length===3&&(this.delta_yaw=this.getDeltaYawFromRot(e,n)),t.length===3&&(r=this.getStepLength(e,t)),r!==0&&(this.last_px+=this.delta_px,this.last_py+=this.delta_py),[this.last_px,this.last_py]}getDeltaPose(){return[this.delta_px,this.delta_py]}getStepLength(e,t){if(t.length<3)return console.warn("acc data less than 3"),0;let n=!1,r=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2));if(this.accH_fifo.push(r),this.accH_time_fifo.push(e),this.imuFreUpdate(),this.accH_fifo.length<this.accH_fifo_len+1)n=!1;else{for(;this.accH_fifo.length>=this.accH_fifo_len+1;)this.accH_fifo.shift(),this.accH_time_fifo.shift();let i=this.PVStepDetec(),o=this.FFTStepDetec(),a=this.recheckState(),l=this.accH_time_fifo[Math.floor(this.accH_time_fifo.length*3/4)];Math.abs(this.abnor_start_time)<.001&&this.abnor_fft_detected?this.abnor_start_time=l:this.abnor_fft_detected||(this.abnor_start_time=0),i&&o&&a?(this.step_count+=1,this.last_step_time=l,n=!0):Math.abs(this.abnor_start_time)>.001&&this.abnor_peak_time-this.abnor_start_time>this.abnor_time_threshold&&this.step_count>1&&this.abnor_peak_time-this.last_step_time>1?(this.step_count+=1,this.last_step_time=l,n=!0):(l-this.last_step_time>2&&(this.state_count=0),n=!1)}if(n){let i=this.last_yaw/180*Math.PI;return this.delta_px=this.const_step_length*Math.cos(i),this.delta_py=this.const_step_length*Math.sin(i),this.const_step_length}else return 0}imuFreUpdate(){if(this.accH_time_fifo.length>2&&(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]<0||this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]>10||this.accH_time_fifo[this.accH_time_fifo.length-1]===this.accH_time_fifo[0])&&(console.warn(`pdr reset last one time ${this.accH_time_fifo[this.accH_time_fifo.length-1]} last two time ${this.accH_time_fifo[this.accH_time_fifo.length-2]}`),this.reset()),this.accH_fifo.length>9||this.fre<15){let e=(this.accH_fifo.length-1)/(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[0]);Math.abs(this.fre-e)>8&&(this.fre=Math.round((e-3)/10)*10,(this.fre<=10||this.fre>=100)&&(console.warn(`Frequency Error ${this.fre}`),this.fre=100),console.debug(`Frequency change to ${this.fre}`),this.accH_fifo_len=Math.floor(1*this.fre)+1)}}recheckState(){return!0}PVStepDetec(){let e=!1,t=this.accH_fifo.slice(Math.floor(this.accH_fifo_len/2)),n=this.accH_time_fifo.slice(Math.floor(this.accH_fifo_len/2)),r=t[Math.floor(t.length/2)],i=n[Math.floor(n.length/2)],o=Math.max(...t),a=Math.min(...t),l=!1,u=!1;return Math.abs(r-a)<.01&&r<this.max_valley&&this.valley_num<=this.peak_num&&(this.last_valley_time===0?u=!0:u=i-this.last_valley_time>this.min_step_time,u&&(this.last_valley_time=i,this.valley_num+=1)),Math.abs(r-o)<.01&&r>this.min_peak&&this.peak_num<=this.valley_num&&(this.last_peak_time===0?l=!0:l=i-this.last_peak_time>this.min_step_time,l&&(this.last_peak_time=i,this.peak_num+=1)),r===o&&r>this.min_peak&&(this.abnor_peak_time=i,this.abnor_peak_accH=r),this.peak_num===this.valley_num&&(l||u)&&(e=!0),e}FFTStepDetec(){return!0}getDeltaYawFromRot(e,t){if(t.length<3)return console.warn("rot data less than 3"),0;let n=[0,0,0];this.last_rot.length===3&&(n=t.map((a,l)=>a-this.last_rot[l]));for(let a=0;a<t.length;a++)n[a]<-180?n[a]+=360:n[a]>180&&(n[a]-=360);let r=.2;this.delta_rot.length===3?this.delta_rot=this.delta_rot.map((a,l)=>r*a+(1-r)*n[l]):this.delta_rot=n,this.last_rot=t,this.delta_yaw=this.delta_rot[0],this.last_yaw+=this.delta_yaw,this.last_yaw=this.limitYaw(this.last_yaw);let i=this.delta_rot.reduce((a,l)=>a+Math.abs(l),0);this.delta_rot_sum_fifo.push(i),this.delta_rot_sum_time_fifo.push(e),Math.abs(this.delta_rot_sum_time_fifo[this.delta_rot_sum_time_fifo.length-1]-this.delta_rot_sum_time_fifo[0])>1&&(this.delta_rot_sum_fifo.shift(),this.delta_rot_sum_time_fifo.shift()),this.delta_yaw_accum+=this.delta_yaw;let o=0;return Math.abs(this.delta_yaw_accum_timestamp-e)>this.delta_yaw_time_threshold?(o=this.delta_yaw_accum,this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=e,o):null}limitYaw(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};var Ye=class{particleFilter;pdr;sigmaBeacon=5;gps_horizontalAccuracy=10;using_gps=!0;last_beacon_time=null;last_pos_time;position_count=0;gps_max_horizontalAccuracy=20;MaxEstimateErr=5;outTrustRegionNum=0;TrustNum=4;cacheSensorData=[];constructor(){this.particleFilter=new We({NumParticle:200,reSampNumParticle:.65,initial_xy_uncertainty:12,initial_yaw_uncertainty:100,step_noise_sigma:.5,yaw_noise_sigma:2,compass_update_interval:3e3,sigmaCompass:80,delta_yaw:2,sigmaBeacon:5,unaccess_weight:.7}),this.pdr=new qe}pfFusionPDRiBeacon(e){let{type:t,timestamp:n,res:r}=e,i=!1;if(this.particleFilter.getPosInitFlag()&&this.particleFilter.getYawInitFlag()){if(t==="acceleration"){let o=r,a=this.pdr.getStepLength(n/1e3,o);a!==0&&(this.particleFilter.motionModelStepLength(a,()=>!0),this.particleFilter.resampling(),this.position_count+=1,i=!0)}if(this.using_gps&&t==="gps"&&(this.last_beacon_time===null||n-this.last_beacon_time>5e3)){let o=this.getGpsPosition(r);i=o!==null,o&&(this.particleFilter.update(o,this.gps_horizontalAccuracy),this.resetParticleFilterDist(o),this.particleFilter.resampling(),this.position_count+=1)}if(t==="deviceMotion"){let o=this.pdr.getDeltaYawFromRot(n/1e3,r);o!==null&&this.particleFilter.motionModelRotYaw(o)}t==="compass"&&this.particleFilter.motionModelCompassYaw(r,n),this.last_pos_time&&n-this.last_pos_time>500&&(this.position_count+=1,i=!0)}else if(!this.particleFilter.getPosInitFlag()&&this.using_gps&&t==="gps"){let o=this.getGpsPosition(r);i=o!==null,o?(this.particleFilter.initParticlesByPos(o.x,o.y,()=>!0),this.last_pos_time=n,console.log(`init Pos by gps success time ${n}`),this.cacheSensorData.length=0):console.log(`init Pos by gps fail time ${n}`)}else if(!this.particleFilter.getYawInitFlag()&&t==="compass"){let o=r;this.particleFilter.initParticlesByCompass(o),this.particleFilter.setLastCompassTime(n),console.log(`init yaw by compass success time ${n}`)}else this.cacheSensorData.push(e);return i&&(this.last_pos_time=n),[i,this.particleFilter.getResultX(),this.particleFilter.getResultY()]}setBeaconPosition(e,t){return this.last_beacon_time=t,this.particleFilter.getPosInitFlag()?this.particleFilter.update(e,this.sigmaBeacon):this.particleFilter.initParticlesByPos(e.x,e.y,()=>!0),this.resetParticleFilterDist(e),this.particleFilter.resampling(),this.position_count+=1,this.cacheSensorData.filter(r=>r.timestamp>t).map(r=>this.pfFusionPDRiBeacon(r)),this.cacheSensorData.length=0,[this.particleFilter.getResultX(),this.particleFilter.getResultY()]}getGpsPosition(e){return e[2]>this.gps_max_horizontalAccuracy?null:ri(e[0],e[1])}resetParticleFilterDist(e){let t=this.particleFilter.getResultX(),n=this.particleFilter.getResultY();$t(t,n,e.x,e.y)>this.MaxEstimateErr?(this.outTrustRegionNum+=1,this.outTrustRegionNum>=this.TrustNum&&(console.info(`\u8D85\u51FA\u53EF\u4FE1\u533A\u57DF\uFF0C\u91CD\u7F6E\u7C92\u5B50\u8FC7\u6EE4\u5668\u5230: ${e.x}, ${e.y}`),this.particleFilter.setPosInitFlag(!1),this.particleFilter.setYawInitFlag(!1),this.outTrustRegionNum=0)):this.outTrustRegionNum=0}};var Fn=class extends ii.EventDispatcher{sensor;pdr;_pause=!1;constructor(e={}){super(),this.sensor=new Ee(e.sensor),this.pdr=new Ye}checkSensor(){return this.sensor.checkSensor()}start(){this.sensor.start(),this.sensor.addEventListener("add-data-item",({item:e})=>{this.getPositionBySensorItem(e,!this._pause)})}pause(){this._pause=!0}continue(){this._pause=!1}getPositionBySensorItem(e,t=!0){let[n,r,i]=this.pdr.pfFusionPDRiBeacon(e);return n&&t&&this.dispatchEvent({type:"position",x:r,y:i,_type:e.type==="gps"?"gps":"pdr"}),[n,r,i]}setBeaconPosition(e,t){let[n,r]=this.pdr.setBeaconPosition(e,t);this.dispatchEvent({type:"position",x:n,y:r,_type:"beacon"})}dispose(){this.sensor.stop()}};var Un=class extends st{constructor(e){super(e)}};async function Bn({brand:s,project:e},t){let{apiDomain:n,apiPath:{floorRange:r},apiInfo:i}=t,o=`${n}${r}?brand=${s}&project=${e}&phase=${e}&building=${e}`;return await fetch(o,i).then(l=>l.json()).then(l=>l.data).then(l=>{let u=(l||[])[0];return u&&(u.info=JSON.parse(u.info)),u})}async function Gn({brand:s,project:e,floor:t,ts:n,resource_type_list:r},i){let{apiDomain:o,apiPath:{floorGraphic:a},apiInfo:l}=i,u=`${o}${a}?brand=${s}&project=${e}&phase=${e}&building=${e}&floor=${t}&ts=${n}&resource_type_list=${r}`;return await fetch(u,l).then(h=>h.json()).then(h=>h.data).then(h=>((h||[]).map(p=>p.info=JSON.parse(p.info)),h||[]))}async function Ki({project:s,floor:e},t){let{apiDomain:n,apiInfo:r}=t,i=`${n}/api/inception-map/external_street/get?projectCode=${s}&floorCode=${e}`;return await fetch(i,r).then(a=>a.json()).then(a=>a.data).then(a=>JSON.parse(a[0].streetInfo||"{}")).then(a=>a.fileId?Zi(a.fileId,t):null)}async function Zi(s,e){let{apiDomain:t,apiInfo:n}=e;return fetch(`${t}/api/inception-map/file/getFileStream?fileId=${s}`,n).then(r=>r.arrayBuffer()).then(r=>{let o=new TextDecoder("utf-8").decode(r);return o?JSON.parse(o):null})}var pt;function oi(s="aibee_map",e=1){return new Promise((t,n)=>{if(pt)return t({db:pt,type:"success"});let r=indexedDB.open(s,e);r.onupgradeneeded=function(i){pt=i.target.result,console.log("onupgradeneeded"),t({db:pt,type:"onupgradeneeded"})},r.onsuccess=i=>{pt=i.target.result,t({db:pt,type:"success"})},r.onerror=i=>{n(i)}})}function zn(s,e,t=pt){return new Promise((n,r)=>{t||r("\u6CA1\u6709db");let o=t.transaction([s],"readonly").objectStore(s).get(e);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=a=>{console.log("[getVersionByKey]",a),n(null)}})}function si(s,e,t,n=pt){return new Promise((r,i)=>(n||i("\u6CA1\u6709db"),new Promise(async(o,a)=>{let l=await zn(s,e),u=n.transaction([s],"readwrite").objectStore(s),c=l!==null?u.put({key:e,value:t}):u.add({key:e,value:t});c.onsuccess=function(h){o(h)},c.onerror=function(h){a(h)}})))}function zt(s,e=pt){e&&(e.objectStoreNames.contains(s)||e.createObjectStore(s,{keyPath:"key"}))}function ai(s=pt){s?.close(),pt=null}var li="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAGQCAYAAAAUdV17AAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAABLKADAAQAAAABAAABkAAAAAAun0XIAAAtt0lEQVR4Ae2dB9glRZm2ZxyyMiTJA0oaQFlgCJKzxEVZlCgiCJhYWBXDyqLrirL/qqy4oLD4iyQRFARFUGFILiBhJC1Z0iBRsuQwMHs/w3eY84WTu7uqup66rvc753Soet+7up+vqrq7evw4p6gIzJw5c04cWhlbbcjey+cK2NzYXE2m7Z7B7semN9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6OBfHHpbZJuc5oxpzHrqKyjWvlQkW3uhO5IC0X4s6Z0PVK+R5+XSO6XmKmX+dxJsqIkNj0vA3uqjFg76NeLgOd1Y9OBMrCf+s5v9OmlML0Epi8ubyqZLInp+1Kfm4YqfpwP++nPlv+cmjN0+O541m2efZb0vbDTzfonNd+NAyP+68nYJGX8imQbCQkCEIAABIoh4NHTFZLPKTD7H+HcNC8gKxgfry0nSuZteyMLfyEAAQhAoCACr8vu0QrKft/nG8FXwdiT+36dEQkCEIAABMoncKCC8pme21lFZd8tiXkssnz3KRECEIBAOgSeVVUm+i6LwyUE43QalppAAAL1I7C0XD7UAXnX+vmOxxCAAASSI7CLpyz8ssGYBxKSo0KFIAABCPSBwAMeIXNXRR/IUyQEIACBUQSGHJDvG7WRnxCAAAQgUD6B+xyQp5VfLiVCAAIQgMAoAtM8hzxBG/8iWXjUTn5CAAIQgEA5BLwA08S36GZkr7Hw+XLKpBQIQAACEGhB4BjF4sc9ZTFGX76hj2+2yMQmCEAAAhAojoDXtDhBMfj7LmLEHRaavthd274qead3kiAAAQhAoDACN8nycQrG04dLGBGQhzcqML9D3zeSZFl+c1iNTwhAAAIQ6ExgePnNGxWI7+qclb0QgAAEINA3Av8fPece3M0Z0YQAAAAASUVORK5CYII=";var hi='data:image/svg+xml,<svg viewBox="12 22 54 38" xmlns="http://www.w3.org/2000/svg">%0A%09<g fill="%23ffffff">%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 14.25,32.165L 20.479,49.0255L 25.7981,49.0255L 32.1671,32.165L 26.568,32.165L 24.3633,39.9922C 23.9959,41.4233 23.681,42.8056 23.4185,44.139L 23.3135,44.139C 23.0569,42.8182 22.7303,41.4454 22.3337,40.0207L 20.0241,32.165L 14.25,32.165 Z "/>%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 39.915,49.0255L 39.915,32.165L 34.6763,32.165L 34.6763,49.0255L 39.915,49.0255 Z M 37.4891,24.4171C 36.6275,24.4336 35.946,24.6849 35.4446,25.1711C 34.9433,25.6573 34.6872,26.2791 34.6763,27.0366C 34.6865,27.7789 34.9353,28.3964 35.4229,28.8889C 35.9105,29.3814 36.5761,29.637 37.4196,29.6557C 38.3131,29.637 39.0091,29.3814 39.5075,28.8889C 40.006,28.3964 40.2592,27.7789 40.2677,27.0366C 40.2426,26.2791 39.9879,25.6573 39.5032,25.1711C 39.0185,24.6849 38.3471,24.4336 37.4891,24.4171 Z "/>%0A%09%09<path fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 44.1851,56.0691L 49.4238,56.0691L 49.4238,47.5447L 49.4957,47.5447C 49.8997,48.0793 50.4949,48.5157 51.2811,48.854C 52.0674,49.1922 52.9953,49.3668 54.0649,49.3777C 56.0656,49.3912 57.8266,48.6768 59.3479,47.2346C 60.8692,45.7923 61.6699,43.5413 61.75,40.4814C 61.6918,37.7576 60.9918,35.6378 59.6502,34.122C 58.3085,32.6062 56.6746,31.8365 54.7485,31.8126C 52.1604,31.842 50.213,32.7675 48.9065,34.5891L 48.8375,34.5891L 48.5963,32.165L 44.0443,32.165C 44.1264,33.761 44.1734,35.6713 44.1851,37.8958L 44.1851,56.0691 Z M 49.4238,39.5729C 49.4238,39.272 49.4598,38.971 49.5317,38.6699C 49.7288,37.8746 50.1261,37.2334 50.7235,36.7462C 51.3209,36.2591 52.0149,36.0087 52.8057,35.9949C 54.0304,36.0239 54.9538,36.4784 55.576,37.3585C 56.1981,38.2386 56.5099,39.3704 56.5114,40.7541C 56.5024,42.2152 56.1696,43.3745 55.513,44.2321C 54.8564,45.0896 53.93,45.5282 52.7337,45.5477C 51.9302,45.5325 51.2437,45.2937 50.674,44.8313C 50.1044,44.3689 49.7236,43.774 49.5317,43.0467C 49.4598,42.7109 49.4238,42.3404 49.4238,41.9352L 49.4238,39.5729 Z "/>%0A%09</g>%0A</svg>%0A';var fi=require("three"),no={loadRoadNetwork:!1},kn="map_version",Vn="route_version",Hn="facility_version",Wn="map_data",$e="road_network_data",Xn="facility_data",pi={half:li,power:ui,mechanical:ci,vip:hi},qn=class{constructor(e){this.bmap=e;this.initDbPromise=this.initDb()}floors=[];initDbPromise=Promise.resolve();db=null;async initDb(){try{let{db:e,type:t}=await oi("aibee_map",2);t==="onupgradeneeded"&&(zt(kn),zt(Vn),zt(Hn),zt(Wn),zt($e),zt(Xn)),this.db=e}catch(e){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",e)}}async load(e){if(Array.isArray(e))this.floors=e;else{let t=await fetch(e).then(n=>n.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(e,t,n){return this.initDbPromise.then(()=>si(e,`${t}`,n,this.db))}getCacheData(e,t){return this.initDbPromise.then(()=>zn(e,`${t}`,this.db))}getFloorCacheKey(e){return`${e.floor_id}`}async getFloorData(e){let t=this.floors.find(r=>r.floor===e);if(!t)return null;let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(kn,n)===t.version_id){let i=await this.getCacheData(Wn,n);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch(r){return console.log("[get floor data error]",r),this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(e){let t=this.getFloorCacheKey(e);console.time("zstd_json");let n=await fetch(e.map_url).then(r=>r.json());return n.floor=e.floor,console.timeEnd("zstd_json"),this.setCacheData(Wn,t,n),this.setCacheData(kn,t,e.version_id),this.getDataByJson(n)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(Vn,n)===t.version_id){let o=await this.getCacheData($e,n);if(o)return o}let i=await fetch(t.route_url).then(o=>o.json());return this.setCacheData($e,n,i),this.setCacheData(Vn,n,t.version_id),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return this.setCacheData($e,n,r),r}}))).filter(t=>t.points)}async getFacilitiesData(){let e=this.floors[0];if(!e)return null;let t=this.getFloorCacheKey(e),n=async()=>{let r=await fetch(e.entry_infra_url).then(i=>i.json());return r&&(this.setCacheData(Xn,t,r),this.setCacheData(Hn,t,e.version_id)),r};try{if(await this.getCacheData(Hn,t)===e.version_id){let i=await this.getCacheData(Xn,t);if(i)return i}return n()}catch(r){return console.log("[get facility error]",r),n()}}async getOtherDataByFreeTime(){}async getMulFloorsData(e){return Promise.all(e.map(t=>this.getFloorData(t))).then(t=>t.filter(n=>n))}async getDataByUrl(e){let t=await fetch(e).then(n=>n.json());return this.getDataByJson(t)}getDataByJson(e){let t=new ht(this.bmap.context);t.userData.graphics=[],t.userData.graphicMap=new Map;let n=[0,0];return e.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y];break;case"graph":X(r.elements,n);let o=[];r.elements.forEach(f=>{f.group==="ground"?t.createGround(f):o.push(f)});let a=o.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b,height:T,airHeight:k}=g,$=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}-${T}-${k}`;return b===0&&($=`${E.toLowerCase()}-${x}-${T}-${k}`),f[$]?f[$].push(g):f[$]=[g],f},{});Object.values(a).forEach(f=>{let g=new fe(this.bmap.context,f);t.mergeGraphicLayer.add(g)});break;case"ground":X(r.elements,n);let l=r.elements.map(f=>new R(this.bmap.context,f));t.addGrounds(l);break;case"wall":X(r.elements,n);let u=r.elements.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b,height:T}=g,k=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}-${T}`;return b===0&&(k=`${E.toLowerCase()}-${x}-${T}`),f[k]?f[k].push(g):f[k]=[g],f},{});Object.values(u).forEach(f=>{let g=new ce(this.bmap.context,f);t.wallLayer.add(g)});break;case"lane":X(r.elements,n);let c=r.elements.reduce((f,g)=>{let{fillColor:E,fillOpacity:x,strokeColor:z,strokeOpacity:b}=g,T=`${E.toLowerCase()}-${x}-${z.toLowerCase()}-${b}`;return b===0&&(T=`${E.toLowerCase()}-${x}`),f[T]?f[T].push(g):f[T]=[g],f},{});Object.values(c).forEach(f=>{let g=new pe(this.bmap.context,f);t.laneLayer.add(g)});break;case"texture2d":case"texture3d":if(X(r.elements,n),r.elements.length){let f=new qt(this.bmap.context,r.elements);t.textureLayer.add(f)}break;case"glb":X(r.elements,n),r.elements.forEach(f=>{let g=rt([f.center_x,f.center_y],n),E=new he(this.bmap.context,{...f,url:f.secondUrl,rotate:f.secondRotate,width:f.secondWidth,center_x:g[0],center_y:g[1]});t.glbModelLayer.add(E)});break;case"store":X(r.elements,n),r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n),E=t.addGraphic(f);t.userData.graphics.push(E),t.userData.graphicMap.set(f.id,E);try{let x=new q(this.bmap.context,{id:f.id,icon:f.poi_info.icon,text:f.poi_info.showName||f.store_name||f.poi_info.text,position:{x:g[0],y:g[1],z:f.airHeight+f.height},icon_size:[18,18],level:f.poi_info.level||0});t.poiLayer2.pushPoi(x),x&&(x.userData.type="store",x.userData.data=f)}catch(x){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",x,f)}});break;case"facility":X(r.elements,n),r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n),E=t.addGraphic(f);if(t.userData.graphics.push(E),t.userData.graphicMap.set(f.id,E),f.poi_info){let x=new q(this.bmap.context,{id:f.id,icon:f.poi_info.icon,text:f.poi_info.showName||f.store_name||f.poi_info.text,position:{x:g[0],y:g[1],z:f.airHeight+f.height},icon_size:[18,18],level:f.poi_info.level||0});t.poiLayer2.pushPoi(x),x.userData.type="facility",x.userData.data=f}else console.log("\u6DFB\u52A0facility\u5931\u8D25\u6CA1\u6709poi_info",f)});break;case"parkingSpace":X(r.elements,n);let h=[],p=new Map;r.elements.forEach(f=>{let g=t.addGraphic(f);h.push(g),p.set(f.id,g);let E=rt([f.center_x,f.center_y],n);if(f.texts[0]){let x=new q(this.bmap.context,{id:f.id,text:f.texts[0],position:{x:E[0],y:E[1],z:f.airHeight+f.height}});x&&(x.userData.type="parkingSpace",x.userData.data=f),t.poiLayer2.pushPoi(x)}});let d=r.elements.filter(f=>pi[f.parkingType]).map(f=>{let g=rt([f.center_x,f.center_y],n),E=en(f.geometry.coords,g);return{uuid:f.id,iconUrl:pi[f.parkingType],name:f.texts[0],deltaHeight:f.deltaHeight,airHeight:f.airHeight,height:f.height,geometry:{...f.geometry,coords:E},opacity:f.fillOpacity,visible:!0}});if(d.length){let f=new qt(this.bmap.context,d);t.textureLayer.add(f)}t.userData.parkingSpaces=h,t.userData.parkingSpacesGraphicMap=p;break;case"text":X(r.elements,n);let m=new de(this.bmap.context,r.elements.map(f=>{let g=rt([f.center_x,f.center_y],n);return{...f,center_x:g[0],center_y:g[1]}}));t.textTextureLayer.add(m);break}}),t.updateBox(),t.userData.center=n,t.userData.height=t.box.getSize(new fi.Vector3).z+e.floorHeight*10,t.name=e.floor,t.userData.data=e,t}async clear(){ai(this.db??void 0)}dispose(){this.clear()}};var jn=class{constructor(e){this.bmap=e}cacheData=new Map;floorDataLengthMap=new Map;buildingGroundMap=new Map;externalStreetMap=new Map;async load(e){let t=Lt(e);if(this.cacheData.has(t))return this.cacheData.get(t);let[,n]=await Promise.all([this.loadBuildGround(e),Gn(e,this.bmap.config)]),r=Lt({floor:e.floor,ts:e.ts});X(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(t,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),this.loadExternalStreet(e),n}async loadExternalStreet(e){}switchFloorByData(e,t){if(!e.length)return;let n=t.userData.legacyToGraphicMap||new Map,r=t.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:a}=this.bmap.config;for(let l=0;l<e.length;l++){let u=e[l];u.info.group==="ground"?(u.info.fillColor=i.color,u.info.fillOpacity=i.opacity,u.info.height=i.height,u.info.stroke=i.stroke,u.info.strokeColor=i.strokeColor,u.info.strokeOpacity=i.strokeOpacity):u.info.userData.mark?(u.info.height=o.height,u.info.fillColor=o.color,u.info.fillOpacity=o.opacity,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity):(u.info.fillOpacity=a.fillOpacity,this.bmap.config.initTransToMark&&(u.info.height=o.height,u.info.fillColor=o.color,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity))}for(let l of e){if(l.info.group==="ground")t.createGround(l.info);else{let u=t.addGraphic(l.info);u.userData.data=l,n.set(l.legacy_id,u)}r.set(l.element_uuid,l)}t.userData.legacyToGraphicMap=n,t.userData.graphicMap=r,t.updateBox(),t===this.bmap.context.currentFloor?(this.bmap.triggerHooks("switch_floor_before",{curFloor:t,graphics:t.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:t,graphics:t.graphicLayer.children})):this.bmap.switchFloorByFloor(t)}filterData(e,t){let n=t.userData.graphicMap||new Map;return e.filter(r=>!n.has(r.element_uuid))}async switchFloorByStoreData(e,t){let n=await this.load({...e,resource_type_list:"6"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async switchFloorByOtherData(e,t){let n=await this.load({...e,resource_type_list:"1,2,3,4"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async loadBuildGround({brand:e,project:t}){let n=await this.loadBuildingGround({brand:e,project:t});return this.bmap.currentBuildGround=n,this.bmap.changeBuildingCenter(n,{brand:e,project:t}),this.bmap.currentBuildGround}async loadBuildingGround({brand:e,project:t}){let n=Lt({brand:e,project:t});if(this.buildingGroundMap.has(n))return this.buildingGroundMap.get(n);let r=Bn({brand:e,project:t},this.bmap.config).then(i=>(this.buildingGroundMap.set(n,i),i));return this.buildingGroundMap.set(n,r),r}async switchFloor(e){let t=new ht(this.bmap.context);t.name=e.floor;try{await Promise.all([this.switchFloorByStoreData(e,t),this.switchFloorByOtherData(e,t)])}catch(n){console.log(n)}return t}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}};
7535
7535
  //# sourceMappingURL=bmap.cjs.min.js.map