@aibee/crc-bmap 0.14.27 → 0.14.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +87 -20
- package/lib/index.esm.min.js +87 -20
- package/lib/meta.json +431 -277
- package/lib/src/elements/poi2.d.ts +30 -13
- package/lib/src/elements/text-texture.d.ts +2 -0
- package/lib/src/factory/index.d.ts +2 -1
- package/lib/src/factory/sdf-material.d.ts +50 -0
- package/lib/src/factory/sdf-text.d.ts +107 -0
- package/lib/src/utils/index-db.d.ts +2 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/road2.d.ts +1 -1
- package/lib/src/utils/text-layout.d.ts +57 -0
- package/lib/worker/{loader.worker-2CGJ23U5.js → loader.worker-SKK7VPJG.js} +9 -9
- package/lib/worker/{path.worker-VZGSKDYR.js → path.worker-KVKX4OAV.js} +7 -7
- package/lib/worker/{recommend.worker-GACCZKX6.js → recommend.worker-3TU53QNT.js} +5 -5
- package/lib/worker/sdf-text.worker-WGWC2SON.js +3 -0
- package/lib/worker/sdf-text.worker-YGTPYDBG.js +1 -0
- package/package.json +2 -1
- package/lib/src/factory/text-texture.d.ts +0 -74
- package/lib/src/factory/worker/text-texture.worker.d.ts +0 -1
- package/lib/worker/lazy-indexdb-text-texture.worker-GTG7ASSH.js +0 -3
- package/lib/worker/lazy-indexdb-text-texture.worker-YSMTLMGO.js +0 -1
- package/lib/worker/text-texture.worker-6IXOXREW.js +0 -3
- package/lib/worker/text-texture.worker-U4G7IIG7.js +0 -1
- /package/lib/src/factory/worker/{lazy-indexdb-text-texture.worker.d.ts → sdf-text.worker.d.ts} +0 -0
|
@@ -2,11 +2,11 @@ var LU=Object.create;var EE=Object.defineProperty;var NU=Object.getOwnPropertyDe
|
|
|
2
2
|
`)&&n.flags==="s")})});var ZM=ot((XQ,$M)=>{"use strict";var Mk=mi(),bk=so(),Ak=bk.RegExp;$M.exports=Mk(function(){var n=Ak("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Xp=ot((YQ,JM)=>{"use strict";var dc=Ns(),Wp=yi(),Tk=Hp(),Ck=HM(),Pk=WM(),Ik=vp(),Rk=Hf(),Lk=Lp().get,Nk=YM(),Ok=ZM(),Dk=Ik("native-string-replace",String.prototype.replace),Vp=RegExp.prototype.exec,Q0=Vp,Fk=Wp("".charAt),Uk=Wp("".indexOf),Bk=Wp("".replace),j0=Wp("".slice),ty=function(){var n=/a/,t=/b*/g;return dc(Vp,n,"a"),dc(Vp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),KM=Pk.BROKEN_CARET,ey=/()??/.exec("")[1]!==void 0,zk=ty||ey||KM||Nk||Ok;zk&&(Q0=function(t){var e=this,o=Lk(e),s=Tk(t),l=o.raw,p,h,g,m,_,w,S;if(l)return l.lastIndex=e.lastIndex,p=dc(Q0,l,s),e.lastIndex=l.lastIndex,p;var b=o.groups,C=KM&&e.sticky,R=dc(Ck,e),x=e.source,E=0,I=s;if(C&&(R=Bk(R,"y",""),Uk(R,"g")===-1&&(R+="g"),I=j0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&Fk(s,e.lastIndex-1)!==`
|
|
3
3
|
`)&&(x="(?: "+x+")",I=" "+I,E++),h=new RegExp("^(?:"+x+")",R)),ey&&(h=new RegExp("^"+x+"$(?!\\s)",R)),ty&&(g=e.lastIndex),m=dc(Vp,C?h:e,I),C?m?(m.input=j0(m.input,E),m[0]=j0(m[0],E),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:ty&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),ey&&m&&m.length>1&&dc(Dk,m[0],h,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=w=Rk(null),_=0;_<b.length;_++)S=b[_],w[S[0]]=m[S[1]];return m});JM.exports=Q0});var Yp=ot(()=>{"use strict";var Gk=Os(),jM=Xp();Gk({target:"RegExp",proto:!0,forced:/./.exec!==jM},{exec:jM})});var $p=ot((KQ,QM)=>{"use strict";var kk=ac();QM.exports=Array.isArray||function(t){return kk(t)==="Array"}});var eb=ot((JQ,tb)=>{"use strict";var qk=$s(),Hk=$p(),Vk=TypeError,Wk=Object.getOwnPropertyDescriptor,Xk=qk&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();tb.exports=Xk?function(n,t){if(Hk(n)&&!Wk(n,"length").writable)throw new Vk("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var ny=ot((jQ,nb)=>{"use strict";var Yk=TypeError,$k=9007199254740991;nb.exports=function(n){if(n>$k)throw Yk("Maximum allowed index exceeded");return n}});var Zp=ot(()=>{"use strict";var Zk=Os(),Kk=cc(),Jk=qf(),jk=eb(),Qk=ny(),tq=mi(),eq=tq(function(){return[].push.call({length:4294967296},1)!==4294967297}),nq=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},rq=eq||!nq();Zk({target:"Array",proto:!0,arity:1,forced:rq},{push:function(t){var e=Kk(this),o=Jk(e),s=arguments.length;Qk(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return jk(e,o),o}})});var Ks=ot((ett,rb)=>{"use strict";var ry=yi(),Kp=Set.prototype;rb.exports={Set,add:ry(Kp.add),has:ry(Kp.has),remove:ry(Kp.delete),proto:Kp}});var Nu=ot((ntt,ib)=>{"use strict";var iq=Ks().has;ib.exports=function(n){return iq(n),n}});var Ou=ot((rtt,ob)=>{"use strict";var oq=Ns();ob.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,l,p;!(l=oq(s,o)).done;)if(p=t(l.value),p!==void 0)return p}});var gc=ot((itt,cb)=>{"use strict";var sb=yi(),sq=Ou(),ab=Ks(),aq=ab.Set,ub=ab.proto,uq=sb(ub.forEach),lb=sb(ub.keys),lq=lb(new aq).next;cb.exports=function(n,t,e){return e?sq({iterator:lb(n),next:lq},t):uq(n,t)}});var Jp=ot((ott,hb)=>{"use strict";var fb=Ks(),cq=gc(),fq=fb.Set,hq=fb.add;hb.exports=function(n){var t=new fq;return cq(n,function(e){hq(t,e)}),t}});var mc=ot((stt,pb)=>{"use strict";var pq=H0(),dq=Ks();pb.exports=pq(dq.proto,"size","get")||function(n){return n.size}});var gb=ot((att,db)=>{"use strict";db.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Du=ot((utt,Eb)=>{"use strict";var mb=kf(),_b=Ma(),yb=Ns(),gq=El(),mq=gb(),vb="Invalid size",yq=RangeError,vq=TypeError,_q=Math.max,xb=function(n,t){this.set=n,this.size=_q(t,0),this.has=mb(n.has),this.keys=mb(n.keys)};xb.prototype={getIterator:function(){return mq(_b(yb(this.keys,this.set)))},includes:function(n){return yb(this.has,this.set,n)}};Eb.exports=function(n){_b(n);var t=+n.size;if(t!==t)throw new vq(vb);var e=gq(t);if(e<0)throw new yq(vb);return new xb(n,e)}});var bb=ot((ltt,Mb)=>{"use strict";var xq=Nu(),Sb=Ks(),Eq=Jp(),wq=mc(),Sq=Du(),Mq=gc(),bq=Ou(),Aq=Sb.has,wb=Sb.remove;Mb.exports=function(t){var e=xq(this),o=Sq(t),s=Eq(e);return wq(e)<=o.size?Mq(e,function(l){o.includes(l)&&wb(s,l)}):bq(o.getIterator(),function(l){Aq(e,l)&&wb(s,l)}),s}});var Fu=ot((ctt,Cb)=>{"use strict";var Tq=hc(),Ab=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Tb=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};Cb.exports=function(n,t){var e=Tq("Set");try{new e()[n](Ab(0));try{return new e()[n](Ab(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](Tb(-1/0)),!1}catch(l){var o=new e;return o.add(1),o.add(2),t(o[n](Tb(1/0)))}}}catch(s){return!1}}});var Pb=ot(()=>{"use strict";var Cq=Os(),Pq=bb(),Iq=Fu(),Rq=!Iq("difference",function(n){return n.size===0});Cq({target:"Set",proto:!0,real:!0,forced:Rq},{difference:Pq})});var Lb=ot((ptt,Rb)=>{"use strict";var Lq=Nu(),iy=Ks(),Nq=mc(),Oq=Du(),Dq=gc(),Fq=Ou(),Uq=iy.Set,Ib=iy.add,Bq=iy.has;Rb.exports=function(t){var e=Lq(this),o=Oq(t),s=new Uq;return Nq(e)>o.size?Fq(o.getIterator(),function(l){Bq(e,l)&&Ib(s,l)}):Dq(e,function(l){o.includes(l)&&Ib(s,l)}),s}});var Nb=ot(()=>{"use strict";var zq=Os(),Gq=mi(),kq=Lb(),qq=Fu(),Hq=!qq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||Gq(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});zq({target:"Set",proto:!0,real:!0,forced:Hq},{intersection:kq})});var oy=ot((mtt,Db)=>{"use strict";var Vq=Ns(),Ob=Ma(),Wq=Ep();Db.exports=function(n,t,e){var o,s;Ob(n);try{if(o=Wq(n,"return"),!o){if(t==="throw")throw e;return e}o=Vq(o,n)}catch(l){s=!0,o=l}if(t==="throw")throw e;if(s)throw o;return Ob(o),e}});var Ub=ot((ytt,Fb)=>{"use strict";var Xq=Nu(),Yq=Ks().has,$q=mc(),Zq=Du(),Kq=gc(),Jq=Ou(),jq=oy();Fb.exports=function(t){var e=Xq(this),o=Zq(t);if($q(e)<=o.size)return Kq(e,function(l){if(o.includes(l))return!1},!0)!==!1;var s=o.getIterator();return Jq(s,function(l){if(Yq(e,l))return jq(s,"normal",!1)})!==!1}});var Bb=ot(()=>{"use strict";var Qq=Os(),t5=Ub(),e5=Fu(),n5=!e5("isDisjointFrom",function(n){return!n});Qq({target:"Set",proto:!0,real:!0,forced:n5},{isDisjointFrom:t5})});var Gb=ot((xtt,zb)=>{"use strict";var r5=Nu(),i5=mc(),o5=gc(),s5=Du();zb.exports=function(t){var e=r5(this),o=s5(t);return i5(e)>o.size?!1:o5(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var kb=ot(()=>{"use strict";var a5=Os(),u5=Gb(),l5=Fu(),c5=!l5("isSubsetOf",function(n){return n});a5({target:"Set",proto:!0,real:!0,forced:c5},{isSubsetOf:u5})});var Hb=ot((Stt,qb)=>{"use strict";var f5=Nu(),h5=Ks().has,p5=mc(),d5=Du(),g5=Ou(),m5=oy();qb.exports=function(t){var e=f5(this),o=d5(t);if(p5(e)<o.size)return!1;var s=o.getIterator();return g5(s,function(l){if(!h5(e,l))return m5(s,"normal",!1)})!==!1}});var Vb=ot(()=>{"use strict";var y5=Os(),v5=Hb(),_5=Fu(),x5=!_5("isSupersetOf",function(n){return!n});y5({target:"Set",proto:!0,real:!0,forced:x5},{isSupersetOf:v5})});var Xb=ot((Att,Wb)=>{"use strict";var E5=Nu(),sy=Ks(),w5=Jp(),S5=Du(),M5=Ou(),b5=sy.add,A5=sy.has,T5=sy.remove;Wb.exports=function(t){var e=E5(this),o=S5(t).getIterator(),s=w5(e);return M5(o,function(l){A5(e,l)?T5(s,l):b5(s,l)}),s}});var Yb=ot(()=>{"use strict";var C5=Os(),P5=Xb(),I5=Fu();C5({target:"Set",proto:!0,real:!0,forced:!I5("symmetricDifference")},{symmetricDifference:P5})});var Zb=ot((Ptt,$b)=>{"use strict";var R5=Nu(),L5=Ks().add,N5=Jp(),O5=Du(),D5=Ou();$b.exports=function(t){var e=R5(this),o=O5(t).getIterator(),s=N5(e);return D5(o,function(l){L5(s,l)}),s}});var Kb=ot(()=>{"use strict";var F5=Os(),U5=Zb(),B5=Fu();F5({target:"Set",proto:!0,real:!0,forced:!B5("union")},{union:U5})});var jb=ot((Ltt,Jb)=>{"use strict";var z5=ac(),G5=yi();Jb.exports=function(n){if(z5(n)==="Function")return G5(n)}});var eA=ot((Ntt,tA)=>{"use strict";var Qb=jb(),k5=kf(),q5=zf(),H5=Qb(Qb.bind);tA.exports=function(n,t){return k5(n),t===void 0?n:q5?H5(n,t):function(){return n.apply(t,arguments)}}});var iA=ot((Ott,rA)=>{"use strict";var V5=$p(),W5=qf(),X5=ny(),Y5=eA(),nA=function(n,t,e,o,s,l,p,h){for(var g=s,m=0,_=p?Y5(p,h):!1,w,S;m<o;)m in e&&(w=_?_(e[m],m,t):e[m],l>0&&V5(w)?(S=W5(w),g=nA(n,t,w,S,g,l-1)-1):(X5(g+1),n[g]=w),g++),m++;return g};rA.exports=nA});var cA=ot((Dtt,lA)=>{"use strict";var $5=yi(),Z5=mi(),oA=Ui(),K5=$0(),J5=hc(),j5=O0(),sA=function(){},aA=J5("Reflect","construct"),ay=/^\s*(?:class|function)\b/,Q5=$5(ay.exec),tH=!ay.test(sA),Kf=function(t){if(!oA(t))return!1;try{return aA(sA,[],t),!0}catch(e){return!1}},uA=function(t){if(!oA(t))return!1;switch(K5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return tH||!!Q5(ay,j5(t))}catch(e){return!0}};uA.sham=!0;lA.exports=!aA||Z5(function(){var n;return Kf(Kf.call)||!Kf(Object)||!Kf(function(){n=!0})||n})?uA:Kf});var dA=ot((Ftt,pA)=>{"use strict";var fA=$p(),eH=cA(),nH=Xs(),rH=Ls(),iH=rH("species"),hA=Array;pA.exports=function(n){var t;return fA(n)&&(t=n.constructor,eH(t)&&(t===hA||fA(t.prototype))?t=void 0:nH(t)&&(t=t[iH],t===null&&(t=void 0))),t===void 0?hA:t}});var mA=ot((Utt,gA)=>{"use strict";var oH=dA();gA.exports=function(n,t){return new(oH(n))(t===0?0:t)}});var yA=ot(()=>{"use strict";var sH=Os(),aH=iA(),uH=cc(),lH=qf(),cH=El(),fH=mA();sH({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=uH(this),o=lH(e),s=fH(e,0);return s.length=aH(s,e,e,o,0,t===void 0?1:cH(t)),s}})});var vA=ot(()=>{"use strict";var hH=b0();hH("flat")});var xA=ot((qtt,_A)=>{var uy=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(s=>(s.key===t&&Object.assign(s,{priority:o}),s)):(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)}};_A.exports=uy});var SA=ot((Htt,wA)=>{function EA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,EA(s,t)):o!==t&&e.set(o,s);return e}wA.exports=EA});var AA=ot((Vtt,bA)=>{function pH(n){let t=Number(n);return!(isNaN(t)||t<=0)}function MA(n){let t=new Map;return Object.keys(n).forEach(o=>{let s=n[o];if(s!==null&&typeof s=="object"&&!Array.isArray(s))return t.set(o,MA(s));if(!pH(s))throw new Error(`Could not add node at key "${o}", make sure it's a valid node`,s);return t.set(o,Number(s))}),t}bA.exports=MA});var PA=ot((Wtt,CA)=>{function TA(n){if(!(n instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof n}`);n.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){TA(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}CA.exports=TA});var NA=ot((Xtt,LA)=>{var dH=xA(),gH=SA(),IA=AA(),RA=PA(),ly=class{constructor(t){t instanceof Map?(RA(t),this.graph=t):t?this.graph=IA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(RA(e),o=e):o=IA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=gH(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,l=new dH,p=new Map,h=[],g=0,m=[];if(o.avoid&&(m=[].concat(o.avoid)),m.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(m.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(l.set(t,0);!l.isEmpty();){let _=l.next();if(_.key===e){g=_.priority;let S=_.key;for(;p.has(S);)h.push(S),S=p.get(S);break}s.add(_.key),(this.graph.get(_.key)||new Map).forEach((S,b)=>{if(s.has(b)||m.includes(b))return null;if(!l.has(b))return p.set(b,_.key),l.set(b,_.priority+S);let C=l.get(b).priority,R=_.priority+S;return R<C?(p.set(b,_.key),l.set(b,R)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:g}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};LA.exports=ly});var $d=ot((iet,PC)=>{"use strict";var CC=Object.getOwnPropertySymbols,TX=Object.prototype.hasOwnProperty,CX=Object.prototype.propertyIsEnumerable;function PX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function IX(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[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 s={};return"abcdefghijklmnopqrst".split("").forEach(function(l){s[l]=l}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}PC.exports=IX()?Object.assign:function(n,t){for(var e,o=PX(n),s,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var p in e)TX.call(e,p)&&(o[p]=e[p]);if(CC){s=CC(e);for(var h=0;h<s.length;h++)CX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var Hv=ot((kv,qv)=>{(function(n,t){typeof kv=="object"&&typeof qv!="undefined"?qv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(kv,function(){"use strict";function n(x,E,I,A,F){(function V(X,q,D,xt,B){for(;xt>D;){if(xt-D>600){var j=xt-D+1,K=q-D+1,Dt=Math.log(j),Q=.5*Math.exp(2*Dt/3),At=.5*Math.sqrt(Dt*Q*(j-Q)/j)*(K-j/2<0?-1:1),Mt=Math.max(D,Math.floor(q-K*Q/j+At)),Lt=Math.min(xt,Math.floor(q+(j-K)*Q/j+At));V(X,q,Mt,Lt,B)}var pt=X[q],yt=D,J=xt;for(t(X,D,q),B(X[xt],pt)>0&&t(X,D,xt);yt<J;){for(t(X,yt,J),yt++,J--;B(X[yt],pt)<0;)yt++;for(;B(X[J],pt)>0;)J--}B(X[D],pt)===0?t(X,D,J):t(X,++J,xt),J<=q&&(D=J+1),q<=J&&(xt=J-1)}})(x,E,I||0,A||x.length-1,F||e)}function t(x,E,I){var A=x[E];x[E]=x[I],x[I]=A}function e(x,E){return x<E?-1:x>E?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 s(x,E,I){if(!I)return E.indexOf(x);for(var A=0;A<E.length;A++)if(I(x,E[A]))return A;return-1}function l(x,E){p(x,0,x.children.length,E,x)}function p(x,E,I,A,F){F||(F=C(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var V=E;V<I;V++){var X=x.children[V];h(F,x.leaf?A(X):X)}return F}function h(x,E){return x.minX=Math.min(x.minX,E.minX),x.minY=Math.min(x.minY,E.minY),x.maxX=Math.max(x.maxX,E.maxX),x.maxY=Math.max(x.maxY,E.maxY),x}function g(x,E){return x.minX-E.minX}function m(x,E){return x.minY-E.minY}function _(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function w(x){return x.maxX-x.minX+(x.maxY-x.minY)}function S(x,E){return x.minX<=E.minX&&x.minY<=E.minY&&E.maxX<=x.maxX&&E.maxY<=x.maxY}function b(x,E){return E.minX<=x.maxX&&E.minY<=x.maxY&&E.maxX>=x.minX&&E.maxY>=x.minY}function C(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function R(x,E,I,A,F){for(var V=[E,I];V.length;)if(!((I=V.pop())-(E=V.pop())<=A)){var X=E+Math.ceil((I-E)/A/2)*A;n(x,X,E,I,F),V.push(E,X,X,I)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var E=this.data,I=[];if(!b(x,E))return I;for(var A=this.toBBox,F=[];E;){for(var V=0;V<E.children.length;V++){var X=E.children[V],q=E.leaf?A(X):X;b(x,q)&&(E.leaf?I.push(X):S(x,q)?this._all(X,I):F.push(X))}E=F.pop()}return I},o.prototype.collides=function(x){var E=this.data;if(!b(x,E))return!1;for(var I=[];E;){for(var A=0;A<E.children.length;A++){var F=E.children[A],V=E.leaf?this.toBBox(F):F;if(b(x,V)){if(E.leaf||S(x,V))return!0;I.push(F)}}E=I.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var E=0;E<x.length;E++)this.insert(x[E]);return this}var I=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var A=this.data;this.data=I,I=A}this._insert(I,this.data.height-I.height-1,!0)}else this.data=I;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=C([]),this},o.prototype.remove=function(x,E){if(!x)return this;for(var I,A,F,V=this.data,X=this.toBBox(x),q=[],D=[];V||q.length;){if(V||(V=q.pop(),A=q[q.length-1],I=D.pop(),F=!0),V.leaf){var xt=s(x,V.children,E);if(xt!==-1)return V.children.splice(xt,1),q.push(V),this._condense(q),this}F||V.leaf||!S(V,X)?A?(I++,V=A.children[I],F=!1):V=null:(q.push(V),D.push(I),I=0,A=V,V=V.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,E){return x.minX-E.minX},o.prototype.compareMinY=function(x,E){return x.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,E){for(var I=[];x;)x.leaf?E.push.apply(E,x.children):I.push.apply(I,x.children),x=I.pop();return E},o.prototype._build=function(x,E,I,A){var F,V=I-E+1,X=this._maxEntries;if(V<=X)return l(F=C(x.slice(E,I+1)),this.toBBox),F;A||(A=Math.ceil(Math.log(V)/Math.log(X)),X=Math.ceil(V/Math.pow(X,A-1))),(F=C([])).leaf=!1,F.height=A;var q=Math.ceil(V/X),D=q*Math.ceil(Math.sqrt(X));R(x,E,I,D,this.compareMinX);for(var xt=E;xt<=I;xt+=D){var B=Math.min(xt+D-1,I);R(x,xt,B,q,this.compareMinY);for(var j=xt;j<=B;j+=q){var K=Math.min(j+q-1,B);F.children.push(this._build(x,j,K,A-1))}}return l(F,this.toBBox),F},o.prototype._chooseSubtree=function(x,E,I,A){for(;A.push(E),!E.leaf&&A.length-1!==I;){for(var F=1/0,V=1/0,X=void 0,q=0;q<E.children.length;q++){var D=E.children[q],xt=_(D),B=(j=x,K=D,(Math.max(K.maxX,j.maxX)-Math.min(K.minX,j.minX))*(Math.max(K.maxY,j.maxY)-Math.min(K.minY,j.minY))-xt);B<V?(V=B,F=xt<F?xt:F,X=D):B===V&&xt<F&&(F=xt,X=D)}E=X||E.children[0]}var j,K;return E},o.prototype._insert=function(x,E,I){var A=I?x:this.toBBox(x),F=[],V=this._chooseSubtree(A,this.data,E,F);for(V.children.push(x),h(V,A);E>=0&&F[E].children.length>this._maxEntries;)this._split(F,E),E--;this._adjustParentBBoxes(A,F,E)},o.prototype._split=function(x,E){var I=x[E],A=I.children.length,F=this._minEntries;this._chooseSplitAxis(I,F,A);var V=this._chooseSplitIndex(I,F,A),X=C(I.children.splice(V,I.children.length-V));X.height=I.height,X.leaf=I.leaf,l(I,this.toBBox),l(X,this.toBBox),E?x[E-1].children.push(X):this._splitRoot(I,X)},o.prototype._splitRoot=function(x,E){this.data=C([x,E]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,E,I){for(var A,F,V,X,q,D,xt,B=1/0,j=1/0,K=E;K<=I-E;K++){var Dt=p(x,0,K,this.toBBox),Q=p(x,K,I,this.toBBox),At=(F=Dt,V=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,V.minX),q=Math.max(F.minY,V.minY),D=Math.min(F.maxX,V.maxX),xt=Math.min(F.maxY,V.maxY),Math.max(0,D-X)*Math.max(0,xt-q)),Mt=_(Dt)+_(Q);At<B?(B=At,A=K,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,A=K)}return A||I-E},o.prototype._chooseSplitAxis=function(x,E,I){var A=x.leaf?this.compareMinX:g,F=x.leaf?this.compareMinY:m;this._allDistMargin(x,E,I,A)<this._allDistMargin(x,E,I,F)&&x.children.sort(A)},o.prototype._allDistMargin=function(x,E,I,A){x.children.sort(A);for(var F=this.toBBox,V=p(x,0,E,F),X=p(x,I-E,I,F),q=w(V)+w(X),D=E;D<I-E;D++){var xt=x.children[D];h(V,x.leaf?F(xt):xt),q+=w(V)}for(var B=I-E-1;B>=E;B--){var j=x.children[B];h(X,x.leaf?F(j):j),q+=w(X)}return q},o.prototype._adjustParentBBoxes=function(x,E,I){for(var A=I;A>=0;A--)h(E[A],x)},o.prototype._condense=function(x){for(var E=x.length-1,I=void 0;E>=0;E--)x[E].children.length===0?E>0?(I=x[E-1].children).splice(I.indexOf(x[E]),1):this.clear():l(x[E],this.toBBox)},o})});var IC=ot((Vv,Wv)=>{(function(n,t){typeof Vv=="object"&&typeof Wv!="undefined"?Wv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(Vv,function(){"use strict";var n=function(o,s){if(o===void 0&&(o=[]),s===void 0&&(s=t),this.data=o,this.length=this.data.length,this.compare=s,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};n.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var o=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),o}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(o){for(var s=this,l=s.data,p=s.compare,h=l[o];o>0;){var g=o-1>>1,m=l[g];if(p(h,m)>=0)break;l[o]=m,o=g}l[o]=h},n.prototype._down=function(o){for(var s=this,l=s.data,p=s.compare,h=this.length>>1,g=l[o];o<h;){var m=(o<<1)+1,_=l[m],w=m+1;if(w<this.length&&p(l[w],_)<0&&(m=w,_=l[w]),p(_,g)>=0)break;l[o]=_,o=m}l[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var LC=ot((fet,RC)=>{RC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=(s-o)/2,m=0,_=g-1;m<g;_=m++){var w=e[o+m*2+0],S=e[o+m*2+1],b=e[o+_*2+0],C=e[o+_*2+1],R=S>p!=C>p&&l<(b-w)*(p-S)/(C-S)+w;R&&(h=!h)}return h}});var OC=ot((het,NC)=>{NC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=s-o,m=0,_=g-1;m<g;_=m++){var w=e[m+o][0],S=e[m+o][1],b=e[_+o][0],C=e[_+o][1],R=S>p!=C>p&&l<(b-w)*(p-S)/(C-S)+w;R&&(h=!h)}return h}});var UC=ot((pet,Jd)=>{var DC=LC(),FC=OC();Jd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?FC(t,e,o,s):DC(t,e,o,s)};Jd.exports.nested=FC;Jd.exports.flat=DC});var zC=ot((jd,BC)=>{(function(n,t){typeof jd=="object"&&typeof BC!="undefined"?t(jd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(jd,function(n){"use strict";let e=33306690738754706e-32;function o(b,C,R,x,E){let I,A,F,V,X=C[0],q=x[0],D=0,xt=0;q>X==q>-X?(I=X,X=C[++D]):(I=q,q=x[++xt]);let B=0;if(D<b&&xt<R)for(q>X==q>-X?(F=I-((A=X+I)-X),X=C[++D]):(F=I-((A=q+I)-q),q=x[++xt]),I=A,F!==0&&(E[B++]=F);D<b&&xt<R;)q>X==q>-X?(F=I-((A=I+X)-(V=A-I))+(X-V),X=C[++D]):(F=I-((A=I+q)-(V=A-I))+(q-V),q=x[++xt]),I=A,F!==0&&(E[B++]=F);for(;D<b;)F=I-((A=I+X)-(V=A-I))+(X-V),X=C[++D],I=A,F!==0&&(E[B++]=F);for(;xt<R;)F=I-((A=I+q)-(V=A-I))+(q-V),q=x[++xt],I=A,F!==0&&(E[B++]=F);return I===0&&B!==0||(E[B++]=I),B}function s(b){return new Float64Array(b)}let l=33306690738754716e-32,p=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),_=s(12),w=s(16),S=s(4);n.orient2d=function(b,C,R,x,E,I){let A=(C-I)*(R-E),F=(b-E)*(x-I),V=A-F;if(A===0||F===0||A>0!=F>0)return V;let X=Math.abs(A+F);return Math.abs(V)>=l*X?V:-function(q,D,xt,B,j,K,Dt){let Q,At,Mt,Lt,pt,yt,J,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,Xe=xt-j,ee=D-K,ge=B-K;pt=(te=(Bt=ft-(J=(yt=134217729*ft)-(yt-ft)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=ft*ge)-J*Gt-Bt*Gt-J*ae))-(ut=te-(qt=(Bt=ee-(J=(yt=134217729*ee)-(yt-ee)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=ee*Xe)-J*Gt-Bt*Gt-J*ae))),g[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),g[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,g[2]=Ut-(xe-pt)+(ut-pt),g[3]=xe;let fe=function(tt,z){let It=z[0];for(let Ot=1;Ot<tt;Ot++)It+=z[Ot];return It}(4,g),Te=p*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(Xe+(pt=xt-Xe))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-K),Lt=B-(ge+(pt=B-ge))+(pt-K),Q===0&&At===0&&Mt===0&&Lt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Lt+ge*Q-(ee*Mt+Xe*At))>=Te||-fe>=Te))return fe;pt=(te=(Bt=Q-(J=(yt=134217729*Q)-(yt-Q)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=Q*ge)-J*Gt-Bt*Gt-J*ae))-(ut=te-(qt=(Bt=At-(J=(yt=134217729*At)-(yt-At)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=At*Xe)-J*Gt-Bt*Gt-J*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let be=o(4,g,4,S,m);pt=(te=(Bt=ft-(J=(yt=134217729*ft)-(yt-ft)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=ft*Lt)-J*Gt-Bt*Gt-J*ae))-(ut=te-(qt=(Bt=ee-(J=(yt=134217729*ee)-(yt-ee)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=ee*Mt)-J*Gt-Bt*Gt-J*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Wt=o(be,m,4,S,_);pt=(te=(Bt=Q-(J=(yt=134217729*Q)-(yt-Q)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=Q*Lt)-J*Gt-Bt*Gt-J*ae))-(ut=te-(qt=(Bt=At-(J=(yt=134217729*At)-(yt-At)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=At*Mt)-J*Gt-Bt*Gt-J*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Me=o(Wt,_,4,S,w);return w[Me-1]}(b,C,R,x,E,I,X)},n.orient2dfast=function(b,C,R,x,E,I){return(C-I)*(R-E)-(b-E)*(x-I)},Object.defineProperty(n,"__esModule",{value:!0})})});var WC=ot((det,Zv)=>{"use strict";var GC=Hv(),tg=IC(),LX=UC(),NX=zC().orient2d;tg.default&&(tg=tg.default);Zv.exports=VC;Zv.exports.default=VC;function VC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=BX(n),s=new GC(16);s.toBBox=function(I){return{minX:I[0],minY:I[1],maxX:I[0],maxY:I[1]}},s.compareMinX=function(I,A){return I[0]-A[0]},s.compareMinY=function(I,A){return I[1]-A[1]},s.load(n);for(var l=[],p=0,h;p<o.length;p++){var g=o[p];s.remove(g),h=HC(g,h),l.push(h)}var m=new GC(16);for(p=0;p<l.length;p++)m.insert(Xv(l[p]));for(var _=t*t,w=e*e;l.length;){var S=l.shift(),b=S.p,C=S.next.p,R=Yv(b,C);if(!(R<w)){var x=R/_;g=OX(s,S.prev.p,b,C,S.next.next.p,x,m),g&&Math.min(Yv(g,b),Yv(g,C))<=x&&(l.push(S),l.push(HC(g,S)),s.remove(g),m.remove(S),m.insert(Xv(S)),m.insert(Xv(S.next)))}}S=h;var E=[];do E.push(S.p),S=S.next;while(S!==h);return E.push(S.p),E}function OX(n,t,e,o,s,l,p){for(var h=new tg([],DX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],w=g.leaf?$v(_,e,o):FX(e,o,_);w>l||h.push({node:_,dist:w})}for(;h.length&&!h.peek().node.children;){var S=h.pop(),b=S.node,C=$v(b,t,e),R=$v(b,o,s);if(S.dist<C&&S.dist<R&&qC(e,b,p)&&qC(o,b,p))return b}g=h.pop(),g&&(g=g.node)}return null}function DX(n,t){return n.dist-t.dist}function FX(n,t,e){if(kC(n,e)||kC(t,e))return 0;var o=Qd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Qd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var l=Qd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var p=Qd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,s,l,p)}function kC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function qC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),l=Math.max(n[0],t[0]),p=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:l,maxY:p}),g=0;g<h.length;g++)if(UX(h[g].p,h[g].next.p,n,t))return!1;return!0}function $c(n,t,e){return NX(n[0],n[1],t[0],t[1],e[0],e[1])}function UX(n,t,e,o){return n!==o&&t!==e&&$c(n,t,e)>0!=$c(n,t,o)>0&&$c(e,o,n)>0!=$c(e,o,t)>0}function Xv(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function BX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],l=0;l<n.length;l++){var p=n[l];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>s[1]&&(s=p)}var h=[t,e,o,s],g=h.slice();for(l=0;l<n.length;l++)LX(n[l],h)||g.push(n[l]);return GX(g)}function HC(n,t){var e={p:n,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 Yv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function $v(n,t,e){var o=t[0],s=t[1],l=e[0]-o,p=e[1]-s;if(l!==0||p!==0){var h=((n[0]-o)*l+(n[1]-s)*p)/(l*l+p*p);h>1?(o=e[0],s=e[1]):h>0&&(o+=l*h,s+=p*h)}return l=n[0]-o,p=n[1]-s,l*l+p*p}function Qd(n,t,e,o,s,l,p,h){var g=e-n,m=o-t,_=p-s,w=h-l,S=n-s,b=t-l,C=g*g+m*m,R=g*_+m*w,x=_*_+w*w,E=g*S+m*b,I=_*S+w*b,A=C*x-R*R,F,V,X,q,D=A,xt=A;A===0?(V=0,D=1,q=I,xt=x):(V=R*I-x*E,q=C*I-R*E,V<0?(V=0,q=I,xt=x):V>D&&(V=D,q=I+R,xt=x)),q<0?(q=0,-E<0?V=0:-E>C?V=D:(V=-E,D=C)):q>xt&&(q=xt,-E+R<0?V=0:-E+R>C?V=D:(V=-E+R,D=C)),F=V===0?0:V/D,X=q===0?0:q/xt;var B=(1-F)*n+F*e,j=(1-F)*t+F*o,K=(1-X)*s+X*p,Dt=(1-X)*l+X*h,Q=K-B,At=Dt-j;return Q*Q+At*At}function zX(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function GX(n){n.sort(zX);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&$c(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var o=[],s=n.length-1;s>=0;s--){for(;o.length>=2&&$c(o[o.length-2],o[o.length-1],n[s])<=0;)o.pop();o.push(n[s])}return o.pop(),t.pop(),t.concat(o)}});var JC=ot((Jv,jv)=>{(function(n,t){typeof Jv=="object"&&typeof jv!="undefined"?jv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Jv,function(){"use strict";function n(s,l,p,h,g){t(s,l,p||0,h||s.length-1,g||o)}function t(s,l,p,h,g){for(;h>p;){if(h-p>600){var m=h-p+1,_=l-p+1,w=Math.log(m),S=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*S*(m-S)/m)*(_-m/2<0?-1:1),C=Math.max(p,Math.floor(l-_*S/m+b)),R=Math.min(h,Math.floor(l+(m-_)*S/m+b));t(s,l,C,R,g)}var x=s[l],E=p,I=h;for(e(s,p,l),g(s[h],x)>0&&e(s,p,h);E<I;){for(e(s,E,I),E++,I--;g(s[E],x)<0;)E++;for(;g(s[I],x)>0;)I--}g(s[p],x)===0?e(s,p,I):(I++,e(s,I,h)),I<=l&&(p=I+1),l<=I&&(h=I-1)}}function e(s,l,p){var h=s[l];s[l]=s[p],s[p]=h}function o(s,l){return s<l?-1:s>l?1:0}return n})});var n_=ot((krt,e_)=>{"use strict";e_.exports=hh;e_.exports.default=hh;var QX=JC();function hh(n,t){if(!(this instanceof hh))return new hh(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}hh.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!ng(n,t))return e;for(var s=[],l,p,h,g;t;){for(l=0,p=t.children.length;l<p;l++)h=t.children[l],g=t.leaf?o(h):h,ng(n,g)&&(t.leaf?e.push(h):t_(n,g)?this._all(h,e):s.push(h));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!ng(n,t))return!1;for(var o=[],s,l,p,h;t;){for(s=0,l=t.children.length;s<l;s++)if(p=t.children[s],h=t.leaf?e(p):p,ng(n,h)){if(t.leaf||t_(n,h))return!0;o.push(p)}t=o.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var o=this._build(n.slice(),0,n.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 s=this.data;this.data=o,o=s}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Jc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],l=[],p,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],p=l.pop(),m=!0),e.leaf&&(g=t7(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&t_(e,o)?(s.push(e),l.push(p),p=0,h=e,e=e.children[0]):h?(p++,e=h.children[p],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:jC,compareMinY:QC,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,o){var s=e-t+1,l=this._maxEntries,p;if(s<=l)return p=Jc(n.slice(t,e+1)),Kc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),p=Jc([]),p.leaf=!1,p.height=o;var h=Math.ceil(s/l),g=h*Math.ceil(Math.sqrt(l)),m,_,w,S;for(tP(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(w=Math.min(m+g-1,e),tP(n,m,w,h,this.compareMinY),_=m;_<=w;_+=h)S=Math.min(_+h-1,w),p.children.push(this._build(n,_,S,o-1));return Kc(p,this.toBBox),p},_chooseSubtree:function(n,t,e,o){for(var s,l,p,h,g,m,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,s=0,l=t.children.length;s<l;s++)p=t.children[s],g=Qv(p),m=e7(n,p)-g,m<w?(w=m,_=g<_?g:_,h=p):m===w&&g<_&&(_=g,h=p);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),l=[],p=this._chooseSubtree(s,this.data,t,l);for(p.children.push(n),fh(p,s);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(s,l,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var l=this._chooseSplitIndex(e,s,o),p=Jc(e.children.splice(l,e.children.length-l));p.height=e.height,p.leaf=e.leaf,Kc(e,this.toBBox),Kc(p,this.toBBox),t?n[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(n,t){this.data=Jc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Kc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,l,p,h,g,m,_;for(g=m=1/0,o=t;o<=e-t;o++)s=ch(n,0,o,this.toBBox),l=ch(n,o,e,this.toBBox),p=n7(s,l),h=Qv(s)+Qv(l),p<g?(g=p,_=o,m=h<m?h:m):p===g&&h<m&&(m=h,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:jC,s=n.leaf?this.compareMinY:QC,l=this._allDistMargin(n,t,e,o),p=this._allDistMargin(n,t,e,s);l<p&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,l=ch(n,0,t,s),p=ch(n,e-t,e,s),h=eg(l)+eg(p),g,m;for(g=t;g<e-t;g++)m=n.children[g],fh(l,n.leaf?s(m):m),h+=eg(l);for(g=e-t-1;g>=t;g--)m=n.children[g],fh(p,n.leaf?s(m):m),h+=eg(p);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)fh(t[o],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Kc(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function t7(n,t,e){if(!e)return t.indexOf(n);for(var o=0;o<t.length;o++)if(e(n,t[o]))return o;return-1}function Kc(n,t){ch(n,0,n.children.length,t,n)}function ch(n,t,e,o,s){s||(s=Jc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var l=t,p;l<e;l++)p=n.children[l],fh(s,n.leaf?o(p):p);return s}function fh(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function jC(n,t){return n.minX-t.minX}function QC(n,t){return n.minY-t.minY}function Qv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function eg(n){return n.maxX-n.minX+(n.maxY-n.minY)}function e7(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function n7(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),l=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,l-o)}function t_(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function ng(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Jc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function tP(n,t,e,o,s){for(var l=[t,e],p;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,QX(n,p,t,e,s),l.push(t,p,p,e))}});var sP=ot((tot,u_)=>{"use strict";u_.exports=sg;u_.exports.default=sg;function sg(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,l=rP(n,0,s,e,!0),p=[];if(!l||l.next===l.prev)return p;var h,g,m,_,w,S,b;if(o&&(l=h7(n,t,l,e)),n.length>80*e){h=m=n[0],g=_=n[1];for(var C=e;C<s;C+=e)w=n[C],S=n[C+1],w<h&&(h=w),S<g&&(g=S),w>m&&(m=w),S>_&&(_=S);b=Math.max(m-h,_-g),b=b!==0?32767/b:0}return gh(l,p,e,h,g,b,0),p}function rP(n,t,e,o,s){var l,p;if(s===a_(n,t,e,o)>0)for(l=t;l<e;l+=o)p=nP(l,n[l],n[l+1],p);else for(l=e-o;l>=t;l-=o)p=nP(l,n[l],n[l+1],p);return p&&ag(p,p.next)&&(yh(p),p=p.next),p}function kl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(ag(e,e.next)||Hr(e.prev,e,e.next)===0)){if(yh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function gh(n,t,e,o,s,l,p){if(n){!p&&l&&y7(n,o,s,l);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,l?l7(n,o,s,l):u7(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),yh(n),n=m.next,h=m.next;continue}if(n=m,n===h){p?p===1?(n=c7(kl(n),t,e),gh(n,t,e,o,s,l,2)):p===2&&f7(n,t,e,o,s,l):gh(kl(n),t,e,o,s,l,1);break}}}}function u7(n){var t=n.prev,e=n,o=n.next;if(Hr(t,e,o)>=0)return!1;for(var s=t.x,l=e.x,p=o.x,h=t.y,g=e.y,m=o.y,_=s<l?s<p?s:p:l<p?l:p,w=h<g?h<m?h:m:g<m?g:m,S=s>l?s>p?s:p:l>p?l:p,b=h>g?h>m?h:m:g>m?g:m,C=o.next;C!==t;){if(C.x>=_&&C.x<=S&&C.y>=w&&C.y<=b&&tf(s,h,l,g,p,m,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.next}return!0}function l7(n,t,e,o){var s=n.prev,l=n,p=n.next;if(Hr(s,l,p)>=0)return!1;for(var h=s.x,g=l.x,m=p.x,_=s.y,w=l.y,S=p.y,b=h<g?h<m?h:m:g<m?g:m,C=_<w?_<S?_:S:w<S?w:S,R=h>g?h>m?h:m:g>m?g:m,x=_>w?_>S?_:S:w>S?w:S,E=o_(b,C,t,e,o),I=o_(R,x,t,e,o),A=n.prevZ,F=n.nextZ;A&&A.z>=E&&F&&F.z<=I;){if(A.x>=b&&A.x<=R&&A.y>=C&&A.y<=x&&A!==s&&A!==p&&tf(h,_,g,w,m,S,A.x,A.y)&&Hr(A.prev,A,A.next)>=0||(A=A.prevZ,F.x>=b&&F.x<=R&&F.y>=C&&F.y<=x&&F!==s&&F!==p&&tf(h,_,g,w,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;A&&A.z>=E;){if(A.x>=b&&A.x<=R&&A.y>=C&&A.y<=x&&A!==s&&A!==p&&tf(h,_,g,w,m,S,A.x,A.y)&&Hr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;F&&F.z<=I;){if(F.x>=b&&F.x<=R&&F.y>=C&&F.y<=x&&F!==s&&F!==p&&tf(h,_,g,w,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function c7(n,t,e){var o=n;do{var s=o.prev,l=o.next.next;!ag(s,l)&&iP(s,o,o.next,l)&&mh(s,l)&&mh(l,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),yh(o),yh(o.next),o=n=l),o=o.next}while(o!==n);return kl(o)}function f7(n,t,e,o,s,l){var p=n;do{for(var h=p.next.next;h!==p.prev;){if(p.i!==h.i&&x7(p,h)){var g=oP(p,h);p=kl(p,p.next),g=kl(g,g.next),gh(p,t,e,o,s,l,0),gh(g,t,e,o,s,l,0);return}h=h.next}p=p.next}while(p!==n)}function h7(n,t,e,o){var s=[],l,p,h,g,m;for(l=0,p=t.length;l<p;l++)h=t[l]*o,g=l<p-1?t[l+1]*o:n.length,m=rP(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(_7(m));for(s.sort(p7),l=0;l<s.length;l++)e=d7(s[l],e);return e}function p7(n,t){return n.x-t.x}function d7(n,t){var e=g7(n,t);if(!e)return t;var o=oP(e,n);return kl(o,o.next),kl(e,e.next)}function g7(n,t){var e=t,o=n.x,s=n.y,l=-1/0,p;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,p=e.x<e.next.x?e:e.next,h===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,m=p.x,_=p.y,w=1/0,S;e=p;do o>=e.x&&e.x>=m&&o!==e.x&&tf(s<_?o:l,s,m,_,s<_?l:o,s,e.x,e.y)&&(S=Math.abs(s-e.y)/(o-e.x),mh(e,n)&&(S<w||S===w&&(e.x>p.x||e.x===p.x&&m7(p,e)))&&(p=e,w=S)),e=e.next;while(e!==g);return p}function m7(n,t){return Hr(n.prev,n,t.prev)<0&&Hr(t.next,n,n.next)<0}function y7(n,t,e,o){var s=n;do s.z===0&&(s.z=o_(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,v7(s)}function v7(n){var t,e,o,s,l,p,h,g,m=1;do{for(e=n,n=null,l=null,p=0;e;){for(p++,o=e,h=0,t=0;t<m&&(h++,o=o.nextZ,!!o);t++);for(g=m;h>0||g>0&&o;)h!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,g--),l?l.nextZ=s:n=s,s.prevZ=l,l=s;e=o}l.nextZ=null,m*=2}while(p>1);return n}function o_(n,t,e,o,s){return n=(n-e)*s|0,t=(t-o)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function _7(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function tf(n,t,e,o,s,l,p,h){return(s-p)*(t-h)>=(n-p)*(l-h)&&(n-p)*(o-h)>=(e-p)*(t-h)&&(e-p)*(l-h)>=(s-p)*(o-h)}function x7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!E7(n,t)&&(mh(n,t)&&mh(t,n)&&w7(n,t)&&(Hr(n.prev,n,t.prev)||Hr(n,t.prev,t))||ag(n,t)&&Hr(n.prev,n,n.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function ag(n,t){return n.x===t.x&&n.y===t.y}function iP(n,t,e,o){var s=og(Hr(n,t,e)),l=og(Hr(n,t,o)),p=og(Hr(e,o,n)),h=og(Hr(e,o,t));return!!(s!==l&&p!==h||s===0&&ig(n,e,t)||l===0&&ig(n,o,t)||p===0&&ig(e,n,o)||h===0&&ig(e,t,o))}function ig(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function og(n){return n>0?1:n<0?-1:0}function E7(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&iP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function mh(n,t){return Hr(n.prev,n,n.next)<0?Hr(n,t,n.next)>=0&&Hr(n,n.prev,t)>=0:Hr(n,t,n.prev)<0||Hr(n,n.next,t)<0}function w7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,l=(n.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&s<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function oP(n,t){var e=new s_(n.i,n.x,n.y),o=new s_(t.i,t.x,t.y),s=n.next,l=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function nP(n,t,e,o){var s=new s_(n,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function yh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function s_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}sg.deviation=function(n,t,e,o){var s=t&&t.length,l=s?t[0]*e:n.length,p=Math.abs(a_(n,0,l,e));if(s)for(var h=0,g=t.length;h<g;h++){var m=t[h]*e,_=h<g-1?t[h+1]*e:n.length;p-=Math.abs(a_(n,m,_,e))}var w=0;for(h=0;h<o.length;h+=3){var S=o[h]*e,b=o[h+1]*e,C=o[h+2]*e;w+=Math.abs((n[S]-n[C])*(n[b+1]-n[S+1])-(n[S]-n[b])*(n[C+1]-n[S+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function a_(n,t,e,o){for(var s=0,l=t,p=e-o;l<e;l+=o)s+=(n[p]-n[l])*(n[l+1]+n[p+1]),p=l;return s}sg.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,s=0;s<n.length;s++){for(var l=0;l<n[s].length;l++)for(var p=0;p<t;p++)e.vertices.push(n[s][l][p]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var p_=ot(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.earthRadius=63710088e-1;Oe.factors={centimeters:Oe.earthRadius*100,centimetres:Oe.earthRadius*100,degrees:Oe.earthRadius/111325,feet:Oe.earthRadius*3.28084,inches:Oe.earthRadius*39.37,kilometers:Oe.earthRadius/1e3,kilometres:Oe.earthRadius/1e3,meters:Oe.earthRadius,metres:Oe.earthRadius,miles:Oe.earthRadius/1609.344,millimeters:Oe.earthRadius*1e3,millimetres:Oe.earthRadius*1e3,nauticalmiles:Oe.earthRadius/1852,radians:1,yards:Oe.earthRadius*1.0936};Oe.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/Oe.earthRadius,yards:1.0936133};Oe.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 nl(n,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=n,o}Oe.feature=nl;function M7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return l_(t).geometry;case"LineString":return f_(t).geometry;case"Polygon":return c_(t).geometry;case"MultiPoint":return uP(t).geometry;case"MultiLineString":return aP(t).geometry;case"MultiPolygon":return lP(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=M7;function l_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ug(n[0])||!ug(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return nl(o,t,e)}Oe.point=l_;function b7(n,t,e){return e===void 0&&(e={}),lg(n.map(function(o){return l_(o,t)}),e)}Oe.points=b7;function c_(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return nl(h,t,e)}Oe.polygon=c_;function A7(n,t,e){return e===void 0&&(e={}),lg(n.map(function(o){return c_(o,t)}),e)}Oe.polygons=A7;function f_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return nl(o,t,e)}Oe.lineString=f_;function T7(n,t,e){return e===void 0&&(e={}),lg(n.map(function(o){return f_(o,t)}),e)}Oe.lineStrings=T7;function lg(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}Oe.featureCollection=lg;function aP(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return nl(o,t,e)}Oe.multiLineString=aP;function uP(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return nl(o,t,e)}Oe.multiPoint=uP;function lP(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return nl(o,t,e)}Oe.multiPolygon=lP;function C7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return nl(o,t,e)}Oe.geometryCollection=C7;function P7(n,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(n*e)/e}Oe.round=P7;function cP(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}Oe.radiansToLength=cP;function h_(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}Oe.lengthToRadians=h_;function I7(n,t){return fP(h_(n,t))}Oe.lengthToDegrees=I7;function R7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=R7;function fP(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=fP;function L7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=L7;function N7(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return cP(h_(n,t),e)}Oe.convertLength=N7;function O7(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=Oe.areaFactors[t];if(!o)throw new Error("invalid original units");var s=Oe.areaFactors[e];if(!s)throw new Error("invalid final units");return n/o*s}Oe.convertArea=O7;function ug(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=ug;function D7(n){return!!n&&n.constructor===Object}Oe.isObject=D7;function F7(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!ug(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=F7;function U7(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Oe.validateId=U7});var g_=ot(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var co=p_();function vh(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,_=0,w=0,S,b=n.type,C=b==="FeatureCollection",R=b==="Feature",x=C?n.features.length:1,E=0;E<x;E++){m=C?n.features[E].geometry:R?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var I=0;I<h;I++){var A=0,F=0;if(p=S?m.geometries[I]:m,p!==null){g=p.coordinates;var V=p.type;switch(_=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,w,E,A,F)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,F)===!1)return!1;w++,V==="MultiPoint"&&A++}V==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],w,E,A,F)===!1)return!1;w++}V==="MultiLineString"&&A++,V==="Polygon"&&F++}V==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-_;l++){if(t(g[o][s][l],w,E,A,F)===!1)return!1;w++}F++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(vh(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function B7(n,t,e,o){var s=e;return vh(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function hP(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function z7(n,t,e){var o=e;return hP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function pP(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function G7(n,t,e){var o=e;return pP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function k7(n){var t=[];return vh(n,function(e){t.push(e)}),t}function d_(n,t){var e,o,s,l,p,h,g,m,_,w,S=0,b=n.type==="FeatureCollection",C=n.type==="Feature",R=b?n.features.length:1;for(e=0;e<R;e++){for(h=b?n.features[e].geometry:C?n.geometry:n,m=b?n.features[e].properties:C?n.properties:{},_=b?n.features[e].bbox:C?n.bbox:void 0,w=b?n.features[e].id:C?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,S,m,_,w)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,S,m,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],S,m,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function q7(n,t,e){var o=e;return d_(n,function(s,l,p,h,g){l===0&&e===void 0?o=s:o=t(o,s,l,p,h,g)}),o}function cg(n,t){d_(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(co.feature(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],w={type:g,coordinates:_};if(t(co.feature(w,s),o,m)===!1)return!1}})}function H7(n,t,e){var o=e;return cg(n,function(s,l,p){l===0&&p===0&&e===void 0?o=s:o=t(o,s,l,p)}),o}function dP(n,t){cg(n,function(e,o,s){var l=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var h,g=0,m=0,_=0;if(vh(e,function(w,S,b,C,R){if(h===void 0||o>g||C>m||R>_){h=w,g=o,m=C,_=R,l=0;return}var x=co.lineString([h,w],e.properties);if(t(x,o,s,R,l)===!1)return!1;l++,h=w})===!1)return!1}}})}function V7(n,t,e){var o=e,s=!1;return dP(n,function(l,p,h,g,m){s===!1&&e===void 0?o=l:o=t(o,l,p,h,g,m),s=!0}),o}function gP(n,t){if(!n)throw new Error("geojson is required");cg(n,function(e,o,s){if(e.geometry!==null){var l=e.geometry.type,p=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<p.length;h++)if(t(co.lineString(p[h],e.properties),o,s,h)===!1)return!1;break}}})}function W7(n,t,e){var o=e;return gP(n,function(s,l,p,h){l===0&&e===void 0?o=s:o=t(o,s,l,p,h)}),o}function X7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.segmentIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=g.length+l-1),co.lineString([g[l],g[l+1]],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l-1),co.lineString([g[s][l],g[s][l+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l-1),co.lineString([g[o][l],g[o][l+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l-1),co.lineString([g[o][s][l],g[o][s][l+1]],p,t)}throw new Error("geojson is invalid")}function Y7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.coordIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":return co.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),co.point(g[o],p,t);case"LineString":return l<0&&(l=g.length+l),co.point(g[l],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l),co.point(g[s][l],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l),co.point(g[o][l],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l),co.point(g[o][s][l],p,t)}throw new Error("geojson is invalid")}Si.coordAll=k7;Si.coordEach=vh;Si.coordReduce=B7;Si.featureEach=pP;Si.featureReduce=G7;Si.findPoint=Y7;Si.findSegment=X7;Si.flattenEach=cg;Si.flattenReduce=H7;Si.geomEach=d_;Si.geomReduce=q7;Si.lineEach=gP;Si.lineReduce=W7;Si.propEach=hP;Si.propReduce=z7;Si.segmentEach=dP;Si.segmentReduce=V7});var mP=ot(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var $7=g_();function m_(n){var t=[1/0,1/0,-1/0,-1/0];return $7.coordEach(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}m_.default=m_;y_.default=m_});var fg=ot((mot,v_)=>{var Ia=Hv(),vP=p_(),_P=g_(),ef=mP().default,Z7=_P.featureEach,dot=_P.coordEach,got=vP.polygon,yP=vP.featureCollection;function xP(n){var t=new Ia(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ia.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}):Z7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}),Ia.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:ef(e),Ia.prototype.remove.call(this,e,o)},t.clear=function(){return Ia.prototype.clear.call(this)},t.search=function(e){var o=Ia.prototype.search.call(this,this.toBBox(e));return yP(o)},t.collides=function(e){return Ia.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Ia.prototype.all.call(this);return yP(e)},t.toJSON=function(){return Ia.prototype.toJSON.call(this)},t.fromJSON=function(e){return Ia.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=ef(e);else if(e.type==="FeatureCollection")o=ef(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}v_.exports=xP;v_.exports.default=xP});var M_=ot((bat,IP)=>{"use strict";var PP=Object.prototype.toString;IP.exports=function(t){var e=PP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&PP.call(t.callee)==="[object Function]"),o}});var zP=ot((Aat,BP)=>{"use strict";var UP;Object.keys||(Eh=Object.prototype.hasOwnProperty,b_=Object.prototype.toString,RP=M_(),A_=Object.prototype.propertyIsEnumerable,LP=!A_.call({toString:null},"toString"),NP=A_.call(function(){},"prototype"),wh=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],mg=function(n){var t=n.constructor;return t&&t.prototype===n},OP={$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},DP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!OP["$"+n]&&Eh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{mg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),FP=function(n){if(typeof window=="undefined"||!DP)return mg(n);try{return mg(n)}catch(t){return!1}},UP=function(t){var e=t!==null&&typeof t=="object",o=b_.call(t)==="[object Function]",s=RP(t),l=e&&b_.call(t)==="[object String]",p=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=NP&&o;if(l&&t.length>0&&!Eh.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)p.push(String(m));else for(var _ in t)!(h&&_==="prototype")&&Eh.call(t,_)&&p.push(String(_));if(LP)for(var w=FP(t),S=0;S<wh.length;++S)!(w&&wh[S]==="constructor")&&Eh.call(t,wh[S])&&p.push(wh[S]);return p});var Eh,b_,RP,A_,LP,NP,wh,mg,OP,DP,FP;BP.exports=UP});var T_=ot((Tat,qP)=>{"use strict";var oY=Array.prototype.slice,sY=M_(),GP=Object.keys,yg=GP?function(t){return GP(t)}:zP(),kP=Object.keys;yg.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 sY(o)?kP(oY.call(o)):kP(o)})}else Object.keys=yg;return Object.keys||yg};qP.exports=yg});var C_=ot((Cat,HP)=>{"use strict";HP.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 s=42;t[e]=s;for(var l 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 p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var vg=ot((Pat,VP)=>{"use strict";var aY=C_();VP.exports=function(){return aY()&&!!Symbol.toStringTag}});var P_=ot((Iat,WP)=>{"use strict";WP.exports=Object});var I_=ot((Rat,XP)=>{"use strict";XP.exports=Error});var $P=ot((Lat,YP)=>{"use strict";YP.exports=EvalError});var KP=ot((Nat,ZP)=>{"use strict";ZP.exports=RangeError});var jP=ot((Oat,JP)=>{"use strict";JP.exports=ReferenceError});var R_=ot((Dat,QP)=>{"use strict";QP.exports=SyntaxError});var ql=ot((Fat,tI)=>{"use strict";tI.exports=TypeError});var nI=ot((Uat,eI)=>{"use strict";eI.exports=URIError});var iI=ot((Bat,rI)=>{"use strict";rI.exports=Math.abs});var sI=ot((zat,oI)=>{"use strict";oI.exports=Math.floor});var uI=ot((Gat,aI)=>{"use strict";aI.exports=Math.max});var cI=ot((kat,lI)=>{"use strict";lI.exports=Math.min});var hI=ot((qat,fI)=>{"use strict";fI.exports=Math.pow});var dI=ot((Hat,pI)=>{"use strict";pI.exports=Math.round});var mI=ot((Vat,gI)=>{"use strict";gI.exports=Number.isNaN||function(t){return t!==t}});var vI=ot((Wat,yI)=>{"use strict";var uY=mI();yI.exports=function(t){return uY(t)||t===0?t:t<0?-1:1}});var xI=ot((Xat,_I)=>{"use strict";_I.exports=Object.getOwnPropertyDescriptor});var Hl=ot((Yat,EI)=>{"use strict";var _g=xI();if(_g)try{_g([],"length")}catch(n){_g=null}EI.exports=_g});var Sh=ot(($at,wI)=>{"use strict";var xg=Object.defineProperty||!1;if(xg)try{xg({},"a",{value:1})}catch(n){xg=!1}wI.exports=xg});var bI=ot((Zat,MI)=>{"use strict";var SI=typeof Symbol!="undefined"&&Symbol,lY=C_();MI.exports=function(){return typeof SI!="function"||typeof Symbol!="function"||typeof SI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:lY()}});var L_=ot((Kat,AI)=>{"use strict";AI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var N_=ot((Jat,TI)=>{"use strict";var cY=P_();TI.exports=cY.getPrototypeOf||null});var II=ot((jat,PI)=>{"use strict";var fY="Function.prototype.bind called on incompatible ",hY=Object.prototype.toString,pY=Math.max,dY="[object Function]",CI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},gY=function(t,e){for(var o=[],s=e||0,l=0;s<t.length;s+=1,l+=1)o[l]=t[s];return o},mY=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};PI.exports=function(t){var e=this;if(typeof e!="function"||hY.apply(e)!==dY)throw new TypeError(fY+e);for(var o=gY(arguments,1),s,l=function(){if(this instanceof s){var _=e.apply(this,CI(o,arguments));return Object(_)===_?_:this}return e.apply(t,CI(o,arguments))},p=pY(0,e.length-o.length),h=[],g=0;g<p;g++)h[g]="$"+g;if(s=Function("binder","return function ("+mY(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var nf=ot((Qat,RI)=>{"use strict";var yY=II();RI.exports=Function.prototype.bind||yY});var Eg=ot((tut,LI)=>{"use strict";LI.exports=Function.prototype.call});var wg=ot((eut,NI)=>{"use strict";NI.exports=Function.prototype.apply});var DI=ot((nut,OI)=>{"use strict";OI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var O_=ot((rut,FI)=>{"use strict";var vY=nf(),_Y=wg(),xY=Eg(),EY=DI();FI.exports=EY||vY.call(xY,_Y)});var Sg=ot((iut,UI)=>{"use strict";var wY=nf(),SY=ql(),MY=Eg(),bY=O_();UI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new SY("a function is required");return bY(wY,MY,t)}});var HI=ot((out,qI)=>{"use strict";var AY=Sg(),BI=Hl(),GI;try{GI=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var D_=!!GI&&BI&&BI(Object.prototype,"__proto__"),kI=Object,zI=kI.getPrototypeOf;qI.exports=D_&&typeof D_.get=="function"?AY([D_.get]):typeof zI=="function"?function(t){return zI(t==null?t:kI(t))}:!1});var F_=ot((sut,YI)=>{"use strict";var VI=L_(),WI=N_(),XI=HI();YI.exports=VI?function(t){return VI(t)}:WI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return WI(t)}:XI?function(t){return XI(t)}:null});var U_=ot((aut,$I)=>{"use strict";var TY=Function.prototype.call,CY=Object.prototype.hasOwnProperty,PY=nf();$I.exports=PY.call(TY,CY)});var G_=ot((uut,tR)=>{"use strict";var Un,IY=P_(),RY=I_(),LY=$P(),NY=KP(),OY=jP(),af=R_(),sf=ql(),DY=nI(),FY=iI(),UY=sI(),BY=uI(),zY=cI(),GY=hI(),kY=dI(),qY=vI(),jI=Function,B_=function(n){try{return jI('"use strict"; return ('+n+").constructor;")()}catch(t){}},Mh=Hl(),HY=Sh(),z_=function(){throw new sf},VY=Mh?function(){try{return arguments.callee,z_}catch(n){try{return Mh(arguments,"callee").get}catch(t){return z_}}}():z_,rf=bI()(),qi=F_(),WY=N_(),XY=L_(),QI=wg(),bh=Eg(),of={},YY=typeof Uint8Array=="undefined"||!qi?Un:qi(Uint8Array),Vl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Un:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Un:ArrayBuffer,"%ArrayIteratorPrototype%":rf&&qi?qi([][Symbol.iterator]()):Un,"%AsyncFromSyncIteratorPrototype%":Un,"%AsyncFunction%":of,"%AsyncGenerator%":of,"%AsyncGeneratorFunction%":of,"%AsyncIteratorPrototype%":of,"%Atomics%":typeof Atomics=="undefined"?Un:Atomics,"%BigInt%":typeof BigInt=="undefined"?Un:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Un:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Un:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Un:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":RY,"%eval%":eval,"%EvalError%":LY,"%Float16Array%":typeof Float16Array=="undefined"?Un:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Un:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Un:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Un:FinalizationRegistry,"%Function%":jI,"%GeneratorFunction%":of,"%Int8Array%":typeof Int8Array=="undefined"?Un:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Un:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Un:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rf&&qi?qi(qi([][Symbol.iterator]())):Un,"%JSON%":typeof JSON=="object"?JSON:Un,"%Map%":typeof Map=="undefined"?Un:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!rf||!qi?Un:qi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":IY,"%Object.getOwnPropertyDescriptor%":Mh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Un:Promise,"%Proxy%":typeof Proxy=="undefined"?Un:Proxy,"%RangeError%":NY,"%ReferenceError%":OY,"%Reflect%":typeof Reflect=="undefined"?Un:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Un:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!rf||!qi?Un:qi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Un:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rf&&qi?qi(""[Symbol.iterator]()):Un,"%Symbol%":rf?Symbol:Un,"%SyntaxError%":af,"%ThrowTypeError%":VY,"%TypedArray%":YY,"%TypeError%":sf,"%Uint8Array%":typeof Uint8Array=="undefined"?Un:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Un:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Un:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Un:Uint32Array,"%URIError%":DY,"%WeakMap%":typeof WeakMap=="undefined"?Un:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Un:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Un:WeakSet,"%Function.prototype.call%":bh,"%Function.prototype.apply%":QI,"%Object.defineProperty%":HY,"%Object.getPrototypeOf%":WY,"%Math.abs%":FY,"%Math.floor%":UY,"%Math.max%":BY,"%Math.min%":zY,"%Math.pow%":GY,"%Math.round%":kY,"%Math.sign%":qY,"%Reflect.getPrototypeOf%":XY};if(qi)try{null.error}catch(n){ZI=qi(qi(n)),Vl["%Error.prototype%"]=ZI}var ZI,$Y=function n(t){var e;if(t==="%AsyncFunction%")e=B_("async function () {}");else if(t==="%GeneratorFunction%")e=B_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=B_("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&qi&&(e=qi(s.prototype))}return Vl[t]=e,e},KI={__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"]},Ah=nf(),Mg=U_(),ZY=Ah.call(bh,Array.prototype.concat),KY=Ah.call(QI,Array.prototype.splice),JI=Ah.call(bh,String.prototype.replace),bg=Ah.call(bh,String.prototype.slice),JY=Ah.call(bh,RegExp.prototype.exec),jY=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,QY=/\\(\\)?/g,t$=function(t){var e=bg(t,0,1),o=bg(t,-1);if(e==="%"&&o!=="%")throw new af("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&e!=="%")throw new af("invalid intrinsic syntax, expected opening `%`");var s=[];return JI(t,jY,function(l,p,h,g){s[s.length]=h?JI(g,QY,"$1"):p||l}),s},e$=function(t,e){var o=t,s;if(Mg(KI,o)&&(s=KI[o],o="%"+s[0]+"%"),Mg(Vl,o)){var l=Vl[o];if(l===of&&(l=$Y(o)),typeof l=="undefined"&&!e)throw new sf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:l}}throw new af("intrinsic "+t+" does not exist!")};tR.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new sf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new sf('"allowMissing" argument must be a boolean');if(JY(/^%?[^%]*%?$/,t)===null)throw new af("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=t$(t),s=o.length>0?o[0]:"",l=e$("%"+s+"%",e),p=l.name,h=l.value,g=!1,m=l.alias;m&&(s=m[0],KY(o,ZY([0,1],m)));for(var _=1,w=!0;_<o.length;_+=1){var S=o[_],b=bg(S,0,1),C=bg(S,-1);if((b==='"'||b==="'"||b==="`"||C==='"'||C==="'"||C==="`")&&b!==C)throw new af("property names with quotes must have matching quotes");if((S==="constructor"||!w)&&(g=!0),s+="."+S,p="%"+s+"%",Mg(Vl,p))h=Vl[p];else if(h!=null){if(!(S in h)){if(!e)throw new sf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Mh&&_+1>=o.length){var R=Mh(h,S);w=!!R,w&&"get"in R&&!("originalValue"in R.get)?h=R.get:h=h[S]}else w=Mg(h,S),h=h[S];w&&!g&&(Vl[p]=h)}}return h}});var Ag=ot((lut,rR)=>{"use strict";var eR=G_(),nR=Sg(),n$=nR([eR("%String.prototype.indexOf%")]);rR.exports=function(t,e){var o=eR(t,!!e);return typeof o=="function"&&n$(t,".prototype.")>-1?nR([o]):o}});var sR=ot((cut,oR)=>{"use strict";var r$=vg()(),i$=Ag(),k_=i$("Object.prototype.toString"),Tg=function(t){return r$&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:k_(t)==="[object Arguments]"},iR=function(t){return Tg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&k_(t)!=="[object Array]"&&"callee"in t&&k_(t.callee)==="[object Function]"},o$=function(){return Tg(arguments)}();Tg.isLegacyArguments=iR;oR.exports=o$?Tg:iR});var Cg=ot((fut,lR)=>{"use strict";var aR=Sh(),s$=R_(),uf=ql(),uR=Hl();lR.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new uf("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new uf("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uf("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uf("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uf("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uf("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!uR&&uR(t,e);if(aR)aR(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:l===null&&g?g.writable:!l});else if(h||!s&&!l&&!p)t[e]=o;else throw new s$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Pg=ot((hut,fR)=>{"use strict";var q_=Sh(),cR=function(){return!!q_};cR.hasArrayLengthDefineBug=function(){if(!q_)return null;try{return q_([],"length",{value:1}).length!==1}catch(t){return!0}};fR.exports=cR});var lf=ot((put,gR)=>{"use strict";var a$=T_(),u$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",l$=Object.prototype.toString,c$=Array.prototype.concat,hR=Cg(),f$=function(n){return typeof n=="function"&&l$.call(n)==="[object Function]"},pR=Pg()(),h$=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!f$(o)||!o())return}pR?hR(n,t,e,!0):hR(n,t,e)},dR=function(n,t){var e=arguments.length>2?arguments[2]:{},o=a$(t);u$&&(o=c$.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)h$(n,o[s],t[o[s]],e[o[s]])};dR.supportsDescriptors=!!pR;gR.exports=dR});var xR=ot((dut,_R)=>{"use strict";var p$=G_(),mR=Cg(),d$=Pg()(),yR=Hl(),vR=ql(),g$=p$("%Math.floor%");_R.exports=function(t,e){if(typeof t!="function")throw new vR("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||g$(e)!==e)throw new vR("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&yR){var p=yR(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!o)&&(d$?mR(t,"length",e,!0,!0):mR(t,"length",e)),t}});var wR=ot((gut,ER)=>{"use strict";var m$=nf(),y$=wg(),v$=O_();ER.exports=function(){return v$(m$,y$,arguments)}});var H_=ot((mut,Ig)=>{"use strict";var _$=xR(),SR=Sh(),x$=Sg(),MR=wR();Ig.exports=function(t){var e=x$(arguments),o=t.length-(arguments.length-1);return _$(e,1+(o>0?o:0),!0)};SR?SR(Ig.exports,"apply",{value:MR}):Ig.exports.apply=MR});var V_=ot((yut,AR)=>{"use strict";var bR=function(n){return n!==n};AR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||bR(t)&&bR(e))}});var W_=ot((vut,TR)=>{"use strict";var E$=V_();TR.exports=function(){return typeof Object.is=="function"?Object.is:E$}});var PR=ot((_ut,CR)=>{"use strict";var w$=W_(),S$=lf();CR.exports=function(){var t=w$();return S$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var NR=ot((xut,LR)=>{"use strict";var M$=lf(),b$=H_(),A$=V_(),IR=W_(),T$=PR(),RR=b$(IR(),Object);M$(RR,{getPolyfill:IR,implementation:A$,shim:T$});LR.exports=RR});var zR=ot((Eut,BR)=>{"use strict";var OR=Ag(),C$=vg()(),P$=U_(),I$=Hl(),$_;C$?(DR=OR("RegExp.prototype.exec"),X_={},Rg=function(){throw X_},Y_={toString:Rg,valueOf:Rg},typeof Symbol.toPrimitive=="symbol"&&(Y_[Symbol.toPrimitive]=Rg),$_=function(t){if(!t||typeof t!="object")return!1;var e=I$(t,"lastIndex"),o=e&&P$(e,"value");if(!o)return!1;try{DR(t,Y_)}catch(s){return s===X_}}):(FR=OR("Object.prototype.toString"),UR="[object RegExp]",$_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:FR(t)===UR});var DR,X_,Rg,Y_,FR,UR;BR.exports=$_});var kR=ot((wut,GR)=>{"use strict";var Ch=function(){return typeof function(){}.name=="string"},Th=Object.getOwnPropertyDescriptor;if(Th)try{Th([],"length")}catch(n){Th=null}Ch.functionsHaveConfigurableNames=function(){if(!Ch()||!Th)return!1;var t=Th(function(){},"name");return!!t&&!!t.configurable};var R$=Function.prototype.bind;Ch.boundFunctionsHaveNames=function(){return Ch()&&typeof R$=="function"&&function(){}.bind().name!==""};GR.exports=Ch});var VR=ot((Sut,HR)=>{"use strict";var qR=Cg(),L$=Pg()(),N$=kR().functionsHaveConfigurableNames(),O$=ql();HR.exports=function(t,e){if(typeof t!="function")throw new O$("`fn` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||N$)&&(L$?qR(t,"name",e,!0,!0):qR(t,"name",e)),t}});var Z_=ot((Mut,WR)=>{"use strict";var D$=VR(),F$=ql(),U$=Object;WR.exports=D$(function(){if(this==null||this!==U$(this))throw new F$("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 K_=ot((but,XR)=>{"use strict";var B$=Z_(),z$=lf().supportsDescriptors,G$=Object.getOwnPropertyDescriptor;XR.exports=function(){if(z$&&/a/mig.flags==="gim"){var t=G$(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 B$}});var ZR=ot((Aut,$R)=>{"use strict";var k$=lf().supportsDescriptors,q$=K_(),H$=Hl(),V$=Object.defineProperty,W$=I_(),YR=F_(),X$=/a/;$R.exports=function(){if(!k$||!YR)throw new W$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=q$(),e=YR(X$),o=H$(e,"flags");return(!o||o.get!==t)&&V$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var QR=ot((Tut,jR)=>{"use strict";var Y$=lf(),$$=H_(),Z$=Z_(),KR=K_(),K$=ZR(),JR=$$(KR());Y$(JR,{getPolyfill:KR,implementation:Z$,shim:K$});jR.exports=JR});var nL=ot((Cut,eL)=>{"use strict";var tL=Ag(),J$=tL("Date.prototype.getDay"),j$=function(t){try{return J$(t),!0}catch(e){return!1}},Q$=tL("Object.prototype.toString"),tZ="[object Date]",eZ=vg()();eL.exports=function(t){return typeof t!="object"||t===null?!1:eZ?j$(t):Q$(t)===tZ}});var J_=ot((Put,pL)=>{var rL=T_(),iL=sR(),oL=NR(),sL=zR(),aL=QR(),uL=nL(),lL=Date.prototype.getTime;function hL(n,t,e){var o=e||{};return(o.strict?oL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?oL(n,t):n==t:nZ(n,t,o)}function cL(n){return n==null}function fL(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function nZ(n,t,e){var o,s;if(typeof n!=typeof t||cL(n)||cL(t)||n.prototype!==t.prototype||iL(n)!==iL(t))return!1;var l=sL(n),p=sL(t);if(l!==p)return!1;if(l||p)return n.source===t.source&&aL(n)===aL(t);if(uL(n)&&uL(t))return lL.call(n)===lL.call(t);var h=fL(n),g=fL(t);if(h!==g)return!1;if(h||g){if(n.length!==t.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==t[o])return!1;return!0}if(typeof n!=typeof t)return!1;try{var m=rL(n),_=rL(t)}catch(w){return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),o=m.length-1;o>=0;o--)if(m[o]!=_[o])return!1;for(o=m.length-1;o>=0;o--)if(s=m[o],!hL(n[s],t[s],e))return!1;return!0}pL.exports=hL});var l1=ot((Dct,xL)=>{var XZ=J_(),Ra=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:YZ};Ra.prototype.compare=function(n,t){if(n.type!==t.type||!_L(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,o=vL(n),s=vL(t);return o.every(function(l){return this.some(function(p){return e.compare(l,p)})},s)}}return!1};function vL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function _L(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}Ra.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};Ra.prototype.compareLine=function(n,t,e,o){if(!_L(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],l[0])&&(l=this.fixStartIndex(l,s),!l))){var p=this.compareCoord(s[e],l[e]);return this.direction||p?this.comparePath(s,l):this.compareCoord(s[e],l[l.length-(1+e)])?this.comparePath(s.slice().reverse(),l):!1}};Ra.prototype.fixStartIndex=function(n,t){for(var e,o=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){o=s;break}return o>=0&&(e=[].concat(n.slice(o,n.length),n.slice(1,o+1))),e};Ra.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};Ra.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(l){return this.some(function(p){return s.compareLine(l,p,1,!0)})},o)}else return!1};Ra.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};Ra.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};Ra.prototype.removePseudo=function(n){return n};function YZ(n,t){return XZ(n,t,{strict:!0})}xL.exports=Ra});var EL=ot((Yct,Og)=>{function il(n,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(n,t,e,o)}il.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var l=this._regionQuery(s);if(l.length<this.minPts)this.noise.push(s);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(s,p),this._expandCluster(p,l)}}return this.clusters};il.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.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)};il.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[o]!==1&&this._addToCluster(o,n)}};il.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};il.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[n],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};il.prototype._mergeArrays=function(n,t){for(var e=t.length,o=0;o<e;o++){var s=t[o];n.indexOf(s)<0&&n.push(s)}return n};il.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof Og!="undefined"&&Og.exports&&(Og.exports=il)});var wL=ot(($ct,Dg)=>{function ol(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ol.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ol.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var l=0;l<this.k;l++){for(var p=new Array(_),h=0,g=0;g<_;g++)p[g]=0;for(var m=0;m<e;m++){var _=this.dataset[m].length;if(l===this.assignments[m]){for(var g=0;g<_;g++)p[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<_;g++)p[g]/=h;this.centroids[l]=p}else this.centroids[l]=this.randomCentroid(),s=!0}}return this.getClusters()};ol.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ol.prototype.assign=function(){for(var n=!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,n=!0);return n};ol.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ol.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,l=t.length,p,h=0;h<l;h++)p=e(n,t[h]),p<o&&(o=p,s=h);return s};ol.prototype.distance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;){var s=n[o]-t[o];e+=s*s}return Math.sqrt(e)};typeof Dg!="undefined"&&Dg.exports&&(Dg.exports=ol)});var c1=ot((Zct,Fg)=>{function La(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}La.prototype.insert=function(n,t){for(var e=this._queue.length,o=e;o--;){var s=this._priorities[o];this._sorting==="desc"?t>s&&(e=o):t<s&&(e=o)}this._insertAt(n,t,e)};La.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};La.prototype.forEach=function(n){this._queue.forEach(n)};La.prototype.getElements=function(){return this._queue};La.prototype.getElementPriority=function(n){return this._priorities[n]};La.prototype.getPriorities=function(){return this._priorities};La.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};La.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<n.length;o++)this.insert(n[o],t[o])}e&&(this._sorting=e)};La.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof Fg!="undefined"&&Fg.exports&&(Fg.exports=La)});var ML=ot((Kct,ff)=>{typeof ff!="undefined"&&ff.exports&&(SL=c1());var SL;function gu(n,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,o)}gu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var p=this.clusters.length-1;this._orderedList.push(s);var h=new SL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(p,h))}return this.clusters};gu.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],s=this._reachability[o];n.push([o,s])}return n};gu.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,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)};gu.prototype._updateQueue=function(n,t,e){var o=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[n],o.dataset[s]),p=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=p,e.insert(s,p)):p<o._reachability[s]&&(o._reachability[s]=p,e.remove(s),e.insert(s,p))}})};gu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var l=e[o];if(this._processed[l]===void 0){var p=this._regionQuery(l);this._processed[l]=1,this.clusters[n].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,p,t),this._expandCluster(n,t))}}};gu.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(n,e);if(o.length>=this.minPts)return e}};gu.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[n],this.dataset[o])<t&&e.push(o);return e};gu.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof ff!="undefined"&&ff.exports&&(ff.exports=gu)});var bL=ot((Jct,Ug)=>{typeof Ug!="undefined"&&Ug.exports&&(Ug.exports={DBSCAN:EL(),KMEANS:wL(),OPTICS:ML(),PriorityQueue:c1()})});var f1=ot((rft,TL)=>{"use strict";TL.exports={eudist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++){var h=(t[p]||0)-(e[p]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++)l+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var IL=ot((ift,PL)=>{"use strict";var CL=f1(),QZ=CL.eudist,tK=CL.dist;PL.exports={kmrand:function(t,e){for(var o={},s=[],l=e<<2,p=t.length,h=t[0].length>0;s.length<e&&l-- >0;){var g=t[Math.floor(Math.random()*p)],m=h?g.join("_"):""+g;o[m]||(o[m]=!0,s.push(g))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var o=t[0].length?QZ:tK,s=[],l=t.length,p=t[0].length>0,h={},g=t[Math.floor(Math.random()*l)],m=p?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var _=[],w=s.length,S=0,b=[],C=0;C<l;C++){for(var R=1/0,x=0;x<w;x++){var E=o(t[C],s[x]);E<=R&&(R=E)}_[C]=R}for(var I=0;I<l;I++)S+=_[I];for(var A=0;A<l;A++)b[A]={i:A,v:t[A],pr:_[A]/S,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var F=1;F<l;F++)b[F].cs=b[F-1].cs+b[F].pr;for(var V=Math.random(),X=0;X<l-1&&b[X++].cs<V;);s.push(b[X-1].v)}return s}}});var DL=ot((aft,OL)=>{"use strict";var h1=f1(),NL=IL(),eK=h1.eudist,oft=h1.mandist,sft=h1.dist,nK=NL.kmrand,rK=NL.kmpp,RL=1e4;function LL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function iK(n,t,e,o){var s=[],l=[],p=[],h=[],g=!1,m=o||RL,_=n.length,w=n[0].length,S=w>0,b=[];if(e)e=="kmrand"?s=nK(n,t):e=="kmpp"?s=rK(n,t):s=e;else for(var C={};s.length<t;){var R=Math.floor(Math.random()*_);C[R]||(C[R]=!0,s.push(n[R]))}do{LL(t,0,b);for(var x=0;x<_;x++){for(var E=1/0,I=0,A=0;A<t;A++){var h=S?eK(n[x],s[A]):Math.abs(n[x]-s[A]);h<=E&&(E=h,I=A)}p[x]=I,b[I]++}for(var F=[],l=[],V=0,X=0;X<t;X++)F[X]=S?LL(w,0,F[X]):0,l[X]=s[X];if(S){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<_;D++)for(var xt=p[D],B=F[xt],j=n[D],K=0;K<w;K++)B[K]+=j[K];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=l[Dt],Lt=b[Dt],pt=0;pt<w;pt++)Q[pt]=At[pt]/Lt||0;if(g){for(var yt=0;yt<w;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var J=0;J<_;J++){var Bt=p[J];F[Bt]+=n[J]}for(var Gt=0;Gt<t;Gt++)s[Gt]=F[Gt]/b[Gt]||0;g=!0;for(var ae=0;ae<t;ae++)if(l[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:RL-m,k:t,idxs:p,centroids:s}}OL.exports=iK});var mf=ot((v1,_1)=>{(function(n,t){typeof v1=="object"&&typeof _1!="undefined"?_1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(v1,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},k,$,W,ht;return ht={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function at(Et){return function(G){return wt([Et,G])}}function wt(Et){if(k)throw new TypeError("Generator is already executing.");for(;N;)try{if(k=1,$&&(W=Et[0]&2?$.return:Et[0]?$.throw||((W=$.return)&&W.call($),0):$.next)&&!(W=W.call($,Et[1])).done)return W;switch($=0,W&&(Et=[Et[0]&2,W.value]),Et[0]){case 0:case 1:W=Et;break;case 4:return N.label++,{value:Et[1],done:!1};case 5:N.label++,$=Et[1],Et=[0];continue;case 7:Et=N.ops.pop(),N.trys.pop();continue;default:if(W=N.trys,!(W=W.length>0&&W[W.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!W||Et[1]>W[0]&&Et[1]<W[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<W[1]){N.label=W[1],W=Et;break}if(W&&N.label<W[2]){N.label=W[2],N.ops.push(Et);break}W[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=W=0}if(Et[0]&5)throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}}var t=function(){function rt(P,N){this.next=null,this.key=P,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,P){return rt>P?1:rt<P?-1:0}function o(rt,P,N){for(var k=new t(null,null),$=k,W=k;;){var ht=N(rt,P.key);if(ht<0){if(P.left===null)break;if(N(rt,P.left.key)<0){var at=P.left;if(P.left=at.right,at.right=P,P=at,P.left===null)break}W.left=P,W=P,P=P.left}else if(ht>0){if(P.right===null)break;if(N(rt,P.right.key)>0){var at=P.right;if(P.right=at.left,at.left=P,P=at,P.right===null)break}$.right=P,$=P,P=P.right}else break}return $.right=P.left,W.left=P.right,P.left=k.right,P.right=k.left,P}function s(rt,P,N,k){var $=new t(rt,P);if(N===null)return $.left=$.right=null,$;N=o(rt,N,k);var W=k(rt,N.key);return W<0?($.left=N.left,$.right=N,N.left=null):W>=0&&($.right=N.right,$.left=N,N.right=null),$}function l(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var W=N(P.key,rt);W===0?(k=P.left,$=P.right):W<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function p(rt,P,N){return P===null?rt:(rt===null||(P=o(rt.key,P,N),P.left=rt),P)}function h(rt,P,N,k,$){if(rt){k(""+P+(N?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+$(rt)+`
|
|
4
4
|
`);var W=P+(N?" ":"\u2502 ");rt.left&&h(rt.left,W,!1,k,$),rt.right&&h(rt.right,W,!0,k,$)}}var g=function(){function rt(P){P===void 0&&(P=e),this._root=null,this._size=0,this._comparator=P}return rt.prototype.insert=function(P,N){return this._size++,this._root=s(P,N,this._root,this._comparator)},rt.prototype.add=function(P,N){var k=new t(P,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,W=o(P,this._root,$),ht=$(P,W.key);return ht===0?this._root=W:(ht<0?(k.left=W.left,k.right=W,W.left=null):ht>0&&(k.right=W.right,k.left=W,W.right=null),this._size++,this._root=k),this._root},rt.prototype.remove=function(P){this._root=this._remove(P,this._root,this._comparator)},rt.prototype._remove=function(P,N,k){var $;if(N===null)return null;N=o(P,N,k);var W=k(P,N.key);return W===0?(N.left===null?$=N.right:($=o(P,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var P=this._root;if(P){for(;P.left;)P=P.left;return this._root=o(P.key,this._root,this._comparator),this._root=this._remove(P.key,this._root,this._comparator),{key:P.key,data:P.data}}return null},rt.prototype.findStatic=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(P){return this._root&&(this._root=o(P,this._root,this._comparator),this._comparator(P,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(P,N){for(var k=this._root,$=[],W=!1;!W;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):W=!0;return this},rt.prototype.range=function(P,N,k,$){for(var W=[],ht=this._comparator,at=this._root,wt;W.length!==0||at;)if(at)W.push(at),at=at.left;else{if(at=W.pop(),wt=ht(at.key,N),wt>0)break;if(ht(at.key,P)>=0&&k.call($,at))return this;at=at.right}return this},rt.prototype.keys=function(){var P=[];return this.forEach(function(N){var k=N.key;return P.push(k)}),P},rt.prototype.values=function(){var P=[];return this.forEach(function(N){var k=N.data;return P.push(k)}),P},rt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},rt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},rt.prototype.minNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.left;)P=P.left;return P},rt.prototype.maxNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.right;)P=P.right;return P},rt.prototype.at=function(P){for(var N=this._root,k=!1,$=0,W=[];!k;)if(N)W.push(N),N=N.left;else if(W.length>0){if(N=W.pop(),$===P)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(P){var N=this._root,k=null;if(P.right){for(k=P.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(P){var N=this._root,k=null;if(P.left!==null){for(k=P.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?N=N.left:(k=N,N=N.right)}return k},rt.prototype.clear=function(){return this._root=null,this._size=0,this},rt.prototype.toList=function(){return w(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,W=this._comparator;if(k&&C(P,N,0,$-1,W),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=b(this.toList(),_(P,N),W);$=this._size+$,this._root=S({head:ht},0,$)}return this},rt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(rt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),rt.prototype.toString=function(P){P===void 0&&(P=function(k){return String(k.key)});var N=[];return h(this._root,"",!0,function(k){return N.push(k)},P),N.join("")},rt.prototype.update=function(P,N,k){var $=this._comparator,W=l(P,this._root,$),ht=W.left,at=W.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=p(ht,at,$)},rt.prototype.split=function(P){return l(P,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var P,N,k;return n(this,function($){switch($.label){case 0:P=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:P===null?[3,2]:(N.push(P),P=P.left,[3,5]);case 2:return N.length===0?[3,4]:(P=N.pop(),[4,P]);case 3:return $.sent(),P=P.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,P,N,k){var $=k-N;if($>0){var W=N+Math.floor($/2),ht=rt[W],at=P[W],wt=new t(ht,at);return wt.left=m(rt,P,N,W),wt.right=m(rt,P,W+1,k),wt}return null}function _(rt,P){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],P[$]);return k.next=null,N.next}function w(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),W=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=W=W.next=N.pop(),P=P.right):k=!0;return W.next=null,$.next}function S(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),W=S(rt,P,$),ht=rt.head;return ht.left=W,rt.head=rt.head.next,ht.right=S(rt,$+1,N),ht}return null}function b(rt,P,N){for(var k=new t(null,null),$=k,W=rt,ht=P;W!==null&&ht!==null;)N(W.key,ht.key)<0?($.next=W,W=W.next):($.next=ht,ht=ht.next),$=$.next;return W!==null?$.next=W:ht!==null&&($.next=ht),k.next}function C(rt,P,N,k,$){if(!(N>=k)){for(var W=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],W)<0);do at--;while($(rt[at],W)>0);if(ht>=at)break;var wt=rt[ht];rt[ht]=rt[at],rt[at]=wt,wt=P[ht],P[ht]=P[at],P[at]=wt}C(rt,P,N,at,$),C(rt,P,at+1,k,$)}}let R=(rt,P)=>rt.ll.x<=P.x&&P.x<=rt.ur.x&&rt.ll.y<=P.y&&P.y<=rt.ur.y,x=(rt,P)=>{if(P.ur.x<rt.ll.x||rt.ur.x<P.ll.x||P.ur.y<rt.ll.y||rt.ur.y<P.ll.y)return null;let N=rt.ll.x<P.ll.x?P.ll.x:rt.ll.x,k=rt.ur.x<P.ur.x?rt.ur.x:P.ur.x,$=rt.ll.y<P.ll.y?P.ll.y:rt.ll.y,W=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:W}}},E=Number.EPSILON;E===void 0&&(E=Math.pow(2,-52));let I=E*E,A=(rt,P)=>{if(-E<rt&&rt<E&&-E<P&&P<E)return 0;let N=rt-P;return N*N<I*rt*P?0:rt<P?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class V{constructor(){this.tree=new g,this.round(0)}round(P){let N=this.tree.add(P),k=this.tree.prev(N);if(k!==null&&A(N.key,k.key)===0)return this.tree.remove(P),k.key;let $=this.tree.next(N);return $!==null&&A(N.key,$.key)===0?(this.tree.remove(P),$.key):P}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,P,N,k,$){let W,ht,at,wt,Et=P[0],G=k[0],st=0,et=0;G>Et==G>-Et?(W=Et,Et=P[++st]):(W=G,G=k[++et]);let lt=0;if(st<rt&&et<N)for(G>Et==G>-Et?(ht=Et+W,at=W-(ht-Et),Et=P[++st]):(ht=G+W,at=W-(ht-G),G=k[++et]),W=ht,at!==0&&($[lt++]=at);st<rt&&et<N;)G>Et==G>-Et?(ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st]):(ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et]),W=ht,at!==0&&($[lt++]=at);for(;st<rt;)ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st],W=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et],W=ht,at!==0&&($[lt++]=at);return(W!==0||lt===0)&&($[lt++]=W),lt}function j(rt,P){let N=P[0];for(let k=1;k<rt;k++)N+=P[k];return N}function K(rt){return new Float64Array(rt)}let Dt=(3+16*q)*q,Q=(2+12*q)*q,At=(9+64*q)*q*q,Mt=K(4),Lt=K(8),pt=K(12),yt=K(16),J=K(4);function Bt(rt,P,N,k,$,W,ht){let at,wt,Et,G,st,et,lt,Ft,Jt,me,ve,He,Ue,Ye,Qe,wr,Kr,nr,Ie=rt-$,rr=N-$,pr=P-W,ur=k-W;Ye=Ie*ur,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ur,Jt=et-(et-ur),me=ur-Jt,Qe=Ft*me-(Ye-lt*Jt-Ft*Jt-lt*me),wr=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Jt=et-(et-rr),me=rr-Jt,Kr=Ft*me-(wr-lt*Jt-Ft*Jt-lt*me),ve=Qe-Kr,st=Qe-ve,Mt[0]=Qe-(ve+st)+(st-Kr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,Mt[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,Mt[2]=He-(nr-st)+(ve-st),Mt[3]=nr;let Qn=j(4,Mt),bi=Q*ht;if(Qn>=bi||-Qn>=bi||(st=rt-Ie,at=rt-(Ie+st)+(st-$),st=N-rr,Et=N-(rr+st)+(st-$),st=P-pr,wt=P-(pr+st)+(st-W),st=k-ur,G=k-(ur+st)+(st-W),at===0&&wt===0&&Et===0&&G===0)||(bi=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ur*at-(pr*Et+rr*wt),Qn>=bi||-Qn>=bi))return Qn;Ye=at*ur,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ur,Jt=et-(et-ur),me=ur-Jt,Qe=Ft*me-(Ye-lt*Jt-Ft*Jt-lt*me),wr=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Jt=et-(et-rr),me=rr-Jt,Kr=Ft*me-(wr-lt*Jt-Ft*Jt-lt*me),ve=Qe-Kr,st=Qe-ve,J[0]=Qe-(ve+st)+(st-Kr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,J[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,J[2]=He-(nr-st)+(ve-st),J[3]=nr;let oi=B(4,Mt,4,J,Lt);Ye=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Jt=et-(et-G),me=G-Jt,Qe=Ft*me-(Ye-lt*Jt-Ft*Jt-lt*me),wr=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Jt=et-(et-Et),me=Et-Jt,Kr=Ft*me-(wr-lt*Jt-Ft*Jt-lt*me),ve=Qe-Kr,st=Qe-ve,J[0]=Qe-(ve+st)+(st-Kr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,J[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,J[2]=He-(nr-st)+(ve-st),J[3]=nr;let Z=B(oi,Lt,4,J,pt);Ye=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Jt=et-(et-G),me=G-Jt,Qe=Ft*me-(Ye-lt*Jt-Ft*Jt-lt*me),wr=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Jt=et-(et-Et),me=Et-Jt,Kr=Ft*me-(wr-lt*Jt-Ft*Jt-lt*me),ve=Qe-Kr,st=Qe-ve,J[0]=Qe-(ve+st)+(st-Kr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,J[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,J[2]=He-(nr-st)+(ve-st),J[3]=nr;let mt=B(Z,pt,4,J,yt);return yt[mt-1]}function Gt(rt,P,N,k,$,W){let ht=(P-W)*(N-$),at=(rt-$)*(k-W),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,W,Et)}let ae=(rt,P)=>rt.x*P.y-rt.y*P.x,ut=(rt,P)=>rt.x*P.x+rt.y*P.y,Ut=(rt,P,N)=>{let k=Gt(rt.x,rt.y,P.x,P.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,P,N)=>P.y===0?null:{x:rt.x+P.x/P.y*(N-rt.y),y:N},qt=(rt,P,N)=>P.x===0?null:{x:N,y:rt.y+P.y/P.x*(N-rt.x)},xe=(rt,P,N,k)=>{if(P.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,P,N.x);if(P.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,P,N.y);let $=ae(P,k);if($==0)return null;let W={x:N.x-rt.x,y:N.y-rt.y},ht=ae(W,P)/$,at=ae(W,k)/$,wt=rt.x+at*P.x,Et=N.x+ht*k.x,G=rt.y+at*P.y,st=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+st)/2;return{x:et,y:lt}};class ft{static compare(P,N){let k=ft.comparePoints(P.point,N.point);return k!==0?k:(P.point!==N.point&&P.link(N),P.isLeft!==N.isLeft?P.isLeft?1:-1:ee.compare(P.segment,N.segment))}static comparePoints(P,N){return P.x<N.x?-1:P.x>N.x?1:P.y<N.y?-1:P.y>N.y?1:0}constructor(P,N){P.events===void 0?P.events=[this]:P.events.push(this),this.point=P,this.isLeft=N}link(P){if(P.point===this.point)throw new Error("Tried to link already linked events");let N=P.point.events;for(let k=0,$=N.length;k<$;k++){let W=N[k];this.point.events.push(W),W.point=this.point}this.checkForConsuming()}checkForConsuming(){let P=this.point.events.length;for(let N=0;N<P;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<P;$++){let W=this.point.events[$];W.consumedBy===void 0&&k.otherSE.point.events===W.otherSE.point.events&&k.segment.consume(W.segment)}}}getAvailableLinkedEvents(){let P=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&P.push($)}return P}getLeftmostComparator(P){let N=new Map,k=$=>{let W=$.otherSE;N.set($,{sine:ce(this.point,P.point,W.point),cosine:te(this.point,P.point,W.point)})};return($,W)=>{N.has($)||k($),N.has(W)||k(W);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(W);return ht>=0&&wt>=0?at<Et?1:at>Et?-1:0:ht<0&&wt<0?at<Et?-1:at>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let Xe=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,W=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(W<$)return-1;let at=P.leftSE.point.y,wt=N.leftSE.point.y,Et=P.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<at&&wt<Et)return 1;if(wt>at&&wt>Et)return-1;let st=P.comparePoint(N.leftSE.point);if(st<0)return 1;if(st>0)return-1;let et=N.comparePoint(P.rightSE.point);return et!==0?et:-1}if(k>$){if(at<wt&&at<G)return-1;if(at>wt&&at>G)return 1;let st=N.comparePoint(P.leftSE.point);if(st!==0)return st;let et=P.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(at<wt)return-1;if(at>wt)return 1;if(W<ht){let st=N.comparePoint(P.rightSE.point);if(st!==0)return st}if(W>ht){let st=P.comparePoint(N.rightSE.point);if(st<0)return 1;if(st>0)return-1}if(W!==ht){let st=Et-at,et=W-k,lt=G-wt,Ft=ht-$;if(st>et&<<Ft)return 1;if(st<et&<>Ft)return-1}return W>ht?1:W<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++Xe,this.leftSE=P,P.segment=this,P.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=P,this.rings=k,this.windings=$}static fromRing(P,N,k){let $,W,ht,at=ft.comparePoints(P,N);if(at<0)$=P,W=N,ht=1;else if(at>0)$=N,W=P,ht=-1;else throw new Error(`Tried to create degenerate segment at [${P.x}, ${P.y}]`);let wt=new ft($,!0),Et=new ft(W,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let P=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<N?P:N},ur:{x:this.rightSE.point.x,y:P>N?P:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}comparePoint(P){if(this.isAnEndpoint(P))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return P.x===N.x?0:P.x<N.x?1:-1;let W=(P.y-N.y)/$.y,ht=N.x+W*$.x;if(P.x===ht)return 0;let at=(P.x-N.x)/$.x,wt=N.y+at*$.y;return P.y===wt?0:P.y<wt?-1:1}getIntersection(P){let N=this.bbox(),k=P.bbox(),$=x(N,k);if($===null)return null;let W=this.leftSE.point,ht=this.rightSE.point,at=P.leftSE.point,wt=P.rightSE.point,Et=R(N,at)&&this.comparePoint(at)===0,G=R(k,W)&&P.comparePoint(W)===0,st=R(N,wt)&&this.comparePoint(wt)===0,et=R(k,ht)&&P.comparePoint(ht)===0;if(G&&Et)return et&&!st?ht:!et&&st?wt:null;if(G)return st&&W.x===wt.x&&W.y===wt.y?null:W;if(Et)return et&&ht.x===at.x&&ht.y===at.y?null:at;if(et&&st)return null;if(et)return ht;if(st)return wt;let lt=xe(W,this.vector(),at,P.vector());return lt===null||!R($,lt)?null:X.round(lt.x,lt.y)}split(P){let N=[],k=P.events!==void 0,$=new ft(P,!0),W=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(W),N.push(W),N.push($);let at=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(at.leftSE.point,at.rightSE.point)>0&&at.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),W.checkForConsuming()),N}swapEvents(){let P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(P){let N=this,k=P;for(;N.consumedBy;)N=N.consumedBy;for(;k.consumedBy;)k=k.consumedBy;let $=ee.compare(N,k);if($!==0){if($>0){let W=N;N=k,k=W}if(N.prev===k){let W=N;N=k,k=W}for(let W=0,ht=k.rings.length;W<ht;W++){let at=k.rings[W],wt=k.windings[W],Et=N.rings.indexOf(at);Et===-1?(N.rings.push(at),N.windings.push(wt)):N.windings[Et]+=wt}k.rings=null,k.windings=null,k.consumedBy=N,k.leftSE.consumedBy=N.leftSE,k.rightSE.consumedBy=N.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 P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let at=0,wt=this.rings.length;at<wt;at++){let Et=this.rings[at],G=this.windings[at],st=N.indexOf(Et);st===-1?(N.push(Et),k.push(G)):k[st]+=G}let W=[],ht=[];for(let at=0,wt=N.length;at<wt;at++){if(k[at]===0)continue;let Et=N[at],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)W.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let st=W.indexOf(Et.poly);st!==-1&&W.splice(st,1)}}for(let at=0,wt=W.length;at<wt;at++){let Et=W[at].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let P=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=P.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;P.length<N.length?(k=P.length,$=N.length):(k=N.length,$=P.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(P.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(P)!==k(N);break}default:throw new Error(`Unrecognized operation type found ${dt.type}`)}return this._isInResult}}class ge{constructor(P,N,k){if(!Array.isArray(P)||P.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof P[0][0]!="number"||typeof P[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(P[0][0],P[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let W=$;for(let ht=1,at=P.length;ht<at;ht++){if(typeof P[ht][0]!="number"||typeof P[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(P[ht][0],P[ht][1]);wt.x===W.x&&wt.y===W.y||(this.segments.push(ee.fromRing(W,wt,this)),wt.x<this.bbox.ll.x&&(this.bbox.ll.x=wt.x),wt.y<this.bbox.ll.y&&(this.bbox.ll.y=wt.y),wt.x>this.bbox.ur.x&&(this.bbox.ur.x=wt.x),wt.y>this.bbox.ur.y&&(this.bbox.ur.y=wt.y),W=wt)}($.x!==W.x||$.y!==W.y)&&this.segments.push(ee.fromRing(W,$,this))}getSweepEvents(){let P=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];P.push($.leftSE),P.push($.rightSE)}return P}}class fe{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(P[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 k=1,$=P.length;k<$;k++){let W=new ge(P[k],this,!1);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.interiorRings.push(W)}this.multiPoly=N}getSweepEvents(){let P=this.exteriorRing.getSweepEvents();for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class Te{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof P[0][0][0]=="number"&&(P=[P])}catch(k){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let k=0,$=P.length;k<$;k++){let W=new fe(P[k],this);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.polys.push(W)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.isInResult()||W.ringOut)continue;let ht=null,at=W.leftSE,wt=W.rightSE,Et=[at],G=at.point,st=[];for(;ht=at,at=wt,Et.push(at),at.point!==G;)for(;;){let et=at.getAvailableLinkedEvents();if(et.length===0){let Jt=Et[0].point,me=Et[Et.length-1].point;throw new Error(`Unable to complete output ring starting at [${Jt.x}, ${Jt.y}]. Last matching segment found ends at [${me.x}, ${me.y}].`)}if(et.length===1){wt=et[0].otherSE;break}let lt=null;for(let Jt=0,me=st.length;Jt<me;Jt++)if(st[Jt].point===at.point){lt=Jt;break}if(lt!==null){let Jt=st.splice(lt)[0],me=Et.splice(Jt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}st.push({index:Et.length,point:at.point});let Ft=at.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(P){this.events=P;for(let N=0,k=P.length;N<k;N++)P[N].segment.ringOut=this;this.poly=null}getGeom(){let P=this.events[0].point,N=[P];for(let Et=1,G=this.events.length-1;Et<G;Et++){let st=this.events[Et].point,et=this.events[Et+1].point;Ut(st,P,et)!==0&&(N.push(st),P=st)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,P,$)===0&&N.shift(),N.push(N[0]);let W=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,at=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=at;Et+=W)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let P=this.events[0];for(let $=1,W=this.events.length;$<W;$++){let ht=this.events[$];ft.compare(P,ht)>0&&(P=ht)}let N=P.segment.prevInResult(),k=N?N.prevInResult():null;for(;;){if(!N)return null;if(!k)return N.ringOut;if(k.ringOut!==N.ringOut)return k.ringOut.enclosingRing()!==N.ringOut?N.ringOut:N.ringOut.enclosingRing();N=k.prevInResult(),k=N?N.prevInResult():null}}}class Wt{constructor(P){this.exteriorRing=P,P.poly=this,this.interiorRings=[]}addInterior(P){this.interiorRings.push(P),P.poly=this}getGeom(){let P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&P.push($)}return P}}class Me{constructor(P){this.rings=P,this.polys=this._composePolys(P)}getGeom(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&P.push($)}return P}_composePolys(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.poly)if(W.isExteriorRing())N.push(new Wt(W));else{let ht=W.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(W)}}return N}}class tt{constructor(P){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=P,this.tree=new g(N),this.segments=[]}process(P){let N=P.segment,k=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(N),k;let $=P.isLeft?this.tree.add(N):this.tree.find(N);if(!$)throw new Error(`Unable to find segment #${N.id} [${N.leftSE.point.x}, ${N.leftSE.point.y}] -> [${N.rightSE.point.x}, ${N.rightSE.point.y}] in SweepLine tree.`);let W=$,ht=$,at,wt;for(;at===void 0;)W=this.tree.prev(W),W===null?at=null:W.key.consumedBy===void 0&&(at=W.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(P.isLeft){let Et=null;if(at){let st=at.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(Et=st),!at.isAnEndpoint(st))){let et=this._splitSafely(at,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let st=wt.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(G=st),!wt.isAnEndpoint(st))){let et=this._splitSafely(wt,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let st=null;Et===null?st=G:G===null?st=Et:st=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(P)):(this.segments.push(N),N.prev=at)}else{if(at&&wt){let Et=at.getIntersection(wt);if(Et!==null){if(!at.isAnEndpoint(Et)){let G=this._splitSafely(at,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}}}this.tree.remove(N)}return k}_splitSafely(P,N){this.tree.remove(P);let k=P.rightSE;this.queue.remove(k);let $=P.split(N);return $.push(k),P.consumedBy===void 0&&this.tree.add(P),$}}let z=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,It=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ot{run(P,N,k){dt.type=P,X.reset();let $=[new Te(N,!0)];for(let st=0,et=k.length;st<et;st++)$.push(new Te(k[st],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let st=$[0],et=1;for(;et<$.length;)x($[et].bbox,st.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let st=0,et=$.length;st<et;st++){let lt=$[st];for(let Ft=st+1,Jt=$.length;Ft<Jt;Ft++)if(x(lt.bbox,$[Ft].bbox)===null)return[]}let W=new g(ft.compare);for(let st=0,et=$.length;st<et;st++){let lt=$[st].getSweepEvents();for(let Ft=0,Jt=lt.length;Ft<Jt;Ft++)if(W.insert(lt[Ft]),W.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(W),at=W.size,wt=W.pop();for(;wt;){let st=wt.key;if(W.size===at){let lt=st.segment;throw new Error(`Unable to pop() ${st.isLeft?"left":"right"} SweepEvent [${st.point.x}, ${st.point.y}] from segment #${lt.id} [${lt.leftSE.point.x}, ${lt.leftSE.point.y}] -> [${lt.rightSE.point.x}, ${lt.rightSE.point.y}] from queue.`)}if(W.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>It)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let et=ht.process(st);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Jt=et[lt];Jt.consumedBy===void 0&&W.insert(Jt)}at=W.size,wt=W.pop()}X.reset();let Et=be.factory(ht.segments);return new Me(Et).getGeom()}}let dt=new Ot;var ne={union:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var tN=ot((kg,QL)=>{(function(n,t){typeof kg=="object"&&typeof QL!="undefined"?t(kg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(kg,function(n){"use strict";function t(){}function e(r){this.message=r||""}function o(r){this.message=r||""}function s(r){this.message=r||""}function l(){}function p(r){return r===null?Qe:r.color}function h(r){return r===null?null:r.parent}function g(r,i){r!==null&&(r.color=i)}function m(r){return r===null?null:r.left}function _(r){return r===null?null:r.right}function w(){this.root_=null,this.size_=0}function S(){}function b(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function C(){}function R(r){this.message=r||""}function x(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),a=Math.max(Math.min(i.length,9007199254740991),0)||0,c=1 in arguments&&parseInt(Number(arguments[1]),10)||0;c=c<0?Math.max(a+c,0):Math.min(c,a);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);c<d;)i[c]=r,++c;return i},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var E=function(){};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.prototype.equalsWithTolerance=function(r,i,a){return Math.abs(r-i)<=a};var I=function(r){function i(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),A=function(){},F={MAX_VALUE:{configurable:!0}};A.isNaN=function(r){return Number.isNaN(r)},A.doubleToLongBits=function(r){return r},A.longBitsToDouble=function(r){return r},A.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,F);var V=function(){},X=function(){},q=function(){},D=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.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=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},xt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(r,i){switch(r){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new I("Invalid ordinate index: "+r)}},D.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var i=arguments[0],a=arguments[1];return!!E.equalsWithTolerance(this.x,i.x,a)&&!!E.equalsWithTolerance(this.y,i.y,a)}},D.prototype.getOrdinate=function(r){switch(r){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new I("Invalid ordinate index: "+r)},D.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||A.isNaN(this.z))&&A.isNaN(r.z)},D.prototype.equals=function(r){return r instanceof D&&this.equals2D(r)},D.prototype.equalInZ=function(r,i){return E.equalsWithTolerance(this.z,r.z,i)},D.prototype.compareTo=function(r){var i=r;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(r){var i=this.x-r.x,a=this.y-r.y,c=this.z-r.z;return Math.sqrt(i*i+a*a+c*c)},D.prototype.distance=function(r){var i=this.x-r.x,a=this.y-r.y;return Math.sqrt(i*i+a*a)},D.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this.x),r=37*r+D.hashCode(this.y)},D.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},D.prototype.interfaces_=function(){return[V,X,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var r=arguments[0],i=A.doubleToLongBits(r);return Math.trunc((i^i)>>>32)}},xt.DimensionalComparator.get=function(){return B},xt.serialVersionUID.get=function(){return 6683108902428367e3},xt.NULL_ORDINATE.get=function(){return A.NaN},xt.X.get=function(){return 0},xt.Y.get=function(){return 1},xt.Z.get=function(){return 2},Object.defineProperties(D,xt);var B=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new I("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};B.prototype.compare=function(r,i){var a=r,c=i,d=B.compare(a.x,c.x);if(d!==0)return d;var v=B.compare(a.y,c.y);return v!==0?v:this._dimensionsToTest<=2?0:B.compare(a.z,c.z)},B.prototype.interfaces_=function(){return[q]},B.prototype.getClass=function(){return B},B.compare=function(r,i){return r<i?-1:r>i?1:A.isNaN(r)?A.isNaN(i)?0:-1:A.isNaN(i)?1:0};var j=function(){};j.prototype.create=function(){},j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j};var K=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.toLocationSymbol=function(r){switch(r){case K.EXTERIOR:return"e";case K.BOUNDARY:return"b";case K.INTERIOR:return"i";case K.NONE:return"-"}throw new I("Unknown location value: "+r)},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(K,Dt);var Q=function(r,i){return r.interfaces_&&r.interfaces_().indexOf(i)>-1},At=function(){},Mt={LOG_10:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.log10=function(r){var i=Math.log(r);return A.isInfinite(i)||A.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,c){var d=r;return i<d&&(d=i),a<d&&(d=a),c<d&&(d=c),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],d=arguments[1],v=arguments[2];return c<d?d:c>v?v:c}},At.wrap=function(r,i){return r<0?i- -r%i:r%i},At.max=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2],c=r;return i>c&&(c=i),a>c&&(c=a),c}if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=d;return v>H&&(H=v),M>H&&(H=M),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var Lt=function(r){this.str=r};Lt.prototype.append=function(r){this.str+=r},Lt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Lt.prototype.toString=function(r){return this.str};var pt=function(r){this.value=r};pt.prototype.intValue=function(){return this.value},pt.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},pt.isNaN=function(r){return Number.isNaN(r)};var yt=function(){};yt.isWhitespace=function(r){return r<=32&&r>=0||r===127},yt.toUpperCase=function(r){return r.toUpperCase()};var J=function r(){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 r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var c=arguments[0];r.call(this,r.parse(c))}}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.init(d,v)}},Bt={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}};J.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},J.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),c=J.magnitude(a._hi),d=J.TEN.pow(c);(a=a.divide(d)).gt(J.TEN)?(a=a.divide(J.TEN),c+=1):a.lt(J.ONE)&&(a=a.multiply(J.TEN),c-=1);for(var v=c+1,M=new Lt,L=J.MAX_PRINT_DIGITS-1,H=0;H<=L;H++){r&&H===v&&M.append(".");var it=Math.trunc(a._hi);if(it<0)break;var bt=!1,Tt=0;it>9?(bt=!0,Tt="9"):Tt="0"+it,M.append(Tt),a=a.subtract(J.valueOf(it)).multiply(J.TEN),bt&&a.selfAdd(J.TEN);var Kt=!0,Qt=J.magnitude(a._hi);if(Qt<0&&Math.abs(Qt)>=L-H&&(Kt=!1),!Kt)break}return i[0]=c,M.toString()},J.prototype.sqr=function(){return this.multiply(this)},J.prototype.doubleValue=function(){return this._hi+this._lo},J.prototype.subtract=function(){if(arguments[0]instanceof J){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},J.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},J.prototype.isZero=function(){return this._hi===0&&this._lo===0},J.prototype.selfSubtract=function(){if(arguments[0]instanceof J){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},J.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},J.prototype.min=function(r){return this.le(r)?this:r},J.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof J){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=J.SPLIT*H,d=it-H,Tt=J.SPLIT*a,d=it-d,v=H-d,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=d*M-bt+d*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*c)/a,Tt=H+it,this._hi=Tt,this._lo=H-Tt+it,this}},J.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},J.prototype.divide=function(){if(arguments[0]instanceof J){var r=arguments[0],i=null,a=null,c=null,d=null,v=null,M=null,L=null,H=null;return a=(v=this._hi/r._hi)-(i=(M=J.SPLIT*v)-(i=M-v)),H=i*(c=(H=J.SPLIT*r._hi)-(c=H-r._hi))-(L=v*r._hi)+i*(d=r._hi-c)+a*c+a*d,M=(this._hi-L-H+this._lo-v*r._lo)/r._hi,new J(H=v+M,v-H+M)}if(typeof arguments[0]=="number"){var it=arguments[0];return A.isNaN(it)?J.createNaN():J.copy(this).selfDivide(it,0)}},J.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},J.prototype.pow=function(r){if(r===0)return J.valueOf(1);var i=new J(this),a=J.valueOf(1),c=Math.abs(r);if(c>1)for(;c>0;)c%2==1&&a.selfMultiply(i),(c/=2)>0&&(i=i.sqr());else a=i;return r<0?a.reciprocal():a},J.prototype.ceil=function(){if(this.isNaN())return J.NaN;var r=Math.ceil(this._hi),i=0;return r===this._hi&&(i=Math.ceil(this._lo)),new J(r,i)},J.prototype.compareTo=function(r){var i=r;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},J.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},J.prototype.setValue=function(){if(arguments[0]instanceof J){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},J.prototype.max=function(r){return this.ge(r)?this:r},J.prototype.sqrt=function(){if(this.isZero())return J.valueOf(0);if(this.isNegative())return J.NaN;var r=1/Math.sqrt(this._hi),i=this._hi*r,a=J.valueOf(i),c=this.subtract(a.sqr())._hi*(.5*r);return a.add(c)},J.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof J){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],a=null,c=null,d=null,v=null,M=null,L=null;return d=this._hi+i,M=d-this._hi,v=d-M,v=i-M+(this._hi-v),L=v+this._lo,a=d+L,c=L+(d-a),this._hi=a+c,this._lo=c+(a-this._hi),this}}else if(arguments.length===2){var H=arguments[0],it=arguments[1],bt=null,Tt=null,Kt=null,Qt=null,le=null,Ee=null,Dn=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Kt=Tt-(Dn=Tt-this._lo);var Jn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Kt=it-Dn+(this._lo-Kt))+(Ee+(Qt-bt))),fi=Ee+(bt-Jn);return this._hi=Jn,this._lo=fi,this}},J.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof J){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null;d=(H=J.SPLIT*this._hi)-this._hi,it=J.SPLIT*a,d=H-d,v=this._hi-d,M=it-a;var bt=(H=this._hi*a)+(it=d*(M=it-M)-H+d*(L=a-M)+v*M+v*L+(this._hi*c+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},J.prototype.selfSqr=function(){return this.selfMultiply(this)},J.prototype.floor=function(){if(this.isNaN())return J.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new J(r,i)},J.prototype.negate=function(){return this.isNaN()?this:new J(-this._hi,-this._lo)},J.prototype.clone=function(){},J.prototype.multiply=function(){if(arguments[0]instanceof J){var r=arguments[0];return r.isNaN()?J.createNaN():J.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return A.isNaN(i)?J.createNaN():J.copy(this).selfMultiply(i,0)}},J.prototype.isNaN=function(){return A.isNaN(this._hi)},J.prototype.intValue=function(){return Math.trunc(this._hi)},J.prototype.toString=function(){var r=J.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},J.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!0,i),c=i[0]+1,d=a;if(a.charAt(0)===".")d="0"+a;else if(c<0)d="0."+J.stringOfChar("0",-c)+a;else if(a.indexOf(".")===-1){var v=c-a.length;d=a+J.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+d:d},J.prototype.reciprocal=function(){var r=null,i=null,a=null,c=null,d=null,v=null,M=null,L=null;i=(d=1/this._hi)-(r=(v=J.SPLIT*d)-(r=v-d)),a=(L=J.SPLIT*this._hi)-this._hi;var H=d+(v=(1-(M=d*this._hi)-(L=r*(a=L-a)-M+r*(c=this._hi-a)+i*a+i*c)-d*this._lo)/this._hi);return new J(H,d-H+v)},J.prototype.toSciNotation=function(){if(this.isZero())return J.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),c=J.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var v=a.charAt(0)+"."+d;return this.isNegative()?"-"+v+c:v+c},J.prototype.abs=function(){return this.isNaN()?J.NaN:this.isNegative()?this.negate():new J(this)},J.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},J.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},J.prototype.add=function(){if(arguments[0]instanceof J){var r=arguments[0];return J.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return J.copy(this).selfAdd(i)}},J.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof J){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._hi=a,this._lo=c}},J.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},J.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},J.prototype.trunc=function(){return this.isNaN()?J.NaN:this.isPositive()?this.floor():this.ceil()},J.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},J.prototype.interfaces_=function(){return[t,V,X]},J.prototype.getClass=function(){return J},J.sqr=function(r){return J.valueOf(r).selfMultiply(r)},J.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return J.parse(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return new J(i)}},J.sqrt=function(r){return J.valueOf(r).sqrt()},J.parse=function(r){for(var i=0,a=r.length;yt.isWhitespace(r.charAt(i));)i++;var c=!1;if(i<a){var d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(c=!0))}for(var v=new J,M=0,L=0,H=0;!(i>=a);){var it=r.charAt(i);if(i++,yt.isDigit(it)){var bt=it-"0";v.selfMultiply(J.TEN),v.selfAdd(bt),M++}else{if(it!=="."){if(it==="e"||it==="E"){var Tt=r.substring(i);try{H=pt.parseInt(Tt)}catch(Dn){throw Dn instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):Dn}break}throw new Error("Unexpected character '"+it+"' at position "+i+" in string "+r)}L=M}}var Kt=v,Qt=M-L-H;if(Qt===0)Kt=v;else if(Qt>0){var le=J.TEN.pow(Qt);Kt=v.divide(le)}else if(Qt<0){var Ee=J.TEN.pow(-Qt);Kt=v.multiply(Ee)}return c?Kt.negate():Kt},J.createNaN=function(){return new J(A.NaN,A.NaN)},J.copy=function(r){return new J(r)},J.magnitude=function(r){var i=Math.abs(r),a=Math.log(i)/Math.log(10),c=Math.trunc(Math.floor(a));return 10*Math.pow(10,c)<=i&&(c+=1),c},J.stringOfChar=function(r,i){for(var a=new Lt,c=0;c<i;c++)a.append(r);return a.toString()},Bt.PI.get=function(){return new J(3.141592653589793,12246467991473532e-32)},Bt.TWO_PI.get=function(){return new J(6.283185307179586,24492935982947064e-32)},Bt.PI_2.get=function(){return new J(1.5707963267948966,6123233995736766e-32)},Bt.E.get=function(){return new J(2.718281828459045,14456468917292502e-32)},Bt.NaN.get=function(){return new J(A.NaN,A.NaN)},Bt.EPS.get=function(){return 123259516440783e-46},Bt.SPLIT.get=function(){return 134217729},Bt.MAX_PRINT_DIGITS.get=function(){return 32},Bt.TEN.get=function(){return J.valueOf(10)},Bt.ONE.get=function(){return J.valueOf(1)},Bt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Bt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(J,Bt);var Gt=function(){},ae={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(r,i,a){var c=Gt.orientationIndexFilter(r,i,a);if(c<=1)return c;var d=J.valueOf(i.x).selfAdd(-r.x),v=J.valueOf(i.y).selfAdd(-r.y),M=J.valueOf(a.x).selfAdd(-i.x),L=J.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,c){return r.multiply(c).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,c){var d=J.valueOf(c.y).selfSubtract(a.y).selfMultiply(J.valueOf(i.x).selfSubtract(r.x)),v=J.valueOf(c.x).selfSubtract(a.x).selfMultiply(J.valueOf(i.y).selfSubtract(r.y)),M=d.subtract(v),L=J.valueOf(c.x).selfSubtract(a.x).selfMultiply(J.valueOf(r.y).selfSubtract(a.y)),H=J.valueOf(c.y).selfSubtract(a.y).selfMultiply(J.valueOf(r.x).selfSubtract(a.x)),it=L.subtract(H).selfDivide(M).doubleValue(),bt=J.valueOf(r.x).selfAdd(J.valueOf(i.x).selfSubtract(r.x).selfMultiply(it)).doubleValue(),Tt=J.valueOf(i.x).selfSubtract(r.x).selfMultiply(J.valueOf(r.y).selfSubtract(a.y)),Kt=J.valueOf(i.y).selfSubtract(r.y).selfMultiply(J.valueOf(r.x).selfSubtract(a.x)),Qt=Tt.subtract(Kt).selfDivide(M).doubleValue(),le=J.valueOf(a.y).selfAdd(J.valueOf(c.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var c=null,d=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=d-v;if(d>0){if(v<=0)return Gt.signum(M);c=d+v}else{if(!(d<0)||v>=0)return Gt.signum(M);c=-d-v}var L=Gt.DP_SAFE_EPSILON*c;return M>=L||-M>=L?Gt.signum(M):2},Gt.signum=function(r){return r>0?1:r<0?-1:0},ae.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,ae);var ut=function(){},Ut={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ut.X.get=function(){return 0},Ut.Y.get=function(){return 1},Ut.Z.get=function(){return 2},Ut.M.get=function(){return 3},ut.prototype.setOrdinate=function(r,i,a){},ut.prototype.size=function(){},ut.prototype.getOrdinate=function(r,i){},ut.prototype.getCoordinate=function(){},ut.prototype.getCoordinateCopy=function(r){},ut.prototype.getDimension=function(){},ut.prototype.getX=function(r){},ut.prototype.clone=function(){},ut.prototype.expandEnvelope=function(r){},ut.prototype.copy=function(){},ut.prototype.getY=function(r){},ut.prototype.toCoordinateArray=function(){},ut.prototype.interfaces_=function(){return[X]},ut.prototype.getClass=function(){return ut},Object.defineProperties(ut,Ut);var jt=function(){},ce=function(r){function i(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(jt),te=function(){};te.arraycopy=function(r,i,a,c,d){for(var v=0,M=i;M<i+d;M++)a[c+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":`
|
|
5
|
-
`}[r]};var $t=function r(){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 a=arguments[0],c=arguments[1];this.x=a,this.y=c,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var d=arguments[0],v=arguments[1];this.x=d.y*v.w-v.y*d.w,this.y=v.x*d.w-d.x*v.w,this.w=d.x*v.y-v.x*d.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var M=arguments[0],L=arguments[1];this.x=M.y-L.y,this.y=L.x-M.x,this.w=M.x*L.y-L.x*M.y}}else if(arguments.length===3){var H=arguments[0],it=arguments[1],bt=arguments[2];this.x=H,this.y=it,this.w=bt}else if(arguments.length===4){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2],le=arguments[3],Ee=Tt.y-Kt.y,Dn=Kt.x-Tt.x,Jn=Tt.x*Kt.y-Kt.x*Tt.y,fi=Qt.y-le.y,as=le.x-Qt.x,qs=Qt.x*le.y-le.x*Qt.y;this.x=Dn*qs-as*Jn,this.y=fi*Jn-Ee*qs,this.w=Ee*as-fi*Dn}};$t.prototype.getY=function(){var r=this.y/this.w;if(A.isNaN(r)||A.isInfinite(r))throw new ce;return r},$t.prototype.getX=function(){var r=this.x/this.w;if(A.isNaN(r)||A.isInfinite(r))throw new ce;return r},$t.prototype.getCoordinate=function(){var r=new D;return r.x=this.getX(),r.y=this.getY(),r},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.intersection=function(r,i,a,c){var d=r.y-i.y,v=i.x-r.x,M=r.x*i.y-i.x*r.y,L=a.y-c.y,H=c.x-a.x,it=a.x*c.y-c.x*a.y,bt=d*H-L*v,Tt=(v*it-H*M)/bt,Kt=(L*M-d*it)/bt;if(A.isNaN(Tt)||A.isInfinite(Tt)||A.isNaN(Kt)||A.isInfinite(Kt))throw new ce;return new D(Tt,Kt)};var qt=function r(){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 r){var a=arguments[0];this.init(a)}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.init(c.x,d.x,c.y,d.y)}else if(arguments.length===4){var v=arguments[0],M=arguments[1],L=arguments[2],H=arguments[3];this.init(v,M,L,H)}},xe={serialVersionUID:{configurable:!0}};qt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},qt.prototype.equals=function(r){if(!(r instanceof qt))return!1;var i=r;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},qt.prototype.intersection=function(r){if(this.isNull()||r.isNull()||!this.intersects(r))return new qt;var i=this._minx>r._minx?this._minx:r._minx,a=this._miny>r._miny?this._miny:r._miny,c=this._maxx<r._maxx?this._maxx:r._maxx,d=this._maxy<r._maxy?this._maxy:r._maxy;return new qt(i,c,a,d)},qt.prototype.isNull=function(){return this._maxx<this._minx},qt.prototype.getMaxX=function(){return this._maxx},qt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];return this.covers(r.x,r.y)}if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];return!this.isNull()&&a>=this._minx&&a<=this._maxx&&c>=this._miny&&c<=this._maxy}},qt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof qt){var r=arguments[0];return!this.isNull()&&!r.isNull()&&!(r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._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 a=arguments[0],c=arguments[1];return!this.isNull()&&!(a>this._maxx||a<this._minx||c>this._maxy||c<this._miny)}},qt.prototype.getMinY=function(){return this._miny},qt.prototype.getMinX=function(){return this._minx},qt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];this.expandToInclude(r.x,r.y)}else if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];this.isNull()?(this._minx=a,this._maxx=a,this._miny=c,this._maxy=c):(a<this._minx&&(this._minx=a),a>this._maxx&&(this._maxx=a),c<this._miny&&(this._miny=c),c>this._maxy&&(this._maxy=c))}},qt.prototype.minExtent=function(){if(this.isNull())return 0;var r=this.getWidth(),i=this.getHeight();return r<i?r:i},qt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},qt.prototype.compareTo=function(r){var i=r;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},qt.prototype.translate=function(r,i){if(this.isNull())return null;this.init(this.getMinX()+r,this.getMaxX()+r,this.getMinY()+i,this.getMaxY()+i)},qt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},qt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},qt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},qt.prototype.maxExtent=function(){if(this.isNull())return 0;var r=this.getWidth(),i=this.getHeight();return r>i?r:i},qt.prototype.expandBy=function(){if(arguments.length===1){var r=arguments[0];this.expandBy(r,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=a,this._maxy+=a,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},qt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof qt){var r=arguments[0];return this.covers(r)}if(arguments[0]instanceof D){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.covers(a,c)}},qt.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},qt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];this.init(a.x,c.x,a.y,c.y)}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];d<v?(this._minx=d,this._maxx=v):(this._minx=v,this._maxx=d),M<L?(this._miny=M,this._maxy=L):(this._miny=L,this._maxy=M)}},qt.prototype.getMaxY=function(){return this._maxy},qt.prototype.distance=function(r){if(this.intersects(r))return 0;var i=0;this._maxx<r._minx?i=r._minx-this._maxx:this._minx>r._maxx&&(i=this._minx-r._maxx);var a=0;return this._maxy<r._miny?a=r._miny-this._maxy:this._miny>r._maxy&&(a=this._miny-r._maxy),i===0?a:a===0?i:Math.sqrt(i*i+a*a)},qt.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this._minx),r=37*r+D.hashCode(this._maxx),r=37*r+D.hashCode(this._miny),r=37*r+D.hashCode(this._maxy)},qt.prototype.interfaces_=function(){return[V,t]},qt.prototype.getClass=function(){return qt},qt.intersects=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];return a.x>=(r.x<i.x?r.x:i.x)&&a.x<=(r.x>i.x?r.x:i.x)&&a.y>=(r.y<i.y?r.y:i.y)&&a.y<=(r.y>i.y?r.y:i.y)}if(arguments.length===4){var c=arguments[0],d=arguments[1],v=arguments[2],M=arguments[3],L=Math.min(v.x,M.x),H=Math.max(v.x,M.x),it=Math.min(c.x,d.x),bt=Math.max(c.x,d.x);return!(it>H)&&!(bt<L)&&(L=Math.min(v.y,M.y),H=Math.max(v.y,M.y),it=Math.min(c.y,d.y),bt=Math.max(c.y,d.y),!(it>H)&&!(bt<L))}},xe.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(qt,xe);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*$/},Xe=function(r){this.geometryFactory=r||new Le};Xe.prototype.read=function(r){var i,a,c;r=r.replace(/[\n\r]/g," ");var d=ft.typeStr.exec(r);if(r.search("EMPTY")!==-1&&((d=ft.emptyTypeStr.exec(r))[2]=void 0),d&&(a=d[1].toLowerCase(),c=d[2],ge[a]&&(i=ge[a].apply(this,[c]))),i===void 0)throw new Error("Could not parse WKT "+r);return i},Xe.prototype.write=function(r){return this.extractGeometry(r)},Xe.prototype.extractGeometry=function(r){var i=r.getGeometryType().toLowerCase();if(!ee[i])return null;var a=i.toUpperCase();return r.isEmpty()?a+" EMPTY":a+"("+ee[i].apply(this,[r])+")"};var ee={coordinate:function(r){return r.x+" "+r.y},point:function(r){return ee.coordinate.call(this,r._coordinates._coordinates[0])},multipoint:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.point.apply(this,[r._geometries[a]])+")");return i.join(",")},linestring:function(r){for(var i=[],a=0,c=r._points._coordinates.length;a<c;++a)i.push(ee.coordinate.apply(this,[r._points._coordinates[a]]));return i.join(",")},linearring:function(r){for(var i=[],a=0,c=r._points._coordinates.length;a<c;++a)i.push(ee.coordinate.apply(this,[r._points._coordinates[a]]));return i.join(",")},multilinestring:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.linestring.apply(this,[r._geometries[a]])+")");return i.join(",")},polygon:function(r){var i=[];i.push("("+ee.linestring.apply(this,[r._shell])+")");for(var a=0,c=r._holes.length;a<c;++a)i.push("("+ee.linestring.apply(this,[r._holes[a]])+")");return i.join(",")},multipolygon:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.polygon.apply(this,[r._geometries[a]])+")");return i.join(",")},geometrycollection:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push(this.extractGeometry(r._geometries[a]));return i.join(",")}},ge={point:function(r){if(r===void 0)return this.geometryFactory.createPoint();var i=r.trim().split(ft.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(r){if(r===void 0)return this.geometryFactory.createMultiPoint();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(c)},linestring:function(r){if(r===void 0)return this.geometryFactory.createLineString();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].trim().split(ft.spaces),c.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(c)},linearring:function(r){if(r===void 0)return this.geometryFactory.createLinearRing();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].trim().split(ft.spaces),c.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(c)},multilinestring:function(r){if(r===void 0)return this.geometryFactory.createMultiLineString();for(var i,a=r.trim().split(ft.parenComma),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(c)},polygon:function(r){if(r===void 0)return this.geometryFactory.createPolygon();for(var i,a,c,d,v=r.trim().split(ft.parenComma),M=[],L=0,H=v.length;L<H;++L)i=v[L].replace(ft.trimParens,"$1"),a=ge.linestring.apply(this,[i]),c=this.geometryFactory.createLinearRing(a._points),L===0?d=c:M.push(c);return this.geometryFactory.createPolygon(d,M)},multipolygon:function(r){if(r===void 0)return this.geometryFactory.createMultiPolygon();for(var i,a=r.trim().split(ft.doubleParenComma),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(c)},geometrycollection:function(r){if(r===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(r=r.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),a=[],c=0,d=i.length;c<d;++c)a.push(this.read(i[c]));return this.geometryFactory.createGeometryCollection(a)}},fe=function(r){this.parser=new Xe(r)};fe.prototype.write=function(r){return this.parser.write(r)},fe.toLineString=function(r,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+r.x+" "+r.y+", "+i.x+" "+i.y+" )"};var Te=function(r){function i(a){r.call(this,a),this.name="RuntimeException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),be=function(r){function i(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var a=arguments[0];r.call(this,a)}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Te),Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.shouldNeverReachHere=function(){if(arguments.length===0)Wt.shouldNeverReachHere(null);else if(arguments.length===1){var r=arguments[0];throw new be("Should never reach here"+(r!==null?": "+r:""))}},Wt.isTrue=function(){var r,i;if(arguments.length===1)r=arguments[0],Wt.isTrue(r,null);else if(arguments.length===2&&(r=arguments[0],i=arguments[1],!r))throw i===null?new be:new be(i)},Wt.equals=function(){var r,i,a;if(arguments.length===2)r=arguments[0],i=arguments[1],Wt.equals(r,i,null);else if(arguments.length===3&&(r=arguments[0],i=arguments[1],a=arguments[2],!i.equals(r)))throw new be("Expected "+r+" but encountered "+i+(a!==null?": "+a:""))};var Me=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},tt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Me.prototype.getIndexAlongSegment=function(r,i){return this.computeIntLineIndex(),this._intLineIndex[r][i]},Me.prototype.getTopologySummary=function(){var r=new Lt;return this.isEndPoint()&&r.append(" endpoint"),this._isProper&&r.append(" proper"),this.isCollinear()&&r.append(" collinear"),r.toString()},Me.prototype.computeIntersection=function(r,i,a,c){this._inputLines[0][0]=r,this._inputLines[0][1]=i,this._inputLines[1][0]=a,this._inputLines[1][1]=c,this._result=this.computeIntersect(r,i,a,c)},Me.prototype.getIntersectionNum=function(){return this._result},Me.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 r=arguments[0];this.getEdgeDistance(r,0)>this.getEdgeDistance(r,1)?(this._intLineIndex[r][0]=0,this._intLineIndex[r][1]=1):(this._intLineIndex[r][0]=1,this._intLineIndex[r][1]=0)}},Me.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Me.prototype.setPrecisionModel=function(r){this._precisionModel=r},Me.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var r=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[r][0])&&!this._intPt[i].equals2D(this._inputLines[r][1]))return!0;return!1}},Me.prototype.getIntersection=function(r){return this._intPt[r]},Me.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Me.prototype.hasIntersection=function(){return this._result!==Me.NO_INTERSECTION},Me.prototype.getEdgeDistance=function(r,i){return Me.computeEdgeDistance(this._intPt[i],this._inputLines[r][0],this._inputLines[r][1])},Me.prototype.isCollinear=function(){return this._result===Me.COLLINEAR_INTERSECTION},Me.prototype.toString=function(){return fe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+fe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Me.prototype.getEndpoint=function(r,i){return this._inputLines[r][i]},Me.prototype.isIntersection=function(r){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(r))return!0;return!1},Me.prototype.getIntersectionAlongSegment=function(r,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[r][i]]},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.computeEdgeDistance=function(r,i,a){var c=Math.abs(a.x-i.x),d=Math.abs(a.y-i.y),v=-1;if(r.equals(i))v=0;else if(r.equals(a))v=c>d?c:d;else{var M=Math.abs(r.x-i.x),L=Math.abs(r.y-i.y);(v=c>d?M:L)!==0||r.equals(i)||(v=Math.max(M,L))}return Wt.isTrue(!(v===0&&!r.equals(i)),"Bad distance calculation"),v},Me.nonRobustComputeEdgeDistance=function(r,i,a){var c=r.x-i.x,d=r.y-i.y,v=Math.sqrt(c*c+d*d);return Wt.isTrue(!(v===0&&!r.equals(i)),"Invalid distance calculation"),v},tt.DONT_INTERSECT.get=function(){return 0},tt.DO_INTERSECT.get=function(){return 1},tt.COLLINEAR.get=function(){return 2},tt.NO_INTERSECTION.get=function(){return 0},tt.POINT_INTERSECTION.get=function(){return 1},tt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Me,tt);var z=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(a){var c=new qt(this._inputLines[0][0],this._inputLines[0][1]),d=new qt(this._inputLines[1][0],this._inputLines[1][1]);return c.contains(a)&&d.contains(a)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return r.prototype.computeIntersection.apply(this,arguments);var a=arguments[0],c=arguments[1],d=arguments[2];if(this._isProper=!1,qt.intersects(c,d,a)&&dt.orientationIndex(c,d,a)===0&&dt.orientationIndex(d,c,a)===0)return this._isProper=!0,(a.equals(c)||a.equals(d))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(a,c,d,v,M){M.x=this.smallestInAbsValue(a.x,c.x,d.x,v.x),M.y=this.smallestInAbsValue(a.y,c.y,d.y,v.y),a.x-=M.x,a.y-=M.y,c.x-=M.x,c.y-=M.y,d.x-=M.x,d.y-=M.y,v.x-=M.x,v.y-=M.y},i.prototype.safeHCoordinateIntersection=function(a,c,d,v){var M=null;try{M=$t.intersection(a,c,d,v)}catch(L){if(!(L instanceof ce))throw L;M=i.nearestEndpoint(a,c,d,v)}return M},i.prototype.intersection=function(a,c,d,v){var M=this.intersectionWithNormalization(a,c,d,v);return this.isInSegmentEnvelopes(M)||(M=new D(i.nearestEndpoint(a,c,d,v))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},i.prototype.smallestInAbsValue=function(a,c,d,v){var M=a,L=Math.abs(M);return Math.abs(c)<L&&(M=c,L=Math.abs(c)),Math.abs(d)<L&&(M=d,L=Math.abs(d)),Math.abs(v)<L&&(M=v),M},i.prototype.checkDD=function(a,c,d,v,M){var L=Gt.intersection(a,c,d,v),H=this.isInSegmentEnvelopes(L);te.out.println("DD in env = "+H+" --------------------- "+L),M.distance(L)>1e-4&&te.out.println("Distance = "+M.distance(L))},i.prototype.intersectionWithNormalization=function(a,c,d,v){var M=new D(a),L=new D(c),H=new D(d),it=new D(v),bt=new D;this.normalizeToEnvCentre(M,L,H,it,bt);var Tt=this.safeHCoordinateIntersection(M,L,H,it);return Tt.x+=bt.x,Tt.y+=bt.y,Tt},i.prototype.computeCollinearIntersection=function(a,c,d,v){var M=qt.intersects(a,c,d),L=qt.intersects(a,c,v),H=qt.intersects(d,v,a),it=qt.intersects(d,v,c);return M&&L?(this._intPt[0]=d,this._intPt[1]=v,r.COLLINEAR_INTERSECTION):H&&it?(this._intPt[0]=a,this._intPt[1]=c,r.COLLINEAR_INTERSECTION):M&&H?(this._intPt[0]=d,this._intPt[1]=a,!d.equals(a)||L||it?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):M&&it?(this._intPt[0]=d,this._intPt[1]=c,!d.equals(c)||L||H?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):L&&H?(this._intPt[0]=v,this._intPt[1]=a,!v.equals(a)||M||it?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):L&&it?(this._intPt[0]=v,this._intPt[1]=c,!v.equals(c)||M||H?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):r.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(a,c,d,v,M){var L=a.x<c.x?a.x:c.x,H=a.y<c.y?a.y:c.y,it=a.x>c.x?a.x:c.x,bt=a.y>c.y?a.y:c.y,Tt=d.x<v.x?d.x:v.x,Kt=d.y<v.y?d.y:v.y,Qt=d.x>v.x?d.x:v.x,le=d.y>v.y?d.y:v.y,Ee=((L>Tt?L:Tt)+(it<Qt?it:Qt))/2,Dn=((H>Kt?H:Kt)+(bt<le?bt:le))/2;M.x=Ee,M.y=Dn,a.x-=M.x,a.y-=M.y,c.x-=M.x,c.y-=M.y,d.x-=M.x,d.y-=M.y,v.x-=M.x,v.y-=M.y},i.prototype.computeIntersect=function(a,c,d,v){if(this._isProper=!1,!qt.intersects(a,c,d,v))return r.NO_INTERSECTION;var M=dt.orientationIndex(a,c,d),L=dt.orientationIndex(a,c,v);if(M>0&&L>0||M<0&&L<0)return r.NO_INTERSECTION;var H=dt.orientationIndex(d,v,a),it=dt.orientationIndex(d,v,c);return H>0&&it>0||H<0&&it<0?r.NO_INTERSECTION:M===0&&L===0&&H===0&&it===0?this.computeCollinearIntersection(a,c,d,v):(M===0||L===0||H===0||it===0?(this._isProper=!1,a.equals2D(d)||a.equals2D(v)?this._intPt[0]=a:c.equals2D(d)||c.equals2D(v)?this._intPt[0]=c:M===0?this._intPt[0]=new D(d):L===0?this._intPt[0]=new D(v):H===0?this._intPt[0]=new D(a):it===0&&(this._intPt[0]=new D(c))):(this._isProper=!0,this._intPt[0]=this.intersection(a,c,d,v)),r.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(a,c,d,v){var M=a,L=dt.distancePointLine(a,d,v),H=dt.distancePointLine(c,d,v);return H<L&&(L=H,M=c),(H=dt.distancePointLine(d,a,c))<L&&(L=H,M=d),(H=dt.distancePointLine(v,a,c))<L&&(L=H,M=v),M},i}(Me),It=function(){};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,i,a){var c=i.x-r.x,d=i.y-r.y,v=a.x-i.x,M=a.y-i.y;return It.signOfDet2x2(c,d,v,M)},It.signOfDet2x2=function(r,i,a,c){var d=null,v=null,M=null;if(d=1,r===0||c===0)return i===0||a===0?0:i>0?a>0?-d:d:a>0?d:-d;if(i===0||a===0)return c>0?r>0?d:-d:r>0?-d:d;if(i>0?c>0?i<=c||(d=-d,v=r,r=a,a=v,v=i,i=c,c=v):i<=-c?(d=-d,a=-a,c=-c):(v=r,r=-a,a=v,v=i,i=-c,c=v):c>0?-i<=c?(d=-d,r=-r,i=-i):(v=-r,r=a,a=v,v=-i,i=c,c=v):i>=c?(r=-r,i=-i,a=-a,c=-c):(d=-d,v=-r,r=-a,a=v,v=-i,i=-c,c=v),r>0){if(!(a>0)||!(r<=a))return d}else{if(a>0||!(r>=a))return-d;d=-d,r=-r,a=-a}for(;;){if(M=Math.floor(a/r),a-=M*r,(c-=M*i)<0)return-d;if(c>i)return d;if(r>a+a){if(i<c+c)return d}else{if(i>c+c)return-d;a=r-a,c=i-c,d=-d}if(c===0)return a===0?0:-d;if(a===0||(M=Math.floor(r/a),r-=M*a,(i-=M*c)<0))return d;if(i>c)return-d;if(a>r+r){if(c<i+i)return-d}else{if(c>i+i)return d;r=a-r,i=c-i,d=-d}if(i===0)return r===0?0:d;if(r===0)return-d}};var Ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var r=arguments[0];this._p=r};Ot.prototype.countSegment=function(r,i){if(r.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(r.y===this._p.y&&i.y===this._p.y){var a=r.x,c=i.x;return a>c&&(a=i.x,c=r.x),this._p.x>=a&&this._p.x<=c&&(this._isPointOnSegment=!0),null}if(r.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&r.y<=this._p.y){var d=r.x-this._p.x,v=r.y-this._p.y,M=i.x-this._p.x,L=i.y-this._p.y,H=It.signOfDet2x2(d,v,M,L);if(H===0)return this._isPointOnSegment=!0,null;L<v&&(H=-H),H>0&&this._crossingCount++}},Ot.prototype.isPointInPolygon=function(){return this.getLocation()!==K.EXTERIOR},Ot.prototype.getLocation=function(){return this._isPointOnSegment?K.BOUNDARY:this._crossingCount%2==1?K.INTERIOR:K.EXTERIOR},Ot.prototype.isOnSegment=function(){return this._isPointOnSegment},Ot.prototype.interfaces_=function(){return[]},Ot.prototype.getClass=function(){return Ot},Ot.locatePointInRing=function(){if(arguments[0]instanceof D&&Q(arguments[1],ut)){for(var r=arguments[0],i=arguments[1],a=new Ot(r),c=new D,d=new D,v=1;v<i.size();v++)if(i.getCoordinate(v,c),i.getCoordinate(v-1,d),a.countSegment(c,d),a.isOnSegment())return a.getLocation();return a.getLocation()}if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var M=arguments[0],L=arguments[1],H=new Ot(M),it=1;it<L.length;it++){var bt=L[it],Tt=L[it-1];if(H.countSegment(bt,Tt),H.isOnSegment())return H.getLocation()}return H.getLocation()}};var dt=function(){},Ht={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},dt.orientationIndex=function(r,i,a){return Gt.orientationIndex(r,i,a)},dt.signedArea=function(){if(arguments[0]instanceof Array){var r=arguments[0];if(r.length<3)return 0;for(var i=0,a=r[0].x,c=1;c<r.length-1;c++){var d=r[c].x-a,v=r[c+1].y;i+=d*(r[c-1].y-v)}return i/2}if(Q(arguments[0],ut)){var M=arguments[0],L=M.size();if(L<3)return 0;var H=new D,it=new D,bt=new D;M.getCoordinate(0,it),M.getCoordinate(1,bt);var Tt=it.x;bt.x-=Tt;for(var Kt=0,Qt=1;Qt<L-1;Qt++)H.y=it.y,it.x=bt.x,it.y=bt.y,M.getCoordinate(Qt+1,bt),bt.x-=Tt,Kt+=it.x*(H.y-bt.y);return Kt/2}},dt.distanceLineLine=function(r,i,a,c){if(r.equals(i))return dt.distancePointLine(r,a,c);if(a.equals(c))return dt.distancePointLine(c,r,i);var d=!1;if(qt.intersects(r,i,a,c)){var v=(i.x-r.x)*(c.y-a.y)-(i.y-r.y)*(c.x-a.x);if(v===0)d=!0;else{var M=(r.y-a.y)*(c.x-a.x)-(r.x-a.x)*(c.y-a.y),L=((r.y-a.y)*(i.x-r.x)-(r.x-a.x)*(i.y-r.y))/v,H=M/v;(H<0||H>1||L<0||L>1)&&(d=!0)}}else d=!0;return d?At.min(dt.distancePointLine(r,a,c),dt.distancePointLine(i,a,c),dt.distancePointLine(a,r,i),dt.distancePointLine(c,r,i)):0},dt.isPointInRing=function(r,i){return dt.locatePointInRing(r,i)!==K.EXTERIOR},dt.computeLength=function(r){var i=r.size();if(i<=1)return 0;var a=0,c=new D;r.getCoordinate(0,c);for(var d=c.x,v=c.y,M=1;M<i;M++){r.getCoordinate(M,c);var L=c.x,H=c.y,it=L-d,bt=H-v;a+=Math.sqrt(it*it+bt*bt),d=L,v=H}return a},dt.isCCW=function(r){var i=r.length-1;if(i<3)throw new I("Ring has fewer than 4 points, so orientation cannot be determined");for(var a=r[0],c=0,d=1;d<=i;d++){var v=r[d];v.y>a.y&&(a=v,c=d)}var M=c;do(M-=1)<0&&(M=i);while(r[M].equals2D(a)&&M!==c);var L=c;do L=(L+1)%i;while(r[L].equals2D(a)&&L!==c);var H=r[M],it=r[L];if(H.equals2D(a)||it.equals2D(a)||H.equals2D(it))return!1;var bt=dt.computeOrientation(H,a,it),Tt=!1;return Tt=bt===0?H.x>it.x:bt>0,Tt},dt.locatePointInRing=function(r,i){return Ot.locatePointInRing(r,i)},dt.distancePointLinePerpendicular=function(r,i,a){var c=(a.x-i.x)*(a.x-i.x)+(a.y-i.y)*(a.y-i.y),d=((i.y-r.y)*(a.x-i.x)-(i.x-r.x)*(a.y-i.y))/c;return Math.abs(d)*Math.sqrt(c)},dt.computeOrientation=function(r,i,a){return dt.orientationIndex(r,i,a)},dt.distancePointLine=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];if(i.length===0)throw new I("Line array must contain at least one vertex");for(var a=r.distance(i[0]),c=0;c<i.length-1;c++){var d=dt.distancePointLine(r,i[c],i[c+1]);d<a&&(a=d)}return a}if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];if(M.x===L.x&&M.y===L.y)return v.distance(M);var H=(L.x-M.x)*(L.x-M.x)+(L.y-M.y)*(L.y-M.y),it=((v.x-M.x)*(L.x-M.x)+(v.y-M.y)*(L.y-M.y))/H;if(it<=0)return v.distance(M);if(it>=1)return v.distance(L);var bt=((M.y-v.y)*(L.x-M.x)-(M.x-v.x)*(L.y-M.y))/H;return Math.abs(bt)*Math.sqrt(H)}},dt.isOnLine=function(r,i){for(var a=new z,c=1;c<i.length;c++){var d=i[c-1],v=i[c];if(a.computeIntersection(r,d,v),a.hasIntersection())return!0}return!1},Ht.CLOCKWISE.get=function(){return-1},Ht.RIGHT.get=function(){return dt.CLOCKWISE},Ht.COUNTERCLOCKWISE.get=function(){return 1},Ht.LEFT.get=function(){return dt.COUNTERCLOCKWISE},Ht.COLLINEAR.get=function(){return 0},Ht.STRAIGHT.get=function(){return dt.COLLINEAR},Object.defineProperties(dt,Ht);var Ce=function(){};Ce.prototype.filter=function(r){},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Vt=function(){var r=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=r,this._SRID=r.getSRID()},Zt={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}};Vt.prototype.isGeometryCollection=function(){return this.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION},Vt.prototype.getFactory=function(){return this._factory},Vt.prototype.getGeometryN=function(r){return this},Vt.prototype.getArea=function(){return 0},Vt.prototype.isRectangle=function(){return!1},Vt.prototype.equals=function(){if(arguments[0]instanceof Vt){var r=arguments[0];return r!==null&&this.equalsTopo(r)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof Vt))return!1;var a=i;return this.equalsExact(a)}},Vt.prototype.equalsExact=function(r){return this===r||this.equalsExact(r,0)},Vt.prototype.geometryChanged=function(){this.apply(Vt.geometryChangedFilter)},Vt.prototype.geometryChangedAction=function(){this._envelope=null},Vt.prototype.equalsNorm=function(r){return r!==null&&this.norm().equalsExact(r.norm())},Vt.prototype.getLength=function(){return 0},Vt.prototype.getNumGeometries=function(){return 1},Vt.prototype.compareTo=function(){if(arguments.length===1){var r=arguments[0],i=r;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(r)}if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.getSortIndex()!==a.getSortIndex()?this.getSortIndex()-a.getSortIndex():this.isEmpty()&&a.isEmpty()?0:this.isEmpty()?-1:a.isEmpty()?1:this.compareToSameClass(a,c)}},Vt.prototype.getUserData=function(){return this._userData},Vt.prototype.getSRID=function(){return this._SRID},Vt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Vt.prototype.checkNotGeometryCollection=function(r){if(r.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION)throw new I("This method does not support GeometryCollection arguments")},Vt.prototype.equal=function(r,i,a){return a===0?r.equals(i):r.distance(i)<=a},Vt.prototype.norm=function(){var r=this.copy();return r.normalize(),r},Vt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Vt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new qt(this._envelope)},Vt.prototype.setSRID=function(r){this._SRID=r},Vt.prototype.setUserData=function(r){this._userData=r},Vt.prototype.compare=function(r,i){for(var a=r.iterator(),c=i.iterator();a.hasNext()&&c.hasNext();){var d=a.next(),v=c.next(),M=d.compareTo(v);if(M!==0)return M}return a.hasNext()?1:c.hasNext()?-1:0},Vt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Vt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Vt.SORTINDEX_MULTIPOINT||this.getSortIndex()===Vt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Vt.SORTINDEX_MULTIPOLYGON},Vt.prototype.interfaces_=function(){return[X,V,t]},Vt.prototype.getClass=function(){return Vt},Vt.hasNonEmptyElements=function(r){for(var i=0;i<r.length;i++)if(!r[i].isEmpty())return!0;return!1},Vt.hasNullElements=function(r){for(var i=0;i<r.length;i++)if(r[i]===null)return!0;return!1},Zt.serialVersionUID.get=function(){return 8763622679187377e3},Zt.SORTINDEX_POINT.get=function(){return 0},Zt.SORTINDEX_MULTIPOINT.get=function(){return 1},Zt.SORTINDEX_LINESTRING.get=function(){return 2},Zt.SORTINDEX_LINEARRING.get=function(){return 3},Zt.SORTINDEX_MULTILINESTRING.get=function(){return 4},Zt.SORTINDEX_POLYGON.get=function(){return 5},Zt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Zt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Zt.geometryChangedFilter.get=function(){return ne},Object.defineProperties(Vt,Zt);var ne=function(){};ne.interfaces_=function(){return[Ce]},ne.filter=function(r){r.geometryChangedAction()};var rt=function(){};rt.prototype.filter=function(r){},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt};var P=function(){},N={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}};P.prototype.isInBoundary=function(r){},P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},N.Mod2BoundaryNodeRule.get=function(){return k},N.EndPointBoundaryNodeRule.get=function(){return $},N.MultiValentEndPointBoundaryNodeRule.get=function(){return W},N.MonoValentEndPointBoundaryNodeRule.get=function(){return ht},N.MOD2_BOUNDARY_RULE.get=function(){return new k},N.ENDPOINT_BOUNDARY_RULE.get=function(){return new $},N.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new W},N.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ht},N.OGC_SFS_BOUNDARY_RULE.get=function(){return P.MOD2_BOUNDARY_RULE},Object.defineProperties(P,N);var k=function(){};k.prototype.isInBoundary=function(r){return r%2==1},k.prototype.interfaces_=function(){return[P]},k.prototype.getClass=function(){return k};var $=function(){};$.prototype.isInBoundary=function(r){return r>0},$.prototype.interfaces_=function(){return[P]},$.prototype.getClass=function(){return $};var W=function(){};W.prototype.isInBoundary=function(r){return r>1},W.prototype.interfaces_=function(){return[P]},W.prototype.getClass=function(){return W};var ht=function(){};ht.prototype.isInBoundary=function(r){return r===1},ht.prototype.interfaces_=function(){return[P]},ht.prototype.getClass=function(){return ht};var at=function(){};at.prototype.add=function(){},at.prototype.addAll=function(){},at.prototype.isEmpty=function(){},at.prototype.iterator=function(){},at.prototype.size=function(){},at.prototype.toArray=function(){},at.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var wt=function(){};wt.prototype.hasNext=function(){},wt.prototype.next=function(){},wt.prototype.remove=function(){};var Et=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(at);(o.prototype=new Error).name="NoSuchElementException";var G=function(r){function i(){r.call(this),this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[r,at]},i.prototype.add=function(a){return arguments.length===1?this.array_.push(a):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(a){for(var c=a.iterator();c.hasNext();)this.add(c.next());return!0},i.prototype.set=function(a,c){var d=this.array_[a];return this.array_[a]=c,d},i.prototype.iterator=function(){return new st(this)},i.prototype.get=function(a){if(a<0||a>=this.size())throw new e;return this.array_[a]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var a=[],c=0,d=this.array_.length;c<d;c++)a.push(this.array_[c]);return a},i.prototype.remove=function(a){for(var c=!1,d=0,v=this.array_.length;d<v;d++)if(this.array_[d]===a){this.array_.splice(d,1),c=!0;break}return c},i}(Et),st=function(r){function i(a){r.call(this),this.arrayList_=a,this.position_=0}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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(a){return this.arrayList_.set(this.position_-1,a)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(wt),et=function(r){function i(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var c=arguments[0];this.ensureCapacity(c.length),this.add(c,!0)}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.ensureCapacity(d.length),this.add(d,v)}}}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={coordArrayType:{configurable:!0}};return a.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(c){return this.get(c)},i.prototype.addAll=function(){if(arguments.length===2){for(var c=arguments[0],d=arguments[1],v=!1,M=c.iterator();M.hasNext();)this.add(M.next(),d),v=!0;return v}return r.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var c=r.prototype.clone.call(this),d=0;d<this.size();d++)c.add(d,this.get(d).copy());return c},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var c=arguments[0];r.prototype.add.call(this,c)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1];return this.add(d,v,!0),!0}if(arguments[0]instanceof D&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;r.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var L=arguments[0],H=arguments[1];return this.add(L,H),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var it=arguments[0],bt=arguments[1];if(arguments[2])for(var Tt=0;Tt<it.length;Tt++)this.add(it[Tt],bt);else for(var Kt=it.length-1;Kt>=0;Kt--)this.add(it[Kt],bt);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var Qt=arguments[0],le=arguments[1];if(!arguments[2]){var Ee=this.size();if(Ee>0&&(Qt>0&&this.get(Qt-1).equals2D(le)||Qt<Ee&&this.get(Qt).equals2D(le)))return null}r.prototype.add.call(this,Qt,le)}}else if(arguments.length===4){var Dn=arguments[0],Jn=arguments[1],fi=arguments[2],as=arguments[3],qs=1;fi>as&&(qs=-1);for(var Cf=fi;Cf!==as;Cf+=qs)this.add(Dn[Cf],Jn);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,a),i}(G),lt=function(){},Ft={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ft.ForwardComparator.get=function(){return Jt},Ft.BidirectionalComparator.get=function(){return me},Ft.coordArrayType.get=function(){return new Array(0).fill(null)},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},lt.isRing=function(r){return!(r.length<4)&&!!r[0].equals2D(r[r.length-1])},lt.ptNotInList=function(r,i){for(var a=0;a<r.length;a++){var c=r[a];if(lt.indexOf(c,i)<0)return c}return null},lt.scroll=function(r,i){var a=lt.indexOf(i,r);if(a<0)return null;var c=new Array(r.length).fill(null);te.arraycopy(r,a,c,0,r.length-a),te.arraycopy(r,0,c,r.length-a,a),te.arraycopy(c,0,r,0,r.length)},lt.equals=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];if(r===i)return!0;if(r===null||i===null||r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(!r[a].equals(i[a]))return!1;return!0}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];if(c===d)return!0;if(c===null||d===null||c.length!==d.length)return!1;for(var M=0;M<c.length;M++)if(v.compare(c[M],d[M])!==0)return!1;return!0}},lt.intersection=function(r,i){for(var a=new et,c=0;c<r.length;c++)i.intersects(r[c])&&a.add(r[c],!0);return a.toCoordinateArray()},lt.hasRepeatedPoints=function(r){for(var i=1;i<r.length;i++)if(r[i-1].equals(r[i]))return!0;return!1},lt.removeRepeatedPoints=function(r){return lt.hasRepeatedPoints(r)?new et(r,!1).toCoordinateArray():r},lt.reverse=function(r){for(var i=r.length-1,a=Math.trunc(i/2),c=0;c<=a;c++){var d=r[c];r[c]=r[i-c],r[i-c]=d}},lt.removeNull=function(r){for(var i=0,a=0;a<r.length;a++)r[a]!==null&&i++;var c=new Array(i).fill(null);if(i===0)return c;for(var d=0,v=0;v<r.length;v++)r[v]!==null&&(c[d++]=r[v]);return c},lt.copyDeep=function(){if(arguments.length===1){for(var r=arguments[0],i=new Array(r.length).fill(null),a=0;a<r.length;a++)i[a]=new D(r[a]);return i}if(arguments.length===5)for(var c=arguments[0],d=arguments[1],v=arguments[2],M=arguments[3],L=arguments[4],H=0;H<L;H++)v[M+H]=new D(c[d+H])},lt.isEqualReversed=function(r,i){for(var a=0;a<r.length;a++){var c=r[a],d=i[r.length-a-1];if(c.compareTo(d)!==0)return!1}return!0},lt.envelope=function(r){for(var i=new qt,a=0;a<r.length;a++)i.expandToInclude(r[a]);return i},lt.toCoordinateArray=function(r){return r.toArray(lt.coordArrayType)},lt.atLeastNCoordinatesOrNothing=function(r,i){return i.length>=r?i:[]},lt.indexOf=function(r,i){for(var a=0;a<i.length;a++)if(r.equals(i[a]))return a;return-1},lt.increasingDirection=function(r){for(var i=0;i<Math.trunc(r.length/2);i++){var a=r.length-1-i,c=r[i].compareTo(r[a]);if(c!==0)return c}return 1},lt.compare=function(r,i){for(var a=0;a<r.length&&a<i.length;){var c=r[a].compareTo(i[a]);if(c!==0)return c;a++}return a<i.length?-1:a<r.length?1:0},lt.minCoordinate=function(r){for(var i=null,a=0;a<r.length;a++)(i===null||i.compareTo(r[a])>0)&&(i=r[a]);return i},lt.extract=function(r,i,a){i=At.clamp(i,0,r.length);var c=(a=At.clamp(a,-1,r.length))-i+1;a<0&&(c=0),i>=r.length&&(c=0),a<i&&(c=0);var d=new Array(c).fill(null);if(c===0)return d;for(var v=0,M=i;M<=a;M++)d[v++]=r[M];return d},Object.defineProperties(lt,Ft);var Jt=function(){};Jt.prototype.compare=function(r,i){return lt.compare(r,i)},Jt.prototype.interfaces_=function(){return[q]},Jt.prototype.getClass=function(){return Jt};var me=function(){};me.prototype.compare=function(r,i){var a=r,c=i;if(a.length<c.length)return-1;if(a.length>c.length)return 1;if(a.length===0)return 0;var d=lt.compare(a,c);return lt.isEqualReversed(a,c)?0:d},me.prototype.OLDcompare=function(r,i){var a=r,c=i;if(a.length<c.length)return-1;if(a.length>c.length)return 1;if(a.length===0)return 0;for(var d=lt.increasingDirection(a),v=lt.increasingDirection(c),M=d>0?0:a.length-1,L=v>0?0:a.length-1,H=0;H<a.length;H++){var it=a[M].compareTo(c[L]);if(it!==0)return it;M+=d,L+=v}return 0},me.prototype.interfaces_=function(){return[q]},me.prototype.getClass=function(){return me};var ve=function(){};ve.prototype.get=function(){},ve.prototype.put=function(){},ve.prototype.size=function(){},ve.prototype.values=function(){},ve.prototype.entrySet=function(){};var He=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(ve);(s.prototype=new Error).name="OperationNotSupported",(l.prototype=new at).contains=function(){};var Ue=function(r){function i(){r.call(this),this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.contains=function(a){for(var c=0,d=this.array_.length;c<d;c++)if(this.array_[c]===a)return!0;return!1},i.prototype.add=function(a){return!this.contains(a)&&(this.array_.push(a),!0)},i.prototype.addAll=function(a){for(var c=a.iterator();c.hasNext();)this.add(c.next());return!0},i.prototype.remove=function(a){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 a=[],c=0,d=this.array_.length;c<d;c++)a.push(this.array_[c]);return a},i.prototype.iterator=function(){return new Ye(this)},i}(l),Ye=function(r){function i(a){r.call(this),this.hashSet_=a,this.position_=0}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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 s},i}(wt),Qe=0;(w.prototype=new He).get=function(r){for(var i=this.root_;i!==null;){var a=r.compareTo(i.key);if(a<0)i=i.left;else{if(!(a>0))return i.value;i=i.right}}return null},w.prototype.put=function(r,i){if(this.root_===null)return this.root_={key:r,value:i,left:null,right:null,parent:null,color:Qe,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var a,c,d=this.root_;do if(a=d,(c=r.compareTo(d.key))<0)d=d.left;else{if(!(c>0)){var v=d.value;return d.value=i,v}d=d.right}while(d!==null);var M={key:r,left:null,right:null,value:i,parent:a,color:Qe,getValue:function(){return this.value},getKey:function(){return this.key}};return c<0?a.left=M:a.right=M,this.fixAfterInsertion(M),this.size_++,null},w.prototype.fixAfterInsertion=function(r){for(r.color=1;r!=null&&r!==this.root_&&r.parent.color===1;)if(h(r)===m(h(h(r)))){var i=_(h(h(r)));p(i)===1?(g(h(r),Qe),g(i,Qe),g(h(h(r)),1),r=h(h(r))):(r===_(h(r))&&(r=h(r),this.rotateLeft(r)),g(h(r),Qe),g(h(h(r)),1),this.rotateRight(h(h(r))))}else{var a=m(h(h(r)));p(a)===1?(g(h(r),Qe),g(a,Qe),g(h(h(r)),1),r=h(h(r))):(r===m(h(r))&&(r=h(r),this.rotateRight(r)),g(h(r),Qe),g(h(h(r)),1),this.rotateLeft(h(h(r))))}this.root_.color=Qe},w.prototype.values=function(){var r=new G,i=this.getFirstEntry();if(i!==null)for(r.add(i.value);(i=w.successor(i))!==null;)r.add(i.value);return r},w.prototype.entrySet=function(){var r=new Ue,i=this.getFirstEntry();if(i!==null)for(r.add(i);(i=w.successor(i))!==null;)r.add(i);return r},w.prototype.rotateLeft=function(r){if(r!=null){var i=r.right;r.right=i.left,i.left!=null&&(i.left.parent=r),i.parent=r.parent,r.parent===null?this.root_=i:r.parent.left===r?r.parent.left=i:r.parent.right=i,i.left=r,r.parent=i}},w.prototype.rotateRight=function(r){if(r!=null){var i=r.left;r.left=i.right,i.right!=null&&(i.right.parent=r),i.parent=r.parent,r.parent===null?this.root_=i:r.parent.right===r?r.parent.right=i:r.parent.left=i,i.right=r,r.parent=i}},w.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},w.successor=function(r){if(r===null)return null;if(r.right!==null){for(var i=r.right;i.left!==null;)i=i.left;return i}for(var a=r.parent,c=r;a!==null&&c===a.right;)c=a,a=a.parent;return a},w.prototype.size=function(){return this.size_};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},S.prototype=new l,(b.prototype=new S).contains=function(r){for(var i=0,a=this.array_.length;i<a;i++)if(this.array_[i].compareTo(r)===0)return!0;return!1},b.prototype.add=function(r){if(this.contains(r))return!1;for(var i=0,a=this.array_.length;i<a;i++)if(this.array_[i].compareTo(r)===1)return this.array_.splice(i,0,r),!0;return this.array_.push(r),!0},b.prototype.addAll=function(r){for(var i=r.iterator();i.hasNext();)this.add(i.next());return!0},b.prototype.remove=function(r){throw new s},b.prototype.size=function(){return this.array_.length},b.prototype.isEmpty=function(){return this.array_.length===0},b.prototype.toArray=function(){for(var r=[],i=0,a=this.array_.length;i<a;i++)r.push(this.array_[i]);return r},b.prototype.iterator=function(){return new Kr(this)};var Kr=function(r){this.treeSet_=r,this.position_=0};Kr.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Kr.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Kr.prototype.remove=function(){throw new s};var nr=function(){};nr.sort=function(){var r,i,a,c,d=arguments[0];if(arguments.length===1)c=function(M,L){return M.compareTo(L)},d.sort(c);else if(arguments.length===2)a=arguments[1],c=function(M,L){return a.compare(M,L)},d.sort(c);else if(arguments.length===3){(i=d.slice(arguments[1],arguments[2])).sort();var v=d.slice(0,arguments[1]).concat(i,d.slice(arguments[2],d.length));for(d.splice(0,d.length),r=0;r<v.length;r++)d.push(v[r])}else if(arguments.length===4)for(i=d.slice(arguments[1],arguments[2]),a=arguments[3],c=function(M,L){return a.compare(M,L)},i.sort(c),v=d.slice(0,arguments[1]).concat(i,d.slice(arguments[2],d.length)),d.splice(0,d.length),r=0;r<v.length;r++)d.push(v[r])},nr.asList=function(r){for(var i=new G,a=0,c=r.length;a<c;a++)i.add(r[a]);return i};var Ie=function(){},rr={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}};rr.P.get=function(){return 0},rr.L.get=function(){return 1},rr.A.get=function(){return 2},rr.FALSE.get=function(){return-1},rr.TRUE.get=function(){return-2},rr.DONTCARE.get=function(){return-3},rr.SYM_FALSE.get=function(){return"F"},rr.SYM_TRUE.get=function(){return"T"},rr.SYM_DONTCARE.get=function(){return"*"},rr.SYM_P.get=function(){return"0"},rr.SYM_L.get=function(){return"1"},rr.SYM_A.get=function(){return"2"},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.toDimensionSymbol=function(r){switch(r){case Ie.FALSE:return Ie.SYM_FALSE;case Ie.TRUE:return Ie.SYM_TRUE;case Ie.DONTCARE:return Ie.SYM_DONTCARE;case Ie.P:return Ie.SYM_P;case Ie.L:return Ie.SYM_L;case Ie.A:return Ie.SYM_A}throw new I("Unknown dimension value: "+r)},Ie.toDimensionValue=function(r){switch(yt.toUpperCase(r)){case Ie.SYM_FALSE:return Ie.FALSE;case Ie.SYM_TRUE:return Ie.TRUE;case Ie.SYM_DONTCARE:return Ie.DONTCARE;case Ie.SYM_P:return Ie.P;case Ie.SYM_L:return Ie.L;case Ie.SYM_A:return Ie.A}throw new I("Unknown dimension symbol: "+r)},Object.defineProperties(Ie,rr);var pr=function(){};pr.prototype.filter=function(r){},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var ur=function(){};ur.prototype.filter=function(r,i){},ur.prototype.isDone=function(){},ur.prototype.isGeometryChanged=function(){},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var Qn=function(r){function i(c,d){if(r.call(this,d),this._geometries=c||[],r.hasNullElements(this._geometries))throw new I("geometries must not contain null elements")}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var c=new qt,d=0;d<this._geometries.length;d++)c.expandToInclude(this._geometries[d].getEnvelopeInternal());return c},i.prototype.getGeometryN=function(c){return this._geometries[c]},i.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var c=new Array(this.getNumPoints()).fill(null),d=-1,v=0;v<this._geometries.length;v++)for(var M=this._geometries[v].getCoordinates(),L=0;L<M.length;L++)c[++d]=M[L];return c},i.prototype.getArea=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getArea();return c},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c;if(this._geometries.length!==v._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(v._geometries[M],d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var c=0;c<this._geometries.length;c++)this._geometries[c].normalize();nr.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var c=Ie.FALSE,d=0;d<this._geometries.length;d++)c=Math.max(c,this._geometries[d].getBoundaryDimension());return c},i.prototype.getDimension=function(){for(var c=Ie.FALSE,d=0;d<this._geometries.length;d++)c=Math.max(c,this._geometries[d].getDimension());return c},i.prototype.getLength=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getLength();return c},i.prototype.getNumPoints=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getNumPoints();return c},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[v]=this._geometries[v].reverse();return this.getFactory().createGeometryCollection(d)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var c=arguments[0],d=new b(nr.asList(this._geometries)),v=new b(nr.asList(c._geometries));return this.compare(d,v)}if(arguments.length===2){for(var M=arguments[0],L=arguments[1],H=M,it=this.getNumGeometries(),bt=H.getNumGeometries(),Tt=0;Tt<it&&Tt<bt;){var Kt=this.getGeometryN(Tt),Qt=H.getGeometryN(Tt),le=Kt.compareToSameClass(Qt,L);if(le!==0)return le;Tt++}return Tt<it?1:Tt<bt?-1:0}},i.prototype.apply=function(){if(Q(arguments[0],rt))for(var c=arguments[0],d=0;d<this._geometries.length;d++)this._geometries[d].apply(c);else if(Q(arguments[0],ur)){var v=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(v),!v.isDone());M++);v.isGeometryChanged()&&this.geometryChanged()}else if(Q(arguments[0],pr)){var L=arguments[0];L.filter(this);for(var H=0;H<this._geometries.length;H++)this._geometries[H].apply(L)}else if(Q(arguments[0],Ce)){var it=arguments[0];it.filter(this);for(var bt=0;bt<this._geometries.length;bt++)this._geometries[bt].apply(it)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Wt.shouldNeverReachHere(),null},i.prototype.clone=function(){var c=r.prototype.clone.call(this);c._geometries=new Array(this._geometries.length).fill(null);for(var d=0;d<this._geometries.length;d++)c._geometries[d]=this._geometries[d].clone();return c},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.isEmpty=function(){for(var c=0;c<this._geometries.length;c++)if(!this._geometries[c].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,a),i}(Vt),bi=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var c=0;c<this._geometries.length;c++)if(!this._geometries[c].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[c-1-v]=this._geometries[v].reverse();return this.getFactory().createMultiLineString(d)},i.prototype.getBoundary=function(){return new oi(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,a),i}(Qn),oi=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var r=arguments[0],i=P.MOD2_BOUNDARY_RULE;this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._geom=a,this._geomFact=a.getFactory(),this._bnRule=c}};oi.prototype.boundaryMultiLineString=function(r){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(r);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},oi.prototype.getBoundary=function(){return this._geom instanceof vt?this.boundaryLineString(this._geom):this._geom instanceof bi?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},oi.prototype.boundaryLineString=function(r){return this._geom.isEmpty()?this.getEmptyMultiPoint():r.isClosed()?this._bnRule.isInBoundary(2)?r.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([r.getStartPoint(),r.getEndPoint()])},oi.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},oi.prototype.computeBoundaryCoordinates=function(r){var i=new G;this._endpointMap=new w;for(var a=0;a<r.getNumGeometries();a++){var c=r.getGeometryN(a);c.getNumPoints()!==0&&(this.addEndpoint(c.getCoordinateN(0)),this.addEndpoint(c.getCoordinateN(c.getNumPoints()-1)))}for(var d=this._endpointMap.entrySet().iterator();d.hasNext();){var v=d.next(),M=v.getValue().count;this._bnRule.isInBoundary(M)&&i.add(v.getKey())}return lt.toCoordinateArray(i)},oi.prototype.addEndpoint=function(r){var i=this._endpointMap.get(r);i===null&&(i=new Z,this._endpointMap.put(r,i)),i.count++},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.getBoundary=function(){if(arguments.length===1){var r=arguments[0];return new oi(r).getBoundary()}if(arguments.length===2){var i=arguments[0],a=arguments[1];return new oi(i,a).getBoundary()}};var Z=function(){this.count=null};Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z};var mt=function(){},Rt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.chars=function(r,i){for(var a=new Array(i).fill(null),c=0;c<i;c++)a[c]=r;return String(a)},mt.getStackTrace=function(){if(arguments.length===1){var r=arguments[0],i=new function(){},a=new function(){}(i);return r.printStackTrace(a),i.toString()}if(arguments.length===2){for(var c=arguments[0],d=arguments[1],v="",M=new function(){}(new function(){}(mt.getStackTrace(c))),L=0;L<d;L++)try{v+=M.readLine()+mt.NEWLINE}catch(H){if(!(H instanceof C))throw H;Wt.shouldNeverReachHere()}return v}},mt.split=function(r,i){for(var a=i.length,c=new G,d=""+r,v=d.indexOf(i);v>=0;){var M=d.substring(0,v);c.add(M),v=(d=d.substring(v+a)).indexOf(i)}d.length>0&&c.add(d);for(var L=new Array(c.size()).fill(null),H=0;H<L.length;H++)L[H]=c.get(H);return L},mt.toString=function(){if(arguments.length===1){var r=arguments[0];return mt.SIMPLE_ORDINATE_FORMAT.format(r)}},mt.spaces=function(r){return mt.chars(" ",r)},Rt.NEWLINE.get=function(){return te.getProperty("line.separator")},Rt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(mt,Rt);var St=function(){};St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.copyCoord=function(r,i,a,c){for(var d=Math.min(r.getDimension(),a.getDimension()),v=0;v<d;v++)a.setOrdinate(c,v,r.getOrdinate(i,v))},St.isRing=function(r){var i=r.size();return i===0||!(i<=3)&&r.getOrdinate(0,ut.X)===r.getOrdinate(i-1,ut.X)&&r.getOrdinate(0,ut.Y)===r.getOrdinate(i-1,ut.Y)},St.isEqual=function(r,i){var a=r.size();if(a!==i.size())return!1;for(var c=Math.min(r.getDimension(),i.getDimension()),d=0;d<a;d++)for(var v=0;v<c;v++){var M=r.getOrdinate(d,v),L=i.getOrdinate(d,v);if(r.getOrdinate(d,v)!==i.getOrdinate(d,v)&&(!A.isNaN(M)||!A.isNaN(L)))return!1}return!0},St.extend=function(r,i,a){var c=r.create(a,i.getDimension()),d=i.size();if(St.copy(i,0,c,0,d),d>0)for(var v=d;v<a;v++)St.copy(i,d-1,c,v,1);return c},St.reverse=function(r){for(var i=r.size()-1,a=Math.trunc(i/2),c=0;c<=a;c++)St.swap(r,c,i-c)},St.swap=function(r,i,a){if(i===a)return null;for(var c=0;c<r.getDimension();c++){var d=r.getOrdinate(i,c);r.setOrdinate(i,c,r.getOrdinate(a,c)),r.setOrdinate(a,c,d)}},St.copy=function(r,i,a,c,d){for(var v=0;v<d;v++)St.copyCoord(r,i+v,a,c+v)},St.toString=function(){if(arguments.length===1){var r=arguments[0],i=r.size();if(i===0)return"()";var a=r.getDimension(),c=new Lt;c.append("(");for(var d=0;d<i;d++){d>0&&c.append(" ");for(var v=0;v<a;v++)v>0&&c.append(","),c.append(mt.toString(r.getOrdinate(d,v)))}return c.append(")"),c.toString()}},St.ensureValidRing=function(r,i){var a=i.size();return a===0?i:a<=3?St.createClosedRing(r,i,4):i.getOrdinate(0,ut.X)===i.getOrdinate(a-1,ut.X)&&i.getOrdinate(0,ut.Y)===i.getOrdinate(a-1,ut.Y)?i:St.createClosedRing(r,i,a+1)},St.createClosedRing=function(r,i,a){var c=r.create(a,i.getDimension()),d=i.size();St.copy(i,0,c,0,d);for(var v=d;v<a;v++)St.copy(i,0,c,v,1);return c};var vt=function(r){function i(c,d){r.call(this,d),this._points=null,this.init(c)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new qt:this._points.expandEnvelope(new qt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c;if(this._points.size()!==v._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),v._points.getCoordinate(M),d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var c=0;c<Math.trunc(this._points.size()/2);c++){var d=this._points.size()-1-c;if(!this._points.getCoordinate(c).equals(this._points.getCoordinate(d)))return this._points.getCoordinate(c).compareTo(this._points.getCoordinate(d))>0&&St.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.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 dt.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var c=this._points.copy();return St.reverse(c),this.getFactory().createLineString(c)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var c=arguments[0],d=0,v=0;d<this._points.size()&&v<c._points.size();){var M=this._points.getCoordinate(d).compareTo(c._points.getCoordinate(v));if(M!==0)return M;d++,v++}return d<this._points.size()?1:v<c._points.size()?-1:0}if(arguments.length===2){var L=arguments[0];return arguments[1].compare(this._points,L._points)}},i.prototype.apply=function(){if(Q(arguments[0],rt))for(var c=arguments[0],d=0;d<this._points.size();d++)c.filter(this._points.getCoordinate(d));else if(Q(arguments[0],ur)){var v=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(v.filter(this._points,M),!v.isDone());M++);v.isGeometryChanged()&&this.geometryChanged()}else Q(arguments[0],pr)?arguments[0].filter(this):Q(arguments[0],Ce)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new oi(this).getBoundary()},i.prototype.isEquivalentClass=function(c){return c instanceof i},i.prototype.clone=function(){var c=r.prototype.clone.call(this);return c._points=this._points.clone(),c},i.prototype.getCoordinateN=function(c){return this._points.getCoordinate(c)},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(c){if(c===null&&(c=this.getFactory().getCoordinateSequenceFactory().create([])),c.size()===1)throw new I("Invalid number of points in LineString (found "+c.size()+" - must be 0 or >= 2)");this._points=c},i.prototype.isCoordinate=function(c){for(var d=0;d<this._points.size();d++)if(this._points.getCoordinate(d).equals(c))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(c){return this.getFactory().createPoint(this._points.getCoordinate(c))},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,a),i}(Vt),he=function(){};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he};var ue=function(r){function i(c,d){r.call(this,d),this._coordinates=c||null,this.init(this._coordinates)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new qt;var c=new qt;return c.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),c},i.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&(!(!this.isEmpty()||!c.isEmpty())||this.isEmpty()===c.isEmpty()&&this.equal(c.getCoordinate(),this.getCoordinate(),d))}return r.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 Ie.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 c=arguments[0];return this.getCoordinate().compareTo(c.getCoordinate())}if(arguments.length===2){var d=arguments[0];return arguments[1].compare(this._coordinates,d._coordinates)}},i.prototype.apply=function(){if(Q(arguments[0],rt)){var c=arguments[0];if(this.isEmpty())return null;c.filter(this.getCoordinate())}else if(Q(arguments[0],ur)){var d=arguments[0];if(this.isEmpty())return null;d.filter(this._coordinates,0),d.isGeometryChanged()&&this.geometryChanged()}else Q(arguments[0],pr)?arguments[0].filter(this):Q(arguments[0],Ce)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var c=r.prototype.clone.call(this);return c._coordinates=this._coordinates.clone(),c},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(c){c===null&&(c=this.getFactory().getCoordinateSequenceFactory().create([])),Wt.isTrue(c.size()<=1),this._coordinates=c},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[he]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,a),i}(Vt),we=function(){};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we};var de=function(r){function i(c,d,v){if(r.call(this,v),this._shell=null,this._holes=null,c===null&&(c=this.getFactory().createLinearRing()),d===null&&(d=[]),r.hasNullElements(d))throw new I("holes must not contain null elements");if(c.isEmpty()&&r.hasNonEmptyElements(d))throw new I("shell is empty but holes are not");this._shell=c,this._holes=d}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var c=new Array(this.getNumPoints()).fill(null),d=-1,v=this._shell.getCoordinates(),M=0;M<v.length;M++)c[++d]=v[M];for(var L=0;L<this._holes.length;L++)for(var H=this._holes[L].getCoordinates(),it=0;it<H.length;it++)c[++d]=H[it];return c},i.prototype.getArea=function(){var c=0;c+=Math.abs(dt.signedArea(this._shell.getCoordinateSequence()));for(var d=0;d<this._holes.length;d++)c-=Math.abs(dt.signedArea(this._holes[d].getCoordinateSequence()));return c},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var c=this._shell.getCoordinateSequence(),d=this.getEnvelopeInternal(),v=0;v<5;v++){var M=c.getX(v);if(M!==d.getMinX()&&M!==d.getMaxX())return!1;var L=c.getY(v);if(L!==d.getMinY()&&L!==d.getMaxY())return!1}for(var H=c.getX(0),it=c.getY(0),bt=1;bt<=4;bt++){var Tt=c.getX(bt),Kt=c.getY(bt);if(Tt!==H==(Kt!==it))return!1;H=Tt,it=Kt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c,M=this._shell,L=v._shell;if(!M.equalsExact(L,d)||this._holes.length!==v._holes.length)return!1;for(var H=0;H<this._holes.length;H++)if(!this._holes[H].equalsExact(v._holes[H],d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var c=0;c<this._holes.length;c++)this.normalize(this._holes[c],!1);nr.sort(this._holes)}else if(arguments.length===2){var d=arguments[0],v=arguments[1];if(d.isEmpty())return null;var M=new Array(d.getCoordinates().length-1).fill(null);te.arraycopy(d.getCoordinates(),0,M,0,M.length);var L=lt.minCoordinate(d.getCoordinates());lt.scroll(M,L),te.arraycopy(M,0,d.getCoordinates(),0,M.length),d.getCoordinates()[M.length]=M[0],dt.isCCW(d.getCoordinates())===v&<.reverse(d.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 c=0;c+=this._shell.getLength();for(var d=0;d<this._holes.length;d++)c+=this._holes[d].getLength();return c},i.prototype.getNumPoints=function(){for(var c=this._shell.getNumPoints(),d=0;d<this._holes.length;d++)c+=this._holes[d].getNumPoints();return c},i.prototype.reverse=function(){var c=this.copy();c._shell=this._shell.copy().reverse(),c._holes=new Array(this._holes.length).fill(null);for(var d=0;d<this._holes.length;d++)c._holes[d]=this._holes[d].copy().reverse();return c},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var c=arguments[0],d=this._shell,v=c._shell;return d.compareToSameClass(v)}if(arguments.length===2){var M=arguments[0],L=arguments[1],H=M,it=this._shell,bt=H._shell,Tt=it.compareToSameClass(bt,L);if(Tt!==0)return Tt;for(var Kt=this.getNumInteriorRing(),Qt=H.getNumInteriorRing(),le=0;le<Kt&&le<Qt;){var Ee=this.getInteriorRingN(le),Dn=H.getInteriorRingN(le),Jn=Ee.compareToSameClass(Dn,L);if(Jn!==0)return Jn;le++}return le<Kt?1:le<Qt?-1:0}},i.prototype.apply=function(c){if(Q(c,rt)){this._shell.apply(c);for(var d=0;d<this._holes.length;d++)this._holes[d].apply(c)}else if(Q(c,ur)){if(this._shell.apply(c),!c.isDone())for(var v=0;v<this._holes.length&&(this._holes[v].apply(c),!c.isDone());v++);c.isGeometryChanged()&&this.geometryChanged()}else if(Q(c,pr))c.filter(this);else if(Q(c,Ce)){c.filter(this),this._shell.apply(c);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(c)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var c=new Array(this._holes.length+1).fill(null);c[0]=this._shell;for(var d=0;d<this._holes.length;d++)c[d+1]=this._holes[d];return c.length<=1?this.getFactory().createLinearRing(c[0].getCoordinateSequence()):this.getFactory().createMultiLineString(c)},i.prototype.clone=function(){var c=r.prototype.clone.call(this);c._shell=this._shell.clone(),c._holes=new Array(this._holes.length).fill(null);for(var d=0;d<this._holes.length;d++)c._holes[d]=this._holes[d].clone();return c},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var c=this._shell.copy(),d=new Array(this._holes.length).fill(null),v=0;v<d.length;v++)d[v]=this._holes[v].copy();return new i(c,d,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(c){return this._holes[c]},i.prototype.interfaces_=function(){return[we]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,a),i}(Vt),Be=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var c=arguments[0];return this._geometries[c].getCoordinate()}return r.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return Ie.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 c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[he]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,a),i}(Qn),Ae=function(r){function i(c,d){c instanceof D&&d instanceof Le&&(c=d.getCoordinateSequenceFactory().create(c)),r.call(this,c,d),this.validateConstruction()}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return Ie.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||r.prototype.isClosed.call(this)},i.prototype.reverse=function(){var c=this._points.copy();return St.reverse(c),this.getFactory().createLinearRing(c)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new I("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new I("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},a.MINIMUM_VALID_SIZE.get=function(){return 4},a.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,a),i}(vt),Pe=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[v]=this._geometries[v].reverse();return this.getFactory().createMultiPolygon(d)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var c=new G,d=0;d<this._geometries.length;d++)for(var v=this._geometries[d].getBoundary(),M=0;M<v.getNumGeometries();M++)c.add(v.getGeometryN(M));var L=new Array(c.size()).fill(null);return this.getFactory().createMultiLineString(c.toArray(L))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[we]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,a),i}(Qn),rn=function(r){this._factory=r||null,this._isUserDataCopied=!1},si={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rn.prototype.setCopyUserData=function(r){this._isUserDataCopied=r},rn.prototype.edit=function(r,i){if(r===null)return null;var a=this.editInternal(r,i);return this._isUserDataCopied&&a.setUserData(r.getUserData()),a},rn.prototype.editInternal=function(r,i){return this._factory===null&&(this._factory=r.getFactory()),r instanceof Qn?this.editGeometryCollection(r,i):r instanceof de?this.editPolygon(r,i):r instanceof ue?i.edit(r,this._factory):r instanceof vt?i.edit(r,this._factory):(Wt.shouldNeverReachHere("Unsupported Geometry class: "+r.getClass().getName()),null)},rn.prototype.editGeometryCollection=function(r,i){for(var a=i.edit(r,this._factory),c=new G,d=0;d<a.getNumGeometries();d++){var v=this.edit(a.getGeometryN(d),i);v===null||v.isEmpty()||c.add(v)}return a.getClass()===Be?this._factory.createMultiPoint(c.toArray([])):a.getClass()===bi?this._factory.createMultiLineString(c.toArray([])):a.getClass()===Pe?this._factory.createMultiPolygon(c.toArray([])):this._factory.createGeometryCollection(c.toArray([]))},rn.prototype.editPolygon=function(r,i){var a=i.edit(r,this._factory);if(a===null&&(a=this._factory.createPolygon(null)),a.isEmpty())return a;var c=this.edit(a.getExteriorRing(),i);if(c===null||c.isEmpty())return this._factory.createPolygon();for(var d=new G,v=0;v<a.getNumInteriorRing();v++){var M=this.edit(a.getInteriorRingN(v),i);M===null||M.isEmpty()||d.add(M)}return this._factory.createPolygon(c,d.toArray([]))},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.GeometryEditorOperation=function(){},si.NoOpGeometryOperation.get=function(){return br},si.CoordinateOperation.get=function(){return Wi},si.CoordinateSequenceOperation.get=function(){return sr},Object.defineProperties(rn,si);var br=function(){};br.prototype.edit=function(r,i){return r},br.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},br.prototype.getClass=function(){return br};var Wi=function(){};Wi.prototype.edit=function(r,i){var a=this.editCoordinates(r.getCoordinates(),r);return a===null?r:r instanceof Ae?i.createLinearRing(a):r instanceof vt?i.createLineString(a):r instanceof ue?a.length>0?i.createPoint(a[0]):i.createPoint():r},Wi.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},Wi.prototype.getClass=function(){return Wi};var sr=function(){};sr.prototype.edit=function(r,i){return r instanceof Ae?i.createLinearRing(this.edit(r.getCoordinateSequence(),r)):r instanceof vt?i.createLineString(this.edit(r.getCoordinateSequence(),r)):r instanceof ue?i.createPoint(this.edit(r.getCoordinateSequence(),r)):r},sr.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},sr.prototype.getClass=function(){return sr};var ye=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 r=arguments[0];this._coordinates=new Array(r).fill(null);for(var i=0;i<r;i++)this._coordinates[i]=new D}else if(Q(arguments[0],ut)){var a=arguments[0];if(a===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=a.getDimension(),this._coordinates=new Array(a.size()).fill(null);for(var c=0;c<this._coordinates.length;c++)this._coordinates[c]=a.getCoordinateCopy(c)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var d=arguments[0],v=arguments[1];this._coordinates=d,this._dimension=v,d===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],L=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=L;for(var H=0;H<M;H++)this._coordinates[H]=new D}}},Fa={serialVersionUID:{configurable:!0}};ye.prototype.setOrdinate=function(r,i,a){switch(i){case ut.X:this._coordinates[r].x=a;break;case ut.Y:this._coordinates[r].y=a;break;case ut.Z:this._coordinates[r].z=a;break;default:throw new I("invalid ordinateIndex")}},ye.prototype.size=function(){return this._coordinates.length},ye.prototype.getOrdinate=function(r,i){switch(i){case ut.X:return this._coordinates[r].x;case ut.Y:return this._coordinates[r].y;case ut.Z:return this._coordinates[r].z}return A.NaN},ye.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._coordinates[r]}if(arguments.length===2){var i=arguments[0],a=arguments[1];a.x=this._coordinates[i].x,a.y=this._coordinates[i].y,a.z=this._coordinates[i].z}},ye.prototype.getCoordinateCopy=function(r){return new D(this._coordinates[r])},ye.prototype.getDimension=function(){return this._dimension},ye.prototype.getX=function(r){return this._coordinates[r].x},ye.prototype.clone=function(){for(var r=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)r[i]=this._coordinates[i].clone();return new ye(r,this._dimension)},ye.prototype.expandEnvelope=function(r){for(var i=0;i<this._coordinates.length;i++)r.expandToInclude(this._coordinates[i]);return r},ye.prototype.copy=function(){for(var r=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)r[i]=this._coordinates[i].copy();return new ye(r,this._dimension)},ye.prototype.toString=function(){if(this._coordinates.length>0){var r=new Lt(17*this._coordinates.length);r.append("("),r.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)r.append(", "),r.append(this._coordinates[i]);return r.append(")"),r.toString()}return"()"},ye.prototype.getY=function(r){return this._coordinates[r].y},ye.prototype.toCoordinateArray=function(){return this._coordinates},ye.prototype.interfaces_=function(){return[ut,t]},ye.prototype.getClass=function(){return ye},Fa.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ye,Fa);var on=function(){},fo={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};on.prototype.readResolve=function(){return on.instance()},on.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return new ye(r)}if(Q(arguments[0],ut)){var i=arguments[0];return new ye(i)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];return c>3&&(c=3),c<2?new ye(a):new ye(a,c)}},on.prototype.interfaces_=function(){return[j,t]},on.prototype.getClass=function(){return on},on.instance=function(){return on.instanceObject},fo.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},fo.instanceObject.get=function(){return new on},Object.defineProperties(on,fo);var ul=function(r){function i(){r.call(this),this.map_=new Map}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.get=function(a){return this.map_.get(a)||null},i.prototype.put=function(a,c){return this.map_.set(a,c),c},i.prototype.values=function(){for(var a=new G,c=this.map_.values(),d=c.next();!d.done;)a.add(d.value),d=c.next();return a},i.prototype.entrySet=function(){var a=new Ue;return this.map_.entries().forEach(function(c){return a.add(c)}),a},i.prototype.size=function(){return this.map_.size()},i}(ve),Ge=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ir){var i=arguments[0];this._modelType=i,i===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var a=arguments[0];this._modelType=r.FIXED,this.setScale(a)}else if(arguments[0]instanceof r){var c=arguments[0];this._modelType=c._modelType,this._scale=c._scale}}},ys={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ge.prototype.equals=function(r){if(!(r instanceof Ge))return!1;var i=r;return this._modelType===i._modelType&&this._scale===i._scale},Ge.prototype.compareTo=function(r){var i=r,a=this.getMaximumSignificantDigits(),c=i.getMaximumSignificantDigits();return new pt(a).compareTo(new pt(c))},Ge.prototype.getScale=function(){return this._scale},Ge.prototype.isFloating=function(){return this._modelType===Ge.FLOATING||this._modelType===Ge.FLOATING_SINGLE},Ge.prototype.getType=function(){return this._modelType},Ge.prototype.toString=function(){var r="UNKNOWN";return this._modelType===Ge.FLOATING?r="Floating":this._modelType===Ge.FLOATING_SINGLE?r="Floating-Single":this._modelType===Ge.FIXED&&(r="Fixed (Scale="+this.getScale()+")"),r},Ge.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var r=arguments[0];return A.isNaN(r)||this._modelType===Ge.FLOATING_SINGLE?r:this._modelType===Ge.FIXED?Math.round(r*this._scale)/this._scale:r}if(arguments[0]instanceof D){var i=arguments[0];if(this._modelType===Ge.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Ge.prototype.getMaximumSignificantDigits=function(){var r=16;return this._modelType===Ge.FLOATING?r=16:this._modelType===Ge.FLOATING_SINGLE?r=6:this._modelType===Ge.FIXED&&(r=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),r},Ge.prototype.setScale=function(r){this._scale=Math.abs(r)},Ge.prototype.interfaces_=function(){return[t,V]},Ge.prototype.getClass=function(){return Ge},Ge.mostPrecise=function(r,i){return r.compareTo(i)>=0?r:i},ys.serialVersionUID.get=function(){return 7777263578777804e3},ys.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ge,ys);var ir=function r(i){this._name=i||null,r.nameToTypeMap.put(i,this)},jo={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ir.prototype.readResolve=function(){return ir.nameToTypeMap.get(this._name)},ir.prototype.toString=function(){return this._name},ir.prototype.interfaces_=function(){return[t]},ir.prototype.getClass=function(){return ir},jo.serialVersionUID.get=function(){return-552860263173159e4},jo.nameToTypeMap.get=function(){return new ul},Object.defineProperties(ir,jo),Ge.Type=ir,Ge.FIXED=new ir("FIXED"),Ge.FLOATING=new ir("FLOATING"),Ge.FLOATING_SINGLE=new ir("FLOATING SINGLE");var Le=function r(){this._precisionModel=new Ge,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Q(arguments[0],j)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ge&&(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]))},Ai={serialVersionUID:{configurable:!0}};Le.prototype.toGeometry=function(r){return r.isNull()?this.createPoint(null):r.getMinX()===r.getMaxX()&&r.getMinY()===r.getMaxY()?this.createPoint(new D(r.getMinX(),r.getMinY())):r.getMinX()===r.getMaxX()||r.getMinY()===r.getMaxY()?this.createLineString([new D(r.getMinX(),r.getMinY()),new D(r.getMaxX(),r.getMaxY())]):this.createPolygon(this.createLinearRing([new D(r.getMinX(),r.getMinY()),new D(r.getMinX(),r.getMaxY()),new D(r.getMaxX(),r.getMaxY()),new D(r.getMaxX(),r.getMinY()),new D(r.getMinX(),r.getMinY())]),null)},Le.prototype.createLineString=function(r){return r?r instanceof Array?new vt(this.getCoordinateSequenceFactory().create(r),this):Q(r,ut)?new vt(r,this):void 0:new vt(this.getCoordinateSequenceFactory().create([]),this)},Le.prototype.createMultiLineString=function(){if(arguments.length===0)return new bi(null,this);if(arguments.length===1){var r=arguments[0];return new bi(r,this)}},Le.prototype.buildGeometry=function(r){for(var i=null,a=!1,c=!1,d=r.iterator();d.hasNext();){var v=d.next(),M=v.getClass();i===null&&(i=M),M!==i&&(a=!0),v.isGeometryCollectionOrDerived()&&(c=!0)}if(i===null)return this.createGeometryCollection();if(a||c)return this.createGeometryCollection(Le.toGeometryArray(r));var L=r.iterator().next();if(r.size()>1){if(L instanceof de)return this.createMultiPolygon(Le.toPolygonArray(r));if(L instanceof vt)return this.createMultiLineString(Le.toLineStringArray(r));if(L instanceof ue)return this.createMultiPoint(Le.toPointArray(r));Wt.shouldNeverReachHere("Unhandled class: "+L.getClass().getName())}return L},Le.prototype.createMultiPointFromCoords=function(r){return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)},Le.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];return this.createPoint(r!==null?this.getCoordinateSequenceFactory().create([r]):null)}if(Q(arguments[0],ut)){var i=arguments[0];return new ue(i,this)}}},Le.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Le.prototype.createPolygon=function(){if(arguments.length===0)return new de(null,null,this);if(arguments.length===1){if(Q(arguments[0],ut)){var r=arguments[0];return this.createPolygon(this.createLinearRing(r))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof Ae){var a=arguments[0];return this.createPolygon(a,null)}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];return new de(c,d,this)}},Le.prototype.getSRID=function(){return this._SRID},Le.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Qn(null,this);if(arguments.length===1){var r=arguments[0];return new Qn(r,this)}},Le.prototype.createGeometry=function(r){return new rn(this).edit(r,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Le.prototype.getPrecisionModel=function(){return this._precisionModel},Le.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLinearRing(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Q(arguments[0],ut)){var i=arguments[0];return new Ae(i,this)}}},Le.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Pe(null,this);if(arguments.length===1){var r=arguments[0];return new Pe(r,this)}},Le.prototype.createMultiPoint=function(){if(arguments.length===0)return new Be(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return new Be(r,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(Q(arguments[0],ut)){var a=arguments[0];if(a===null)return this.createMultiPoint(new Array(0).fill(null));for(var c=new Array(a.size()).fill(null),d=0;d<a.size();d++){var v=this.getCoordinateSequenceFactory().create(1,a.getDimension());St.copy(a,d,v,0,1),c[d]=this.createPoint(v)}return this.createMultiPoint(c)}}},Le.prototype.interfaces_=function(){return[t]},Le.prototype.getClass=function(){return Le},Le.toMultiPolygonArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toGeometryArray=function(r){if(r===null)return null;var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.getDefaultCoordinateSequenceFactory=function(){return on.instance()},Le.toMultiLineStringArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toLineStringArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toMultiPointArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toLinearRingArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toPointArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toPolygonArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.createPointFromInternalCoord=function(r,i){return i.getPrecisionModel().makePrecise(r),i.getFactory().createPoint(r)},Ai.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Le,Ai);var Ua=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],yu=function(r){this.geometryFactory=r||new Le};yu.prototype.read=function(r){var i,a=(i=typeof r=="string"?JSON.parse(r):r).type;if(!Ti[a])throw new Error("Unknown GeoJSON type: "+i.type);return Ua.indexOf(a)!==-1?Ti[a].apply(this,[i.coordinates]):a==="GeometryCollection"?Ti[a].apply(this,[i.geometries]):Ti[a].apply(this,[i])},yu.prototype.write=function(r){var i=r.getGeometryType();if(!Po[i])throw new Error("Geometry is not supported");return Po[i].apply(this,[r])};var Ti={Feature:function(r){var i={};for(var a in r)i[a]=r[a];if(r.geometry){var c=r.geometry.type;if(!Ti[c])throw new Error("Unknown GeoJSON type: "+r.type);i.geometry=this.read(r.geometry)}return r.bbox&&(i.bbox=Ti.bbox.apply(this,[r.bbox])),i},FeatureCollection:function(r){var i={};if(r.features){i.features=[];for(var a=0;a<r.features.length;++a)i.features.push(this.read(r.features[a]))}return r.bbox&&(i.bbox=this.parse.bbox.apply(this,[r.bbox])),i},coordinates:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(new D(c[0],c[1]))}return i},bbox:function(r){return this.geometryFactory.createLinearRing([new D(r[0],r[1]),new D(r[2],r[1]),new D(r[2],r[3]),new D(r[0],r[3]),new D(r[0],r[1])])},Point:function(r){var i=new D(r[0],r[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(r){for(var i=[],a=0;a<r.length;++a)i.push(Ti.Point.apply(this,[r[a]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(r){var i=Ti.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(i)},MultiLineString:function(r){for(var i=[],a=0;a<r.length;++a)i.push(Ti.LineString.apply(this,[r[a]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(r){for(var i=Ti.coordinates.apply(this,[r[0]]),a=this.geometryFactory.createLinearRing(i),c=[],d=1;d<r.length;++d){var v=r[d],M=Ti.coordinates.apply(this,[v]),L=this.geometryFactory.createLinearRing(M);c.push(L)}return this.geometryFactory.createPolygon(a,c)},MultiPolygon:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(Ti.Polygon.apply(this,[c]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(this.read(c))}return this.geometryFactory.createGeometryCollection(i)}},Po={coordinate:function(r){return[r.x,r.y]},Point:function(r){return{type:"Point",coordinates:Po.coordinate.apply(this,[r.getCoordinate()])}},MultiPoint:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.Point.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(r){for(var i=[],a=r.getCoordinates(),c=0;c<a.length;++c){var d=a[c];i.push(Po.coordinate.apply(this,[d]))}return{type:"LineString",coordinates:i}},MultiLineString:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.LineString.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(r){var i=[],a=Po.LineString.apply(this,[r._shell]);i.push(a.coordinates);for(var c=0;c<r._holes.length;++c){var d=r._holes[c],v=Po.LineString.apply(this,[d]);i.push(v.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.Polygon.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=c.getGeometryType();i.push(Po[d].apply(this,[c]))}return{type:"GeometryCollection",geometries:i}}},ll=function(r){this.geometryFactory=r||new Le,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new yu(this.geometryFactory)};ll.prototype.read=function(r){var i=this.parser.read(r);return this.precisionModel.getType()===Ge.FIXED&&this.reducePrecision(i),i},ll.prototype.reducePrecision=function(r){var i,a;if(r.coordinate)this.precisionModel.makePrecise(r.coordinate);else if(r.points)for(i=0,a=r.points.length;i<a;i++)this.precisionModel.makePrecise(r.points[i]);else if(r.geometries)for(i=0,a=r.geometries.length;i<a;i++)this.reducePrecision(r.geometries[i])};var Ba=function(){this.parser=new yu(this.geometryFactory)};Ba.prototype.write=function(r){return this.parser.write(r)};var Xt=function(){},cl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.opposite=function(r){return r===Xt.LEFT?Xt.RIGHT:r===Xt.RIGHT?Xt.LEFT:r},cl.ON.get=function(){return 0},cl.LEFT.get=function(){return 1},cl.RIGHT.get=function(){return 2},Object.defineProperties(Xt,cl),(R.prototype=new Error).name="EmptyStackException",(x.prototype=new Et).add=function(r){return this.array_.push(r),!0},x.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},x.prototype.push=function(r){return this.array_.push(r),r},x.prototype.pop=function(r){if(this.array_.length===0)throw new R;return this.array_.pop()},x.prototype.peek=function(){if(this.array_.length===0)throw new R;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(r){return this.array_.indexOf(r)},x.prototype.size=function(){return this.array_.length},x.prototype.toArray=function(){for(var r=[],i=0,a=this.array_.length;i<a;i++)r.push(this.array_[i]);return r};var Io=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Io.prototype.getCoordinate=function(){return this._minCoord},Io.prototype.getRightmostSide=function(r,i){var a=this.getRightmostSideOfSegment(r,i);return a<0&&(a=this.getRightmostSideOfSegment(r,i-1)),a<0&&(this._minCoord=null,this.checkForRightmostCoordinate(r)),a},Io.prototype.findRightmostEdgeAtVertex=function(){var r=this._minDe.getEdge().getCoordinates();Wt.isTrue(this._minIndex>0&&this._minIndex<r.length,"rightmost point expected to be interior vertex of edge");var i=r[this._minIndex-1],a=r[this._minIndex+1],c=dt.computeOrientation(this._minCoord,a,i),d=!1;(i.y<this._minCoord.y&&a.y<this._minCoord.y&&c===dt.COUNTERCLOCKWISE||i.y>this._minCoord.y&&a.y>this._minCoord.y&&c===dt.CLOCKWISE)&&(d=!0),d&&(this._minIndex=this._minIndex-1)},Io.prototype.getRightmostSideOfSegment=function(r,i){var a=r.getEdge().getCoordinates();if(i<0||i+1>=a.length||a[i].y===a[i+1].y)return-1;var c=Xt.LEFT;return a[i].y<a[i+1].y&&(c=Xt.RIGHT),c},Io.prototype.getEdge=function(){return this._orientedDe},Io.prototype.checkForRightmostCoordinate=function(r){for(var i=r.getEdge().getCoordinates(),a=0;a<i.length-1;a++)(this._minCoord===null||i[a].x>this._minCoord.x)&&(this._minDe=r,this._minIndex=a,this._minCoord=i[a])},Io.prototype.findRightmostEdgeAtNode=function(){var r=this._minDe.getNode().getEdges();this._minDe=r.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Io.prototype.findEdge=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next();a.isForward()&&this.checkForRightmostCoordinate(a)}Wt.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)===Xt.LEFT&&(this._orientedDe=this._minDe.getSym())},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Qo=function(r){function i(a,c){r.call(this,i.msgWithCoord(a,c)),this.pt=c?new D(c):null,this.name="TopologyException"}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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(a,c){return c?a:a+" [ "+c+" ]"},i}(Te),fl=function(){this.array_=[]};fl.prototype.addLast=function(r){this.array_.push(r)},fl.prototype.removeFirst=function(){return this.array_.shift()},fl.prototype.isEmpty=function(){return this.array_.length===0};var Jr=function(){this._finder=null,this._dirEdgeList=new G,this._nodes=new G,this._rightMostCoord=null,this._env=null,this._finder=new Io};Jr.prototype.clearVisitedEdges=function(){for(var r=this._dirEdgeList.iterator();r.hasNext();)r.next().setVisited(!1)},Jr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Jr.prototype.computeNodeDepth=function(r){for(var i=null,a=r.getEdges().iterator();a.hasNext();){var c=a.next();if(c.isVisited()||c.getSym().isVisited()){i=c;break}}if(i===null)throw new Qo("unable to find edge to compute depths at "+r.getCoordinate());r.getEdges().computeDepths(i);for(var d=r.getEdges().iterator();d.hasNext();){var v=d.next();v.setVisited(!0),this.copySymDepths(v)}},Jr.prototype.computeDepth=function(r){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(Xt.RIGHT,r),this.copySymDepths(i),this.computeDepths(i)},Jr.prototype.create=function(r){this.addReachable(r),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Jr.prototype.findResultEdges=function(){for(var r=this._dirEdgeList.iterator();r.hasNext();){var i=r.next();i.getDepth(Xt.RIGHT)>=1&&i.getDepth(Xt.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},Jr.prototype.computeDepths=function(r){var i=new Ue,a=new fl,c=r.getNode();for(a.addLast(c),i.add(c),r.setVisited(!0);!a.isEmpty();){var d=a.removeFirst();i.add(d),this.computeNodeDepth(d);for(var v=d.getEdges().iterator();v.hasNext();){var M=v.next().getSym();if(!M.isVisited()){var L=M.getNode();i.contains(L)||(a.addLast(L),i.add(L))}}}},Jr.prototype.compareTo=function(r){var i=r;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 r=new qt,i=this._dirEdgeList.iterator();i.hasNext();)for(var a=i.next().getEdge().getCoordinates(),c=0;c<a.length-1;c++)r.expandToInclude(a[c]);this._env=r}return this._env},Jr.prototype.addReachable=function(r){var i=new x;for(i.add(r);!i.empty();){var a=i.pop();this.add(a,i)}},Jr.prototype.copySymDepths=function(r){var i=r.getSym();i.setDepth(Xt.LEFT,r.getDepth(Xt.RIGHT)),i.setDepth(Xt.RIGHT,r.getDepth(Xt.LEFT))},Jr.prototype.add=function(r,i){r.setVisited(!0),this._nodes.add(r);for(var a=r.getEdges().iterator();a.hasNext();){var c=a.next();this._dirEdgeList.add(c);var d=c.getSym().getNode();d.isVisited()||i.push(d)}},Jr.prototype.getNodes=function(){return this._nodes},Jr.prototype.getDirectedEdges=function(){return this._dirEdgeList},Jr.prototype.interfaces_=function(){return[V]},Jr.prototype.getClass=function(){return Jr};var Zn=function r(){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 a=arguments[0];this.init(1),this.location[Xt.ON]=a}else if(arguments[0]instanceof r){var c=arguments[0];if(this.init(c.location.length),c!==null)for(var d=0;d<this.location.length;d++)this.location[d]=c.location[d]}}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this.init(3),this.location[Xt.ON]=v,this.location[Xt.LEFT]=M,this.location[Xt.RIGHT]=L}};Zn.prototype.setAllLocations=function(r){for(var i=0;i<this.location.length;i++)this.location[i]=r},Zn.prototype.isNull=function(){for(var r=0;r<this.location.length;r++)if(this.location[r]!==K.NONE)return!1;return!0},Zn.prototype.setAllLocationsIfNull=function(r){for(var i=0;i<this.location.length;i++)this.location[i]===K.NONE&&(this.location[i]=r)},Zn.prototype.isLine=function(){return this.location.length===1},Zn.prototype.merge=function(r){if(r.location.length>this.location.length){var i=new Array(3).fill(null);i[Xt.ON]=this.location[Xt.ON],i[Xt.LEFT]=K.NONE,i[Xt.RIGHT]=K.NONE,this.location=i}for(var a=0;a<this.location.length;a++)this.location[a]===K.NONE&&a<r.location.length&&(this.location[a]=r.location[a])},Zn.prototype.getLocations=function(){return this.location},Zn.prototype.flip=function(){if(this.location.length<=1)return null;var r=this.location[Xt.LEFT];this.location[Xt.LEFT]=this.location[Xt.RIGHT],this.location[Xt.RIGHT]=r},Zn.prototype.toString=function(){var r=new Lt;return this.location.length>1&&r.append(K.toLocationSymbol(this.location[Xt.LEFT])),r.append(K.toLocationSymbol(this.location[Xt.ON])),this.location.length>1&&r.append(K.toLocationSymbol(this.location[Xt.RIGHT])),r.toString()},Zn.prototype.setLocations=function(r,i,a){this.location[Xt.ON]=r,this.location[Xt.LEFT]=i,this.location[Xt.RIGHT]=a},Zn.prototype.get=function(r){return r<this.location.length?this.location[r]:K.NONE},Zn.prototype.isArea=function(){return this.location.length>1},Zn.prototype.isAnyNull=function(){for(var r=0;r<this.location.length;r++)if(this.location[r]===K.NONE)return!0;return!1},Zn.prototype.setLocation=function(){if(arguments.length===1){var r=arguments[0];this.setLocation(Xt.ON,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.location[i]=a}},Zn.prototype.init=function(r){this.location=new Array(r).fill(null),this.setAllLocations(K.NONE)},Zn.prototype.isEqualOnSide=function(r,i){return this.location[i]===r.location[i]},Zn.prototype.allPositionsEqual=function(r){for(var i=0;i<this.location.length;i++)if(this.location[i]!==r)return!1;return!0},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var On=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new Zn(i),this.elt[1]=new Zn(i)}else if(arguments[0]instanceof r){var a=arguments[0];this.elt[0]=new Zn(a.elt[0]),this.elt[1]=new Zn(a.elt[1])}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.elt[0]=new Zn(K.NONE),this.elt[1]=new Zn(K.NONE),this.elt[c].setLocation(d)}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this.elt[0]=new Zn(v,M,L),this.elt[1]=new Zn(v,M,L)}else if(arguments.length===4){var H=arguments[0],it=arguments[1],bt=arguments[2],Tt=arguments[3];this.elt[0]=new Zn(K.NONE,K.NONE,K.NONE),this.elt[1]=new Zn(K.NONE,K.NONE,K.NONE),this.elt[H].setLocations(it,bt,Tt)}};On.prototype.getGeometryCount=function(){var r=0;return this.elt[0].isNull()||r++,this.elt[1].isNull()||r++,r},On.prototype.setAllLocations=function(r,i){this.elt[r].setAllLocations(i)},On.prototype.isNull=function(r){return this.elt[r].isNull()},On.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var r=arguments[0];this.setAllLocationsIfNull(0,r),this.setAllLocationsIfNull(1,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.elt[i].setAllLocationsIfNull(a)}},On.prototype.isLine=function(r){return this.elt[r].isLine()},On.prototype.merge=function(r){for(var i=0;i<2;i++)this.elt[i]===null&&r.elt[i]!==null?this.elt[i]=new Zn(r.elt[i]):this.elt[i].merge(r.elt[i])},On.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},On.prototype.getLocation=function(){if(arguments.length===1){var r=arguments[0];return this.elt[r].get(Xt.ON)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.elt[i].get(a)}},On.prototype.toString=function(){var r=new Lt;return this.elt[0]!==null&&(r.append("A:"),r.append(this.elt[0].toString())),this.elt[1]!==null&&(r.append(" B:"),r.append(this.elt[1].toString())),r.toString()},On.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var r=arguments[0];return this.elt[r].isArea()}},On.prototype.isAnyNull=function(r){return this.elt[r].isAnyNull()},On.prototype.setLocation=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[r].setLocation(Xt.ON,i)}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this.elt[a].setLocation(c,d)}},On.prototype.isEqualOnSide=function(r,i){return this.elt[0].isEqualOnSide(r.elt[0],i)&&this.elt[1].isEqualOnSide(r.elt[1],i)},On.prototype.allPositionsEqual=function(r,i){return this.elt[r].allPositionsEqual(i)},On.prototype.toLine=function(r){this.elt[r].isArea()&&(this.elt[r]=new Zn(this.elt[r].location[0]))},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.toLineLabel=function(r){for(var i=new On(K.NONE),a=0;a<2;a++)i.setLocation(a,r.getLocation(a));return i};var Ar=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new G,this._pts=new G,this._label=new On(K.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new G,this._geometryFactory=null;var r=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(r),this.computeRing()};Ar.prototype.computeRing=function(){if(this._ring!==null)return null;for(var r=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)r[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(r),this._isHole=dt.isCCW(this._ring.getCoordinates())},Ar.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ar.prototype.computePoints=function(r){this._startDe=r;var i=r,a=!0;do{if(i===null)throw new Qo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new Qo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var c=i.getLabel();Wt.isTrue(c.isArea()),this.mergeLabel(c),this.addPoints(i.getEdge(),i.isForward(),a),a=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},Ar.prototype.getLinearRing=function(){return this._ring},Ar.prototype.getCoordinate=function(r){return this._pts.get(r)},Ar.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var r=this._startDe;do{var i=r.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),r=this.getNext(r)}while(r!==this._startDe);this._maxNodeDegree*=2},Ar.prototype.addPoints=function(r,i,a){var c=r.getCoordinates();if(i){var d=1;a&&(d=0);for(var v=d;v<c.length;v++)this._pts.add(c[v])}else{var M=c.length-2;a&&(M=c.length-1);for(var L=M;L>=0;L--)this._pts.add(c[L])}},Ar.prototype.isHole=function(){return this._isHole},Ar.prototype.setInResult=function(){var r=this._startDe;do r.getEdge().setInResult(!0),r=r.getNext();while(r!==this._startDe)},Ar.prototype.containsPoint=function(r){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(r)||!dt.isPointInRing(r,i.getCoordinates()))return!1;for(var a=this._holes.iterator();a.hasNext();)if(a.next().containsPoint(r))return!1;return!0},Ar.prototype.addHole=function(r){this._holes.add(r)},Ar.prototype.isShell=function(){return this._shell===null},Ar.prototype.getLabel=function(){return this._label},Ar.prototype.getEdges=function(){return this._edges},Ar.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ar.prototype.getShell=function(){return this._shell},Ar.prototype.mergeLabel=function(){if(arguments.length===1){var r=arguments[0];this.mergeLabel(r,0),this.mergeLabel(r,1)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=i.getLocation(a,Xt.RIGHT);if(c===K.NONE)return null;if(this._label.getLocation(a)===K.NONE)return this._label.setLocation(a,c),null}},Ar.prototype.setShell=function(r){this._shell=r,r!==null&&r.addHole(this)},Ar.prototype.toPolygon=function(r){for(var i=new Array(this._holes.size()).fill(null),a=0;a<this._holes.size();a++)i[a]=this._holes.get(a).getLinearRing();return r.createPolygon(this.getLinearRing(),i)},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var em=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(a,c){a.setMinEdgeRing(c)},i.prototype.getNext=function(a){return a.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),Bh=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var a=new G,c=this._startDe;do{if(c.getMinEdgeRing()===null){var d=new em(c,this._geometryFactory);a.add(d)}c=c.getNext()}while(c!==this._startDe);return a},i.prototype.setEdgeRing=function(a,c){a.setEdgeRing(c)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var a=this._startDe;do a.getNode().getEdges().linkMinimalDirectedEdges(this),a=a.getNext();while(a!==this._startDe)},i.prototype.getNext=function(a){return a.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),Xi=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 r=arguments[0];this._label=r}}};Xi.prototype.setVisited=function(r){this._isVisited=r},Xi.prototype.setInResult=function(r){this._isInResult=r},Xi.prototype.isCovered=function(){return this._isCovered},Xi.prototype.isCoveredSet=function(){return this._isCoveredSet},Xi.prototype.setLabel=function(r){this._label=r},Xi.prototype.getLabel=function(){return this._label},Xi.prototype.setCovered=function(r){this._isCovered=r,this._isCoveredSet=!0},Xi.prototype.updateIM=function(r){Wt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(r)},Xi.prototype.isInResult=function(){return this._isInResult},Xi.prototype.isVisited=function(){return this._isVisited},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi};var Kl=function(r){function i(){r.call(this),this._coord=null,this._edges=null;var a=arguments[0],c=arguments[1];this._coord=a,this._edges=c,this._label=new On(0,K.NONE)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var a=this.getEdges().getEdges().iterator();a.hasNext();)if(a.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(a){a.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(a){},i.prototype.computeMergedLocation=function(a,c){var d=K.NONE;if(d=this._label.getLocation(c),!a.isNull(c)){var v=a.getLocation(c);d!==K.BOUNDARY&&(d=v)}return d},i.prototype.setLabel=function(){if(arguments.length!==2)return r.prototype.setLabel.apply(this,arguments);var a=arguments[0],c=arguments[1];this._label===null?this._label=new On(a,c):this._label.setLocation(a,c)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var a=arguments[0];this.mergeLabel(a._label)}else if(arguments[0]instanceof On)for(var c=arguments[0],d=0;d<2;d++){var v=this.computeMergedLocation(c,d);this._label.getLocation(d)===K.NONE&&this._label.setLocation(d,v)}},i.prototype.add=function(a){this._edges.insert(a),a.setNode(this)},i.prototype.setLabelBoundary=function(a){if(this._label===null)return null;var c=K.NONE;this._label!==null&&(c=this._label.getLocation(a));var d=null;switch(c){case K.BOUNDARY:d=K.INTERIOR;break;case K.INTERIOR:default:d=K.BOUNDARY}this._label.setLocation(a,d)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Xi),Ro=function(){this.nodeMap=new w,this.nodeFact=null;var r=arguments[0];this.nodeFact=r};Ro.prototype.find=function(r){return this.nodeMap.get(r)},Ro.prototype.addNode=function(){if(arguments[0]instanceof D){var r=arguments[0],i=this.nodeMap.get(r);return i===null&&(i=this.nodeFact.createNode(r),this.nodeMap.put(r,i)),i}if(arguments[0]instanceof Kl){var a=arguments[0],c=this.nodeMap.get(a.getCoordinate());return c===null?(this.nodeMap.put(a.getCoordinate(),a),a):(c.mergeLabel(a),c)}},Ro.prototype.print=function(r){for(var i=this.iterator();i.hasNext();)i.next().print(r)},Ro.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ro.prototype.values=function(){return this.nodeMap.values()},Ro.prototype.getBoundaryNodes=function(r){for(var i=new G,a=this.iterator();a.hasNext();){var c=a.next();c.getLabel().getLocation(r)===K.BOUNDARY&&i.add(c)}return i},Ro.prototype.add=function(r){var i=r.getCoordinate();this.addNode(i).add(r)},Ro.prototype.interfaces_=function(){return[]},Ro.prototype.getClass=function(){return Ro};var Yn=function(){},za={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.isNorthern=function(r){return r===Yn.NE||r===Yn.NW},Yn.isOpposite=function(r,i){return r===i?!1:(r-i+4)%4===2},Yn.commonHalfPlane=function(r,i){if(r===i)return r;if((r-i+4)%4===2)return-1;var a=r<i?r:i;return a===0&&(r>i?r:i)===3?3:a},Yn.isInHalfPlane=function(r,i){return i===Yn.SE?r===Yn.SE||r===Yn.SW:r===i||r===i+1},Yn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];if(r===0&&i===0)throw new I("Cannot compute the quadrant for point ( "+r+", "+i+" )");return r>=0?i>=0?Yn.NE:Yn.SE:i>=0?Yn.NW:Yn.SW}if(arguments[0]instanceof D&&arguments[1]instanceof D){var a=arguments[0],c=arguments[1];if(c.x===a.x&&c.y===a.y)throw new I("Cannot compute the quadrant for two identical points "+a);return c.x>=a.x?c.y>=a.y?Yn.NE:Yn.SE:c.y>=a.y?Yn.NW:Yn.SW}},za.NE.get=function(){return 0},za.NW.get=function(){return 1},za.SW.get=function(){return 2},za.SE.get=function(){return 3},Object.defineProperties(Yn,za);var jr=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 r=arguments[0];this._edge=r}else if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2];this._edge=i,this.init(a,c),this._label=null}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];this._edge=d,this.init(v,M),this._label=L}};jr.prototype.compareDirection=function(r){return this._dx===r._dx&&this._dy===r._dy?0:this._quadrant>r._quadrant?1:this._quadrant<r._quadrant?-1:dt.computeOrientation(r._p0,r._p1,this._p1)},jr.prototype.getDy=function(){return this._dy},jr.prototype.getCoordinate=function(){return this._p0},jr.prototype.setNode=function(r){this._node=r},jr.prototype.print=function(r){var i=Math.atan2(this._dy,this._dx),a=this.getClass().getName(),c=a.lastIndexOf("."),d=a.substring(c+1);r.print(" "+d+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},jr.prototype.compareTo=function(r){var i=r;return this.compareDirection(i)},jr.prototype.getDirectedCoordinate=function(){return this._p1},jr.prototype.getDx=function(){return this._dx},jr.prototype.getLabel=function(){return this._label},jr.prototype.getEdge=function(){return this._edge},jr.prototype.getQuadrant=function(){return this._quadrant},jr.prototype.getNode=function(){return this._node},jr.prototype.toString=function(){var r=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),a=i.lastIndexOf(".");return" "+i.substring(a+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+r+" "+this._label},jr.prototype.computeLabel=function(r){},jr.prototype.init=function(r,i){this._p0=r,this._p1=i,this._dx=i.x-r.x,this._dy=i.y-r.y,this._quadrant=Yn.quadrant(this._dx,this._dy),Wt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},jr.prototype.interfaces_=function(){return[V]},jr.prototype.getClass=function(){return jr};var Ef=function(r){function i(){var a=arguments[0],c=arguments[1];if(r.call(this,a),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=c,c)this.init(a.getCoordinate(0),a.getCoordinate(1));else{var d=a.getNumPoints()-1;this.init(a.getCoordinate(d),a.getCoordinate(d-1))}this.computeDirectedLabel()}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(a){return this._depth[a]},i.prototype.setVisited=function(a){this._isVisited=a},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(a,c){if(this._depth[a]!==-999&&this._depth[a]!==c)throw new Qo("assigned depths do not match",this.getCoordinate());this._depth[a]=c},i.prototype.isInteriorAreaEdge=function(){for(var a=!0,c=0;c<2;c++)this._label.isArea(c)&&this._label.getLocation(c,Xt.LEFT)===K.INTERIOR&&this._label.getLocation(c,Xt.RIGHT)===K.INTERIOR||(a=!1);return a},i.prototype.setNextMin=function(a){this._nextMin=a},i.prototype.print=function(a){r.prototype.print.call(this,a),a.print(" "+this._depth[Xt.LEFT]+"/"+this._depth[Xt.RIGHT]),a.print(" ("+this.getDepthDelta()+")"),this._isInResult&&a.print(" inResult")},i.prototype.setMinEdgeRing=function(a){this._minEdgeRing=a},i.prototype.isLineEdge=function(){var a=this._label.isLine(0)||this._label.isLine(1),c=!this._label.isArea(0)||this._label.allPositionsEqual(0,K.EXTERIOR),d=!this._label.isArea(1)||this._label.allPositionsEqual(1,K.EXTERIOR);return a&&c&&d},i.prototype.setEdgeRing=function(a){this._edgeRing=a},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var a=this._edge.getDepthDelta();return this._isForward||(a=-a),a},i.prototype.setInResult=function(a){this._isInResult=a},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(a){this.print(a),a.print(" "),this._isForward?this._edge.print(a):this._edge.printReverse(a)},i.prototype.setSym=function(a){this._sym=a},i.prototype.setVisitedEdge=function(a){this.setVisited(a),this._sym.setVisited(a)},i.prototype.setEdgeDepths=function(a,c){var d=this.getEdge().getDepthDelta();this._isForward||(d=-d);var v=1;a===Xt.LEFT&&(v=-1);var M=Xt.opposite(a),L=c+d*v;this.setDepth(a,c),this.setDepth(M,L)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(a){this._next=a},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(a,c){return a===K.EXTERIOR&&c===K.INTERIOR?1:a===K.INTERIOR&&c===K.EXTERIOR?-1:0},i}(jr),vu=function(){};vu.prototype.createNode=function(r){return new Kl(r,null)},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var dr=function(){if(this._edges=new G,this._nodes=null,this._edgeEndList=new G,arguments.length===0)this._nodes=new Ro(new vu);else if(arguments.length===1){var r=arguments[0];this._nodes=new Ro(r)}};dr.prototype.printEdges=function(r){r.println("Edges:");for(var i=0;i<this._edges.size();i++){r.println("edge "+i+":");var a=this._edges.get(i);a.print(r),a.eiList.print(r)}},dr.prototype.find=function(r){return this._nodes.find(r)},dr.prototype.addNode=function(){if(arguments[0]instanceof Kl){var r=arguments[0];return this._nodes.addNode(r)}if(arguments[0]instanceof D){var i=arguments[0];return this._nodes.addNode(i)}},dr.prototype.getNodeIterator=function(){return this._nodes.iterator()},dr.prototype.linkResultDirectedEdges=function(){for(var r=this._nodes.iterator();r.hasNext();)r.next().getEdges().linkResultDirectedEdges()},dr.prototype.debugPrintln=function(r){te.out.println(r)},dr.prototype.isBoundaryNode=function(r,i){var a=this._nodes.find(i);if(a===null)return!1;var c=a.getLabel();return c!==null&&c.getLocation(r)===K.BOUNDARY},dr.prototype.linkAllDirectedEdges=function(){for(var r=this._nodes.iterator();r.hasNext();)r.next().getEdges().linkAllDirectedEdges()},dr.prototype.matchInSameDirection=function(r,i,a,c){return!!r.equals(a)&&dt.computeOrientation(r,i,c)===dt.COLLINEAR&&Yn.quadrant(r,i)===Yn.quadrant(a,c)},dr.prototype.getEdgeEnds=function(){return this._edgeEndList},dr.prototype.debugPrint=function(r){te.out.print(r)},dr.prototype.getEdgeIterator=function(){return this._edges.iterator()},dr.prototype.findEdgeInSameDirection=function(r,i){for(var a=0;a<this._edges.size();a++){var c=this._edges.get(a),d=c.getCoordinates();if(this.matchInSameDirection(r,i,d[0],d[1])||this.matchInSameDirection(r,i,d[d.length-1],d[d.length-2]))return c}return null},dr.prototype.insertEdge=function(r){this._edges.add(r)},dr.prototype.findEdgeEnd=function(r){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var a=i.next();if(a.getEdge()===r)return a}return null},dr.prototype.addEdges=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next();this._edges.add(a);var c=new Ef(a,!0),d=new Ef(a,!1);c.setSym(d),d.setSym(c),this.add(c),this.add(d)}},dr.prototype.add=function(r){this._nodes.add(r),this._edgeEndList.add(r)},dr.prototype.getNodes=function(){return this._nodes.values()},dr.prototype.findEdge=function(r,i){for(var a=0;a<this._edges.size();a++){var c=this._edges.get(a),d=c.getCoordinates();if(r.equals(d[0])&&i.equals(d[1]))return c}return null},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.linkResultDirectedEdges=function(r){for(var i=r.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Ci=function(){this._geometryFactory=null,this._shellList=new G;var r=arguments[0];this._geometryFactory=r};Ci.prototype.sortShellsAndHoles=function(r,i,a){for(var c=r.iterator();c.hasNext();){var d=c.next();d.isHole()?a.add(d):i.add(d)}},Ci.prototype.computePolygons=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next().toPolygon(this._geometryFactory);i.add(c)}return i},Ci.prototype.placeFreeHoles=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next();if(c.getShell()===null){var d=this.findEdgeRingContaining(c,r);if(d===null)throw new Qo("unable to assign hole to a shell",c.getCoordinate(0));c.setShell(d)}}},Ci.prototype.buildMinimalEdgeRings=function(r,i,a){for(var c=new G,d=r.iterator();d.hasNext();){var v=d.next();if(v.getMaxNodeDegree()>2){v.linkDirectedEdgesForMinimalEdgeRings();var M=v.buildMinimalRings(),L=this.findShell(M);L!==null?(this.placePolygonHoles(L,M),i.add(L)):a.addAll(M)}else c.add(v)}return c},Ci.prototype.containsPoint=function(r){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(r))return!0;return!1},Ci.prototype.buildMaximalEdgeRings=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next();if(c.isInResult()&&c.getLabel().isArea()&&c.getEdgeRing()===null){var d=new Bh(c,this._geometryFactory);i.add(d),d.setInResult()}}return i},Ci.prototype.placePolygonHoles=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next();c.isHole()&&c.setShell(r)}},Ci.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ci.prototype.findEdgeRingContaining=function(r,i){for(var a=r.getLinearRing(),c=a.getEnvelopeInternal(),d=a.getCoordinateN(0),v=null,M=null,L=i.iterator();L.hasNext();){var H=L.next(),it=H.getLinearRing(),bt=it.getEnvelopeInternal();v!==null&&(M=v.getLinearRing().getEnvelopeInternal());var Tt=!1;bt.contains(c)&&dt.isPointInRing(d,it.getCoordinates())&&(Tt=!0),Tt&&(v===null||M.contains(bt))&&(v=H)}return v},Ci.prototype.findShell=function(r){for(var i=0,a=null,c=r.iterator();c.hasNext();){var d=c.next();d.isHole()||(a=d,i++)}return Wt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),a},Ci.prototype.add=function(){if(arguments.length===1){var r=arguments[0];this.add(r.getEdgeEnds(),r.getNodes())}else if(arguments.length===2){var i=arguments[0],a=arguments[1];dr.linkResultDirectedEdges(a);var c=this.buildMaximalEdgeRings(i),d=new G,v=this.buildMinimalEdgeRings(c,this._shellList,d);this.sortShellsAndHoles(v,this._shellList,d),this.placeFreeHoles(this._shellList,d)}},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var or=function(){};or.prototype.getBounds=function(){},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or};var tn=function(){this._bounds=null,this._item=null;var r=arguments[0],i=arguments[1];this._bounds=r,this._item=i};tn.prototype.getItem=function(){return this._item},tn.prototype.getBounds=function(){return this._bounds},tn.prototype.interfaces_=function(){return[or,t]},tn.prototype.getClass=function(){return tn};var vs=function(){this._size=null,this._items=null,this._size=0,this._items=new G,this._items.add(null)};vs.prototype.poll=function(){if(this.isEmpty())return null;var r=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),r},vs.prototype.size=function(){return this._size},vs.prototype.reorder=function(r){for(var i=null,a=this._items.get(r);2*r<=this._size&&((i=2*r)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(a)<0);r=i)this._items.set(r,this._items.get(i));this._items.set(r,a)},vs.prototype.clear=function(){this._size=0,this._items.clear()},vs.prototype.isEmpty=function(){return this._size===0},vs.prototype.add=function(r){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,r);r.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,r)},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var Us=function(){};Us.prototype.visitItem=function(r){},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us};var Ga=function(){};Ga.prototype.insert=function(r,i){},Ga.prototype.remove=function(r,i){},Ga.prototype.query=function(){},Ga.prototype.interfaces_=function(){return[]},Ga.prototype.getClass=function(){return Ga};var Ir=function(){if(this._childBoundables=new G,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this._level=r}}},zh={serialVersionUID:{configurable:!0}};Ir.prototype.getLevel=function(){return this._level},Ir.prototype.size=function(){return this._childBoundables.size()},Ir.prototype.getChildBoundables=function(){return this._childBoundables},Ir.prototype.addChildBoundable=function(r){Wt.isTrue(this._bounds===null),this._childBoundables.add(r)},Ir.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ir.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ir.prototype.interfaces_=function(){return[or,t]},Ir.prototype.getClass=function(){return Ir},zh.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ir,zh);var ho=function(){};ho.reverseOrder=function(){return{compare:function(r,i){return i.compareTo(r)}}},ho.min=function(r){return ho.sort(r),r.get(0)},ho.sort=function(r,i){var a=r.toArray();i?nr.sort(a,i):nr.sort(a);for(var c=r.iterator(),d=0,v=a.length;d<v;d++)c.next(),c.set(a[d])},ho.singletonList=function(r){var i=new G;return i.add(r),i};var Sr=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var r=arguments[0],i=arguments[1],a=arguments[2];this._boundable1=r,this._boundable2=i,this._itemDistance=a,this._distance=this.distance()};Sr.prototype.expandToQueue=function(r,i){var a=Sr.isComposite(this._boundable1),c=Sr.isComposite(this._boundable2);if(a&&c)return Sr.area(this._boundable1)>Sr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,r,i),null):(this.expand(this._boundable2,this._boundable1,r,i),null);if(a)return this.expand(this._boundable1,this._boundable2,r,i),null;if(c)return this.expand(this._boundable2,this._boundable1,r,i),null;throw new I("neither boundable is composite")},Sr.prototype.isLeaves=function(){return!(Sr.isComposite(this._boundable1)||Sr.isComposite(this._boundable2))},Sr.prototype.compareTo=function(r){var i=r;return this._distance<i._distance?-1:this._distance>i._distance?1:0},Sr.prototype.expand=function(r,i,a,c){for(var d=r.getChildBoundables().iterator();d.hasNext();){var v=d.next(),M=new Sr(v,i,this._itemDistance);M.getDistance()<c&&a.add(M)}},Sr.prototype.getBoundable=function(r){return r===0?this._boundable1:this._boundable2},Sr.prototype.getDistance=function(){return this._distance},Sr.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Sr.prototype.interfaces_=function(){return[V]},Sr.prototype.getClass=function(){return Sr},Sr.area=function(r){return r.getBounds().getArea()},Sr.isComposite=function(r){return r instanceof Ir};var Fr=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new G,this._nodeCapacity=null,arguments.length===0){var i=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var a=arguments[0];Wt.isTrue(a>1,"Node capacity must be greater than 1"),this._nodeCapacity=a}},Ur={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Fr.prototype.getNodeCapacity=function(){return this._nodeCapacity},Fr.prototype.lastNode=function(r){return r.get(r.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 r=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Ir?r+=this.size(a):a instanceof tn&&(r+=1)}return r}},Fr.prototype.removeItem=function(r,i){for(var a=null,c=r.getChildBoundables().iterator();c.hasNext();){var d=c.next();d instanceof tn&&d.getItem()===i&&(a=d)}return a!==null&&(r.getChildBoundables().remove(a),!0)},Fr.prototype.itemsTree=function(){if(arguments.length===0){this.build();var r=this.itemsTree(this._root);return r===null?new G:r}if(arguments.length===1){for(var i=arguments[0],a=new G,c=i.getChildBoundables().iterator();c.hasNext();){var d=c.next();if(d instanceof Ir){var v=this.itemsTree(d);v!==null&&a.add(v)}else d instanceof tn?a.add(d.getItem()):Wt.shouldNeverReachHere()}return a.size()<=0?null:a}},Fr.prototype.insert=function(r,i){Wt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new tn(r,i))},Fr.prototype.boundablesAtLevel=function(){if(arguments.length===1){var r=arguments[0],i=new G;return this.boundablesAtLevel(r,this._root,i),i}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];if(Wt.isTrue(a>-2),c.getLevel()===a)return d.add(c),null;for(var v=c.getChildBoundables().iterator();v.hasNext();){var M=v.next();M instanceof Ir?this.boundablesAtLevel(a,M,d):(Wt.isTrue(M instanceof tn),a===-1&&d.add(M))}return null}},Fr.prototype.query=function(){if(arguments.length===1){var r=arguments[0];this.build();var i=new G;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i),i}if(arguments.length===2){var a=arguments[0],c=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,c)}else if(arguments.length===3){if(Q(arguments[2],Us)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir)for(var d=arguments[0],v=arguments[1],M=arguments[2],L=v.getChildBoundables(),H=0;H<L.size();H++){var it=L.get(H);this.getIntersectsOp().intersects(it.getBounds(),d)&&(it instanceof Ir?this.query(d,it,M):it instanceof tn?M.visitItem(it.getItem()):Wt.shouldNeverReachHere())}else if(Q(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir)for(var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=Tt.getChildBoundables(),le=0;le<Qt.size();le++){var Ee=Qt.get(le);this.getIntersectsOp().intersects(Ee.getBounds(),bt)&&(Ee instanceof Ir?this.query(bt,Ee,Kt):Ee instanceof tn?Kt.add(Ee.getItem()):Wt.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 r=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.remove(r,this._root,i)}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2],v=this.removeItem(c,d);if(v)return!0;for(var M=null,L=c.getChildBoundables().iterator();L.hasNext();){var H=L.next();if(this.getIntersectsOp().intersects(H.getBounds(),a)&&H instanceof Ir&&(v=this.remove(a,H,d))){M=H;break}}return M!==null&&M.getChildBoundables().isEmpty()&&c.getChildBoundables().remove(M),v}},Fr.prototype.createHigherLevels=function(r,i){Wt.isTrue(!r.isEmpty());var a=this.createParentBoundables(r,i+1);return a.size()===1?a.get(0):this.createHigherLevels(a,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 r=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var a=i.next();if(a instanceof Ir){var c=this.depth(a);c>r&&(r=c)}}return r+1}},Fr.prototype.createParentBoundables=function(r,i){Wt.isTrue(!r.isEmpty());var a=new G;a.add(this.createNode(i));var c=new G(r);ho.sort(c,this.getComparator());for(var d=c.iterator();d.hasNext();){var v=d.next();this.lastNode(a).getChildBoundables().size()===this.getNodeCapacity()&&a.add(this.createNode(i)),this.lastNode(a).addChildBoundable(v)}return a},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(r,i){return r>i?1:r<i?-1:0},Ur.IntersectsOp.get=function(){return wf},Ur.serialVersionUID.get=function(){return-3886435814360241e3},Ur.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Fr,Ur);var wf=function(){},Lo=function(){};Lo.prototype.distance=function(r,i){},Lo.prototype.interfaces_=function(){return[]},Lo.prototype.getClass=function(){return Lo};var Sf=function(r){function i(c){c=c||i.DEFAULT_NODE_CAPACITY,r.call(this,c)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={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(c,d){Wt.isTrue(c.length>0);for(var v=new G,M=0;M<c.length;M++)v.addAll(this.createParentBoundablesFromVerticalSlice(c[M],d));return v},i.prototype.createNode=function(c){return new Jl(c)},i.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return r.prototype.insert.apply(this,arguments);var c=arguments[0],d=arguments[1];if(c.isNull())return null;r.prototype.insert.call(this,c,d)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(c,d){for(var v=Math.trunc(Math.ceil(c.size()/d)),M=new Array(d).fill(null),L=c.iterator(),H=0;H<d;H++){M[H]=new G;for(var it=0;L.hasNext()&&it<v;){var bt=L.next();M[H].add(bt),it++}}return M},i.prototype.query=function(){if(arguments.length===1){var c=arguments[0];return r.prototype.query.call(this,c)}if(arguments.length===2){var d=arguments[0],v=arguments[1];r.prototype.query.call(this,d,v)}else if(arguments.length===3){if(Q(arguments[2],Us)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir){var M=arguments[0],L=arguments[1],H=arguments[2];r.prototype.query.call(this,M,L,H)}else if(Q(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir){var it=arguments[0],bt=arguments[1],Tt=arguments[2];r.prototype.query.call(this,it,bt,Tt)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(c,d){return r.prototype.createParentBoundables.call(this,c,d)},i.prototype.remove=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return r.prototype.remove.call(this,c,d)}return r.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(c,d){Wt.isTrue(!c.isEmpty());var v=Math.trunc(Math.ceil(c.size()/this.getNodeCapacity())),M=new G(c);ho.sort(M,i.xComparator);var L=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(v))));return this.createParentBoundablesFromVerticalSlices(L,d)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(Q(arguments[0],Lo)){var c=arguments[0],d=new Sr(this.getRoot(),this.getRoot(),c);return this.nearestNeighbour(d)}if(arguments[0]instanceof Sr){var v=arguments[0];return this.nearestNeighbour(v,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&Q(arguments[1],Lo)){var M=arguments[0],L=arguments[1],H=new Sr(this.getRoot(),M.getRoot(),L);return this.nearestNeighbour(H)}if(arguments[0]instanceof Sr&&typeof arguments[1]=="number"){var it=arguments[0],bt=arguments[1],Tt=null,Kt=new vs;for(Kt.add(it);!Kt.isEmpty()&&bt>0;){var Qt=Kt.poll(),le=Qt.getDistance();if(le>=bt)break;Qt.isLeaves()?(bt=le,Tt=Qt):Qt.expandToQueue(Kt,bt)}return[Tt.getBoundable(0).getItem(),Tt.getBoundable(1).getItem()]}}else if(arguments.length===3){var Ee=arguments[0],Dn=arguments[1],Jn=arguments[2],fi=new tn(Ee,Dn),as=new Sr(this.getRoot(),fi,Jn);return this.nearestNeighbour(as)[0]}},i.prototype.interfaces_=function(){return[Ga,t]},i.prototype.getClass=function(){return i},i.centreX=function(c){return i.avg(c.getMinX(),c.getMaxX())},i.avg=function(c,d){return(c+d)/2},i.centreY=function(c){return i.avg(c.getMinY(),c.getMaxY())},a.STRtreeNode.get=function(){return Jl},a.serialVersionUID.get=function(){return 0x39920f7d5f261e0},a.xComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(c,d){return r.compareDoubles(i.centreX(c.getBounds()),i.centreX(d.getBounds()))}}},a.yComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(c,d){return r.compareDoubles(i.centreY(c.getBounds()),i.centreY(d.getBounds()))}}},a.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(c,d){return c.intersects(d)}}},a.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,a),i}(Fr),Jl=function(r){function i(){var a=arguments[0];r.call(this,a)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var a=null,c=this.getChildBoundables().iterator();c.hasNext();){var d=c.next();a===null?a=new qt(d.getBounds()):a.expandToInclude(d.getBounds())}return a},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ir),lr=function(){};lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.relativeSign=function(r,i){return r<i?-1:r>i?1:0},lr.compare=function(r,i,a){if(i.equals2D(a))return 0;var c=lr.relativeSign(i.x,a.x),d=lr.relativeSign(i.y,a.y);switch(r){case 0:return lr.compareValue(c,d);case 1:return lr.compareValue(d,c);case 2:return lr.compareValue(d,-c);case 3:return lr.compareValue(-c,d);case 4:return lr.compareValue(-c,-d);case 5:return lr.compareValue(-d,-c);case 6:return lr.compareValue(-d,c);case 7:return lr.compareValue(c,-d)}return Wt.shouldNeverReachHere("invalid octant value"),0},lr.compareValue=function(r,i){return r<0?-1:r>0?1:i<0?-1:i>0?1:0};var _s=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this._segString=r,this.coord=new D(i),this.segmentIndex=a,this._segmentOctant=c,this._isInterior=!i.equals2D(r.getCoordinate(a))};_s.prototype.getCoordinate=function(){return this.coord},_s.prototype.print=function(r){r.print(this.coord),r.print(" seg # = "+this.segmentIndex)},_s.prototype.compareTo=function(r){var i=r;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:lr.compare(this._segmentOctant,this.coord,i.coord)},_s.prototype.isEndPoint=function(r){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===r},_s.prototype.isInterior=function(){return this._isInterior},_s.prototype.interfaces_=function(){return[V]},_s.prototype.getClass=function(){return _s};var Qr=function(){this._nodeMap=new w,this._edge=null;var r=arguments[0];this._edge=r};Qr.prototype.getSplitCoordinates=function(){var r=new et;this.addEndpoints();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next();this.addEdgeCoordinates(a,c,r),a=c}return r.toCoordinateArray()},Qr.prototype.addCollapsedNodes=function(){var r=new G;this.findCollapsesFromInsertedNodes(r),this.findCollapsesFromExistingVertices(r);for(var i=r.iterator();i.hasNext();){var a=i.next().intValue();this.add(this._edge.getCoordinate(a),a)}},Qr.prototype.print=function(r){r.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(r)},Qr.prototype.findCollapsesFromExistingVertices=function(r){for(var i=0;i<this._edge.size()-2;i++){var a=this._edge.getCoordinate(i),c=this._edge.getCoordinate(i+2);a.equals2D(c)&&r.add(new pt(i+1))}},Qr.prototype.addEdgeCoordinates=function(r,i,a){var c=this._edge.getCoordinate(i.segmentIndex),d=i.isInterior()||!i.coord.equals2D(c);a.add(new D(r.coord),!1);for(var v=r.segmentIndex+1;v<=i.segmentIndex;v++)a.add(this._edge.getCoordinate(v));d&&a.add(new D(i.coord))},Qr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qr.prototype.addSplitEdges=function(r){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next(),d=this.createSplitEdge(a,c);r.add(d),a=c}},Qr.prototype.findCollapseIndex=function(r,i,a){if(!r.coord.equals2D(i.coord))return!1;var c=i.segmentIndex-r.segmentIndex;return i.isInterior()||c--,c===1&&(a[0]=r.segmentIndex+1,!0)},Qr.prototype.findCollapsesFromInsertedNodes=function(r){for(var i=new Array(1).fill(null),a=this.iterator(),c=a.next();a.hasNext();){var d=a.next();this.findCollapseIndex(c,d,i)&&r.add(new pt(i[0])),c=d}},Qr.prototype.getEdge=function(){return this._edge},Qr.prototype.addEndpoints=function(){var r=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(r),r)},Qr.prototype.createSplitEdge=function(r,i){var a=i.segmentIndex-r.segmentIndex+2,c=this._edge.getCoordinate(i.segmentIndex),d=i.isInterior()||!i.coord.equals2D(c);d||a--;var v=new Array(a).fill(null),M=0;v[M++]=new D(r.coord);for(var L=r.segmentIndex+1;L<=i.segmentIndex;L++)v[M++]=this._edge.getCoordinate(L);return d&&(v[M]=new D(i.coord)),new mr(v,this._edge.getData())},Qr.prototype.add=function(r,i){var a=new _s(this._edge,r,i,this._edge.getSegmentOctant(i)),c=this._nodeMap.get(a);return c!==null?(Wt.isTrue(c.coord.equals2D(r),"Found equal nodes with different coordinates"),c):(this._nodeMap.put(a,a),a)},Qr.prototype.checkSplitEdgesCorrectness=function(r){var i=this._edge.getCoordinates(),a=r.get(0).getCoordinate(0);if(!a.equals2D(i[0]))throw new Te("bad split edge start point at "+a);var c=r.get(r.size()-1).getCoordinates(),d=c[c.length-1];if(!d.equals2D(i[i.length-1]))throw new Te("bad split edge end point at "+d)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var ua=function(){};ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua},ua.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];if(r===0&&i===0)throw new I("Cannot compute the octant for point ( "+r+", "+i+" )");var a=Math.abs(r),c=Math.abs(i);return r>=0?i>=0?a>=c?0:1:a>=c?7:6:i>=0?a>=c?3:2:a>=c?4:5}if(arguments[0]instanceof D&&arguments[1]instanceof D){var d=arguments[0],v=arguments[1],M=v.x-d.x,L=v.y-d.y;if(M===0&&L===0)throw new I("Cannot compute the octant for two identical points "+d);return ua.octant(M,L)}};var No=function(){};No.prototype.getCoordinates=function(){},No.prototype.size=function(){},No.prototype.getCoordinate=function(r){},No.prototype.isClosed=function(){},No.prototype.setData=function(r){},No.prototype.getData=function(){},No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No};var _u=function(){};_u.prototype.addIntersection=function(r,i){},_u.prototype.interfaces_=function(){return[No]},_u.prototype.getClass=function(){return _u};var mr=function(){this._nodeList=new Qr(this),this._pts=null,this._data=null;var r=arguments[0],i=arguments[1];this._pts=r,this._data=i};mr.prototype.getCoordinates=function(){return this._pts},mr.prototype.size=function(){return this._pts.length},mr.prototype.getCoordinate=function(r){return this._pts[r]},mr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},mr.prototype.getSegmentOctant=function(r){return r===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(r),this.getCoordinate(r+1))},mr.prototype.setData=function(r){this._data=r},mr.prototype.safeOctant=function(r,i){return r.equals2D(i)?0:ua.octant(r,i)},mr.prototype.getData=function(){return this._data},mr.prototype.addIntersection=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this.addIntersectionNode(r,i)}else if(arguments.length===4){var a=arguments[0],c=arguments[1],d=arguments[3],v=new D(a.getIntersection(d));this.addIntersection(v,c)}},mr.prototype.toString=function(){return fe.toLineString(new ye(this._pts))},mr.prototype.getNodeList=function(){return this._nodeList},mr.prototype.addIntersectionNode=function(r,i){var a=i,c=a+1;if(c<this._pts.length){var d=this._pts[c];r.equals2D(d)&&(a=c)}return this._nodeList.add(r,a)},mr.prototype.addIntersections=function(r,i,a){for(var c=0;c<r.getIntersectionNum();c++)this.addIntersection(r,i,a,c)},mr.prototype.interfaces_=function(){return[_u]},mr.prototype.getClass=function(){return mr},mr.getNodedSubstrings=function(){if(arguments.length===1){var r=arguments[0],i=new G;return mr.getNodedSubstrings(r,i),i}if(arguments.length===2)for(var a=arguments[0],c=arguments[1],d=a.iterator();d.hasNext();)d.next().getNodeList().addSplitEdges(c)};var ie=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 r=arguments[0];this.p0=new D(r.p0),this.p1=new D(r.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],a=arguments[1],c=arguments[2],d=arguments[3];this.p0=new D(i,a),this.p1=new D(c,d)}},Gh={serialVersionUID:{configurable:!0}};ie.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ie.prototype.orientationIndex=function(){if(arguments[0]instanceof ie){var r=arguments[0],i=dt.orientationIndex(this.p0,this.p1,r.p0),a=dt.orientationIndex(this.p0,this.p1,r.p1);return i>=0&&a>=0||i<=0&&a<=0?Math.max(i,a):0}if(arguments[0]instanceof D){var c=arguments[0];return dt.orientationIndex(this.p0,this.p1,c)}},ie.prototype.toGeometry=function(r){return r.createLineString([this.p0,this.p1])},ie.prototype.isVertical=function(){return this.p0.x===this.p1.x},ie.prototype.equals=function(r){if(!(r instanceof ie))return!1;var i=r;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},ie.prototype.intersection=function(r){var i=new z;return i.computeIntersection(this.p0,this.p1,r.p0,r.p1),i.hasIntersection()?i.getIntersection(0):null},ie.prototype.project=function(){if(arguments[0]instanceof D){var r=arguments[0];if(r.equals(this.p0)||r.equals(this.p1))return new D(r);var i=this.projectionFactor(r),a=new D;return a.x=this.p0.x+i*(this.p1.x-this.p0.x),a.y=this.p0.y+i*(this.p1.y-this.p0.y),a}if(arguments[0]instanceof ie){var c=arguments[0],d=this.projectionFactor(c.p0),v=this.projectionFactor(c.p1);if(d>=1&&v>=1||d<=0&&v<=0)return null;var M=this.project(c.p0);d<0&&(M=this.p0),d>1&&(M=this.p1);var L=this.project(c.p1);return v<0&&(L=this.p0),v>1&&(L=this.p1),new ie(M,L)}},ie.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ie.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ie.prototype.getCoordinate=function(r){return r===0?this.p0:this.p1},ie.prototype.distancePerpendicular=function(r){return dt.distancePointLinePerpendicular(r,this.p0,this.p1)},ie.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ie.prototype.midPoint=function(){return ie.midPoint(this.p0,this.p1)},ie.prototype.projectionFactor=function(r){if(r.equals(this.p0))return 0;if(r.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,c=i*i+a*a;return c<=0?A.NaN:((r.x-this.p0.x)*i+(r.y-this.p0.y)*a)/c},ie.prototype.closestPoints=function(r){var i=this.intersection(r);if(i!==null)return[i,i];var a=new Array(2).fill(null),c=A.MAX_VALUE,d=null,v=this.closestPoint(r.p0);c=v.distance(r.p0),a[0]=v,a[1]=r.p0;var M=this.closestPoint(r.p1);(d=M.distance(r.p1))<c&&(c=d,a[0]=M,a[1]=r.p1);var L=r.closestPoint(this.p0);(d=L.distance(this.p0))<c&&(c=d,a[0]=this.p0,a[1]=L);var H=r.closestPoint(this.p1);return(d=H.distance(this.p1))<c&&(c=d,a[0]=this.p1,a[1]=H),a},ie.prototype.closestPoint=function(r){var i=this.projectionFactor(r);return i>0&&i<1?this.project(r):this.p0.distance(r)<this.p1.distance(r)?this.p0:this.p1},ie.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ie.prototype.getLength=function(){return this.p0.distance(this.p1)},ie.prototype.compareTo=function(r){var i=r,a=this.p0.compareTo(i.p0);return a!==0?a:this.p1.compareTo(i.p1)},ie.prototype.reverse=function(){var r=this.p0;this.p0=this.p1,this.p1=r},ie.prototype.equalsTopo=function(r){return this.p0.equals(r.p0)&&(this.p1.equals(r.p1)||this.p0.equals(r.p1))&&this.p1.equals(r.p0)},ie.prototype.lineIntersection=function(r){try{return $t.intersection(this.p0,this.p1,r.p0,r.p1)}catch(i){if(!(i instanceof ce))throw i}return null},ie.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ie.prototype.pointAlongOffset=function(r,i){var a=this.p0.x+r*(this.p1.x-this.p0.x),c=this.p0.y+r*(this.p1.y-this.p0.y),d=this.p1.x-this.p0.x,v=this.p1.y-this.p0.y,M=Math.sqrt(d*d+v*v),L=0,H=0;if(i!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");L=i*d/M,H=i*v/M}return new D(a-H,c+L)},ie.prototype.setCoordinates=function(){if(arguments.length===1){var r=arguments[0];this.setCoordinates(r.p0,r.p1)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=a.x,this.p1.y=a.y}},ie.prototype.segmentFraction=function(r){var i=this.projectionFactor(r);return i<0?i=0:(i>1||A.isNaN(i))&&(i=1),i},ie.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ie.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ie.prototype.distance=function(){if(arguments[0]instanceof ie){var r=arguments[0];return dt.distanceLineLine(this.p0,this.p1,r.p0,r.p1)}if(arguments[0]instanceof D){var i=arguments[0];return dt.distancePointLine(i,this.p0,this.p1)}},ie.prototype.pointAlong=function(r){var i=new D;return i.x=this.p0.x+r*(this.p1.x-this.p0.x),i.y=this.p0.y+r*(this.p1.y-this.p0.y),i},ie.prototype.hashCode=function(){var r=A.doubleToLongBits(this.p0.x);r^=31*A.doubleToLongBits(this.p0.y);var i=Math.trunc(r)^Math.trunc(r>>32),a=A.doubleToLongBits(this.p1.x);return a^=31*A.doubleToLongBits(this.p1.y),i^(Math.trunc(a)^Math.trunc(a>>32))},ie.prototype.interfaces_=function(){return[V,t]},ie.prototype.getClass=function(){return ie},ie.midPoint=function(r,i){return new D((r.x+i.x)/2,(r.y+i.y)/2)},Gh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ie,Gh);var Pi=function(){this.tempEnv1=new qt,this.tempEnv2=new qt,this._overlapSeg1=new ie,this._overlapSeg2=new ie};Pi.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];r.getLineSegment(i,this._overlapSeg1),a.getLineSegment(c,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ii=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this._pts=r,this._start=i,this._end=a,this._context=c};Ii.prototype.getLineSegment=function(r,i){i.p0=this._pts[r],i.p1=this._pts[r+1]},Ii.prototype.computeSelect=function(r,i,a,c){var d=this._pts[i],v=this._pts[a];if(c.tempEnv1.init(d,v),a-i==1)return c.select(this,i),null;if(!r.intersects(c.tempEnv1))return null;var M=Math.trunc((i+a)/2);i<M&&this.computeSelect(r,i,M,c),M<a&&this.computeSelect(r,M,a,c)},Ii.prototype.getCoordinates=function(){for(var r=new Array(this._end-this._start+1).fill(null),i=0,a=this._start;a<=this._end;a++)r[i++]=this._pts[a];return r},Ii.prototype.computeOverlaps=function(r,i){this.computeOverlapsInternal(this._start,this._end,r,r._start,r._end,i)},Ii.prototype.setId=function(r){this._id=r},Ii.prototype.select=function(r,i){this.computeSelect(r,this._start,this._end,i)},Ii.prototype.getEnvelope=function(){if(this._env===null){var r=this._pts[this._start],i=this._pts[this._end];this._env=new qt(r,i)}return this._env},Ii.prototype.getEndIndex=function(){return this._end},Ii.prototype.getStartIndex=function(){return this._start},Ii.prototype.getContext=function(){return this._context},Ii.prototype.getId=function(){return this._id},Ii.prototype.computeOverlapsInternal=function(r,i,a,c,d,v){var M=this._pts[r],L=this._pts[i],H=a._pts[c],it=a._pts[d];if(i-r==1&&d-c==1)return v.overlap(this,r,a,c),null;if(v.tempEnv1.init(M,L),v.tempEnv2.init(H,it),!v.tempEnv1.intersects(v.tempEnv2))return null;var bt=Math.trunc((r+i)/2),Tt=Math.trunc((c+d)/2);r<bt&&(c<Tt&&this.computeOverlapsInternal(r,bt,a,c,Tt,v),Tt<d&&this.computeOverlapsInternal(r,bt,a,Tt,d,v)),bt<i&&(c<Tt&&this.computeOverlapsInternal(bt,i,a,c,Tt,v),Tt<d&&this.computeOverlapsInternal(bt,i,a,Tt,d,v))},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var po=function(){};po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},po.getChainStartIndices=function(r){var i=0,a=new G;a.add(new pt(i));do{var c=po.findChainEnd(r,i);a.add(new pt(c)),i=c}while(i<r.length-1);return po.toIntArray(a)},po.findChainEnd=function(r,i){for(var a=i;a<r.length-1&&r[a].equals2D(r[a+1]);)a++;if(a>=r.length-1)return r.length-1;for(var c=Yn.quadrant(r[a],r[a+1]),d=i+1;d<r.length&&!(!r[d-1].equals2D(r[d])&&Yn.quadrant(r[d-1],r[d])!==c);)d++;return d-1},po.getChains=function(){if(arguments.length===1){var r=arguments[0];return po.getChains(r,null)}if(arguments.length===2){for(var i=arguments[0],a=arguments[1],c=new G,d=po.getChainStartIndices(i),v=0;v<d.length-1;v++){var M=new Ii(i,d[v],d[v+1],a);c.add(M)}return c}},po.toIntArray=function(r){for(var i=new Array(r.size()).fill(null),a=0;a<i.length;a++)i[a]=r.get(a).intValue();return i};var Yi=function(){};Yi.prototype.computeNodes=function(r){},Yi.prototype.getNodedSubstrings=function(){},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi};var la=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.setSegmentIntersector(r)}}};la.prototype.setSegmentIntersector=function(r){this._segInt=r},la.prototype.interfaces_=function(){return[Yi]},la.prototype.getClass=function(){return la};var hl=function(r){function i(c){c?r.call(this,c):r.call(this),this._monoChains=new G,this._index=new Sf,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return mr.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(c){for(var d=po.getChains(c.getCoordinates(),c).iterator();d.hasNext();){var v=d.next();v.setId(this._idCounter++),this._index.insert(v.getEnvelope(),v),this._monoChains.add(v)}},i.prototype.computeNodes=function(c){this._nodedSegStrings=c;for(var d=c.iterator();d.hasNext();)this.add(d.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var c=new Mr(this._segInt),d=this._monoChains.iterator();d.hasNext();)for(var v=d.next(),M=this._index.query(v.getEnvelope()).iterator();M.hasNext();){var L=M.next();if(L.getId()>v.getId()&&(v.computeOverlaps(L,c),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},a.SegmentOverlapAction.get=function(){return Mr},Object.defineProperties(i,a),i}(la),Mr=function(r){function i(){r.call(this),this._si=null;var a=arguments[0];this._si=a}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return r.prototype.overlap.apply(this,arguments);var a=arguments[0],c=arguments[1],d=arguments[2],v=arguments[3],M=a.getContext(),L=d.getContext();this._si.processIntersections(M,c,L,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Pi),ke=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this.setQuadrantSegments(a),this.setEndCapStyle(c)}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];this.setQuadrantSegments(d),this.setEndCapStyle(v),this.setJoinStyle(M),this.setMitreLimit(L)}}},Oo={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}};ke.prototype.getEndCapStyle=function(){return this._endCapStyle},ke.prototype.isSingleSided=function(){return this._isSingleSided},ke.prototype.setQuadrantSegments=function(r){this._quadrantSegments=r,this._quadrantSegments===0&&(this._joinStyle=ke.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=ke.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),r<=0&&(this._quadrantSegments=1),this._joinStyle!==ke.JOIN_ROUND&&(this._quadrantSegments=ke.DEFAULT_QUADRANT_SEGMENTS)},ke.prototype.getJoinStyle=function(){return this._joinStyle},ke.prototype.setJoinStyle=function(r){this._joinStyle=r},ke.prototype.setSimplifyFactor=function(r){this._simplifyFactor=r<0?0:r},ke.prototype.getSimplifyFactor=function(){return this._simplifyFactor},ke.prototype.getQuadrantSegments=function(){return this._quadrantSegments},ke.prototype.setEndCapStyle=function(r){this._endCapStyle=r},ke.prototype.getMitreLimit=function(){return this._mitreLimit},ke.prototype.setMitreLimit=function(r){this._mitreLimit=r},ke.prototype.setSingleSided=function(r){this._isSingleSided=r},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.bufferDistanceError=function(r){var i=Math.PI/2/r;return 1-Math.cos(i/2)},Oo.CAP_ROUND.get=function(){return 1},Oo.CAP_FLAT.get=function(){return 2},Oo.CAP_SQUARE.get=function(){return 3},Oo.JOIN_ROUND.get=function(){return 1},Oo.JOIN_MITRE.get=function(){return 2},Oo.JOIN_BEVEL.get=function(){return 3},Oo.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Oo.DEFAULT_MITRE_LIMIT.get=function(){return 5},Oo.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(ke,Oo);var yr=function(r){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=dt.COUNTERCLOCKWISE,this._inputLine=r||null},ka={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};yr.prototype.isDeletable=function(r,i,a,c){var d=this._inputLine[r],v=this._inputLine[i],M=this._inputLine[a];return!!this.isConcave(d,v,M)&&!!this.isShallow(d,v,M,c)&&this.isShallowSampled(d,v,r,a,c)},yr.prototype.deleteShallowConcavities=function(){for(var r=1,i=this.findNextNonDeletedIndex(r),a=this.findNextNonDeletedIndex(i),c=!1;a<this._inputLine.length;){var d=!1;this.isDeletable(r,i,a,this._distanceTol)&&(this._isDeleted[i]=yr.DELETE,d=!0,c=!0),r=d?a:i,i=this.findNextNonDeletedIndex(r),a=this.findNextNonDeletedIndex(i)}return c},yr.prototype.isShallowConcavity=function(r,i,a,c){return dt.computeOrientation(r,i,a)!==this._angleOrientation?!1:dt.distancePointLine(i,r,a)<c},yr.prototype.isShallowSampled=function(r,i,a,c,d){var v=Math.trunc((c-a)/yr.NUM_PTS_TO_CHECK);v<=0&&(v=1);for(var M=a;M<c;M+=v)if(!this.isShallow(r,i,this._inputLine[M],d))return!1;return!0},yr.prototype.isConcave=function(r,i,a){var c=dt.computeOrientation(r,i,a)===this._angleOrientation;return c},yr.prototype.simplify=function(r){this._distanceTol=Math.abs(r),r<0&&(this._angleOrientation=dt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},yr.prototype.findNextNonDeletedIndex=function(r){for(var i=r+1;i<this._inputLine.length&&this._isDeleted[i]===yr.DELETE;)i++;return i},yr.prototype.isShallow=function(r,i,a,c){return dt.distancePointLine(i,r,a)<c},yr.prototype.collapseLine=function(){for(var r=new et,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==yr.DELETE&&r.add(this._inputLine[i]);return r.toCoordinateArray()},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.simplify=function(r,i){return new yr(r).simplify(i)},ka.INIT.get=function(){return 0},ka.DELETE.get=function(){return 1},ka.KEEP.get=function(){return 1},ka.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(yr,ka);var $i=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new G},kh={COORDINATE_ARRAY_TYPE:{configurable:!0}};$i.prototype.getCoordinates=function(){return this._ptList.toArray($i.COORDINATE_ARRAY_TYPE)},$i.prototype.setPrecisionModel=function(r){this._precisionModel=r},$i.prototype.addPt=function(r){var i=new D(r);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},$i.prototype.revere=function(){},$i.prototype.addPts=function(r,i){if(i)for(var a=0;a<r.length;a++)this.addPt(r[a]);else for(var c=r.length-1;c>=0;c--)this.addPt(r[c])},$i.prototype.isRedundant=function(r){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return r.distance(i)<this._minimimVertexDistance},$i.prototype.toString=function(){return new Le().createLineString(this.getCoordinates()).toString()},$i.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var r=new D(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(r.equals(i))return null;this._ptList.add(r)},$i.prototype.setMinimumVertexDistance=function(r){this._minimimVertexDistance=r},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},kh.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties($i,kh);var Ve=function(){},ca={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.toDegrees=function(r){return 180*r/Math.PI},Ve.normalize=function(r){for(;r>Math.PI;)r-=Ve.PI_TIMES_2;for(;r<=-Math.PI;)r+=Ve.PI_TIMES_2;return r},Ve.angle=function(){if(arguments.length===1){var r=arguments[0];return Math.atan2(r.y,r.x)}if(arguments.length===2){var i=arguments[0],a=arguments[1],c=a.x-i.x,d=a.y-i.y;return Math.atan2(d,c)}},Ve.isAcute=function(r,i,a){var c=r.x-i.x,d=r.y-i.y;return c*(a.x-i.x)+d*(a.y-i.y)>0},Ve.isObtuse=function(r,i,a){var c=r.x-i.x,d=r.y-i.y;return c*(a.x-i.x)+d*(a.y-i.y)<0},Ve.interiorAngle=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a);return Math.abs(d-c)},Ve.normalizePositive=function(r){if(r<0){for(;r<0;)r+=Ve.PI_TIMES_2;r>=Ve.PI_TIMES_2&&(r=0)}else{for(;r>=Ve.PI_TIMES_2;)r-=Ve.PI_TIMES_2;r<0&&(r=0)}return r},Ve.angleBetween=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a);return Ve.diff(c,d)},Ve.diff=function(r,i){var a=null;return(a=r<i?i-r:r-i)>Math.PI&&(a=2*Math.PI-a),a},Ve.toRadians=function(r){return r*Math.PI/180},Ve.getTurn=function(r,i){var a=Math.sin(i-r);return a>0?Ve.COUNTERCLOCKWISE:a<0?Ve.CLOCKWISE:Ve.NONE},Ve.angleBetweenOriented=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a)-c;return d<=-Math.PI?d+Ve.PI_TIMES_2:d>Math.PI?d-Ve.PI_TIMES_2:d},ca.PI_TIMES_2.get=function(){return 2*Math.PI},ca.PI_OVER_2.get=function(){return Math.PI/2},ca.PI_OVER_4.get=function(){return Math.PI/4},ca.COUNTERCLOCKWISE.get=function(){return dt.COUNTERCLOCKWISE},ca.CLOCKWISE.get=function(){return dt.CLOCKWISE},ca.NONE.get=function(){return dt.COLLINEAR},Object.defineProperties(Ve,ca);var Kn=function r(){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 ie,this._seg1=new ie,this._offset0=new ie,this._offset1=new ie,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],a=arguments[1],c=arguments[2];this._precisionModel=i,this._bufParams=a,this._li=new z,this._filletAngleQuantum=Math.PI/2/a.getQuadrantSegments(),a.getQuadrantSegments()>=8&&a.getJoinStyle()===ke.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(c)},xs={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}};Kn.prototype.addNextSegment=function(r,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=r,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 a=dt.computeOrientation(this._s0,this._s1,this._s2),c=a===dt.CLOCKWISE&&this._side===Xt.LEFT||a===dt.COUNTERCLOCKWISE&&this._side===Xt.RIGHT;a===0?this.addCollinear(i):c?this.addOutsideTurn(a,i):this.addInsideTurn(a,i)},Kn.prototype.addLineEndCap=function(r,i){var a=new ie(r,i),c=new ie;this.computeOffsetSegment(a,Xt.LEFT,this._distance,c);var d=new ie;this.computeOffsetSegment(a,Xt.RIGHT,this._distance,d);var v=i.x-r.x,M=i.y-r.y,L=Math.atan2(M,v);switch(this._bufParams.getEndCapStyle()){case ke.CAP_ROUND:this._segList.addPt(c.p1),this.addFilletArc(i,L+Math.PI/2,L-Math.PI/2,dt.CLOCKWISE,this._distance),this._segList.addPt(d.p1);break;case ke.CAP_FLAT:this._segList.addPt(c.p1),this._segList.addPt(d.p1);break;case ke.CAP_SQUARE:var H=new D;H.x=Math.abs(this._distance)*Math.cos(L),H.y=Math.abs(this._distance)*Math.sin(L);var it=new D(c.p1.x+H.x,c.p1.y+H.y),bt=new D(d.p1.x+H.x,d.p1.y+H.y);this._segList.addPt(it),this._segList.addPt(bt)}},Kn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Kn.prototype.addMitreJoin=function(r,i,a,c){var d=!0,v=null;try{v=$t.intersection(i.p0,i.p1,a.p0,a.p1),(c<=0?1:v.distance(r)/Math.abs(c))>this._bufParams.getMitreLimit()&&(d=!1)}catch(M){if(!(M instanceof ce))throw M;v=new D(0,0),d=!1}d?this._segList.addPt(v):this.addLimitedMitreJoin(i,a,c,this._bufParams.getMitreLimit())},Kn.prototype.addFilletCorner=function(r,i,a,c,d){var v=i.x-r.x,M=i.y-r.y,L=Math.atan2(M,v),H=a.x-r.x,it=a.y-r.y,bt=Math.atan2(it,H);c===dt.CLOCKWISE?L<=bt&&(L+=2*Math.PI):L>=bt&&(L-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(r,L,bt,c,d),this._segList.addPt(a)},Kn.prototype.addOutsideTurn=function(r,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Kn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===ke.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===ke.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,r,this._distance),this._segList.addPt(this._offset1.p0))},Kn.prototype.createSquare=function(r){this._segList.addPt(new D(r.x+this._distance,r.y+this._distance)),this._segList.addPt(new D(r.x+this._distance,r.y-this._distance)),this._segList.addPt(new D(r.x-this._distance,r.y-this._distance)),this._segList.addPt(new D(r.x-this._distance,r.y+this._distance)),this._segList.closeRing()},Kn.prototype.addSegments=function(r,i){this._segList.addPts(r,i)},Kn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Kn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Kn.prototype.initSideSegments=function(r,i,a){this._s1=r,this._s2=i,this._side=a,this._seg1.setCoordinates(r,i),this.computeOffsetSegment(this._seg1,a,this._distance,this._offset1)},Kn.prototype.addLimitedMitreJoin=function(r,i,a,c){var d=this._seg0.p1,v=Ve.angle(d,this._seg0.p0),M=Ve.angleBetweenOriented(this._seg0.p0,d,this._seg1.p1)/2,L=Ve.normalize(v+M),H=Ve.normalize(L+Math.PI),it=c*a,bt=a-it*Math.abs(Math.sin(M)),Tt=d.x+it*Math.cos(H),Kt=d.y+it*Math.sin(H),Qt=new D(Tt,Kt),le=new ie(d,Qt),Ee=le.pointAlongOffset(1,bt),Dn=le.pointAlongOffset(1,-bt);this._side===Xt.LEFT?(this._segList.addPt(Ee),this._segList.addPt(Dn)):(this._segList.addPt(Dn),this._segList.addPt(Ee))},Kn.prototype.computeOffsetSegment=function(r,i,a,c){var d=i===Xt.LEFT?1:-1,v=r.p1.x-r.p0.x,M=r.p1.y-r.p0.y,L=Math.sqrt(v*v+M*M),H=d*a*v/L,it=d*a*M/L;c.p0.x=r.p0.x-it,c.p0.y=r.p0.y+H,c.p1.x=r.p1.x-it,c.p1.y=r.p1.y+H},Kn.prototype.addFilletArc=function(r,i,a,c,d){var v=c===dt.CLOCKWISE?-1:1,M=Math.abs(i-a),L=Math.trunc(M/this._filletAngleQuantum+.5);if(L<1)return null;for(var H=M/L,it=0,bt=new D;it<M;){var Tt=i+v*it;bt.x=r.x+d*Math.cos(Tt),bt.y=r.y+d*Math.sin(Tt),this._segList.addPt(bt),it+=H}},Kn.prototype.addInsideTurn=function(r,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*Kn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var a=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(a);var c=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(c)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Kn.prototype.createCircle=function(r){var i=new D(r.x+this._distance,r.y);this._segList.addPt(i),this.addFilletArc(r,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Kn.prototype.addBevelJoin=function(r,i){this._segList.addPt(r.p1),this._segList.addPt(i.p0)},Kn.prototype.init=function(r){this._distance=r,this._maxCurveSegmentError=r*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $i,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(r*Kn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Kn.prototype.addCollinear=function(r){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===ke.JOIN_BEVEL||this._bufParams.getJoinStyle()===ke.JOIN_MITRE?(r&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,dt.CLOCKWISE,this._distance))},Kn.prototype.closeRing=function(){this._segList.closeRing()},Kn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},xs.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},xs.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},xs.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},xs.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Kn,xs);var pi=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var r=arguments[0],i=arguments[1];this._precisionModel=r,this._bufParams=i};pi.prototype.getOffsetCurve=function(r,i){if(this._distance=i,i===0)return null;var a=i<0,c=Math.abs(i),d=this.getSegGen(c);r.length<=1?this.computePointCurve(r[0],d):this.computeOffsetCurve(r,a,d);var v=d.getCoordinates();return a&<.reverse(v),v},pi.prototype.computeSingleSidedBufferCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);if(i){a.addSegments(r,!0);var d=yr.simplify(r,-c),v=d.length-1;a.initSideSegments(d[v],d[v-1],Xt.LEFT),a.addFirstSegment();for(var M=v-2;M>=0;M--)a.addNextSegment(d[M],!0)}else{a.addSegments(r,!1);var L=yr.simplify(r,c),H=L.length-1;a.initSideSegments(L[0],L[1],Xt.LEFT),a.addFirstSegment();for(var it=2;it<=H;it++)a.addNextSegment(L[it],!0)}a.addLastSegment(),a.closeRing()},pi.prototype.computeRingBufferCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);i===Xt.RIGHT&&(c=-c);var d=yr.simplify(r,c),v=d.length-1;a.initSideSegments(d[v-1],d[0],i);for(var M=1;M<=v;M++){var L=M!==1;a.addNextSegment(d[M],L)}a.closeRing()},pi.prototype.computeLineBufferCurve=function(r,i){var a=this.simplifyTolerance(this._distance),c=yr.simplify(r,a),d=c.length-1;i.initSideSegments(c[0],c[1],Xt.LEFT);for(var v=2;v<=d;v++)i.addNextSegment(c[v],!0);i.addLastSegment(),i.addLineEndCap(c[d-1],c[d]);var M=yr.simplify(r,-a),L=M.length-1;i.initSideSegments(M[L],M[L-1],Xt.LEFT);for(var H=L-2;H>=0;H--)i.addNextSegment(M[H],!0);i.addLastSegment(),i.addLineEndCap(M[1],M[0]),i.closeRing()},pi.prototype.computePointCurve=function(r,i){switch(this._bufParams.getEndCapStyle()){case ke.CAP_ROUND:i.createCircle(r);break;case ke.CAP_SQUARE:i.createSquare(r)}},pi.prototype.getLineCurve=function(r,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var a=Math.abs(i),c=this.getSegGen(a);if(r.length<=1)this.computePointCurve(r[0],c);else if(this._bufParams.isSingleSided()){var d=i<0;this.computeSingleSidedBufferCurve(r,d,c)}else this.computeLineBufferCurve(r,c);return c.getCoordinates()},pi.prototype.getBufferParameters=function(){return this._bufParams},pi.prototype.simplifyTolerance=function(r){return r*this._bufParams.getSimplifyFactor()},pi.prototype.getRingCurve=function(r,i,a){if(this._distance=a,r.length<=2)return this.getLineCurve(r,a);if(a===0)return pi.copyCoordinates(r);var c=this.getSegGen(a);return this.computeRingBufferCurve(r,i,c),c.getCoordinates()},pi.prototype.computeOffsetCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);if(i){var d=yr.simplify(r,-c),v=d.length-1;a.initSideSegments(d[v],d[v-1],Xt.LEFT),a.addFirstSegment();for(var M=v-2;M>=0;M--)a.addNextSegment(d[M],!0)}else{var L=yr.simplify(r,c),H=L.length-1;a.initSideSegments(L[0],L[1],Xt.LEFT),a.addFirstSegment();for(var it=2;it<=H;it++)a.addNextSegment(L[it],!0)}a.addLastSegment()},pi.prototype.getSegGen=function(r){return new Kn(this._precisionModel,this._bufParams,r)},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},pi.copyCoordinates=function(r){for(var i=new Array(r.length).fill(null),a=0;a<i.length;a++)i[a]=new D(r[a]);return i};var fa=function(){this._subgraphs=null,this._seg=new ie,this._cga=new dt;var r=arguments[0];this._subgraphs=r},Mf={DepthSegment:{configurable:!0}};fa.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var r=arguments[0],i=new G,a=this._subgraphs.iterator();a.hasNext();){var c=a.next(),d=c.getEnvelope();r.y<d.getMinY()||r.y>d.getMaxY()||this.findStabbedSegments(r,c.getDirectedEdges(),i)}return i}if(arguments.length===3){if(Q(arguments[2],Et)&&arguments[0]instanceof D&&arguments[1]instanceof Ef){for(var v=arguments[0],M=arguments[1],L=arguments[2],H=M.getEdge().getCoordinates(),it=0;it<H.length-1;it++)if(this._seg.p0=H[it],this._seg.p1=H[it+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||dt.computeOrientation(this._seg.p0,this._seg.p1,v)===dt.RIGHT)){var bt=M.getDepth(Xt.LEFT);this._seg.p0.equals(H[it])||(bt=M.getDepth(Xt.RIGHT));var Tt=new Es(this._seg,bt);L.add(Tt)}}else if(Q(arguments[2],Et)&&arguments[0]instanceof D&&Q(arguments[1],Et))for(var Kt=arguments[0],Qt=arguments[1],le=arguments[2],Ee=Qt.iterator();Ee.hasNext();){var Dn=Ee.next();Dn.isForward()&&this.findStabbedSegments(Kt,Dn,le)}}},fa.prototype.getDepth=function(r){var i=this.findStabbedSegments(r);return i.size()===0?0:ho.min(i)._leftDepth},fa.prototype.interfaces_=function(){return[]},fa.prototype.getClass=function(){return fa},Mf.DepthSegment.get=function(){return Es},Object.defineProperties(fa,Mf);var Es=function(){this._upwardSeg=null,this._leftDepth=null;var r=arguments[0],i=arguments[1];this._upwardSeg=new ie(r),this._leftDepth=i};Es.prototype.compareTo=function(r){var i=r;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var a=this._upwardSeg.orientationIndex(i._upwardSeg);return a!==0||(a=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?a:this._upwardSeg.compareTo(i._upwardSeg)},Es.prototype.compareX=function(r,i){var a=r.p0.compareTo(i.p0);return a!==0?a:r.p1.compareTo(i.p1)},Es.prototype.toString=function(){return this._upwardSeg.toString()},Es.prototype.interfaces_=function(){return[V]},Es.prototype.getClass=function(){return Es};var Ke=function(r,i,a){this.p0=r||null,this.p1=i||null,this.p2=a||null};Ke.prototype.area=function(){return Ke.area(this.p0,this.p1,this.p2)},Ke.prototype.signedArea=function(){return Ke.signedArea(this.p0,this.p1,this.p2)},Ke.prototype.interpolateZ=function(r){if(r===null)throw new I("Supplied point is null.");return Ke.interpolateZ(r,this.p0,this.p1,this.p2)},Ke.prototype.longestSideLength=function(){return Ke.longestSideLength(this.p0,this.p1,this.p2)},Ke.prototype.isAcute=function(){return Ke.isAcute(this.p0,this.p1,this.p2)},Ke.prototype.circumcentre=function(){return Ke.circumcentre(this.p0,this.p1,this.p2)},Ke.prototype.area3D=function(){return Ke.area3D(this.p0,this.p1,this.p2)},Ke.prototype.centroid=function(){return Ke.centroid(this.p0,this.p1,this.p2)},Ke.prototype.inCentre=function(){return Ke.inCentre(this.p0,this.p1,this.p2)},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},Ke.area=function(r,i,a){return Math.abs(((a.x-r.x)*(i.y-r.y)-(i.x-r.x)*(a.y-r.y))/2)},Ke.signedArea=function(r,i,a){return((a.x-r.x)*(i.y-r.y)-(i.x-r.x)*(a.y-r.y))/2},Ke.det=function(r,i,a,c){return r*c-i*a},Ke.interpolateZ=function(r,i,a,c){var d=i.x,v=i.y,M=a.x-d,L=c.x-d,H=a.y-v,it=c.y-v,bt=M*it-L*H,Tt=r.x-d,Kt=r.y-v,Qt=(it*Tt-L*Kt)/bt,le=(-H*Tt+M*Kt)/bt;return i.z+Qt*(a.z-i.z)+le*(c.z-i.z)},Ke.longestSideLength=function(r,i,a){var c=r.distance(i),d=i.distance(a),v=a.distance(r),M=c;return d>M&&(M=d),v>M&&(M=v),M},Ke.isAcute=function(r,i,a){return!!Ve.isAcute(r,i,a)&&!!Ve.isAcute(i,a,r)&&!!Ve.isAcute(a,r,i)},Ke.circumcentre=function(r,i,a){var c=a.x,d=a.y,v=r.x-c,M=r.y-d,L=i.x-c,H=i.y-d,it=2*Ke.det(v,M,L,H),bt=Ke.det(M,v*v+M*M,H,L*L+H*H),Tt=Ke.det(v,v*v+M*M,L,L*L+H*H);return new D(c-bt/it,d+Tt/it)},Ke.perpendicularBisector=function(r,i){var a=i.x-r.x,c=i.y-r.y,d=new $t(r.x+a/2,r.y+c/2,1),v=new $t(r.x-c+a/2,r.y+a+c/2,1);return new $t(d,v)},Ke.angleBisector=function(r,i,a){var c=i.distance(r),d=c/(c+i.distance(a)),v=a.x-r.x,M=a.y-r.y;return new D(r.x+d*v,r.y+d*M)},Ke.area3D=function(r,i,a){var c=i.x-r.x,d=i.y-r.y,v=i.z-r.z,M=a.x-r.x,L=a.y-r.y,H=a.z-r.z,it=d*H-v*L,bt=v*M-c*H,Tt=c*L-d*M,Kt=it*it+bt*bt+Tt*Tt,Qt=Math.sqrt(Kt)/2;return Qt},Ke.centroid=function(r,i,a){var c=(r.x+i.x+a.x)/3,d=(r.y+i.y+a.y)/3;return new D(c,d)},Ke.inCentre=function(r,i,a){var c=i.distance(a),d=r.distance(a),v=r.distance(i),M=c+d+v,L=(c*r.x+d*i.x+v*a.x)/M,H=(c*r.y+d*i.y+v*a.y)/M;return new D(L,H)};var Zi=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new G;var r=arguments[0],i=arguments[1],a=arguments[2];this._inputGeom=r,this._distance=i,this._curveBuilder=a};Zi.prototype.addPoint=function(r){if(this._distance<=0)return null;var i=r.getCoordinates(),a=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(a,K.EXTERIOR,K.INTERIOR)},Zi.prototype.addPolygon=function(r){var i=this._distance,a=Xt.LEFT;this._distance<0&&(i=-this._distance,a=Xt.RIGHT);var c=r.getExteriorRing(),d=lt.removeRepeatedPoints(c.getCoordinates());if(this._distance<0&&this.isErodedCompletely(c,this._distance)||this._distance<=0&&d.length<3)return null;this.addPolygonRing(d,i,a,K.EXTERIOR,K.INTERIOR);for(var v=0;v<r.getNumInteriorRing();v++){var M=r.getInteriorRingN(v),L=lt.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(L,i,Xt.opposite(a),K.INTERIOR,K.EXTERIOR)}},Zi.prototype.isTriangleErodedCompletely=function(r,i){var a=new Ke(r[0],r[1],r[2]),c=a.inCentre();return dt.distancePointLine(c,a.p0,a.p1)<Math.abs(i)},Zi.prototype.addLineString=function(r){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=lt.removeRepeatedPoints(r.getCoordinates()),a=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(a,K.EXTERIOR,K.INTERIOR)},Zi.prototype.addCurve=function(r,i,a){if(r===null||r.length<2)return null;var c=new mr(r,new On(0,K.BOUNDARY,i,a));this._curveList.add(c)},Zi.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Zi.prototype.addPolygonRing=function(r,i,a,c,d){if(i===0&&r.length<Ae.MINIMUM_VALID_SIZE)return null;var v=c,M=d;r.length>=Ae.MINIMUM_VALID_SIZE&&dt.isCCW(r)&&(v=d,M=c,a=Xt.opposite(a));var L=this._curveBuilder.getRingCurve(r,a,i);this.addCurve(L,v,M)},Zi.prototype.add=function(r){if(r.isEmpty())return null;r instanceof de?this.addPolygon(r):r instanceof vt?this.addLineString(r):r instanceof ue?this.addPoint(r):r instanceof Be?this.addCollection(r):r instanceof bi?this.addCollection(r):r instanceof Pe?this.addCollection(r):r instanceof Qn&&this.addCollection(r)},Zi.prototype.isErodedCompletely=function(r,i){var a=r.getCoordinates();if(a.length<4)return i<0;if(a.length===4)return this.isTriangleErodedCompletely(a,i);var c=r.getEnvelopeInternal(),d=Math.min(c.getHeight(),c.getWidth());return i<0&&2*Math.abs(i)>d},Zi.prototype.addCollection=function(r){for(var i=0;i<r.getNumGeometries();i++){var a=r.getGeometryN(i);this.add(a)}},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi};var xu=function(){};xu.prototype.locate=function(r){},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu};var go=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var r=arguments[0];this._parent=r,this._atStart=!0,this._index=0,this._max=r.getNumGeometries()};go.prototype.next=function(){if(this._atStart)return this._atStart=!1,go.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 r=this._parent.getGeometryN(this._index++);return r instanceof Qn?(this._subcollectionIterator=new go(r),this._subcollectionIterator.next()):r},go.prototype.remove=function(){throw new Error(this.getClass().getName())},go.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)},go.prototype.interfaces_=function(){return[wt]},go.prototype.getClass=function(){return go},go.isAtomic=function(r){return!(r instanceof Qn)};var di=function(){this._geom=null;var r=arguments[0];this._geom=r};di.prototype.locate=function(r){return di.locate(r,this._geom)},di.prototype.interfaces_=function(){return[xu]},di.prototype.getClass=function(){return di},di.isPointInRing=function(r,i){return!!i.getEnvelopeInternal().intersects(r)&&dt.isPointInRing(r,i.getCoordinates())},di.containsPointInPolygon=function(r,i){if(i.isEmpty())return!1;var a=i.getExteriorRing();if(!di.isPointInRing(r,a))return!1;for(var c=0;c<i.getNumInteriorRing();c++){var d=i.getInteriorRingN(c);if(di.isPointInRing(r,d))return!1}return!0},di.containsPoint=function(r,i){if(i instanceof de)return di.containsPointInPolygon(r,i);if(i instanceof Qn)for(var a=new go(i);a.hasNext();){var c=a.next();if(c!==i&&di.containsPoint(r,c))return!0}return!1},di.locate=function(r,i){return i.isEmpty()?K.EXTERIOR:di.containsPoint(r,i)?K.INTERIOR:K.EXTERIOR};var ti=function(){this._edgeMap=new w,this._edgeList=null,this._ptInAreaLocation=[K.NONE,K.NONE]};ti.prototype.getNextCW=function(r){this.getEdges();var i=this._edgeList.indexOf(r),a=i-1;return i===0&&(a=this._edgeList.size()-1),this._edgeList.get(a)},ti.prototype.propagateSideLabels=function(r){for(var i=K.NONE,a=this.iterator();a.hasNext();){var c=a.next().getLabel();c.isArea(r)&&c.getLocation(r,Xt.LEFT)!==K.NONE&&(i=c.getLocation(r,Xt.LEFT))}if(i===K.NONE)return null;for(var d=i,v=this.iterator();v.hasNext();){var M=v.next(),L=M.getLabel();if(L.getLocation(r,Xt.ON)===K.NONE&&L.setLocation(r,Xt.ON,d),L.isArea(r)){var H=L.getLocation(r,Xt.LEFT),it=L.getLocation(r,Xt.RIGHT);if(it!==K.NONE){if(it!==d)throw new Qo("side location conflict",M.getCoordinate());H===K.NONE&&Wt.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),d=H}else Wt.isTrue(L.getLocation(r,Xt.LEFT)===K.NONE,"found single null side"),L.setLocation(r,Xt.RIGHT,d),L.setLocation(r,Xt.LEFT,d)}}},ti.prototype.getCoordinate=function(){var r=this.iterator();return r.hasNext()?r.next().getCoordinate():null},ti.prototype.print=function(r){te.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(r)},ti.prototype.isAreaLabelsConsistent=function(r){return this.computeEdgeEndLabels(r.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ti.prototype.checkAreaLabelsConsistent=function(r){var i=this.getEdges();if(i.size()<=0)return!0;var a=i.size()-1,c=i.get(a).getLabel().getLocation(r,Xt.LEFT);Wt.isTrue(c!==K.NONE,"Found unlabelled area edge");for(var d=c,v=this.iterator();v.hasNext();){var M=v.next().getLabel();Wt.isTrue(M.isArea(r),"Found non-area edge");var L=M.getLocation(r,Xt.LEFT),H=M.getLocation(r,Xt.RIGHT);if(L===H||H!==d)return!1;d=L}return!0},ti.prototype.findIndex=function(r){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===r)return i;return-1},ti.prototype.iterator=function(){return this.getEdges().iterator()},ti.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new G(this._edgeMap.values())),this._edgeList},ti.prototype.getLocation=function(r,i,a){return this._ptInAreaLocation[r]===K.NONE&&(this._ptInAreaLocation[r]=di.locate(i,a[r].getGeometry())),this._ptInAreaLocation[r]},ti.prototype.toString=function(){var r=new Lt;r.append("EdgeEndStar: "+this.getCoordinate()),r.append(`
|
|
5
|
+
`}[r]};var $t=function r(){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 a=arguments[0],c=arguments[1];this.x=a,this.y=c,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var d=arguments[0],v=arguments[1];this.x=d.y*v.w-v.y*d.w,this.y=v.x*d.w-d.x*v.w,this.w=d.x*v.y-v.x*d.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var M=arguments[0],L=arguments[1];this.x=M.y-L.y,this.y=L.x-M.x,this.w=M.x*L.y-L.x*M.y}}else if(arguments.length===3){var H=arguments[0],it=arguments[1],bt=arguments[2];this.x=H,this.y=it,this.w=bt}else if(arguments.length===4){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2],le=arguments[3],Ee=Tt.y-Kt.y,Dn=Kt.x-Tt.x,Jn=Tt.x*Kt.y-Kt.x*Tt.y,fi=Qt.y-le.y,as=le.x-Qt.x,qs=Qt.x*le.y-le.x*Qt.y;this.x=Dn*qs-as*Jn,this.y=fi*Jn-Ee*qs,this.w=Ee*as-fi*Dn}};$t.prototype.getY=function(){var r=this.y/this.w;if(A.isNaN(r)||A.isInfinite(r))throw new ce;return r},$t.prototype.getX=function(){var r=this.x/this.w;if(A.isNaN(r)||A.isInfinite(r))throw new ce;return r},$t.prototype.getCoordinate=function(){var r=new D;return r.x=this.getX(),r.y=this.getY(),r},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.intersection=function(r,i,a,c){var d=r.y-i.y,v=i.x-r.x,M=r.x*i.y-i.x*r.y,L=a.y-c.y,H=c.x-a.x,it=a.x*c.y-c.x*a.y,bt=d*H-L*v,Tt=(v*it-H*M)/bt,Kt=(L*M-d*it)/bt;if(A.isNaN(Tt)||A.isInfinite(Tt)||A.isNaN(Kt)||A.isInfinite(Kt))throw new ce;return new D(Tt,Kt)};var qt=function r(){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 r){var a=arguments[0];this.init(a)}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.init(c.x,d.x,c.y,d.y)}else if(arguments.length===4){var v=arguments[0],M=arguments[1],L=arguments[2],H=arguments[3];this.init(v,M,L,H)}},xe={serialVersionUID:{configurable:!0}};qt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},qt.prototype.equals=function(r){if(!(r instanceof qt))return!1;var i=r;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},qt.prototype.intersection=function(r){if(this.isNull()||r.isNull()||!this.intersects(r))return new qt;var i=this._minx>r._minx?this._minx:r._minx,a=this._miny>r._miny?this._miny:r._miny,c=this._maxx<r._maxx?this._maxx:r._maxx,d=this._maxy<r._maxy?this._maxy:r._maxy;return new qt(i,c,a,d)},qt.prototype.isNull=function(){return this._maxx<this._minx},qt.prototype.getMaxX=function(){return this._maxx},qt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];return this.covers(r.x,r.y)}if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];return!this.isNull()&&a>=this._minx&&a<=this._maxx&&c>=this._miny&&c<=this._maxy}},qt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof qt){var r=arguments[0];return!this.isNull()&&!r.isNull()&&!(r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._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 a=arguments[0],c=arguments[1];return!this.isNull()&&!(a>this._maxx||a<this._minx||c>this._maxy||c<this._miny)}},qt.prototype.getMinY=function(){return this._miny},qt.prototype.getMinX=function(){return this._minx},qt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];this.expandToInclude(r.x,r.y)}else if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];this.isNull()?(this._minx=a,this._maxx=a,this._miny=c,this._maxy=c):(a<this._minx&&(this._minx=a),a>this._maxx&&(this._maxx=a),c<this._miny&&(this._miny=c),c>this._maxy&&(this._maxy=c))}},qt.prototype.minExtent=function(){if(this.isNull())return 0;var r=this.getWidth(),i=this.getHeight();return r<i?r:i},qt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},qt.prototype.compareTo=function(r){var i=r;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},qt.prototype.translate=function(r,i){if(this.isNull())return null;this.init(this.getMinX()+r,this.getMaxX()+r,this.getMinY()+i,this.getMaxY()+i)},qt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},qt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},qt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},qt.prototype.maxExtent=function(){if(this.isNull())return 0;var r=this.getWidth(),i=this.getHeight();return r>i?r:i},qt.prototype.expandBy=function(){if(arguments.length===1){var r=arguments[0];this.expandBy(r,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=a,this._maxy+=a,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},qt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof qt){var r=arguments[0];return this.covers(r)}if(arguments[0]instanceof D){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.covers(a,c)}},qt.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},qt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof qt){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 a=arguments[0],c=arguments[1];this.init(a.x,c.x,a.y,c.y)}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];d<v?(this._minx=d,this._maxx=v):(this._minx=v,this._maxx=d),M<L?(this._miny=M,this._maxy=L):(this._miny=L,this._maxy=M)}},qt.prototype.getMaxY=function(){return this._maxy},qt.prototype.distance=function(r){if(this.intersects(r))return 0;var i=0;this._maxx<r._minx?i=r._minx-this._maxx:this._minx>r._maxx&&(i=this._minx-r._maxx);var a=0;return this._maxy<r._miny?a=r._miny-this._maxy:this._miny>r._maxy&&(a=this._miny-r._maxy),i===0?a:a===0?i:Math.sqrt(i*i+a*a)},qt.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this._minx),r=37*r+D.hashCode(this._maxx),r=37*r+D.hashCode(this._miny),r=37*r+D.hashCode(this._maxy)},qt.prototype.interfaces_=function(){return[V,t]},qt.prototype.getClass=function(){return qt},qt.intersects=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];return a.x>=(r.x<i.x?r.x:i.x)&&a.x<=(r.x>i.x?r.x:i.x)&&a.y>=(r.y<i.y?r.y:i.y)&&a.y<=(r.y>i.y?r.y:i.y)}if(arguments.length===4){var c=arguments[0],d=arguments[1],v=arguments[2],M=arguments[3],L=Math.min(v.x,M.x),H=Math.max(v.x,M.x),it=Math.min(c.x,d.x),bt=Math.max(c.x,d.x);return!(it>H)&&!(bt<L)&&(L=Math.min(v.y,M.y),H=Math.max(v.y,M.y),it=Math.min(c.y,d.y),bt=Math.max(c.y,d.y),!(it>H)&&!(bt<L))}},xe.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(qt,xe);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*$/},Xe=function(r){this.geometryFactory=r||new Le};Xe.prototype.read=function(r){var i,a,c;r=r.replace(/[\n\r]/g," ");var d=ft.typeStr.exec(r);if(r.search("EMPTY")!==-1&&((d=ft.emptyTypeStr.exec(r))[2]=void 0),d&&(a=d[1].toLowerCase(),c=d[2],ge[a]&&(i=ge[a].apply(this,[c]))),i===void 0)throw new Error("Could not parse WKT "+r);return i},Xe.prototype.write=function(r){return this.extractGeometry(r)},Xe.prototype.extractGeometry=function(r){var i=r.getGeometryType().toLowerCase();if(!ee[i])return null;var a=i.toUpperCase();return r.isEmpty()?a+" EMPTY":a+"("+ee[i].apply(this,[r])+")"};var ee={coordinate:function(r){return r.x+" "+r.y},point:function(r){return ee.coordinate.call(this,r._coordinates._coordinates[0])},multipoint:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.point.apply(this,[r._geometries[a]])+")");return i.join(",")},linestring:function(r){for(var i=[],a=0,c=r._points._coordinates.length;a<c;++a)i.push(ee.coordinate.apply(this,[r._points._coordinates[a]]));return i.join(",")},linearring:function(r){for(var i=[],a=0,c=r._points._coordinates.length;a<c;++a)i.push(ee.coordinate.apply(this,[r._points._coordinates[a]]));return i.join(",")},multilinestring:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.linestring.apply(this,[r._geometries[a]])+")");return i.join(",")},polygon:function(r){var i=[];i.push("("+ee.linestring.apply(this,[r._shell])+")");for(var a=0,c=r._holes.length;a<c;++a)i.push("("+ee.linestring.apply(this,[r._holes[a]])+")");return i.join(",")},multipolygon:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push("("+ee.polygon.apply(this,[r._geometries[a]])+")");return i.join(",")},geometrycollection:function(r){for(var i=[],a=0,c=r._geometries.length;a<c;++a)i.push(this.extractGeometry(r._geometries[a]));return i.join(",")}},ge={point:function(r){if(r===void 0)return this.geometryFactory.createPoint();var i=r.trim().split(ft.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(r){if(r===void 0)return this.geometryFactory.createMultiPoint();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(c)},linestring:function(r){if(r===void 0)return this.geometryFactory.createLineString();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].trim().split(ft.spaces),c.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(c)},linearring:function(r){if(r===void 0)return this.geometryFactory.createLinearRing();for(var i,a=r.trim().split(","),c=[],d=0,v=a.length;d<v;++d)i=a[d].trim().split(ft.spaces),c.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(c)},multilinestring:function(r){if(r===void 0)return this.geometryFactory.createMultiLineString();for(var i,a=r.trim().split(ft.parenComma),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(c)},polygon:function(r){if(r===void 0)return this.geometryFactory.createPolygon();for(var i,a,c,d,v=r.trim().split(ft.parenComma),M=[],L=0,H=v.length;L<H;++L)i=v[L].replace(ft.trimParens,"$1"),a=ge.linestring.apply(this,[i]),c=this.geometryFactory.createLinearRing(a._points),L===0?d=c:M.push(c);return this.geometryFactory.createPolygon(d,M)},multipolygon:function(r){if(r===void 0)return this.geometryFactory.createMultiPolygon();for(var i,a=r.trim().split(ft.doubleParenComma),c=[],d=0,v=a.length;d<v;++d)i=a[d].replace(ft.trimParens,"$1"),c.push(ge.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(c)},geometrycollection:function(r){if(r===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(r=r.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),a=[],c=0,d=i.length;c<d;++c)a.push(this.read(i[c]));return this.geometryFactory.createGeometryCollection(a)}},fe=function(r){this.parser=new Xe(r)};fe.prototype.write=function(r){return this.parser.write(r)},fe.toLineString=function(r,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+r.x+" "+r.y+", "+i.x+" "+i.y+" )"};var Te=function(r){function i(a){r.call(this,a),this.name="RuntimeException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),be=function(r){function i(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var a=arguments[0];r.call(this,a)}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Te),Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.shouldNeverReachHere=function(){if(arguments.length===0)Wt.shouldNeverReachHere(null);else if(arguments.length===1){var r=arguments[0];throw new be("Should never reach here"+(r!==null?": "+r:""))}},Wt.isTrue=function(){var r,i;if(arguments.length===1)r=arguments[0],Wt.isTrue(r,null);else if(arguments.length===2&&(r=arguments[0],i=arguments[1],!r))throw i===null?new be:new be(i)},Wt.equals=function(){var r,i,a;if(arguments.length===2)r=arguments[0],i=arguments[1],Wt.equals(r,i,null);else if(arguments.length===3&&(r=arguments[0],i=arguments[1],a=arguments[2],!i.equals(r)))throw new be("Expected "+r+" but encountered "+i+(a!==null?": "+a:""))};var Me=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},tt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Me.prototype.getIndexAlongSegment=function(r,i){return this.computeIntLineIndex(),this._intLineIndex[r][i]},Me.prototype.getTopologySummary=function(){var r=new Lt;return this.isEndPoint()&&r.append(" endpoint"),this._isProper&&r.append(" proper"),this.isCollinear()&&r.append(" collinear"),r.toString()},Me.prototype.computeIntersection=function(r,i,a,c){this._inputLines[0][0]=r,this._inputLines[0][1]=i,this._inputLines[1][0]=a,this._inputLines[1][1]=c,this._result=this.computeIntersect(r,i,a,c)},Me.prototype.getIntersectionNum=function(){return this._result},Me.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 r=arguments[0];this.getEdgeDistance(r,0)>this.getEdgeDistance(r,1)?(this._intLineIndex[r][0]=0,this._intLineIndex[r][1]=1):(this._intLineIndex[r][0]=1,this._intLineIndex[r][1]=0)}},Me.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Me.prototype.setPrecisionModel=function(r){this._precisionModel=r},Me.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var r=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[r][0])&&!this._intPt[i].equals2D(this._inputLines[r][1]))return!0;return!1}},Me.prototype.getIntersection=function(r){return this._intPt[r]},Me.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Me.prototype.hasIntersection=function(){return this._result!==Me.NO_INTERSECTION},Me.prototype.getEdgeDistance=function(r,i){return Me.computeEdgeDistance(this._intPt[i],this._inputLines[r][0],this._inputLines[r][1])},Me.prototype.isCollinear=function(){return this._result===Me.COLLINEAR_INTERSECTION},Me.prototype.toString=function(){return fe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+fe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Me.prototype.getEndpoint=function(r,i){return this._inputLines[r][i]},Me.prototype.isIntersection=function(r){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(r))return!0;return!1},Me.prototype.getIntersectionAlongSegment=function(r,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[r][i]]},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.computeEdgeDistance=function(r,i,a){var c=Math.abs(a.x-i.x),d=Math.abs(a.y-i.y),v=-1;if(r.equals(i))v=0;else if(r.equals(a))v=c>d?c:d;else{var M=Math.abs(r.x-i.x),L=Math.abs(r.y-i.y);(v=c>d?M:L)!==0||r.equals(i)||(v=Math.max(M,L))}return Wt.isTrue(!(v===0&&!r.equals(i)),"Bad distance calculation"),v},Me.nonRobustComputeEdgeDistance=function(r,i,a){var c=r.x-i.x,d=r.y-i.y,v=Math.sqrt(c*c+d*d);return Wt.isTrue(!(v===0&&!r.equals(i)),"Invalid distance calculation"),v},tt.DONT_INTERSECT.get=function(){return 0},tt.DO_INTERSECT.get=function(){return 1},tt.COLLINEAR.get=function(){return 2},tt.NO_INTERSECTION.get=function(){return 0},tt.POINT_INTERSECTION.get=function(){return 1},tt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Me,tt);var z=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(a){var c=new qt(this._inputLines[0][0],this._inputLines[0][1]),d=new qt(this._inputLines[1][0],this._inputLines[1][1]);return c.contains(a)&&d.contains(a)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return r.prototype.computeIntersection.apply(this,arguments);var a=arguments[0],c=arguments[1],d=arguments[2];if(this._isProper=!1,qt.intersects(c,d,a)&&dt.orientationIndex(c,d,a)===0&&dt.orientationIndex(d,c,a)===0)return this._isProper=!0,(a.equals(c)||a.equals(d))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(a,c,d,v,M){M.x=this.smallestInAbsValue(a.x,c.x,d.x,v.x),M.y=this.smallestInAbsValue(a.y,c.y,d.y,v.y),a.x-=M.x,a.y-=M.y,c.x-=M.x,c.y-=M.y,d.x-=M.x,d.y-=M.y,v.x-=M.x,v.y-=M.y},i.prototype.safeHCoordinateIntersection=function(a,c,d,v){var M=null;try{M=$t.intersection(a,c,d,v)}catch(L){if(!(L instanceof ce))throw L;M=i.nearestEndpoint(a,c,d,v)}return M},i.prototype.intersection=function(a,c,d,v){var M=this.intersectionWithNormalization(a,c,d,v);return this.isInSegmentEnvelopes(M)||(M=new D(i.nearestEndpoint(a,c,d,v))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},i.prototype.smallestInAbsValue=function(a,c,d,v){var M=a,L=Math.abs(M);return Math.abs(c)<L&&(M=c,L=Math.abs(c)),Math.abs(d)<L&&(M=d,L=Math.abs(d)),Math.abs(v)<L&&(M=v),M},i.prototype.checkDD=function(a,c,d,v,M){var L=Gt.intersection(a,c,d,v),H=this.isInSegmentEnvelopes(L);te.out.println("DD in env = "+H+" --------------------- "+L),M.distance(L)>1e-4&&te.out.println("Distance = "+M.distance(L))},i.prototype.intersectionWithNormalization=function(a,c,d,v){var M=new D(a),L=new D(c),H=new D(d),it=new D(v),bt=new D;this.normalizeToEnvCentre(M,L,H,it,bt);var Tt=this.safeHCoordinateIntersection(M,L,H,it);return Tt.x+=bt.x,Tt.y+=bt.y,Tt},i.prototype.computeCollinearIntersection=function(a,c,d,v){var M=qt.intersects(a,c,d),L=qt.intersects(a,c,v),H=qt.intersects(d,v,a),it=qt.intersects(d,v,c);return M&&L?(this._intPt[0]=d,this._intPt[1]=v,r.COLLINEAR_INTERSECTION):H&&it?(this._intPt[0]=a,this._intPt[1]=c,r.COLLINEAR_INTERSECTION):M&&H?(this._intPt[0]=d,this._intPt[1]=a,!d.equals(a)||L||it?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):M&&it?(this._intPt[0]=d,this._intPt[1]=c,!d.equals(c)||L||H?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):L&&H?(this._intPt[0]=v,this._intPt[1]=a,!v.equals(a)||M||it?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):L&&it?(this._intPt[0]=v,this._intPt[1]=c,!v.equals(c)||M||H?r.COLLINEAR_INTERSECTION:r.POINT_INTERSECTION):r.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(a,c,d,v,M){var L=a.x<c.x?a.x:c.x,H=a.y<c.y?a.y:c.y,it=a.x>c.x?a.x:c.x,bt=a.y>c.y?a.y:c.y,Tt=d.x<v.x?d.x:v.x,Kt=d.y<v.y?d.y:v.y,Qt=d.x>v.x?d.x:v.x,le=d.y>v.y?d.y:v.y,Ee=((L>Tt?L:Tt)+(it<Qt?it:Qt))/2,Dn=((H>Kt?H:Kt)+(bt<le?bt:le))/2;M.x=Ee,M.y=Dn,a.x-=M.x,a.y-=M.y,c.x-=M.x,c.y-=M.y,d.x-=M.x,d.y-=M.y,v.x-=M.x,v.y-=M.y},i.prototype.computeIntersect=function(a,c,d,v){if(this._isProper=!1,!qt.intersects(a,c,d,v))return r.NO_INTERSECTION;var M=dt.orientationIndex(a,c,d),L=dt.orientationIndex(a,c,v);if(M>0&&L>0||M<0&&L<0)return r.NO_INTERSECTION;var H=dt.orientationIndex(d,v,a),it=dt.orientationIndex(d,v,c);return H>0&&it>0||H<0&&it<0?r.NO_INTERSECTION:M===0&&L===0&&H===0&&it===0?this.computeCollinearIntersection(a,c,d,v):(M===0||L===0||H===0||it===0?(this._isProper=!1,a.equals2D(d)||a.equals2D(v)?this._intPt[0]=a:c.equals2D(d)||c.equals2D(v)?this._intPt[0]=c:M===0?this._intPt[0]=new D(d):L===0?this._intPt[0]=new D(v):H===0?this._intPt[0]=new D(a):it===0&&(this._intPt[0]=new D(c))):(this._isProper=!0,this._intPt[0]=this.intersection(a,c,d,v)),r.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(a,c,d,v){var M=a,L=dt.distancePointLine(a,d,v),H=dt.distancePointLine(c,d,v);return H<L&&(L=H,M=c),(H=dt.distancePointLine(d,a,c))<L&&(L=H,M=d),(H=dt.distancePointLine(v,a,c))<L&&(L=H,M=v),M},i}(Me),It=function(){};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,i,a){var c=i.x-r.x,d=i.y-r.y,v=a.x-i.x,M=a.y-i.y;return It.signOfDet2x2(c,d,v,M)},It.signOfDet2x2=function(r,i,a,c){var d=null,v=null,M=null;if(d=1,r===0||c===0)return i===0||a===0?0:i>0?a>0?-d:d:a>0?d:-d;if(i===0||a===0)return c>0?r>0?d:-d:r>0?-d:d;if(i>0?c>0?i<=c||(d=-d,v=r,r=a,a=v,v=i,i=c,c=v):i<=-c?(d=-d,a=-a,c=-c):(v=r,r=-a,a=v,v=i,i=-c,c=v):c>0?-i<=c?(d=-d,r=-r,i=-i):(v=-r,r=a,a=v,v=-i,i=c,c=v):i>=c?(r=-r,i=-i,a=-a,c=-c):(d=-d,v=-r,r=-a,a=v,v=-i,i=-c,c=v),r>0){if(!(a>0)||!(r<=a))return d}else{if(a>0||!(r>=a))return-d;d=-d,r=-r,a=-a}for(;;){if(M=Math.floor(a/r),a-=M*r,(c-=M*i)<0)return-d;if(c>i)return d;if(r>a+a){if(i<c+c)return d}else{if(i>c+c)return-d;a=r-a,c=i-c,d=-d}if(c===0)return a===0?0:-d;if(a===0||(M=Math.floor(r/a),r-=M*a,(i-=M*c)<0))return d;if(i>c)return-d;if(a>r+r){if(c<i+i)return-d}else{if(c>i+i)return d;r=a-r,i=c-i,d=-d}if(i===0)return r===0?0:d;if(r===0)return-d}};var Ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var r=arguments[0];this._p=r};Ot.prototype.countSegment=function(r,i){if(r.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(r.y===this._p.y&&i.y===this._p.y){var a=r.x,c=i.x;return a>c&&(a=i.x,c=r.x),this._p.x>=a&&this._p.x<=c&&(this._isPointOnSegment=!0),null}if(r.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&r.y<=this._p.y){var d=r.x-this._p.x,v=r.y-this._p.y,M=i.x-this._p.x,L=i.y-this._p.y,H=It.signOfDet2x2(d,v,M,L);if(H===0)return this._isPointOnSegment=!0,null;L<v&&(H=-H),H>0&&this._crossingCount++}},Ot.prototype.isPointInPolygon=function(){return this.getLocation()!==K.EXTERIOR},Ot.prototype.getLocation=function(){return this._isPointOnSegment?K.BOUNDARY:this._crossingCount%2==1?K.INTERIOR:K.EXTERIOR},Ot.prototype.isOnSegment=function(){return this._isPointOnSegment},Ot.prototype.interfaces_=function(){return[]},Ot.prototype.getClass=function(){return Ot},Ot.locatePointInRing=function(){if(arguments[0]instanceof D&&Q(arguments[1],ut)){for(var r=arguments[0],i=arguments[1],a=new Ot(r),c=new D,d=new D,v=1;v<i.size();v++)if(i.getCoordinate(v,c),i.getCoordinate(v-1,d),a.countSegment(c,d),a.isOnSegment())return a.getLocation();return a.getLocation()}if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var M=arguments[0],L=arguments[1],H=new Ot(M),it=1;it<L.length;it++){var bt=L[it],Tt=L[it-1];if(H.countSegment(bt,Tt),H.isOnSegment())return H.getLocation()}return H.getLocation()}};var dt=function(){},Ht={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},dt.orientationIndex=function(r,i,a){return Gt.orientationIndex(r,i,a)},dt.signedArea=function(){if(arguments[0]instanceof Array){var r=arguments[0];if(r.length<3)return 0;for(var i=0,a=r[0].x,c=1;c<r.length-1;c++){var d=r[c].x-a,v=r[c+1].y;i+=d*(r[c-1].y-v)}return i/2}if(Q(arguments[0],ut)){var M=arguments[0],L=M.size();if(L<3)return 0;var H=new D,it=new D,bt=new D;M.getCoordinate(0,it),M.getCoordinate(1,bt);var Tt=it.x;bt.x-=Tt;for(var Kt=0,Qt=1;Qt<L-1;Qt++)H.y=it.y,it.x=bt.x,it.y=bt.y,M.getCoordinate(Qt+1,bt),bt.x-=Tt,Kt+=it.x*(H.y-bt.y);return Kt/2}},dt.distanceLineLine=function(r,i,a,c){if(r.equals(i))return dt.distancePointLine(r,a,c);if(a.equals(c))return dt.distancePointLine(c,r,i);var d=!1;if(qt.intersects(r,i,a,c)){var v=(i.x-r.x)*(c.y-a.y)-(i.y-r.y)*(c.x-a.x);if(v===0)d=!0;else{var M=(r.y-a.y)*(c.x-a.x)-(r.x-a.x)*(c.y-a.y),L=((r.y-a.y)*(i.x-r.x)-(r.x-a.x)*(i.y-r.y))/v,H=M/v;(H<0||H>1||L<0||L>1)&&(d=!0)}}else d=!0;return d?At.min(dt.distancePointLine(r,a,c),dt.distancePointLine(i,a,c),dt.distancePointLine(a,r,i),dt.distancePointLine(c,r,i)):0},dt.isPointInRing=function(r,i){return dt.locatePointInRing(r,i)!==K.EXTERIOR},dt.computeLength=function(r){var i=r.size();if(i<=1)return 0;var a=0,c=new D;r.getCoordinate(0,c);for(var d=c.x,v=c.y,M=1;M<i;M++){r.getCoordinate(M,c);var L=c.x,H=c.y,it=L-d,bt=H-v;a+=Math.sqrt(it*it+bt*bt),d=L,v=H}return a},dt.isCCW=function(r){var i=r.length-1;if(i<3)throw new I("Ring has fewer than 4 points, so orientation cannot be determined");for(var a=r[0],c=0,d=1;d<=i;d++){var v=r[d];v.y>a.y&&(a=v,c=d)}var M=c;do(M-=1)<0&&(M=i);while(r[M].equals2D(a)&&M!==c);var L=c;do L=(L+1)%i;while(r[L].equals2D(a)&&L!==c);var H=r[M],it=r[L];if(H.equals2D(a)||it.equals2D(a)||H.equals2D(it))return!1;var bt=dt.computeOrientation(H,a,it),Tt=!1;return Tt=bt===0?H.x>it.x:bt>0,Tt},dt.locatePointInRing=function(r,i){return Ot.locatePointInRing(r,i)},dt.distancePointLinePerpendicular=function(r,i,a){var c=(a.x-i.x)*(a.x-i.x)+(a.y-i.y)*(a.y-i.y),d=((i.y-r.y)*(a.x-i.x)-(i.x-r.x)*(a.y-i.y))/c;return Math.abs(d)*Math.sqrt(c)},dt.computeOrientation=function(r,i,a){return dt.orientationIndex(r,i,a)},dt.distancePointLine=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];if(i.length===0)throw new I("Line array must contain at least one vertex");for(var a=r.distance(i[0]),c=0;c<i.length-1;c++){var d=dt.distancePointLine(r,i[c],i[c+1]);d<a&&(a=d)}return a}if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];if(M.x===L.x&&M.y===L.y)return v.distance(M);var H=(L.x-M.x)*(L.x-M.x)+(L.y-M.y)*(L.y-M.y),it=((v.x-M.x)*(L.x-M.x)+(v.y-M.y)*(L.y-M.y))/H;if(it<=0)return v.distance(M);if(it>=1)return v.distance(L);var bt=((M.y-v.y)*(L.x-M.x)-(M.x-v.x)*(L.y-M.y))/H;return Math.abs(bt)*Math.sqrt(H)}},dt.isOnLine=function(r,i){for(var a=new z,c=1;c<i.length;c++){var d=i[c-1],v=i[c];if(a.computeIntersection(r,d,v),a.hasIntersection())return!0}return!1},Ht.CLOCKWISE.get=function(){return-1},Ht.RIGHT.get=function(){return dt.CLOCKWISE},Ht.COUNTERCLOCKWISE.get=function(){return 1},Ht.LEFT.get=function(){return dt.COUNTERCLOCKWISE},Ht.COLLINEAR.get=function(){return 0},Ht.STRAIGHT.get=function(){return dt.COLLINEAR},Object.defineProperties(dt,Ht);var Ce=function(){};Ce.prototype.filter=function(r){},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Vt=function(){var r=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=r,this._SRID=r.getSRID()},Zt={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}};Vt.prototype.isGeometryCollection=function(){return this.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION},Vt.prototype.getFactory=function(){return this._factory},Vt.prototype.getGeometryN=function(r){return this},Vt.prototype.getArea=function(){return 0},Vt.prototype.isRectangle=function(){return!1},Vt.prototype.equals=function(){if(arguments[0]instanceof Vt){var r=arguments[0];return r!==null&&this.equalsTopo(r)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof Vt))return!1;var a=i;return this.equalsExact(a)}},Vt.prototype.equalsExact=function(r){return this===r||this.equalsExact(r,0)},Vt.prototype.geometryChanged=function(){this.apply(Vt.geometryChangedFilter)},Vt.prototype.geometryChangedAction=function(){this._envelope=null},Vt.prototype.equalsNorm=function(r){return r!==null&&this.norm().equalsExact(r.norm())},Vt.prototype.getLength=function(){return 0},Vt.prototype.getNumGeometries=function(){return 1},Vt.prototype.compareTo=function(){if(arguments.length===1){var r=arguments[0],i=r;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(r)}if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.getSortIndex()!==a.getSortIndex()?this.getSortIndex()-a.getSortIndex():this.isEmpty()&&a.isEmpty()?0:this.isEmpty()?-1:a.isEmpty()?1:this.compareToSameClass(a,c)}},Vt.prototype.getUserData=function(){return this._userData},Vt.prototype.getSRID=function(){return this._SRID},Vt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Vt.prototype.checkNotGeometryCollection=function(r){if(r.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION)throw new I("This method does not support GeometryCollection arguments")},Vt.prototype.equal=function(r,i,a){return a===0?r.equals(i):r.distance(i)<=a},Vt.prototype.norm=function(){var r=this.copy();return r.normalize(),r},Vt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Vt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new qt(this._envelope)},Vt.prototype.setSRID=function(r){this._SRID=r},Vt.prototype.setUserData=function(r){this._userData=r},Vt.prototype.compare=function(r,i){for(var a=r.iterator(),c=i.iterator();a.hasNext()&&c.hasNext();){var d=a.next(),v=c.next(),M=d.compareTo(v);if(M!==0)return M}return a.hasNext()?1:c.hasNext()?-1:0},Vt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Vt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Vt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Vt.SORTINDEX_MULTIPOINT||this.getSortIndex()===Vt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Vt.SORTINDEX_MULTIPOLYGON},Vt.prototype.interfaces_=function(){return[X,V,t]},Vt.prototype.getClass=function(){return Vt},Vt.hasNonEmptyElements=function(r){for(var i=0;i<r.length;i++)if(!r[i].isEmpty())return!0;return!1},Vt.hasNullElements=function(r){for(var i=0;i<r.length;i++)if(r[i]===null)return!0;return!1},Zt.serialVersionUID.get=function(){return 8763622679187377e3},Zt.SORTINDEX_POINT.get=function(){return 0},Zt.SORTINDEX_MULTIPOINT.get=function(){return 1},Zt.SORTINDEX_LINESTRING.get=function(){return 2},Zt.SORTINDEX_LINEARRING.get=function(){return 3},Zt.SORTINDEX_MULTILINESTRING.get=function(){return 4},Zt.SORTINDEX_POLYGON.get=function(){return 5},Zt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Zt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Zt.geometryChangedFilter.get=function(){return ne},Object.defineProperties(Vt,Zt);var ne=function(){};ne.interfaces_=function(){return[Ce]},ne.filter=function(r){r.geometryChangedAction()};var rt=function(){};rt.prototype.filter=function(r){},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt};var P=function(){},N={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}};P.prototype.isInBoundary=function(r){},P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},N.Mod2BoundaryNodeRule.get=function(){return k},N.EndPointBoundaryNodeRule.get=function(){return $},N.MultiValentEndPointBoundaryNodeRule.get=function(){return W},N.MonoValentEndPointBoundaryNodeRule.get=function(){return ht},N.MOD2_BOUNDARY_RULE.get=function(){return new k},N.ENDPOINT_BOUNDARY_RULE.get=function(){return new $},N.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new W},N.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ht},N.OGC_SFS_BOUNDARY_RULE.get=function(){return P.MOD2_BOUNDARY_RULE},Object.defineProperties(P,N);var k=function(){};k.prototype.isInBoundary=function(r){return r%2==1},k.prototype.interfaces_=function(){return[P]},k.prototype.getClass=function(){return k};var $=function(){};$.prototype.isInBoundary=function(r){return r>0},$.prototype.interfaces_=function(){return[P]},$.prototype.getClass=function(){return $};var W=function(){};W.prototype.isInBoundary=function(r){return r>1},W.prototype.interfaces_=function(){return[P]},W.prototype.getClass=function(){return W};var ht=function(){};ht.prototype.isInBoundary=function(r){return r===1},ht.prototype.interfaces_=function(){return[P]},ht.prototype.getClass=function(){return ht};var at=function(){};at.prototype.add=function(){},at.prototype.addAll=function(){},at.prototype.isEmpty=function(){},at.prototype.iterator=function(){},at.prototype.size=function(){},at.prototype.toArray=function(){},at.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var wt=function(){};wt.prototype.hasNext=function(){},wt.prototype.next=function(){},wt.prototype.remove=function(){};var Et=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(at);(o.prototype=new Error).name="NoSuchElementException";var G=function(r){function i(){r.call(this),this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[r,at]},i.prototype.add=function(a){return arguments.length===1?this.array_.push(a):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(a){for(var c=a.iterator();c.hasNext();)this.add(c.next());return!0},i.prototype.set=function(a,c){var d=this.array_[a];return this.array_[a]=c,d},i.prototype.iterator=function(){return new st(this)},i.prototype.get=function(a){if(a<0||a>=this.size())throw new e;return this.array_[a]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var a=[],c=0,d=this.array_.length;c<d;c++)a.push(this.array_[c]);return a},i.prototype.remove=function(a){for(var c=!1,d=0,v=this.array_.length;d<v;d++)if(this.array_[d]===a){this.array_.splice(d,1),c=!0;break}return c},i}(Et),st=function(r){function i(a){r.call(this),this.arrayList_=a,this.position_=0}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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(a){return this.arrayList_.set(this.position_-1,a)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(wt),et=function(r){function i(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var c=arguments[0];this.ensureCapacity(c.length),this.add(c,!0)}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.ensureCapacity(d.length),this.add(d,v)}}}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={coordArrayType:{configurable:!0}};return a.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(c){return this.get(c)},i.prototype.addAll=function(){if(arguments.length===2){for(var c=arguments[0],d=arguments[1],v=!1,M=c.iterator();M.hasNext();)this.add(M.next(),d),v=!0;return v}return r.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var c=r.prototype.clone.call(this),d=0;d<this.size();d++)c.add(d,this.get(d).copy());return c},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var c=arguments[0];r.prototype.add.call(this,c)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1];return this.add(d,v,!0),!0}if(arguments[0]instanceof D&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;r.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var L=arguments[0],H=arguments[1];return this.add(L,H),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var it=arguments[0],bt=arguments[1];if(arguments[2])for(var Tt=0;Tt<it.length;Tt++)this.add(it[Tt],bt);else for(var Kt=it.length-1;Kt>=0;Kt--)this.add(it[Kt],bt);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var Qt=arguments[0],le=arguments[1];if(!arguments[2]){var Ee=this.size();if(Ee>0&&(Qt>0&&this.get(Qt-1).equals2D(le)||Qt<Ee&&this.get(Qt).equals2D(le)))return null}r.prototype.add.call(this,Qt,le)}}else if(arguments.length===4){var Dn=arguments[0],Jn=arguments[1],fi=arguments[2],as=arguments[3],qs=1;fi>as&&(qs=-1);for(var Cf=fi;Cf!==as;Cf+=qs)this.add(Dn[Cf],Jn);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,a),i}(G),lt=function(){},Ft={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ft.ForwardComparator.get=function(){return Jt},Ft.BidirectionalComparator.get=function(){return me},Ft.coordArrayType.get=function(){return new Array(0).fill(null)},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},lt.isRing=function(r){return!(r.length<4)&&!!r[0].equals2D(r[r.length-1])},lt.ptNotInList=function(r,i){for(var a=0;a<r.length;a++){var c=r[a];if(lt.indexOf(c,i)<0)return c}return null},lt.scroll=function(r,i){var a=lt.indexOf(i,r);if(a<0)return null;var c=new Array(r.length).fill(null);te.arraycopy(r,a,c,0,r.length-a),te.arraycopy(r,0,c,r.length-a,a),te.arraycopy(c,0,r,0,r.length)},lt.equals=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];if(r===i)return!0;if(r===null||i===null||r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(!r[a].equals(i[a]))return!1;return!0}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];if(c===d)return!0;if(c===null||d===null||c.length!==d.length)return!1;for(var M=0;M<c.length;M++)if(v.compare(c[M],d[M])!==0)return!1;return!0}},lt.intersection=function(r,i){for(var a=new et,c=0;c<r.length;c++)i.intersects(r[c])&&a.add(r[c],!0);return a.toCoordinateArray()},lt.hasRepeatedPoints=function(r){for(var i=1;i<r.length;i++)if(r[i-1].equals(r[i]))return!0;return!1},lt.removeRepeatedPoints=function(r){return lt.hasRepeatedPoints(r)?new et(r,!1).toCoordinateArray():r},lt.reverse=function(r){for(var i=r.length-1,a=Math.trunc(i/2),c=0;c<=a;c++){var d=r[c];r[c]=r[i-c],r[i-c]=d}},lt.removeNull=function(r){for(var i=0,a=0;a<r.length;a++)r[a]!==null&&i++;var c=new Array(i).fill(null);if(i===0)return c;for(var d=0,v=0;v<r.length;v++)r[v]!==null&&(c[d++]=r[v]);return c},lt.copyDeep=function(){if(arguments.length===1){for(var r=arguments[0],i=new Array(r.length).fill(null),a=0;a<r.length;a++)i[a]=new D(r[a]);return i}if(arguments.length===5)for(var c=arguments[0],d=arguments[1],v=arguments[2],M=arguments[3],L=arguments[4],H=0;H<L;H++)v[M+H]=new D(c[d+H])},lt.isEqualReversed=function(r,i){for(var a=0;a<r.length;a++){var c=r[a],d=i[r.length-a-1];if(c.compareTo(d)!==0)return!1}return!0},lt.envelope=function(r){for(var i=new qt,a=0;a<r.length;a++)i.expandToInclude(r[a]);return i},lt.toCoordinateArray=function(r){return r.toArray(lt.coordArrayType)},lt.atLeastNCoordinatesOrNothing=function(r,i){return i.length>=r?i:[]},lt.indexOf=function(r,i){for(var a=0;a<i.length;a++)if(r.equals(i[a]))return a;return-1},lt.increasingDirection=function(r){for(var i=0;i<Math.trunc(r.length/2);i++){var a=r.length-1-i,c=r[i].compareTo(r[a]);if(c!==0)return c}return 1},lt.compare=function(r,i){for(var a=0;a<r.length&&a<i.length;){var c=r[a].compareTo(i[a]);if(c!==0)return c;a++}return a<i.length?-1:a<r.length?1:0},lt.minCoordinate=function(r){for(var i=null,a=0;a<r.length;a++)(i===null||i.compareTo(r[a])>0)&&(i=r[a]);return i},lt.extract=function(r,i,a){i=At.clamp(i,0,r.length);var c=(a=At.clamp(a,-1,r.length))-i+1;a<0&&(c=0),i>=r.length&&(c=0),a<i&&(c=0);var d=new Array(c).fill(null);if(c===0)return d;for(var v=0,M=i;M<=a;M++)d[v++]=r[M];return d},Object.defineProperties(lt,Ft);var Jt=function(){};Jt.prototype.compare=function(r,i){return lt.compare(r,i)},Jt.prototype.interfaces_=function(){return[q]},Jt.prototype.getClass=function(){return Jt};var me=function(){};me.prototype.compare=function(r,i){var a=r,c=i;if(a.length<c.length)return-1;if(a.length>c.length)return 1;if(a.length===0)return 0;var d=lt.compare(a,c);return lt.isEqualReversed(a,c)?0:d},me.prototype.OLDcompare=function(r,i){var a=r,c=i;if(a.length<c.length)return-1;if(a.length>c.length)return 1;if(a.length===0)return 0;for(var d=lt.increasingDirection(a),v=lt.increasingDirection(c),M=d>0?0:a.length-1,L=v>0?0:a.length-1,H=0;H<a.length;H++){var it=a[M].compareTo(c[L]);if(it!==0)return it;M+=d,L+=v}return 0},me.prototype.interfaces_=function(){return[q]},me.prototype.getClass=function(){return me};var ve=function(){};ve.prototype.get=function(){},ve.prototype.put=function(){},ve.prototype.size=function(){},ve.prototype.values=function(){},ve.prototype.entrySet=function(){};var He=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(ve);(s.prototype=new Error).name="OperationNotSupported",(l.prototype=new at).contains=function(){};var Ue=function(r){function i(){r.call(this),this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.contains=function(a){for(var c=0,d=this.array_.length;c<d;c++)if(this.array_[c]===a)return!0;return!1},i.prototype.add=function(a){return!this.contains(a)&&(this.array_.push(a),!0)},i.prototype.addAll=function(a){for(var c=a.iterator();c.hasNext();)this.add(c.next());return!0},i.prototype.remove=function(a){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 a=[],c=0,d=this.array_.length;c<d;c++)a.push(this.array_[c]);return a},i.prototype.iterator=function(){return new Ye(this)},i}(l),Ye=function(r){function i(a){r.call(this),this.hashSet_=a,this.position_=0}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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 s},i}(wt),Qe=0;(w.prototype=new He).get=function(r){for(var i=this.root_;i!==null;){var a=r.compareTo(i.key);if(a<0)i=i.left;else{if(!(a>0))return i.value;i=i.right}}return null},w.prototype.put=function(r,i){if(this.root_===null)return this.root_={key:r,value:i,left:null,right:null,parent:null,color:Qe,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var a,c,d=this.root_;do if(a=d,(c=r.compareTo(d.key))<0)d=d.left;else{if(!(c>0)){var v=d.value;return d.value=i,v}d=d.right}while(d!==null);var M={key:r,left:null,right:null,value:i,parent:a,color:Qe,getValue:function(){return this.value},getKey:function(){return this.key}};return c<0?a.left=M:a.right=M,this.fixAfterInsertion(M),this.size_++,null},w.prototype.fixAfterInsertion=function(r){for(r.color=1;r!=null&&r!==this.root_&&r.parent.color===1;)if(h(r)===m(h(h(r)))){var i=_(h(h(r)));p(i)===1?(g(h(r),Qe),g(i,Qe),g(h(h(r)),1),r=h(h(r))):(r===_(h(r))&&(r=h(r),this.rotateLeft(r)),g(h(r),Qe),g(h(h(r)),1),this.rotateRight(h(h(r))))}else{var a=m(h(h(r)));p(a)===1?(g(h(r),Qe),g(a,Qe),g(h(h(r)),1),r=h(h(r))):(r===m(h(r))&&(r=h(r),this.rotateRight(r)),g(h(r),Qe),g(h(h(r)),1),this.rotateLeft(h(h(r))))}this.root_.color=Qe},w.prototype.values=function(){var r=new G,i=this.getFirstEntry();if(i!==null)for(r.add(i.value);(i=w.successor(i))!==null;)r.add(i.value);return r},w.prototype.entrySet=function(){var r=new Ue,i=this.getFirstEntry();if(i!==null)for(r.add(i);(i=w.successor(i))!==null;)r.add(i);return r},w.prototype.rotateLeft=function(r){if(r!=null){var i=r.right;r.right=i.left,i.left!=null&&(i.left.parent=r),i.parent=r.parent,r.parent===null?this.root_=i:r.parent.left===r?r.parent.left=i:r.parent.right=i,i.left=r,r.parent=i}},w.prototype.rotateRight=function(r){if(r!=null){var i=r.left;r.left=i.right,i.right!=null&&(i.right.parent=r),i.parent=r.parent,r.parent===null?this.root_=i:r.parent.right===r?r.parent.right=i:r.parent.left=i,i.right=r,r.parent=i}},w.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},w.successor=function(r){if(r===null)return null;if(r.right!==null){for(var i=r.right;i.left!==null;)i=i.left;return i}for(var a=r.parent,c=r;a!==null&&c===a.right;)c=a,a=a.parent;return a},w.prototype.size=function(){return this.size_};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},S.prototype=new l,(b.prototype=new S).contains=function(r){for(var i=0,a=this.array_.length;i<a;i++)if(this.array_[i].compareTo(r)===0)return!0;return!1},b.prototype.add=function(r){if(this.contains(r))return!1;for(var i=0,a=this.array_.length;i<a;i++)if(this.array_[i].compareTo(r)===1)return this.array_.splice(i,0,r),!0;return this.array_.push(r),!0},b.prototype.addAll=function(r){for(var i=r.iterator();i.hasNext();)this.add(i.next());return!0},b.prototype.remove=function(r){throw new s},b.prototype.size=function(){return this.array_.length},b.prototype.isEmpty=function(){return this.array_.length===0},b.prototype.toArray=function(){for(var r=[],i=0,a=this.array_.length;i<a;i++)r.push(this.array_[i]);return r},b.prototype.iterator=function(){return new Kr(this)};var Kr=function(r){this.treeSet_=r,this.position_=0};Kr.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Kr.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Kr.prototype.remove=function(){throw new s};var nr=function(){};nr.sort=function(){var r,i,a,c,d=arguments[0];if(arguments.length===1)c=function(M,L){return M.compareTo(L)},d.sort(c);else if(arguments.length===2)a=arguments[1],c=function(M,L){return a.compare(M,L)},d.sort(c);else if(arguments.length===3){(i=d.slice(arguments[1],arguments[2])).sort();var v=d.slice(0,arguments[1]).concat(i,d.slice(arguments[2],d.length));for(d.splice(0,d.length),r=0;r<v.length;r++)d.push(v[r])}else if(arguments.length===4)for(i=d.slice(arguments[1],arguments[2]),a=arguments[3],c=function(M,L){return a.compare(M,L)},i.sort(c),v=d.slice(0,arguments[1]).concat(i,d.slice(arguments[2],d.length)),d.splice(0,d.length),r=0;r<v.length;r++)d.push(v[r])},nr.asList=function(r){for(var i=new G,a=0,c=r.length;a<c;a++)i.add(r[a]);return i};var Ie=function(){},rr={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}};rr.P.get=function(){return 0},rr.L.get=function(){return 1},rr.A.get=function(){return 2},rr.FALSE.get=function(){return-1},rr.TRUE.get=function(){return-2},rr.DONTCARE.get=function(){return-3},rr.SYM_FALSE.get=function(){return"F"},rr.SYM_TRUE.get=function(){return"T"},rr.SYM_DONTCARE.get=function(){return"*"},rr.SYM_P.get=function(){return"0"},rr.SYM_L.get=function(){return"1"},rr.SYM_A.get=function(){return"2"},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.toDimensionSymbol=function(r){switch(r){case Ie.FALSE:return Ie.SYM_FALSE;case Ie.TRUE:return Ie.SYM_TRUE;case Ie.DONTCARE:return Ie.SYM_DONTCARE;case Ie.P:return Ie.SYM_P;case Ie.L:return Ie.SYM_L;case Ie.A:return Ie.SYM_A}throw new I("Unknown dimension value: "+r)},Ie.toDimensionValue=function(r){switch(yt.toUpperCase(r)){case Ie.SYM_FALSE:return Ie.FALSE;case Ie.SYM_TRUE:return Ie.TRUE;case Ie.SYM_DONTCARE:return Ie.DONTCARE;case Ie.SYM_P:return Ie.P;case Ie.SYM_L:return Ie.L;case Ie.SYM_A:return Ie.A}throw new I("Unknown dimension symbol: "+r)},Object.defineProperties(Ie,rr);var pr=function(){};pr.prototype.filter=function(r){},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var ur=function(){};ur.prototype.filter=function(r,i){},ur.prototype.isDone=function(){},ur.prototype.isGeometryChanged=function(){},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var Qn=function(r){function i(c,d){if(r.call(this,d),this._geometries=c||[],r.hasNullElements(this._geometries))throw new I("geometries must not contain null elements")}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var c=new qt,d=0;d<this._geometries.length;d++)c.expandToInclude(this._geometries[d].getEnvelopeInternal());return c},i.prototype.getGeometryN=function(c){return this._geometries[c]},i.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var c=new Array(this.getNumPoints()).fill(null),d=-1,v=0;v<this._geometries.length;v++)for(var M=this._geometries[v].getCoordinates(),L=0;L<M.length;L++)c[++d]=M[L];return c},i.prototype.getArea=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getArea();return c},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c;if(this._geometries.length!==v._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(v._geometries[M],d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var c=0;c<this._geometries.length;c++)this._geometries[c].normalize();nr.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var c=Ie.FALSE,d=0;d<this._geometries.length;d++)c=Math.max(c,this._geometries[d].getBoundaryDimension());return c},i.prototype.getDimension=function(){for(var c=Ie.FALSE,d=0;d<this._geometries.length;d++)c=Math.max(c,this._geometries[d].getDimension());return c},i.prototype.getLength=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getLength();return c},i.prototype.getNumPoints=function(){for(var c=0,d=0;d<this._geometries.length;d++)c+=this._geometries[d].getNumPoints();return c},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[v]=this._geometries[v].reverse();return this.getFactory().createGeometryCollection(d)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var c=arguments[0],d=new b(nr.asList(this._geometries)),v=new b(nr.asList(c._geometries));return this.compare(d,v)}if(arguments.length===2){for(var M=arguments[0],L=arguments[1],H=M,it=this.getNumGeometries(),bt=H.getNumGeometries(),Tt=0;Tt<it&&Tt<bt;){var Kt=this.getGeometryN(Tt),Qt=H.getGeometryN(Tt),le=Kt.compareToSameClass(Qt,L);if(le!==0)return le;Tt++}return Tt<it?1:Tt<bt?-1:0}},i.prototype.apply=function(){if(Q(arguments[0],rt))for(var c=arguments[0],d=0;d<this._geometries.length;d++)this._geometries[d].apply(c);else if(Q(arguments[0],ur)){var v=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(v),!v.isDone());M++);v.isGeometryChanged()&&this.geometryChanged()}else if(Q(arguments[0],pr)){var L=arguments[0];L.filter(this);for(var H=0;H<this._geometries.length;H++)this._geometries[H].apply(L)}else if(Q(arguments[0],Ce)){var it=arguments[0];it.filter(this);for(var bt=0;bt<this._geometries.length;bt++)this._geometries[bt].apply(it)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Wt.shouldNeverReachHere(),null},i.prototype.clone=function(){var c=r.prototype.clone.call(this);c._geometries=new Array(this._geometries.length).fill(null);for(var d=0;d<this._geometries.length;d++)c._geometries[d]=this._geometries[d].clone();return c},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.isEmpty=function(){for(var c=0;c<this._geometries.length;c++)if(!this._geometries[c].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,a),i}(Vt),bi=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var c=0;c<this._geometries.length;c++)if(!this._geometries[c].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[c-1-v]=this._geometries[v].reverse();return this.getFactory().createMultiLineString(d)},i.prototype.getBoundary=function(){return new oi(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,a),i}(Qn),oi=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var r=arguments[0],i=P.MOD2_BOUNDARY_RULE;this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._geom=a,this._geomFact=a.getFactory(),this._bnRule=c}};oi.prototype.boundaryMultiLineString=function(r){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(r);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},oi.prototype.getBoundary=function(){return this._geom instanceof vt?this.boundaryLineString(this._geom):this._geom instanceof bi?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},oi.prototype.boundaryLineString=function(r){return this._geom.isEmpty()?this.getEmptyMultiPoint():r.isClosed()?this._bnRule.isInBoundary(2)?r.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([r.getStartPoint(),r.getEndPoint()])},oi.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},oi.prototype.computeBoundaryCoordinates=function(r){var i=new G;this._endpointMap=new w;for(var a=0;a<r.getNumGeometries();a++){var c=r.getGeometryN(a);c.getNumPoints()!==0&&(this.addEndpoint(c.getCoordinateN(0)),this.addEndpoint(c.getCoordinateN(c.getNumPoints()-1)))}for(var d=this._endpointMap.entrySet().iterator();d.hasNext();){var v=d.next(),M=v.getValue().count;this._bnRule.isInBoundary(M)&&i.add(v.getKey())}return lt.toCoordinateArray(i)},oi.prototype.addEndpoint=function(r){var i=this._endpointMap.get(r);i===null&&(i=new Z,this._endpointMap.put(r,i)),i.count++},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.getBoundary=function(){if(arguments.length===1){var r=arguments[0];return new oi(r).getBoundary()}if(arguments.length===2){var i=arguments[0],a=arguments[1];return new oi(i,a).getBoundary()}};var Z=function(){this.count=null};Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z};var mt=function(){},Rt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.chars=function(r,i){for(var a=new Array(i).fill(null),c=0;c<i;c++)a[c]=r;return String(a)},mt.getStackTrace=function(){if(arguments.length===1){var r=arguments[0],i=new function(){},a=new function(){}(i);return r.printStackTrace(a),i.toString()}if(arguments.length===2){for(var c=arguments[0],d=arguments[1],v="",M=new function(){}(new function(){}(mt.getStackTrace(c))),L=0;L<d;L++)try{v+=M.readLine()+mt.NEWLINE}catch(H){if(!(H instanceof C))throw H;Wt.shouldNeverReachHere()}return v}},mt.split=function(r,i){for(var a=i.length,c=new G,d=""+r,v=d.indexOf(i);v>=0;){var M=d.substring(0,v);c.add(M),v=(d=d.substring(v+a)).indexOf(i)}d.length>0&&c.add(d);for(var L=new Array(c.size()).fill(null),H=0;H<L.length;H++)L[H]=c.get(H);return L},mt.toString=function(){if(arguments.length===1){var r=arguments[0];return mt.SIMPLE_ORDINATE_FORMAT.format(r)}},mt.spaces=function(r){return mt.chars(" ",r)},Rt.NEWLINE.get=function(){return te.getProperty("line.separator")},Rt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(mt,Rt);var St=function(){};St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.copyCoord=function(r,i,a,c){for(var d=Math.min(r.getDimension(),a.getDimension()),v=0;v<d;v++)a.setOrdinate(c,v,r.getOrdinate(i,v))},St.isRing=function(r){var i=r.size();return i===0||!(i<=3)&&r.getOrdinate(0,ut.X)===r.getOrdinate(i-1,ut.X)&&r.getOrdinate(0,ut.Y)===r.getOrdinate(i-1,ut.Y)},St.isEqual=function(r,i){var a=r.size();if(a!==i.size())return!1;for(var c=Math.min(r.getDimension(),i.getDimension()),d=0;d<a;d++)for(var v=0;v<c;v++){var M=r.getOrdinate(d,v),L=i.getOrdinate(d,v);if(r.getOrdinate(d,v)!==i.getOrdinate(d,v)&&(!A.isNaN(M)||!A.isNaN(L)))return!1}return!0},St.extend=function(r,i,a){var c=r.create(a,i.getDimension()),d=i.size();if(St.copy(i,0,c,0,d),d>0)for(var v=d;v<a;v++)St.copy(i,d-1,c,v,1);return c},St.reverse=function(r){for(var i=r.size()-1,a=Math.trunc(i/2),c=0;c<=a;c++)St.swap(r,c,i-c)},St.swap=function(r,i,a){if(i===a)return null;for(var c=0;c<r.getDimension();c++){var d=r.getOrdinate(i,c);r.setOrdinate(i,c,r.getOrdinate(a,c)),r.setOrdinate(a,c,d)}},St.copy=function(r,i,a,c,d){for(var v=0;v<d;v++)St.copyCoord(r,i+v,a,c+v)},St.toString=function(){if(arguments.length===1){var r=arguments[0],i=r.size();if(i===0)return"()";var a=r.getDimension(),c=new Lt;c.append("(");for(var d=0;d<i;d++){d>0&&c.append(" ");for(var v=0;v<a;v++)v>0&&c.append(","),c.append(mt.toString(r.getOrdinate(d,v)))}return c.append(")"),c.toString()}},St.ensureValidRing=function(r,i){var a=i.size();return a===0?i:a<=3?St.createClosedRing(r,i,4):i.getOrdinate(0,ut.X)===i.getOrdinate(a-1,ut.X)&&i.getOrdinate(0,ut.Y)===i.getOrdinate(a-1,ut.Y)?i:St.createClosedRing(r,i,a+1)},St.createClosedRing=function(r,i,a){var c=r.create(a,i.getDimension()),d=i.size();St.copy(i,0,c,0,d);for(var v=d;v<a;v++)St.copy(i,0,c,v,1);return c};var vt=function(r){function i(c,d){r.call(this,d),this._points=null,this.init(c)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new qt:this._points.expandEnvelope(new qt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c;if(this._points.size()!==v._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),v._points.getCoordinate(M),d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var c=0;c<Math.trunc(this._points.size()/2);c++){var d=this._points.size()-1-c;if(!this._points.getCoordinate(c).equals(this._points.getCoordinate(d)))return this._points.getCoordinate(c).compareTo(this._points.getCoordinate(d))>0&&St.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.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 dt.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var c=this._points.copy();return St.reverse(c),this.getFactory().createLineString(c)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var c=arguments[0],d=0,v=0;d<this._points.size()&&v<c._points.size();){var M=this._points.getCoordinate(d).compareTo(c._points.getCoordinate(v));if(M!==0)return M;d++,v++}return d<this._points.size()?1:v<c._points.size()?-1:0}if(arguments.length===2){var L=arguments[0];return arguments[1].compare(this._points,L._points)}},i.prototype.apply=function(){if(Q(arguments[0],rt))for(var c=arguments[0],d=0;d<this._points.size();d++)c.filter(this._points.getCoordinate(d));else if(Q(arguments[0],ur)){var v=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(v.filter(this._points,M),!v.isDone());M++);v.isGeometryChanged()&&this.geometryChanged()}else Q(arguments[0],pr)?arguments[0].filter(this):Q(arguments[0],Ce)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new oi(this).getBoundary()},i.prototype.isEquivalentClass=function(c){return c instanceof i},i.prototype.clone=function(){var c=r.prototype.clone.call(this);return c._points=this._points.clone(),c},i.prototype.getCoordinateN=function(c){return this._points.getCoordinate(c)},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(c){if(c===null&&(c=this.getFactory().getCoordinateSequenceFactory().create([])),c.size()===1)throw new I("Invalid number of points in LineString (found "+c.size()+" - must be 0 or >= 2)");this._points=c},i.prototype.isCoordinate=function(c){for(var d=0;d<this._points.size();d++)if(this._points.getCoordinate(d).equals(c))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(c){return this.getFactory().createPoint(this._points.getCoordinate(c))},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,a),i}(Vt),he=function(){};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he};var ue=function(r){function i(c,d){r.call(this,d),this._coordinates=c||null,this.init(this._coordinates)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new qt;var c=new qt;return c.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),c},i.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&(!(!this.isEmpty()||!c.isEmpty())||this.isEmpty()===c.isEmpty()&&this.equal(c.getCoordinate(),this.getCoordinate(),d))}return r.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 Ie.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 c=arguments[0];return this.getCoordinate().compareTo(c.getCoordinate())}if(arguments.length===2){var d=arguments[0];return arguments[1].compare(this._coordinates,d._coordinates)}},i.prototype.apply=function(){if(Q(arguments[0],rt)){var c=arguments[0];if(this.isEmpty())return null;c.filter(this.getCoordinate())}else if(Q(arguments[0],ur)){var d=arguments[0];if(this.isEmpty())return null;d.filter(this._coordinates,0),d.isGeometryChanged()&&this.geometryChanged()}else Q(arguments[0],pr)?arguments[0].filter(this):Q(arguments[0],Ce)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var c=r.prototype.clone.call(this);return c._coordinates=this._coordinates.clone(),c},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(c){c===null&&(c=this.getFactory().getCoordinateSequenceFactory().create([])),Wt.isTrue(c.size()<=1),this._coordinates=c},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[he]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,a),i}(Vt),we=function(){};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we};var de=function(r){function i(c,d,v){if(r.call(this,v),this._shell=null,this._holes=null,c===null&&(c=this.getFactory().createLinearRing()),d===null&&(d=[]),r.hasNullElements(d))throw new I("holes must not contain null elements");if(c.isEmpty()&&r.hasNonEmptyElements(d))throw new I("shell is empty but holes are not");this._shell=c,this._holes=d}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var c=new Array(this.getNumPoints()).fill(null),d=-1,v=this._shell.getCoordinates(),M=0;M<v.length;M++)c[++d]=v[M];for(var L=0;L<this._holes.length;L++)for(var H=this._holes[L].getCoordinates(),it=0;it<H.length;it++)c[++d]=H[it];return c},i.prototype.getArea=function(){var c=0;c+=Math.abs(dt.signedArea(this._shell.getCoordinateSequence()));for(var d=0;d<this._holes.length;d++)c-=Math.abs(dt.signedArea(this._holes[d].getCoordinateSequence()));return c},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var c=this._shell.getCoordinateSequence(),d=this.getEnvelopeInternal(),v=0;v<5;v++){var M=c.getX(v);if(M!==d.getMinX()&&M!==d.getMaxX())return!1;var L=c.getY(v);if(L!==d.getMinY()&&L!==d.getMaxY())return!1}for(var H=c.getX(0),it=c.getY(0),bt=1;bt<=4;bt++){var Tt=c.getX(bt),Kt=c.getY(bt);if(Tt!==H==(Kt!==it))return!1;H=Tt,it=Kt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];if(!this.isEquivalentClass(c))return!1;var v=c,M=this._shell,L=v._shell;if(!M.equalsExact(L,d)||this._holes.length!==v._holes.length)return!1;for(var H=0;H<this._holes.length;H++)if(!this._holes[H].equalsExact(v._holes[H],d))return!1;return!0}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var c=0;c<this._holes.length;c++)this.normalize(this._holes[c],!1);nr.sort(this._holes)}else if(arguments.length===2){var d=arguments[0],v=arguments[1];if(d.isEmpty())return null;var M=new Array(d.getCoordinates().length-1).fill(null);te.arraycopy(d.getCoordinates(),0,M,0,M.length);var L=lt.minCoordinate(d.getCoordinates());lt.scroll(M,L),te.arraycopy(M,0,d.getCoordinates(),0,M.length),d.getCoordinates()[M.length]=M[0],dt.isCCW(d.getCoordinates())===v&<.reverse(d.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 c=0;c+=this._shell.getLength();for(var d=0;d<this._holes.length;d++)c+=this._holes[d].getLength();return c},i.prototype.getNumPoints=function(){for(var c=this._shell.getNumPoints(),d=0;d<this._holes.length;d++)c+=this._holes[d].getNumPoints();return c},i.prototype.reverse=function(){var c=this.copy();c._shell=this._shell.copy().reverse(),c._holes=new Array(this._holes.length).fill(null);for(var d=0;d<this._holes.length;d++)c._holes[d]=this._holes[d].copy().reverse();return c},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var c=arguments[0],d=this._shell,v=c._shell;return d.compareToSameClass(v)}if(arguments.length===2){var M=arguments[0],L=arguments[1],H=M,it=this._shell,bt=H._shell,Tt=it.compareToSameClass(bt,L);if(Tt!==0)return Tt;for(var Kt=this.getNumInteriorRing(),Qt=H.getNumInteriorRing(),le=0;le<Kt&&le<Qt;){var Ee=this.getInteriorRingN(le),Dn=H.getInteriorRingN(le),Jn=Ee.compareToSameClass(Dn,L);if(Jn!==0)return Jn;le++}return le<Kt?1:le<Qt?-1:0}},i.prototype.apply=function(c){if(Q(c,rt)){this._shell.apply(c);for(var d=0;d<this._holes.length;d++)this._holes[d].apply(c)}else if(Q(c,ur)){if(this._shell.apply(c),!c.isDone())for(var v=0;v<this._holes.length&&(this._holes[v].apply(c),!c.isDone());v++);c.isGeometryChanged()&&this.geometryChanged()}else if(Q(c,pr))c.filter(this);else if(Q(c,Ce)){c.filter(this),this._shell.apply(c);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(c)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var c=new Array(this._holes.length+1).fill(null);c[0]=this._shell;for(var d=0;d<this._holes.length;d++)c[d+1]=this._holes[d];return c.length<=1?this.getFactory().createLinearRing(c[0].getCoordinateSequence()):this.getFactory().createMultiLineString(c)},i.prototype.clone=function(){var c=r.prototype.clone.call(this);c._shell=this._shell.clone(),c._holes=new Array(this._holes.length).fill(null);for(var d=0;d<this._holes.length;d++)c._holes[d]=this._holes[d].clone();return c},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var c=this._shell.copy(),d=new Array(this._holes.length).fill(null),v=0;v<d.length;v++)d[v]=this._holes[v].copy();return new i(c,d,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(c){return this._holes[c]},i.prototype.interfaces_=function(){return[we]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,a),i}(Vt),Be=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var c=arguments[0];return this._geometries[c].getCoordinate()}return r.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return Ie.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 c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[he]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,a),i}(Qn),Ae=function(r){function i(c,d){c instanceof D&&d instanceof Le&&(c=d.getCoordinateSequenceFactory().create(c)),r.call(this,c,d),this.validateConstruction()}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return Ie.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||r.prototype.isClosed.call(this)},i.prototype.reverse=function(){var c=this._points.copy();return St.reverse(c),this.getFactory().createLinearRing(c)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new I("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new I("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},a.MINIMUM_VALID_SIZE.get=function(){return 4},a.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,a),i}(vt),Pe=function(r){function i(){r.apply(this,arguments)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Vt.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return!!this.isEquivalentClass(c)&&r.prototype.equalsExact.call(this,c,d)}return r.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var c=this._geometries.length,d=new Array(c).fill(null),v=0;v<this._geometries.length;v++)d[v]=this._geometries[v].reverse();return this.getFactory().createMultiPolygon(d)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var c=new G,d=0;d<this._geometries.length;d++)for(var v=this._geometries[d].getBoundary(),M=0;M<v.getNumGeometries();M++)c.add(v.getGeometryN(M));var L=new Array(c.size()).fill(null);return this.getFactory().createMultiLineString(c.toArray(L))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var c=new Array(this._geometries.length).fill(null),d=0;d<c.length;d++)c[d]=this._geometries[d].copy();return new i(c,this._factory)},i.prototype.interfaces_=function(){return[we]},i.prototype.getClass=function(){return i},a.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,a),i}(Qn),rn=function(r){this._factory=r||null,this._isUserDataCopied=!1},si={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rn.prototype.setCopyUserData=function(r){this._isUserDataCopied=r},rn.prototype.edit=function(r,i){if(r===null)return null;var a=this.editInternal(r,i);return this._isUserDataCopied&&a.setUserData(r.getUserData()),a},rn.prototype.editInternal=function(r,i){return this._factory===null&&(this._factory=r.getFactory()),r instanceof Qn?this.editGeometryCollection(r,i):r instanceof de?this.editPolygon(r,i):r instanceof ue?i.edit(r,this._factory):r instanceof vt?i.edit(r,this._factory):(Wt.shouldNeverReachHere("Unsupported Geometry class: "+r.getClass().getName()),null)},rn.prototype.editGeometryCollection=function(r,i){for(var a=i.edit(r,this._factory),c=new G,d=0;d<a.getNumGeometries();d++){var v=this.edit(a.getGeometryN(d),i);v===null||v.isEmpty()||c.add(v)}return a.getClass()===Be?this._factory.createMultiPoint(c.toArray([])):a.getClass()===bi?this._factory.createMultiLineString(c.toArray([])):a.getClass()===Pe?this._factory.createMultiPolygon(c.toArray([])):this._factory.createGeometryCollection(c.toArray([]))},rn.prototype.editPolygon=function(r,i){var a=i.edit(r,this._factory);if(a===null&&(a=this._factory.createPolygon(null)),a.isEmpty())return a;var c=this.edit(a.getExteriorRing(),i);if(c===null||c.isEmpty())return this._factory.createPolygon();for(var d=new G,v=0;v<a.getNumInteriorRing();v++){var M=this.edit(a.getInteriorRingN(v),i);M===null||M.isEmpty()||d.add(M)}return this._factory.createPolygon(c,d.toArray([]))},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.GeometryEditorOperation=function(){},si.NoOpGeometryOperation.get=function(){return br},si.CoordinateOperation.get=function(){return Wi},si.CoordinateSequenceOperation.get=function(){return sr},Object.defineProperties(rn,si);var br=function(){};br.prototype.edit=function(r,i){return r},br.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},br.prototype.getClass=function(){return br};var Wi=function(){};Wi.prototype.edit=function(r,i){var a=this.editCoordinates(r.getCoordinates(),r);return a===null?r:r instanceof Ae?i.createLinearRing(a):r instanceof vt?i.createLineString(a):r instanceof ue?a.length>0?i.createPoint(a[0]):i.createPoint():r},Wi.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},Wi.prototype.getClass=function(){return Wi};var sr=function(){};sr.prototype.edit=function(r,i){return r instanceof Ae?i.createLinearRing(this.edit(r.getCoordinateSequence(),r)):r instanceof vt?i.createLineString(this.edit(r.getCoordinateSequence(),r)):r instanceof ue?i.createPoint(this.edit(r.getCoordinateSequence(),r)):r},sr.prototype.interfaces_=function(){return[rn.GeometryEditorOperation]},sr.prototype.getClass=function(){return sr};var ye=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 r=arguments[0];this._coordinates=new Array(r).fill(null);for(var i=0;i<r;i++)this._coordinates[i]=new D}else if(Q(arguments[0],ut)){var a=arguments[0];if(a===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=a.getDimension(),this._coordinates=new Array(a.size()).fill(null);for(var c=0;c<this._coordinates.length;c++)this._coordinates[c]=a.getCoordinateCopy(c)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var d=arguments[0],v=arguments[1];this._coordinates=d,this._dimension=v,d===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],L=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=L;for(var H=0;H<M;H++)this._coordinates[H]=new D}}},Fa={serialVersionUID:{configurable:!0}};ye.prototype.setOrdinate=function(r,i,a){switch(i){case ut.X:this._coordinates[r].x=a;break;case ut.Y:this._coordinates[r].y=a;break;case ut.Z:this._coordinates[r].z=a;break;default:throw new I("invalid ordinateIndex")}},ye.prototype.size=function(){return this._coordinates.length},ye.prototype.getOrdinate=function(r,i){switch(i){case ut.X:return this._coordinates[r].x;case ut.Y:return this._coordinates[r].y;case ut.Z:return this._coordinates[r].z}return A.NaN},ye.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._coordinates[r]}if(arguments.length===2){var i=arguments[0],a=arguments[1];a.x=this._coordinates[i].x,a.y=this._coordinates[i].y,a.z=this._coordinates[i].z}},ye.prototype.getCoordinateCopy=function(r){return new D(this._coordinates[r])},ye.prototype.getDimension=function(){return this._dimension},ye.prototype.getX=function(r){return this._coordinates[r].x},ye.prototype.clone=function(){for(var r=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)r[i]=this._coordinates[i].clone();return new ye(r,this._dimension)},ye.prototype.expandEnvelope=function(r){for(var i=0;i<this._coordinates.length;i++)r.expandToInclude(this._coordinates[i]);return r},ye.prototype.copy=function(){for(var r=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)r[i]=this._coordinates[i].copy();return new ye(r,this._dimension)},ye.prototype.toString=function(){if(this._coordinates.length>0){var r=new Lt(17*this._coordinates.length);r.append("("),r.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)r.append(", "),r.append(this._coordinates[i]);return r.append(")"),r.toString()}return"()"},ye.prototype.getY=function(r){return this._coordinates[r].y},ye.prototype.toCoordinateArray=function(){return this._coordinates},ye.prototype.interfaces_=function(){return[ut,t]},ye.prototype.getClass=function(){return ye},Fa.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ye,Fa);var on=function(){},fo={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};on.prototype.readResolve=function(){return on.instance()},on.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return new ye(r)}if(Q(arguments[0],ut)){var i=arguments[0];return new ye(i)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];return c>3&&(c=3),c<2?new ye(a):new ye(a,c)}},on.prototype.interfaces_=function(){return[j,t]},on.prototype.getClass=function(){return on},on.instance=function(){return on.instanceObject},fo.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},fo.instanceObject.get=function(){return new on},Object.defineProperties(on,fo);var ul=function(r){function i(){r.call(this),this.map_=new Map}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.get=function(a){return this.map_.get(a)||null},i.prototype.put=function(a,c){return this.map_.set(a,c),c},i.prototype.values=function(){for(var a=new G,c=this.map_.values(),d=c.next();!d.done;)a.add(d.value),d=c.next();return a},i.prototype.entrySet=function(){var a=new Ue;return this.map_.entries().forEach(function(c){return a.add(c)}),a},i.prototype.size=function(){return this.map_.size()},i}(ve),Ge=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ir){var i=arguments[0];this._modelType=i,i===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var a=arguments[0];this._modelType=r.FIXED,this.setScale(a)}else if(arguments[0]instanceof r){var c=arguments[0];this._modelType=c._modelType,this._scale=c._scale}}},ys={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ge.prototype.equals=function(r){if(!(r instanceof Ge))return!1;var i=r;return this._modelType===i._modelType&&this._scale===i._scale},Ge.prototype.compareTo=function(r){var i=r,a=this.getMaximumSignificantDigits(),c=i.getMaximumSignificantDigits();return new pt(a).compareTo(new pt(c))},Ge.prototype.getScale=function(){return this._scale},Ge.prototype.isFloating=function(){return this._modelType===Ge.FLOATING||this._modelType===Ge.FLOATING_SINGLE},Ge.prototype.getType=function(){return this._modelType},Ge.prototype.toString=function(){var r="UNKNOWN";return this._modelType===Ge.FLOATING?r="Floating":this._modelType===Ge.FLOATING_SINGLE?r="Floating-Single":this._modelType===Ge.FIXED&&(r="Fixed (Scale="+this.getScale()+")"),r},Ge.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var r=arguments[0];return A.isNaN(r)||this._modelType===Ge.FLOATING_SINGLE?r:this._modelType===Ge.FIXED?Math.round(r*this._scale)/this._scale:r}if(arguments[0]instanceof D){var i=arguments[0];if(this._modelType===Ge.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Ge.prototype.getMaximumSignificantDigits=function(){var r=16;return this._modelType===Ge.FLOATING?r=16:this._modelType===Ge.FLOATING_SINGLE?r=6:this._modelType===Ge.FIXED&&(r=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),r},Ge.prototype.setScale=function(r){this._scale=Math.abs(r)},Ge.prototype.interfaces_=function(){return[t,V]},Ge.prototype.getClass=function(){return Ge},Ge.mostPrecise=function(r,i){return r.compareTo(i)>=0?r:i},ys.serialVersionUID.get=function(){return 7777263578777804e3},ys.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ge,ys);var ir=function r(i){this._name=i||null,r.nameToTypeMap.put(i,this)},jo={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ir.prototype.readResolve=function(){return ir.nameToTypeMap.get(this._name)},ir.prototype.toString=function(){return this._name},ir.prototype.interfaces_=function(){return[t]},ir.prototype.getClass=function(){return ir},jo.serialVersionUID.get=function(){return-552860263173159e4},jo.nameToTypeMap.get=function(){return new ul},Object.defineProperties(ir,jo),Ge.Type=ir,Ge.FIXED=new ir("FIXED"),Ge.FLOATING=new ir("FLOATING"),Ge.FLOATING_SINGLE=new ir("FLOATING SINGLE");var Le=function r(){this._precisionModel=new Ge,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Q(arguments[0],j)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ge&&(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]))},Ai={serialVersionUID:{configurable:!0}};Le.prototype.toGeometry=function(r){return r.isNull()?this.createPoint(null):r.getMinX()===r.getMaxX()&&r.getMinY()===r.getMaxY()?this.createPoint(new D(r.getMinX(),r.getMinY())):r.getMinX()===r.getMaxX()||r.getMinY()===r.getMaxY()?this.createLineString([new D(r.getMinX(),r.getMinY()),new D(r.getMaxX(),r.getMaxY())]):this.createPolygon(this.createLinearRing([new D(r.getMinX(),r.getMinY()),new D(r.getMinX(),r.getMaxY()),new D(r.getMaxX(),r.getMaxY()),new D(r.getMaxX(),r.getMinY()),new D(r.getMinX(),r.getMinY())]),null)},Le.prototype.createLineString=function(r){return r?r instanceof Array?new vt(this.getCoordinateSequenceFactory().create(r),this):Q(r,ut)?new vt(r,this):void 0:new vt(this.getCoordinateSequenceFactory().create([]),this)},Le.prototype.createMultiLineString=function(){if(arguments.length===0)return new bi(null,this);if(arguments.length===1){var r=arguments[0];return new bi(r,this)}},Le.prototype.buildGeometry=function(r){for(var i=null,a=!1,c=!1,d=r.iterator();d.hasNext();){var v=d.next(),M=v.getClass();i===null&&(i=M),M!==i&&(a=!0),v.isGeometryCollectionOrDerived()&&(c=!0)}if(i===null)return this.createGeometryCollection();if(a||c)return this.createGeometryCollection(Le.toGeometryArray(r));var L=r.iterator().next();if(r.size()>1){if(L instanceof de)return this.createMultiPolygon(Le.toPolygonArray(r));if(L instanceof vt)return this.createMultiLineString(Le.toLineStringArray(r));if(L instanceof ue)return this.createMultiPoint(Le.toPointArray(r));Wt.shouldNeverReachHere("Unhandled class: "+L.getClass().getName())}return L},Le.prototype.createMultiPointFromCoords=function(r){return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)},Le.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var r=arguments[0];return this.createPoint(r!==null?this.getCoordinateSequenceFactory().create([r]):null)}if(Q(arguments[0],ut)){var i=arguments[0];return new ue(i,this)}}},Le.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Le.prototype.createPolygon=function(){if(arguments.length===0)return new de(null,null,this);if(arguments.length===1){if(Q(arguments[0],ut)){var r=arguments[0];return this.createPolygon(this.createLinearRing(r))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof Ae){var a=arguments[0];return this.createPolygon(a,null)}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];return new de(c,d,this)}},Le.prototype.getSRID=function(){return this._SRID},Le.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Qn(null,this);if(arguments.length===1){var r=arguments[0];return new Qn(r,this)}},Le.prototype.createGeometry=function(r){return new rn(this).edit(r,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Le.prototype.getPrecisionModel=function(){return this._precisionModel},Le.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLinearRing(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Q(arguments[0],ut)){var i=arguments[0];return new Ae(i,this)}}},Le.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Pe(null,this);if(arguments.length===1){var r=arguments[0];return new Pe(r,this)}},Le.prototype.createMultiPoint=function(){if(arguments.length===0)return new Be(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return new Be(r,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(Q(arguments[0],ut)){var a=arguments[0];if(a===null)return this.createMultiPoint(new Array(0).fill(null));for(var c=new Array(a.size()).fill(null),d=0;d<a.size();d++){var v=this.getCoordinateSequenceFactory().create(1,a.getDimension());St.copy(a,d,v,0,1),c[d]=this.createPoint(v)}return this.createMultiPoint(c)}}},Le.prototype.interfaces_=function(){return[t]},Le.prototype.getClass=function(){return Le},Le.toMultiPolygonArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toGeometryArray=function(r){if(r===null)return null;var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.getDefaultCoordinateSequenceFactory=function(){return on.instance()},Le.toMultiLineStringArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toLineStringArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toMultiPointArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toLinearRingArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toPointArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.toPolygonArray=function(r){var i=new Array(r.size()).fill(null);return r.toArray(i)},Le.createPointFromInternalCoord=function(r,i){return i.getPrecisionModel().makePrecise(r),i.getFactory().createPoint(r)},Ai.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Le,Ai);var Ua=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],yu=function(r){this.geometryFactory=r||new Le};yu.prototype.read=function(r){var i,a=(i=typeof r=="string"?JSON.parse(r):r).type;if(!Ti[a])throw new Error("Unknown GeoJSON type: "+i.type);return Ua.indexOf(a)!==-1?Ti[a].apply(this,[i.coordinates]):a==="GeometryCollection"?Ti[a].apply(this,[i.geometries]):Ti[a].apply(this,[i])},yu.prototype.write=function(r){var i=r.getGeometryType();if(!Po[i])throw new Error("Geometry is not supported");return Po[i].apply(this,[r])};var Ti={Feature:function(r){var i={};for(var a in r)i[a]=r[a];if(r.geometry){var c=r.geometry.type;if(!Ti[c])throw new Error("Unknown GeoJSON type: "+r.type);i.geometry=this.read(r.geometry)}return r.bbox&&(i.bbox=Ti.bbox.apply(this,[r.bbox])),i},FeatureCollection:function(r){var i={};if(r.features){i.features=[];for(var a=0;a<r.features.length;++a)i.features.push(this.read(r.features[a]))}return r.bbox&&(i.bbox=this.parse.bbox.apply(this,[r.bbox])),i},coordinates:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(new D(c[0],c[1]))}return i},bbox:function(r){return this.geometryFactory.createLinearRing([new D(r[0],r[1]),new D(r[2],r[1]),new D(r[2],r[3]),new D(r[0],r[3]),new D(r[0],r[1])])},Point:function(r){var i=new D(r[0],r[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(r){for(var i=[],a=0;a<r.length;++a)i.push(Ti.Point.apply(this,[r[a]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(r){var i=Ti.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(i)},MultiLineString:function(r){for(var i=[],a=0;a<r.length;++a)i.push(Ti.LineString.apply(this,[r[a]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(r){for(var i=Ti.coordinates.apply(this,[r[0]]),a=this.geometryFactory.createLinearRing(i),c=[],d=1;d<r.length;++d){var v=r[d],M=Ti.coordinates.apply(this,[v]),L=this.geometryFactory.createLinearRing(M);c.push(L)}return this.geometryFactory.createPolygon(a,c)},MultiPolygon:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(Ti.Polygon.apply(this,[c]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(r){for(var i=[],a=0;a<r.length;++a){var c=r[a];i.push(this.read(c))}return this.geometryFactory.createGeometryCollection(i)}},Po={coordinate:function(r){return[r.x,r.y]},Point:function(r){return{type:"Point",coordinates:Po.coordinate.apply(this,[r.getCoordinate()])}},MultiPoint:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.Point.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(r){for(var i=[],a=r.getCoordinates(),c=0;c<a.length;++c){var d=a[c];i.push(Po.coordinate.apply(this,[d]))}return{type:"LineString",coordinates:i}},MultiLineString:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.LineString.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(r){var i=[],a=Po.LineString.apply(this,[r._shell]);i.push(a.coordinates);for(var c=0;c<r._holes.length;++c){var d=r._holes[c],v=Po.LineString.apply(this,[d]);i.push(v.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=Po.Polygon.apply(this,[c]);i.push(d.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(r){for(var i=[],a=0;a<r._geometries.length;++a){var c=r._geometries[a],d=c.getGeometryType();i.push(Po[d].apply(this,[c]))}return{type:"GeometryCollection",geometries:i}}},ll=function(r){this.geometryFactory=r||new Le,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new yu(this.geometryFactory)};ll.prototype.read=function(r){var i=this.parser.read(r);return this.precisionModel.getType()===Ge.FIXED&&this.reducePrecision(i),i},ll.prototype.reducePrecision=function(r){var i,a;if(r.coordinate)this.precisionModel.makePrecise(r.coordinate);else if(r.points)for(i=0,a=r.points.length;i<a;i++)this.precisionModel.makePrecise(r.points[i]);else if(r.geometries)for(i=0,a=r.geometries.length;i<a;i++)this.reducePrecision(r.geometries[i])};var Ba=function(){this.parser=new yu(this.geometryFactory)};Ba.prototype.write=function(r){return this.parser.write(r)};var Xt=function(){},cl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.opposite=function(r){return r===Xt.LEFT?Xt.RIGHT:r===Xt.RIGHT?Xt.LEFT:r},cl.ON.get=function(){return 0},cl.LEFT.get=function(){return 1},cl.RIGHT.get=function(){return 2},Object.defineProperties(Xt,cl),(R.prototype=new Error).name="EmptyStackException",(x.prototype=new Et).add=function(r){return this.array_.push(r),!0},x.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},x.prototype.push=function(r){return this.array_.push(r),r},x.prototype.pop=function(r){if(this.array_.length===0)throw new R;return this.array_.pop()},x.prototype.peek=function(){if(this.array_.length===0)throw new R;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(r){return this.array_.indexOf(r)},x.prototype.size=function(){return this.array_.length},x.prototype.toArray=function(){for(var r=[],i=0,a=this.array_.length;i<a;i++)r.push(this.array_[i]);return r};var Io=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Io.prototype.getCoordinate=function(){return this._minCoord},Io.prototype.getRightmostSide=function(r,i){var a=this.getRightmostSideOfSegment(r,i);return a<0&&(a=this.getRightmostSideOfSegment(r,i-1)),a<0&&(this._minCoord=null,this.checkForRightmostCoordinate(r)),a},Io.prototype.findRightmostEdgeAtVertex=function(){var r=this._minDe.getEdge().getCoordinates();Wt.isTrue(this._minIndex>0&&this._minIndex<r.length,"rightmost point expected to be interior vertex of edge");var i=r[this._minIndex-1],a=r[this._minIndex+1],c=dt.computeOrientation(this._minCoord,a,i),d=!1;(i.y<this._minCoord.y&&a.y<this._minCoord.y&&c===dt.COUNTERCLOCKWISE||i.y>this._minCoord.y&&a.y>this._minCoord.y&&c===dt.CLOCKWISE)&&(d=!0),d&&(this._minIndex=this._minIndex-1)},Io.prototype.getRightmostSideOfSegment=function(r,i){var a=r.getEdge().getCoordinates();if(i<0||i+1>=a.length||a[i].y===a[i+1].y)return-1;var c=Xt.LEFT;return a[i].y<a[i+1].y&&(c=Xt.RIGHT),c},Io.prototype.getEdge=function(){return this._orientedDe},Io.prototype.checkForRightmostCoordinate=function(r){for(var i=r.getEdge().getCoordinates(),a=0;a<i.length-1;a++)(this._minCoord===null||i[a].x>this._minCoord.x)&&(this._minDe=r,this._minIndex=a,this._minCoord=i[a])},Io.prototype.findRightmostEdgeAtNode=function(){var r=this._minDe.getNode().getEdges();this._minDe=r.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Io.prototype.findEdge=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next();a.isForward()&&this.checkForRightmostCoordinate(a)}Wt.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)===Xt.LEFT&&(this._orientedDe=this._minDe.getSym())},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Qo=function(r){function i(a,c){r.call(this,i.msgWithCoord(a,c)),this.pt=c?new D(c):null,this.name="TopologyException"}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.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(a,c){return c?a:a+" [ "+c+" ]"},i}(Te),fl=function(){this.array_=[]};fl.prototype.addLast=function(r){this.array_.push(r)},fl.prototype.removeFirst=function(){return this.array_.shift()},fl.prototype.isEmpty=function(){return this.array_.length===0};var Jr=function(){this._finder=null,this._dirEdgeList=new G,this._nodes=new G,this._rightMostCoord=null,this._env=null,this._finder=new Io};Jr.prototype.clearVisitedEdges=function(){for(var r=this._dirEdgeList.iterator();r.hasNext();)r.next().setVisited(!1)},Jr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Jr.prototype.computeNodeDepth=function(r){for(var i=null,a=r.getEdges().iterator();a.hasNext();){var c=a.next();if(c.isVisited()||c.getSym().isVisited()){i=c;break}}if(i===null)throw new Qo("unable to find edge to compute depths at "+r.getCoordinate());r.getEdges().computeDepths(i);for(var d=r.getEdges().iterator();d.hasNext();){var v=d.next();v.setVisited(!0),this.copySymDepths(v)}},Jr.prototype.computeDepth=function(r){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(Xt.RIGHT,r),this.copySymDepths(i),this.computeDepths(i)},Jr.prototype.create=function(r){this.addReachable(r),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Jr.prototype.findResultEdges=function(){for(var r=this._dirEdgeList.iterator();r.hasNext();){var i=r.next();i.getDepth(Xt.RIGHT)>=1&&i.getDepth(Xt.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},Jr.prototype.computeDepths=function(r){var i=new Ue,a=new fl,c=r.getNode();for(a.addLast(c),i.add(c),r.setVisited(!0);!a.isEmpty();){var d=a.removeFirst();i.add(d),this.computeNodeDepth(d);for(var v=d.getEdges().iterator();v.hasNext();){var M=v.next().getSym();if(!M.isVisited()){var L=M.getNode();i.contains(L)||(a.addLast(L),i.add(L))}}}},Jr.prototype.compareTo=function(r){var i=r;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 r=new qt,i=this._dirEdgeList.iterator();i.hasNext();)for(var a=i.next().getEdge().getCoordinates(),c=0;c<a.length-1;c++)r.expandToInclude(a[c]);this._env=r}return this._env},Jr.prototype.addReachable=function(r){var i=new x;for(i.add(r);!i.empty();){var a=i.pop();this.add(a,i)}},Jr.prototype.copySymDepths=function(r){var i=r.getSym();i.setDepth(Xt.LEFT,r.getDepth(Xt.RIGHT)),i.setDepth(Xt.RIGHT,r.getDepth(Xt.LEFT))},Jr.prototype.add=function(r,i){r.setVisited(!0),this._nodes.add(r);for(var a=r.getEdges().iterator();a.hasNext();){var c=a.next();this._dirEdgeList.add(c);var d=c.getSym().getNode();d.isVisited()||i.push(d)}},Jr.prototype.getNodes=function(){return this._nodes},Jr.prototype.getDirectedEdges=function(){return this._dirEdgeList},Jr.prototype.interfaces_=function(){return[V]},Jr.prototype.getClass=function(){return Jr};var Zn=function r(){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 a=arguments[0];this.init(1),this.location[Xt.ON]=a}else if(arguments[0]instanceof r){var c=arguments[0];if(this.init(c.location.length),c!==null)for(var d=0;d<this.location.length;d++)this.location[d]=c.location[d]}}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this.init(3),this.location[Xt.ON]=v,this.location[Xt.LEFT]=M,this.location[Xt.RIGHT]=L}};Zn.prototype.setAllLocations=function(r){for(var i=0;i<this.location.length;i++)this.location[i]=r},Zn.prototype.isNull=function(){for(var r=0;r<this.location.length;r++)if(this.location[r]!==K.NONE)return!1;return!0},Zn.prototype.setAllLocationsIfNull=function(r){for(var i=0;i<this.location.length;i++)this.location[i]===K.NONE&&(this.location[i]=r)},Zn.prototype.isLine=function(){return this.location.length===1},Zn.prototype.merge=function(r){if(r.location.length>this.location.length){var i=new Array(3).fill(null);i[Xt.ON]=this.location[Xt.ON],i[Xt.LEFT]=K.NONE,i[Xt.RIGHT]=K.NONE,this.location=i}for(var a=0;a<this.location.length;a++)this.location[a]===K.NONE&&a<r.location.length&&(this.location[a]=r.location[a])},Zn.prototype.getLocations=function(){return this.location},Zn.prototype.flip=function(){if(this.location.length<=1)return null;var r=this.location[Xt.LEFT];this.location[Xt.LEFT]=this.location[Xt.RIGHT],this.location[Xt.RIGHT]=r},Zn.prototype.toString=function(){var r=new Lt;return this.location.length>1&&r.append(K.toLocationSymbol(this.location[Xt.LEFT])),r.append(K.toLocationSymbol(this.location[Xt.ON])),this.location.length>1&&r.append(K.toLocationSymbol(this.location[Xt.RIGHT])),r.toString()},Zn.prototype.setLocations=function(r,i,a){this.location[Xt.ON]=r,this.location[Xt.LEFT]=i,this.location[Xt.RIGHT]=a},Zn.prototype.get=function(r){return r<this.location.length?this.location[r]:K.NONE},Zn.prototype.isArea=function(){return this.location.length>1},Zn.prototype.isAnyNull=function(){for(var r=0;r<this.location.length;r++)if(this.location[r]===K.NONE)return!0;return!1},Zn.prototype.setLocation=function(){if(arguments.length===1){var r=arguments[0];this.setLocation(Xt.ON,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.location[i]=a}},Zn.prototype.init=function(r){this.location=new Array(r).fill(null),this.setAllLocations(K.NONE)},Zn.prototype.isEqualOnSide=function(r,i){return this.location[i]===r.location[i]},Zn.prototype.allPositionsEqual=function(r){for(var i=0;i<this.location.length;i++)if(this.location[i]!==r)return!1;return!0},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var On=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new Zn(i),this.elt[1]=new Zn(i)}else if(arguments[0]instanceof r){var a=arguments[0];this.elt[0]=new Zn(a.elt[0]),this.elt[1]=new Zn(a.elt[1])}}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.elt[0]=new Zn(K.NONE),this.elt[1]=new Zn(K.NONE),this.elt[c].setLocation(d)}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this.elt[0]=new Zn(v,M,L),this.elt[1]=new Zn(v,M,L)}else if(arguments.length===4){var H=arguments[0],it=arguments[1],bt=arguments[2],Tt=arguments[3];this.elt[0]=new Zn(K.NONE,K.NONE,K.NONE),this.elt[1]=new Zn(K.NONE,K.NONE,K.NONE),this.elt[H].setLocations(it,bt,Tt)}};On.prototype.getGeometryCount=function(){var r=0;return this.elt[0].isNull()||r++,this.elt[1].isNull()||r++,r},On.prototype.setAllLocations=function(r,i){this.elt[r].setAllLocations(i)},On.prototype.isNull=function(r){return this.elt[r].isNull()},On.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var r=arguments[0];this.setAllLocationsIfNull(0,r),this.setAllLocationsIfNull(1,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.elt[i].setAllLocationsIfNull(a)}},On.prototype.isLine=function(r){return this.elt[r].isLine()},On.prototype.merge=function(r){for(var i=0;i<2;i++)this.elt[i]===null&&r.elt[i]!==null?this.elt[i]=new Zn(r.elt[i]):this.elt[i].merge(r.elt[i])},On.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},On.prototype.getLocation=function(){if(arguments.length===1){var r=arguments[0];return this.elt[r].get(Xt.ON)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.elt[i].get(a)}},On.prototype.toString=function(){var r=new Lt;return this.elt[0]!==null&&(r.append("A:"),r.append(this.elt[0].toString())),this.elt[1]!==null&&(r.append(" B:"),r.append(this.elt[1].toString())),r.toString()},On.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var r=arguments[0];return this.elt[r].isArea()}},On.prototype.isAnyNull=function(r){return this.elt[r].isAnyNull()},On.prototype.setLocation=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[r].setLocation(Xt.ON,i)}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this.elt[a].setLocation(c,d)}},On.prototype.isEqualOnSide=function(r,i){return this.elt[0].isEqualOnSide(r.elt[0],i)&&this.elt[1].isEqualOnSide(r.elt[1],i)},On.prototype.allPositionsEqual=function(r,i){return this.elt[r].allPositionsEqual(i)},On.prototype.toLine=function(r){this.elt[r].isArea()&&(this.elt[r]=new Zn(this.elt[r].location[0]))},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.toLineLabel=function(r){for(var i=new On(K.NONE),a=0;a<2;a++)i.setLocation(a,r.getLocation(a));return i};var Ar=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new G,this._pts=new G,this._label=new On(K.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new G,this._geometryFactory=null;var r=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(r),this.computeRing()};Ar.prototype.computeRing=function(){if(this._ring!==null)return null;for(var r=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)r[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(r),this._isHole=dt.isCCW(this._ring.getCoordinates())},Ar.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ar.prototype.computePoints=function(r){this._startDe=r;var i=r,a=!0;do{if(i===null)throw new Qo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new Qo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var c=i.getLabel();Wt.isTrue(c.isArea()),this.mergeLabel(c),this.addPoints(i.getEdge(),i.isForward(),a),a=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},Ar.prototype.getLinearRing=function(){return this._ring},Ar.prototype.getCoordinate=function(r){return this._pts.get(r)},Ar.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var r=this._startDe;do{var i=r.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),r=this.getNext(r)}while(r!==this._startDe);this._maxNodeDegree*=2},Ar.prototype.addPoints=function(r,i,a){var c=r.getCoordinates();if(i){var d=1;a&&(d=0);for(var v=d;v<c.length;v++)this._pts.add(c[v])}else{var M=c.length-2;a&&(M=c.length-1);for(var L=M;L>=0;L--)this._pts.add(c[L])}},Ar.prototype.isHole=function(){return this._isHole},Ar.prototype.setInResult=function(){var r=this._startDe;do r.getEdge().setInResult(!0),r=r.getNext();while(r!==this._startDe)},Ar.prototype.containsPoint=function(r){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(r)||!dt.isPointInRing(r,i.getCoordinates()))return!1;for(var a=this._holes.iterator();a.hasNext();)if(a.next().containsPoint(r))return!1;return!0},Ar.prototype.addHole=function(r){this._holes.add(r)},Ar.prototype.isShell=function(){return this._shell===null},Ar.prototype.getLabel=function(){return this._label},Ar.prototype.getEdges=function(){return this._edges},Ar.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ar.prototype.getShell=function(){return this._shell},Ar.prototype.mergeLabel=function(){if(arguments.length===1){var r=arguments[0];this.mergeLabel(r,0),this.mergeLabel(r,1)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=i.getLocation(a,Xt.RIGHT);if(c===K.NONE)return null;if(this._label.getLocation(a)===K.NONE)return this._label.setLocation(a,c),null}},Ar.prototype.setShell=function(r){this._shell=r,r!==null&&r.addHole(this)},Ar.prototype.toPolygon=function(r){for(var i=new Array(this._holes.size()).fill(null),a=0;a<this._holes.size();a++)i[a]=this._holes.get(a).getLinearRing();return r.createPolygon(this.getLinearRing(),i)},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var em=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(a,c){a.setMinEdgeRing(c)},i.prototype.getNext=function(a){return a.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),Bh=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var a=new G,c=this._startDe;do{if(c.getMinEdgeRing()===null){var d=new em(c,this._geometryFactory);a.add(d)}c=c.getNext()}while(c!==this._startDe);return a},i.prototype.setEdgeRing=function(a,c){a.setEdgeRing(c)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var a=this._startDe;do a.getNode().getEdges().linkMinimalDirectedEdges(this),a=a.getNext();while(a!==this._startDe)},i.prototype.getNext=function(a){return a.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),Xi=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 r=arguments[0];this._label=r}}};Xi.prototype.setVisited=function(r){this._isVisited=r},Xi.prototype.setInResult=function(r){this._isInResult=r},Xi.prototype.isCovered=function(){return this._isCovered},Xi.prototype.isCoveredSet=function(){return this._isCoveredSet},Xi.prototype.setLabel=function(r){this._label=r},Xi.prototype.getLabel=function(){return this._label},Xi.prototype.setCovered=function(r){this._isCovered=r,this._isCoveredSet=!0},Xi.prototype.updateIM=function(r){Wt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(r)},Xi.prototype.isInResult=function(){return this._isInResult},Xi.prototype.isVisited=function(){return this._isVisited},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi};var Kl=function(r){function i(){r.call(this),this._coord=null,this._edges=null;var a=arguments[0],c=arguments[1];this._coord=a,this._edges=c,this._label=new On(0,K.NONE)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var a=this.getEdges().getEdges().iterator();a.hasNext();)if(a.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(a){a.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(a){},i.prototype.computeMergedLocation=function(a,c){var d=K.NONE;if(d=this._label.getLocation(c),!a.isNull(c)){var v=a.getLocation(c);d!==K.BOUNDARY&&(d=v)}return d},i.prototype.setLabel=function(){if(arguments.length!==2)return r.prototype.setLabel.apply(this,arguments);var a=arguments[0],c=arguments[1];this._label===null?this._label=new On(a,c):this._label.setLocation(a,c)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var a=arguments[0];this.mergeLabel(a._label)}else if(arguments[0]instanceof On)for(var c=arguments[0],d=0;d<2;d++){var v=this.computeMergedLocation(c,d);this._label.getLocation(d)===K.NONE&&this._label.setLocation(d,v)}},i.prototype.add=function(a){this._edges.insert(a),a.setNode(this)},i.prototype.setLabelBoundary=function(a){if(this._label===null)return null;var c=K.NONE;this._label!==null&&(c=this._label.getLocation(a));var d=null;switch(c){case K.BOUNDARY:d=K.INTERIOR;break;case K.INTERIOR:default:d=K.BOUNDARY}this._label.setLocation(a,d)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Xi),Ro=function(){this.nodeMap=new w,this.nodeFact=null;var r=arguments[0];this.nodeFact=r};Ro.prototype.find=function(r){return this.nodeMap.get(r)},Ro.prototype.addNode=function(){if(arguments[0]instanceof D){var r=arguments[0],i=this.nodeMap.get(r);return i===null&&(i=this.nodeFact.createNode(r),this.nodeMap.put(r,i)),i}if(arguments[0]instanceof Kl){var a=arguments[0],c=this.nodeMap.get(a.getCoordinate());return c===null?(this.nodeMap.put(a.getCoordinate(),a),a):(c.mergeLabel(a),c)}},Ro.prototype.print=function(r){for(var i=this.iterator();i.hasNext();)i.next().print(r)},Ro.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ro.prototype.values=function(){return this.nodeMap.values()},Ro.prototype.getBoundaryNodes=function(r){for(var i=new G,a=this.iterator();a.hasNext();){var c=a.next();c.getLabel().getLocation(r)===K.BOUNDARY&&i.add(c)}return i},Ro.prototype.add=function(r){var i=r.getCoordinate();this.addNode(i).add(r)},Ro.prototype.interfaces_=function(){return[]},Ro.prototype.getClass=function(){return Ro};var Yn=function(){},za={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.isNorthern=function(r){return r===Yn.NE||r===Yn.NW},Yn.isOpposite=function(r,i){return r===i?!1:(r-i+4)%4===2},Yn.commonHalfPlane=function(r,i){if(r===i)return r;if((r-i+4)%4===2)return-1;var a=r<i?r:i;return a===0&&(r>i?r:i)===3?3:a},Yn.isInHalfPlane=function(r,i){return i===Yn.SE?r===Yn.SE||r===Yn.SW:r===i||r===i+1},Yn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];if(r===0&&i===0)throw new I("Cannot compute the quadrant for point ( "+r+", "+i+" )");return r>=0?i>=0?Yn.NE:Yn.SE:i>=0?Yn.NW:Yn.SW}if(arguments[0]instanceof D&&arguments[1]instanceof D){var a=arguments[0],c=arguments[1];if(c.x===a.x&&c.y===a.y)throw new I("Cannot compute the quadrant for two identical points "+a);return c.x>=a.x?c.y>=a.y?Yn.NE:Yn.SE:c.y>=a.y?Yn.NW:Yn.SW}},za.NE.get=function(){return 0},za.NW.get=function(){return 1},za.SW.get=function(){return 2},za.SE.get=function(){return 3},Object.defineProperties(Yn,za);var jr=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 r=arguments[0];this._edge=r}else if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2];this._edge=i,this.init(a,c),this._label=null}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];this._edge=d,this.init(v,M),this._label=L}};jr.prototype.compareDirection=function(r){return this._dx===r._dx&&this._dy===r._dy?0:this._quadrant>r._quadrant?1:this._quadrant<r._quadrant?-1:dt.computeOrientation(r._p0,r._p1,this._p1)},jr.prototype.getDy=function(){return this._dy},jr.prototype.getCoordinate=function(){return this._p0},jr.prototype.setNode=function(r){this._node=r},jr.prototype.print=function(r){var i=Math.atan2(this._dy,this._dx),a=this.getClass().getName(),c=a.lastIndexOf("."),d=a.substring(c+1);r.print(" "+d+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},jr.prototype.compareTo=function(r){var i=r;return this.compareDirection(i)},jr.prototype.getDirectedCoordinate=function(){return this._p1},jr.prototype.getDx=function(){return this._dx},jr.prototype.getLabel=function(){return this._label},jr.prototype.getEdge=function(){return this._edge},jr.prototype.getQuadrant=function(){return this._quadrant},jr.prototype.getNode=function(){return this._node},jr.prototype.toString=function(){var r=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),a=i.lastIndexOf(".");return" "+i.substring(a+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+r+" "+this._label},jr.prototype.computeLabel=function(r){},jr.prototype.init=function(r,i){this._p0=r,this._p1=i,this._dx=i.x-r.x,this._dy=i.y-r.y,this._quadrant=Yn.quadrant(this._dx,this._dy),Wt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},jr.prototype.interfaces_=function(){return[V]},jr.prototype.getClass=function(){return jr};var Ef=function(r){function i(){var a=arguments[0],c=arguments[1];if(r.call(this,a),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=c,c)this.init(a.getCoordinate(0),a.getCoordinate(1));else{var d=a.getNumPoints()-1;this.init(a.getCoordinate(d),a.getCoordinate(d-1))}this.computeDirectedLabel()}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(a){return this._depth[a]},i.prototype.setVisited=function(a){this._isVisited=a},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(a,c){if(this._depth[a]!==-999&&this._depth[a]!==c)throw new Qo("assigned depths do not match",this.getCoordinate());this._depth[a]=c},i.prototype.isInteriorAreaEdge=function(){for(var a=!0,c=0;c<2;c++)this._label.isArea(c)&&this._label.getLocation(c,Xt.LEFT)===K.INTERIOR&&this._label.getLocation(c,Xt.RIGHT)===K.INTERIOR||(a=!1);return a},i.prototype.setNextMin=function(a){this._nextMin=a},i.prototype.print=function(a){r.prototype.print.call(this,a),a.print(" "+this._depth[Xt.LEFT]+"/"+this._depth[Xt.RIGHT]),a.print(" ("+this.getDepthDelta()+")"),this._isInResult&&a.print(" inResult")},i.prototype.setMinEdgeRing=function(a){this._minEdgeRing=a},i.prototype.isLineEdge=function(){var a=this._label.isLine(0)||this._label.isLine(1),c=!this._label.isArea(0)||this._label.allPositionsEqual(0,K.EXTERIOR),d=!this._label.isArea(1)||this._label.allPositionsEqual(1,K.EXTERIOR);return a&&c&&d},i.prototype.setEdgeRing=function(a){this._edgeRing=a},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var a=this._edge.getDepthDelta();return this._isForward||(a=-a),a},i.prototype.setInResult=function(a){this._isInResult=a},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(a){this.print(a),a.print(" "),this._isForward?this._edge.print(a):this._edge.printReverse(a)},i.prototype.setSym=function(a){this._sym=a},i.prototype.setVisitedEdge=function(a){this.setVisited(a),this._sym.setVisited(a)},i.prototype.setEdgeDepths=function(a,c){var d=this.getEdge().getDepthDelta();this._isForward||(d=-d);var v=1;a===Xt.LEFT&&(v=-1);var M=Xt.opposite(a),L=c+d*v;this.setDepth(a,c),this.setDepth(M,L)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(a){this._next=a},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(a,c){return a===K.EXTERIOR&&c===K.INTERIOR?1:a===K.INTERIOR&&c===K.EXTERIOR?-1:0},i}(jr),vu=function(){};vu.prototype.createNode=function(r){return new Kl(r,null)},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var dr=function(){if(this._edges=new G,this._nodes=null,this._edgeEndList=new G,arguments.length===0)this._nodes=new Ro(new vu);else if(arguments.length===1){var r=arguments[0];this._nodes=new Ro(r)}};dr.prototype.printEdges=function(r){r.println("Edges:");for(var i=0;i<this._edges.size();i++){r.println("edge "+i+":");var a=this._edges.get(i);a.print(r),a.eiList.print(r)}},dr.prototype.find=function(r){return this._nodes.find(r)},dr.prototype.addNode=function(){if(arguments[0]instanceof Kl){var r=arguments[0];return this._nodes.addNode(r)}if(arguments[0]instanceof D){var i=arguments[0];return this._nodes.addNode(i)}},dr.prototype.getNodeIterator=function(){return this._nodes.iterator()},dr.prototype.linkResultDirectedEdges=function(){for(var r=this._nodes.iterator();r.hasNext();)r.next().getEdges().linkResultDirectedEdges()},dr.prototype.debugPrintln=function(r){te.out.println(r)},dr.prototype.isBoundaryNode=function(r,i){var a=this._nodes.find(i);if(a===null)return!1;var c=a.getLabel();return c!==null&&c.getLocation(r)===K.BOUNDARY},dr.prototype.linkAllDirectedEdges=function(){for(var r=this._nodes.iterator();r.hasNext();)r.next().getEdges().linkAllDirectedEdges()},dr.prototype.matchInSameDirection=function(r,i,a,c){return!!r.equals(a)&&dt.computeOrientation(r,i,c)===dt.COLLINEAR&&Yn.quadrant(r,i)===Yn.quadrant(a,c)},dr.prototype.getEdgeEnds=function(){return this._edgeEndList},dr.prototype.debugPrint=function(r){te.out.print(r)},dr.prototype.getEdgeIterator=function(){return this._edges.iterator()},dr.prototype.findEdgeInSameDirection=function(r,i){for(var a=0;a<this._edges.size();a++){var c=this._edges.get(a),d=c.getCoordinates();if(this.matchInSameDirection(r,i,d[0],d[1])||this.matchInSameDirection(r,i,d[d.length-1],d[d.length-2]))return c}return null},dr.prototype.insertEdge=function(r){this._edges.add(r)},dr.prototype.findEdgeEnd=function(r){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var a=i.next();if(a.getEdge()===r)return a}return null},dr.prototype.addEdges=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next();this._edges.add(a);var c=new Ef(a,!0),d=new Ef(a,!1);c.setSym(d),d.setSym(c),this.add(c),this.add(d)}},dr.prototype.add=function(r){this._nodes.add(r),this._edgeEndList.add(r)},dr.prototype.getNodes=function(){return this._nodes.values()},dr.prototype.findEdge=function(r,i){for(var a=0;a<this._edges.size();a++){var c=this._edges.get(a),d=c.getCoordinates();if(r.equals(d[0])&&i.equals(d[1]))return c}return null},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.linkResultDirectedEdges=function(r){for(var i=r.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Ci=function(){this._geometryFactory=null,this._shellList=new G;var r=arguments[0];this._geometryFactory=r};Ci.prototype.sortShellsAndHoles=function(r,i,a){for(var c=r.iterator();c.hasNext();){var d=c.next();d.isHole()?a.add(d):i.add(d)}},Ci.prototype.computePolygons=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next().toPolygon(this._geometryFactory);i.add(c)}return i},Ci.prototype.placeFreeHoles=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next();if(c.getShell()===null){var d=this.findEdgeRingContaining(c,r);if(d===null)throw new Qo("unable to assign hole to a shell",c.getCoordinate(0));c.setShell(d)}}},Ci.prototype.buildMinimalEdgeRings=function(r,i,a){for(var c=new G,d=r.iterator();d.hasNext();){var v=d.next();if(v.getMaxNodeDegree()>2){v.linkDirectedEdgesForMinimalEdgeRings();var M=v.buildMinimalRings(),L=this.findShell(M);L!==null?(this.placePolygonHoles(L,M),i.add(L)):a.addAll(M)}else c.add(v)}return c},Ci.prototype.containsPoint=function(r){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(r))return!0;return!1},Ci.prototype.buildMaximalEdgeRings=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next();if(c.isInResult()&&c.getLabel().isArea()&&c.getEdgeRing()===null){var d=new Bh(c,this._geometryFactory);i.add(d),d.setInResult()}}return i},Ci.prototype.placePolygonHoles=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next();c.isHole()&&c.setShell(r)}},Ci.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ci.prototype.findEdgeRingContaining=function(r,i){for(var a=r.getLinearRing(),c=a.getEnvelopeInternal(),d=a.getCoordinateN(0),v=null,M=null,L=i.iterator();L.hasNext();){var H=L.next(),it=H.getLinearRing(),bt=it.getEnvelopeInternal();v!==null&&(M=v.getLinearRing().getEnvelopeInternal());var Tt=!1;bt.contains(c)&&dt.isPointInRing(d,it.getCoordinates())&&(Tt=!0),Tt&&(v===null||M.contains(bt))&&(v=H)}return v},Ci.prototype.findShell=function(r){for(var i=0,a=null,c=r.iterator();c.hasNext();){var d=c.next();d.isHole()||(a=d,i++)}return Wt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),a},Ci.prototype.add=function(){if(arguments.length===1){var r=arguments[0];this.add(r.getEdgeEnds(),r.getNodes())}else if(arguments.length===2){var i=arguments[0],a=arguments[1];dr.linkResultDirectedEdges(a);var c=this.buildMaximalEdgeRings(i),d=new G,v=this.buildMinimalEdgeRings(c,this._shellList,d);this.sortShellsAndHoles(v,this._shellList,d),this.placeFreeHoles(this._shellList,d)}},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var or=function(){};or.prototype.getBounds=function(){},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or};var tn=function(){this._bounds=null,this._item=null;var r=arguments[0],i=arguments[1];this._bounds=r,this._item=i};tn.prototype.getItem=function(){return this._item},tn.prototype.getBounds=function(){return this._bounds},tn.prototype.interfaces_=function(){return[or,t]},tn.prototype.getClass=function(){return tn};var vs=function(){this._size=null,this._items=null,this._size=0,this._items=new G,this._items.add(null)};vs.prototype.poll=function(){if(this.isEmpty())return null;var r=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),r},vs.prototype.size=function(){return this._size},vs.prototype.reorder=function(r){for(var i=null,a=this._items.get(r);2*r<=this._size&&((i=2*r)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(a)<0);r=i)this._items.set(r,this._items.get(i));this._items.set(r,a)},vs.prototype.clear=function(){this._size=0,this._items.clear()},vs.prototype.isEmpty=function(){return this._size===0},vs.prototype.add=function(r){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,r);r.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,r)},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var Us=function(){};Us.prototype.visitItem=function(r){},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us};var Ga=function(){};Ga.prototype.insert=function(r,i){},Ga.prototype.remove=function(r,i){},Ga.prototype.query=function(){},Ga.prototype.interfaces_=function(){return[]},Ga.prototype.getClass=function(){return Ga};var Ir=function(){if(this._childBoundables=new G,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this._level=r}}},zh={serialVersionUID:{configurable:!0}};Ir.prototype.getLevel=function(){return this._level},Ir.prototype.size=function(){return this._childBoundables.size()},Ir.prototype.getChildBoundables=function(){return this._childBoundables},Ir.prototype.addChildBoundable=function(r){Wt.isTrue(this._bounds===null),this._childBoundables.add(r)},Ir.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ir.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ir.prototype.interfaces_=function(){return[or,t]},Ir.prototype.getClass=function(){return Ir},zh.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ir,zh);var ho=function(){};ho.reverseOrder=function(){return{compare:function(r,i){return i.compareTo(r)}}},ho.min=function(r){return ho.sort(r),r.get(0)},ho.sort=function(r,i){var a=r.toArray();i?nr.sort(a,i):nr.sort(a);for(var c=r.iterator(),d=0,v=a.length;d<v;d++)c.next(),c.set(a[d])},ho.singletonList=function(r){var i=new G;return i.add(r),i};var Sr=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var r=arguments[0],i=arguments[1],a=arguments[2];this._boundable1=r,this._boundable2=i,this._itemDistance=a,this._distance=this.distance()};Sr.prototype.expandToQueue=function(r,i){var a=Sr.isComposite(this._boundable1),c=Sr.isComposite(this._boundable2);if(a&&c)return Sr.area(this._boundable1)>Sr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,r,i),null):(this.expand(this._boundable2,this._boundable1,r,i),null);if(a)return this.expand(this._boundable1,this._boundable2,r,i),null;if(c)return this.expand(this._boundable2,this._boundable1,r,i),null;throw new I("neither boundable is composite")},Sr.prototype.isLeaves=function(){return!(Sr.isComposite(this._boundable1)||Sr.isComposite(this._boundable2))},Sr.prototype.compareTo=function(r){var i=r;return this._distance<i._distance?-1:this._distance>i._distance?1:0},Sr.prototype.expand=function(r,i,a,c){for(var d=r.getChildBoundables().iterator();d.hasNext();){var v=d.next(),M=new Sr(v,i,this._itemDistance);M.getDistance()<c&&a.add(M)}},Sr.prototype.getBoundable=function(r){return r===0?this._boundable1:this._boundable2},Sr.prototype.getDistance=function(){return this._distance},Sr.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Sr.prototype.interfaces_=function(){return[V]},Sr.prototype.getClass=function(){return Sr},Sr.area=function(r){return r.getBounds().getArea()},Sr.isComposite=function(r){return r instanceof Ir};var Fr=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new G,this._nodeCapacity=null,arguments.length===0){var i=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var a=arguments[0];Wt.isTrue(a>1,"Node capacity must be greater than 1"),this._nodeCapacity=a}},Ur={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Fr.prototype.getNodeCapacity=function(){return this._nodeCapacity},Fr.prototype.lastNode=function(r){return r.get(r.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 r=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Ir?r+=this.size(a):a instanceof tn&&(r+=1)}return r}},Fr.prototype.removeItem=function(r,i){for(var a=null,c=r.getChildBoundables().iterator();c.hasNext();){var d=c.next();d instanceof tn&&d.getItem()===i&&(a=d)}return a!==null&&(r.getChildBoundables().remove(a),!0)},Fr.prototype.itemsTree=function(){if(arguments.length===0){this.build();var r=this.itemsTree(this._root);return r===null?new G:r}if(arguments.length===1){for(var i=arguments[0],a=new G,c=i.getChildBoundables().iterator();c.hasNext();){var d=c.next();if(d instanceof Ir){var v=this.itemsTree(d);v!==null&&a.add(v)}else d instanceof tn?a.add(d.getItem()):Wt.shouldNeverReachHere()}return a.size()<=0?null:a}},Fr.prototype.insert=function(r,i){Wt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new tn(r,i))},Fr.prototype.boundablesAtLevel=function(){if(arguments.length===1){var r=arguments[0],i=new G;return this.boundablesAtLevel(r,this._root,i),i}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];if(Wt.isTrue(a>-2),c.getLevel()===a)return d.add(c),null;for(var v=c.getChildBoundables().iterator();v.hasNext();){var M=v.next();M instanceof Ir?this.boundablesAtLevel(a,M,d):(Wt.isTrue(M instanceof tn),a===-1&&d.add(M))}return null}},Fr.prototype.query=function(){if(arguments.length===1){var r=arguments[0];this.build();var i=new G;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i),i}if(arguments.length===2){var a=arguments[0],c=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,c)}else if(arguments.length===3){if(Q(arguments[2],Us)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir)for(var d=arguments[0],v=arguments[1],M=arguments[2],L=v.getChildBoundables(),H=0;H<L.size();H++){var it=L.get(H);this.getIntersectsOp().intersects(it.getBounds(),d)&&(it instanceof Ir?this.query(d,it,M):it instanceof tn?M.visitItem(it.getItem()):Wt.shouldNeverReachHere())}else if(Q(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir)for(var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=Tt.getChildBoundables(),le=0;le<Qt.size();le++){var Ee=Qt.get(le);this.getIntersectsOp().intersects(Ee.getBounds(),bt)&&(Ee instanceof Ir?this.query(bt,Ee,Kt):Ee instanceof tn?Kt.add(Ee.getItem()):Wt.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 r=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.remove(r,this._root,i)}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2],v=this.removeItem(c,d);if(v)return!0;for(var M=null,L=c.getChildBoundables().iterator();L.hasNext();){var H=L.next();if(this.getIntersectsOp().intersects(H.getBounds(),a)&&H instanceof Ir&&(v=this.remove(a,H,d))){M=H;break}}return M!==null&&M.getChildBoundables().isEmpty()&&c.getChildBoundables().remove(M),v}},Fr.prototype.createHigherLevels=function(r,i){Wt.isTrue(!r.isEmpty());var a=this.createParentBoundables(r,i+1);return a.size()===1?a.get(0):this.createHigherLevels(a,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 r=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var a=i.next();if(a instanceof Ir){var c=this.depth(a);c>r&&(r=c)}}return r+1}},Fr.prototype.createParentBoundables=function(r,i){Wt.isTrue(!r.isEmpty());var a=new G;a.add(this.createNode(i));var c=new G(r);ho.sort(c,this.getComparator());for(var d=c.iterator();d.hasNext();){var v=d.next();this.lastNode(a).getChildBoundables().size()===this.getNodeCapacity()&&a.add(this.createNode(i)),this.lastNode(a).addChildBoundable(v)}return a},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(r,i){return r>i?1:r<i?-1:0},Ur.IntersectsOp.get=function(){return wf},Ur.serialVersionUID.get=function(){return-3886435814360241e3},Ur.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Fr,Ur);var wf=function(){},Lo=function(){};Lo.prototype.distance=function(r,i){},Lo.prototype.interfaces_=function(){return[]},Lo.prototype.getClass=function(){return Lo};var Sf=function(r){function i(c){c=c||i.DEFAULT_NODE_CAPACITY,r.call(this,c)}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={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(c,d){Wt.isTrue(c.length>0);for(var v=new G,M=0;M<c.length;M++)v.addAll(this.createParentBoundablesFromVerticalSlice(c[M],d));return v},i.prototype.createNode=function(c){return new Jl(c)},i.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return r.prototype.insert.apply(this,arguments);var c=arguments[0],d=arguments[1];if(c.isNull())return null;r.prototype.insert.call(this,c,d)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(c,d){for(var v=Math.trunc(Math.ceil(c.size()/d)),M=new Array(d).fill(null),L=c.iterator(),H=0;H<d;H++){M[H]=new G;for(var it=0;L.hasNext()&&it<v;){var bt=L.next();M[H].add(bt),it++}}return M},i.prototype.query=function(){if(arguments.length===1){var c=arguments[0];return r.prototype.query.call(this,c)}if(arguments.length===2){var d=arguments[0],v=arguments[1];r.prototype.query.call(this,d,v)}else if(arguments.length===3){if(Q(arguments[2],Us)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir){var M=arguments[0],L=arguments[1],H=arguments[2];r.prototype.query.call(this,M,L,H)}else if(Q(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ir){var it=arguments[0],bt=arguments[1],Tt=arguments[2];r.prototype.query.call(this,it,bt,Tt)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(c,d){return r.prototype.createParentBoundables.call(this,c,d)},i.prototype.remove=function(){if(arguments.length===2){var c=arguments[0],d=arguments[1];return r.prototype.remove.call(this,c,d)}return r.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(c,d){Wt.isTrue(!c.isEmpty());var v=Math.trunc(Math.ceil(c.size()/this.getNodeCapacity())),M=new G(c);ho.sort(M,i.xComparator);var L=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(v))));return this.createParentBoundablesFromVerticalSlices(L,d)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(Q(arguments[0],Lo)){var c=arguments[0],d=new Sr(this.getRoot(),this.getRoot(),c);return this.nearestNeighbour(d)}if(arguments[0]instanceof Sr){var v=arguments[0];return this.nearestNeighbour(v,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&Q(arguments[1],Lo)){var M=arguments[0],L=arguments[1],H=new Sr(this.getRoot(),M.getRoot(),L);return this.nearestNeighbour(H)}if(arguments[0]instanceof Sr&&typeof arguments[1]=="number"){var it=arguments[0],bt=arguments[1],Tt=null,Kt=new vs;for(Kt.add(it);!Kt.isEmpty()&&bt>0;){var Qt=Kt.poll(),le=Qt.getDistance();if(le>=bt)break;Qt.isLeaves()?(bt=le,Tt=Qt):Qt.expandToQueue(Kt,bt)}return[Tt.getBoundable(0).getItem(),Tt.getBoundable(1).getItem()]}}else if(arguments.length===3){var Ee=arguments[0],Dn=arguments[1],Jn=arguments[2],fi=new tn(Ee,Dn),as=new Sr(this.getRoot(),fi,Jn);return this.nearestNeighbour(as)[0]}},i.prototype.interfaces_=function(){return[Ga,t]},i.prototype.getClass=function(){return i},i.centreX=function(c){return i.avg(c.getMinX(),c.getMaxX())},i.avg=function(c,d){return(c+d)/2},i.centreY=function(c){return i.avg(c.getMinY(),c.getMaxY())},a.STRtreeNode.get=function(){return Jl},a.serialVersionUID.get=function(){return 0x39920f7d5f261e0},a.xComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(c,d){return r.compareDoubles(i.centreX(c.getBounds()),i.centreX(d.getBounds()))}}},a.yComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(c,d){return r.compareDoubles(i.centreY(c.getBounds()),i.centreY(d.getBounds()))}}},a.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(c,d){return c.intersects(d)}}},a.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,a),i}(Fr),Jl=function(r){function i(){var a=arguments[0];r.call(this,a)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var a=null,c=this.getChildBoundables().iterator();c.hasNext();){var d=c.next();a===null?a=new qt(d.getBounds()):a.expandToInclude(d.getBounds())}return a},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ir),lr=function(){};lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.relativeSign=function(r,i){return r<i?-1:r>i?1:0},lr.compare=function(r,i,a){if(i.equals2D(a))return 0;var c=lr.relativeSign(i.x,a.x),d=lr.relativeSign(i.y,a.y);switch(r){case 0:return lr.compareValue(c,d);case 1:return lr.compareValue(d,c);case 2:return lr.compareValue(d,-c);case 3:return lr.compareValue(-c,d);case 4:return lr.compareValue(-c,-d);case 5:return lr.compareValue(-d,-c);case 6:return lr.compareValue(-d,c);case 7:return lr.compareValue(c,-d)}return Wt.shouldNeverReachHere("invalid octant value"),0},lr.compareValue=function(r,i){return r<0?-1:r>0?1:i<0?-1:i>0?1:0};var _s=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this._segString=r,this.coord=new D(i),this.segmentIndex=a,this._segmentOctant=c,this._isInterior=!i.equals2D(r.getCoordinate(a))};_s.prototype.getCoordinate=function(){return this.coord},_s.prototype.print=function(r){r.print(this.coord),r.print(" seg # = "+this.segmentIndex)},_s.prototype.compareTo=function(r){var i=r;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:lr.compare(this._segmentOctant,this.coord,i.coord)},_s.prototype.isEndPoint=function(r){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===r},_s.prototype.isInterior=function(){return this._isInterior},_s.prototype.interfaces_=function(){return[V]},_s.prototype.getClass=function(){return _s};var Qr=function(){this._nodeMap=new w,this._edge=null;var r=arguments[0];this._edge=r};Qr.prototype.getSplitCoordinates=function(){var r=new et;this.addEndpoints();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next();this.addEdgeCoordinates(a,c,r),a=c}return r.toCoordinateArray()},Qr.prototype.addCollapsedNodes=function(){var r=new G;this.findCollapsesFromInsertedNodes(r),this.findCollapsesFromExistingVertices(r);for(var i=r.iterator();i.hasNext();){var a=i.next().intValue();this.add(this._edge.getCoordinate(a),a)}},Qr.prototype.print=function(r){r.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(r)},Qr.prototype.findCollapsesFromExistingVertices=function(r){for(var i=0;i<this._edge.size()-2;i++){var a=this._edge.getCoordinate(i),c=this._edge.getCoordinate(i+2);a.equals2D(c)&&r.add(new pt(i+1))}},Qr.prototype.addEdgeCoordinates=function(r,i,a){var c=this._edge.getCoordinate(i.segmentIndex),d=i.isInterior()||!i.coord.equals2D(c);a.add(new D(r.coord),!1);for(var v=r.segmentIndex+1;v<=i.segmentIndex;v++)a.add(this._edge.getCoordinate(v));d&&a.add(new D(i.coord))},Qr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qr.prototype.addSplitEdges=function(r){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next(),d=this.createSplitEdge(a,c);r.add(d),a=c}},Qr.prototype.findCollapseIndex=function(r,i,a){if(!r.coord.equals2D(i.coord))return!1;var c=i.segmentIndex-r.segmentIndex;return i.isInterior()||c--,c===1&&(a[0]=r.segmentIndex+1,!0)},Qr.prototype.findCollapsesFromInsertedNodes=function(r){for(var i=new Array(1).fill(null),a=this.iterator(),c=a.next();a.hasNext();){var d=a.next();this.findCollapseIndex(c,d,i)&&r.add(new pt(i[0])),c=d}},Qr.prototype.getEdge=function(){return this._edge},Qr.prototype.addEndpoints=function(){var r=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(r),r)},Qr.prototype.createSplitEdge=function(r,i){var a=i.segmentIndex-r.segmentIndex+2,c=this._edge.getCoordinate(i.segmentIndex),d=i.isInterior()||!i.coord.equals2D(c);d||a--;var v=new Array(a).fill(null),M=0;v[M++]=new D(r.coord);for(var L=r.segmentIndex+1;L<=i.segmentIndex;L++)v[M++]=this._edge.getCoordinate(L);return d&&(v[M]=new D(i.coord)),new mr(v,this._edge.getData())},Qr.prototype.add=function(r,i){var a=new _s(this._edge,r,i,this._edge.getSegmentOctant(i)),c=this._nodeMap.get(a);return c!==null?(Wt.isTrue(c.coord.equals2D(r),"Found equal nodes with different coordinates"),c):(this._nodeMap.put(a,a),a)},Qr.prototype.checkSplitEdgesCorrectness=function(r){var i=this._edge.getCoordinates(),a=r.get(0).getCoordinate(0);if(!a.equals2D(i[0]))throw new Te("bad split edge start point at "+a);var c=r.get(r.size()-1).getCoordinates(),d=c[c.length-1];if(!d.equals2D(i[i.length-1]))throw new Te("bad split edge end point at "+d)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var ua=function(){};ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua},ua.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];if(r===0&&i===0)throw new I("Cannot compute the octant for point ( "+r+", "+i+" )");var a=Math.abs(r),c=Math.abs(i);return r>=0?i>=0?a>=c?0:1:a>=c?7:6:i>=0?a>=c?3:2:a>=c?4:5}if(arguments[0]instanceof D&&arguments[1]instanceof D){var d=arguments[0],v=arguments[1],M=v.x-d.x,L=v.y-d.y;if(M===0&&L===0)throw new I("Cannot compute the octant for two identical points "+d);return ua.octant(M,L)}};var No=function(){};No.prototype.getCoordinates=function(){},No.prototype.size=function(){},No.prototype.getCoordinate=function(r){},No.prototype.isClosed=function(){},No.prototype.setData=function(r){},No.prototype.getData=function(){},No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No};var _u=function(){};_u.prototype.addIntersection=function(r,i){},_u.prototype.interfaces_=function(){return[No]},_u.prototype.getClass=function(){return _u};var mr=function(){this._nodeList=new Qr(this),this._pts=null,this._data=null;var r=arguments[0],i=arguments[1];this._pts=r,this._data=i};mr.prototype.getCoordinates=function(){return this._pts},mr.prototype.size=function(){return this._pts.length},mr.prototype.getCoordinate=function(r){return this._pts[r]},mr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},mr.prototype.getSegmentOctant=function(r){return r===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(r),this.getCoordinate(r+1))},mr.prototype.setData=function(r){this._data=r},mr.prototype.safeOctant=function(r,i){return r.equals2D(i)?0:ua.octant(r,i)},mr.prototype.getData=function(){return this._data},mr.prototype.addIntersection=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this.addIntersectionNode(r,i)}else if(arguments.length===4){var a=arguments[0],c=arguments[1],d=arguments[3],v=new D(a.getIntersection(d));this.addIntersection(v,c)}},mr.prototype.toString=function(){return fe.toLineString(new ye(this._pts))},mr.prototype.getNodeList=function(){return this._nodeList},mr.prototype.addIntersectionNode=function(r,i){var a=i,c=a+1;if(c<this._pts.length){var d=this._pts[c];r.equals2D(d)&&(a=c)}return this._nodeList.add(r,a)},mr.prototype.addIntersections=function(r,i,a){for(var c=0;c<r.getIntersectionNum();c++)this.addIntersection(r,i,a,c)},mr.prototype.interfaces_=function(){return[_u]},mr.prototype.getClass=function(){return mr},mr.getNodedSubstrings=function(){if(arguments.length===1){var r=arguments[0],i=new G;return mr.getNodedSubstrings(r,i),i}if(arguments.length===2)for(var a=arguments[0],c=arguments[1],d=a.iterator();d.hasNext();)d.next().getNodeList().addSplitEdges(c)};var ie=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 r=arguments[0];this.p0=new D(r.p0),this.p1=new D(r.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],a=arguments[1],c=arguments[2],d=arguments[3];this.p0=new D(i,a),this.p1=new D(c,d)}},Gh={serialVersionUID:{configurable:!0}};ie.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ie.prototype.orientationIndex=function(){if(arguments[0]instanceof ie){var r=arguments[0],i=dt.orientationIndex(this.p0,this.p1,r.p0),a=dt.orientationIndex(this.p0,this.p1,r.p1);return i>=0&&a>=0||i<=0&&a<=0?Math.max(i,a):0}if(arguments[0]instanceof D){var c=arguments[0];return dt.orientationIndex(this.p0,this.p1,c)}},ie.prototype.toGeometry=function(r){return r.createLineString([this.p0,this.p1])},ie.prototype.isVertical=function(){return this.p0.x===this.p1.x},ie.prototype.equals=function(r){if(!(r instanceof ie))return!1;var i=r;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},ie.prototype.intersection=function(r){var i=new z;return i.computeIntersection(this.p0,this.p1,r.p0,r.p1),i.hasIntersection()?i.getIntersection(0):null},ie.prototype.project=function(){if(arguments[0]instanceof D){var r=arguments[0];if(r.equals(this.p0)||r.equals(this.p1))return new D(r);var i=this.projectionFactor(r),a=new D;return a.x=this.p0.x+i*(this.p1.x-this.p0.x),a.y=this.p0.y+i*(this.p1.y-this.p0.y),a}if(arguments[0]instanceof ie){var c=arguments[0],d=this.projectionFactor(c.p0),v=this.projectionFactor(c.p1);if(d>=1&&v>=1||d<=0&&v<=0)return null;var M=this.project(c.p0);d<0&&(M=this.p0),d>1&&(M=this.p1);var L=this.project(c.p1);return v<0&&(L=this.p0),v>1&&(L=this.p1),new ie(M,L)}},ie.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ie.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ie.prototype.getCoordinate=function(r){return r===0?this.p0:this.p1},ie.prototype.distancePerpendicular=function(r){return dt.distancePointLinePerpendicular(r,this.p0,this.p1)},ie.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ie.prototype.midPoint=function(){return ie.midPoint(this.p0,this.p1)},ie.prototype.projectionFactor=function(r){if(r.equals(this.p0))return 0;if(r.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,c=i*i+a*a;return c<=0?A.NaN:((r.x-this.p0.x)*i+(r.y-this.p0.y)*a)/c},ie.prototype.closestPoints=function(r){var i=this.intersection(r);if(i!==null)return[i,i];var a=new Array(2).fill(null),c=A.MAX_VALUE,d=null,v=this.closestPoint(r.p0);c=v.distance(r.p0),a[0]=v,a[1]=r.p0;var M=this.closestPoint(r.p1);(d=M.distance(r.p1))<c&&(c=d,a[0]=M,a[1]=r.p1);var L=r.closestPoint(this.p0);(d=L.distance(this.p0))<c&&(c=d,a[0]=this.p0,a[1]=L);var H=r.closestPoint(this.p1);return(d=H.distance(this.p1))<c&&(c=d,a[0]=this.p1,a[1]=H),a},ie.prototype.closestPoint=function(r){var i=this.projectionFactor(r);return i>0&&i<1?this.project(r):this.p0.distance(r)<this.p1.distance(r)?this.p0:this.p1},ie.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ie.prototype.getLength=function(){return this.p0.distance(this.p1)},ie.prototype.compareTo=function(r){var i=r,a=this.p0.compareTo(i.p0);return a!==0?a:this.p1.compareTo(i.p1)},ie.prototype.reverse=function(){var r=this.p0;this.p0=this.p1,this.p1=r},ie.prototype.equalsTopo=function(r){return this.p0.equals(r.p0)&&(this.p1.equals(r.p1)||this.p0.equals(r.p1))&&this.p1.equals(r.p0)},ie.prototype.lineIntersection=function(r){try{return $t.intersection(this.p0,this.p1,r.p0,r.p1)}catch(i){if(!(i instanceof ce))throw i}return null},ie.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ie.prototype.pointAlongOffset=function(r,i){var a=this.p0.x+r*(this.p1.x-this.p0.x),c=this.p0.y+r*(this.p1.y-this.p0.y),d=this.p1.x-this.p0.x,v=this.p1.y-this.p0.y,M=Math.sqrt(d*d+v*v),L=0,H=0;if(i!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");L=i*d/M,H=i*v/M}return new D(a-H,c+L)},ie.prototype.setCoordinates=function(){if(arguments.length===1){var r=arguments[0];this.setCoordinates(r.p0,r.p1)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=a.x,this.p1.y=a.y}},ie.prototype.segmentFraction=function(r){var i=this.projectionFactor(r);return i<0?i=0:(i>1||A.isNaN(i))&&(i=1),i},ie.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ie.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ie.prototype.distance=function(){if(arguments[0]instanceof ie){var r=arguments[0];return dt.distanceLineLine(this.p0,this.p1,r.p0,r.p1)}if(arguments[0]instanceof D){var i=arguments[0];return dt.distancePointLine(i,this.p0,this.p1)}},ie.prototype.pointAlong=function(r){var i=new D;return i.x=this.p0.x+r*(this.p1.x-this.p0.x),i.y=this.p0.y+r*(this.p1.y-this.p0.y),i},ie.prototype.hashCode=function(){var r=A.doubleToLongBits(this.p0.x);r^=31*A.doubleToLongBits(this.p0.y);var i=Math.trunc(r)^Math.trunc(r>>32),a=A.doubleToLongBits(this.p1.x);return a^=31*A.doubleToLongBits(this.p1.y),i^(Math.trunc(a)^Math.trunc(a>>32))},ie.prototype.interfaces_=function(){return[V,t]},ie.prototype.getClass=function(){return ie},ie.midPoint=function(r,i){return new D((r.x+i.x)/2,(r.y+i.y)/2)},Gh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ie,Gh);var Pi=function(){this.tempEnv1=new qt,this.tempEnv2=new qt,this._overlapSeg1=new ie,this._overlapSeg2=new ie};Pi.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];r.getLineSegment(i,this._overlapSeg1),a.getLineSegment(c,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ii=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this._pts=r,this._start=i,this._end=a,this._context=c};Ii.prototype.getLineSegment=function(r,i){i.p0=this._pts[r],i.p1=this._pts[r+1]},Ii.prototype.computeSelect=function(r,i,a,c){var d=this._pts[i],v=this._pts[a];if(c.tempEnv1.init(d,v),a-i==1)return c.select(this,i),null;if(!r.intersects(c.tempEnv1))return null;var M=Math.trunc((i+a)/2);i<M&&this.computeSelect(r,i,M,c),M<a&&this.computeSelect(r,M,a,c)},Ii.prototype.getCoordinates=function(){for(var r=new Array(this._end-this._start+1).fill(null),i=0,a=this._start;a<=this._end;a++)r[i++]=this._pts[a];return r},Ii.prototype.computeOverlaps=function(r,i){this.computeOverlapsInternal(this._start,this._end,r,r._start,r._end,i)},Ii.prototype.setId=function(r){this._id=r},Ii.prototype.select=function(r,i){this.computeSelect(r,this._start,this._end,i)},Ii.prototype.getEnvelope=function(){if(this._env===null){var r=this._pts[this._start],i=this._pts[this._end];this._env=new qt(r,i)}return this._env},Ii.prototype.getEndIndex=function(){return this._end},Ii.prototype.getStartIndex=function(){return this._start},Ii.prototype.getContext=function(){return this._context},Ii.prototype.getId=function(){return this._id},Ii.prototype.computeOverlapsInternal=function(r,i,a,c,d,v){var M=this._pts[r],L=this._pts[i],H=a._pts[c],it=a._pts[d];if(i-r==1&&d-c==1)return v.overlap(this,r,a,c),null;if(v.tempEnv1.init(M,L),v.tempEnv2.init(H,it),!v.tempEnv1.intersects(v.tempEnv2))return null;var bt=Math.trunc((r+i)/2),Tt=Math.trunc((c+d)/2);r<bt&&(c<Tt&&this.computeOverlapsInternal(r,bt,a,c,Tt,v),Tt<d&&this.computeOverlapsInternal(r,bt,a,Tt,d,v)),bt<i&&(c<Tt&&this.computeOverlapsInternal(bt,i,a,c,Tt,v),Tt<d&&this.computeOverlapsInternal(bt,i,a,Tt,d,v))},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var po=function(){};po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},po.getChainStartIndices=function(r){var i=0,a=new G;a.add(new pt(i));do{var c=po.findChainEnd(r,i);a.add(new pt(c)),i=c}while(i<r.length-1);return po.toIntArray(a)},po.findChainEnd=function(r,i){for(var a=i;a<r.length-1&&r[a].equals2D(r[a+1]);)a++;if(a>=r.length-1)return r.length-1;for(var c=Yn.quadrant(r[a],r[a+1]),d=i+1;d<r.length&&!(!r[d-1].equals2D(r[d])&&Yn.quadrant(r[d-1],r[d])!==c);)d++;return d-1},po.getChains=function(){if(arguments.length===1){var r=arguments[0];return po.getChains(r,null)}if(arguments.length===2){for(var i=arguments[0],a=arguments[1],c=new G,d=po.getChainStartIndices(i),v=0;v<d.length-1;v++){var M=new Ii(i,d[v],d[v+1],a);c.add(M)}return c}},po.toIntArray=function(r){for(var i=new Array(r.size()).fill(null),a=0;a<i.length;a++)i[a]=r.get(a).intValue();return i};var Yi=function(){};Yi.prototype.computeNodes=function(r){},Yi.prototype.getNodedSubstrings=function(){},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi};var la=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.setSegmentIntersector(r)}}};la.prototype.setSegmentIntersector=function(r){this._segInt=r},la.prototype.interfaces_=function(){return[Yi]},la.prototype.getClass=function(){return la};var hl=function(r){function i(c){c?r.call(this,c):r.call(this),this._monoChains=new G,this._index=new Sf,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var a={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return mr.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(c){for(var d=po.getChains(c.getCoordinates(),c).iterator();d.hasNext();){var v=d.next();v.setId(this._idCounter++),this._index.insert(v.getEnvelope(),v),this._monoChains.add(v)}},i.prototype.computeNodes=function(c){this._nodedSegStrings=c;for(var d=c.iterator();d.hasNext();)this.add(d.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var c=new Mr(this._segInt),d=this._monoChains.iterator();d.hasNext();)for(var v=d.next(),M=this._index.query(v.getEnvelope()).iterator();M.hasNext();){var L=M.next();if(L.getId()>v.getId()&&(v.computeOverlaps(L,c),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},a.SegmentOverlapAction.get=function(){return Mr},Object.defineProperties(i,a),i}(la),Mr=function(r){function i(){r.call(this),this._si=null;var a=arguments[0];this._si=a}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return r.prototype.overlap.apply(this,arguments);var a=arguments[0],c=arguments[1],d=arguments[2],v=arguments[3],M=a.getContext(),L=d.getContext();this._si.processIntersections(M,c,L,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Pi),ke=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this.setQuadrantSegments(a),this.setEndCapStyle(c)}else if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3];this.setQuadrantSegments(d),this.setEndCapStyle(v),this.setJoinStyle(M),this.setMitreLimit(L)}}},Oo={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}};ke.prototype.getEndCapStyle=function(){return this._endCapStyle},ke.prototype.isSingleSided=function(){return this._isSingleSided},ke.prototype.setQuadrantSegments=function(r){this._quadrantSegments=r,this._quadrantSegments===0&&(this._joinStyle=ke.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=ke.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),r<=0&&(this._quadrantSegments=1),this._joinStyle!==ke.JOIN_ROUND&&(this._quadrantSegments=ke.DEFAULT_QUADRANT_SEGMENTS)},ke.prototype.getJoinStyle=function(){return this._joinStyle},ke.prototype.setJoinStyle=function(r){this._joinStyle=r},ke.prototype.setSimplifyFactor=function(r){this._simplifyFactor=r<0?0:r},ke.prototype.getSimplifyFactor=function(){return this._simplifyFactor},ke.prototype.getQuadrantSegments=function(){return this._quadrantSegments},ke.prototype.setEndCapStyle=function(r){this._endCapStyle=r},ke.prototype.getMitreLimit=function(){return this._mitreLimit},ke.prototype.setMitreLimit=function(r){this._mitreLimit=r},ke.prototype.setSingleSided=function(r){this._isSingleSided=r},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.bufferDistanceError=function(r){var i=Math.PI/2/r;return 1-Math.cos(i/2)},Oo.CAP_ROUND.get=function(){return 1},Oo.CAP_FLAT.get=function(){return 2},Oo.CAP_SQUARE.get=function(){return 3},Oo.JOIN_ROUND.get=function(){return 1},Oo.JOIN_MITRE.get=function(){return 2},Oo.JOIN_BEVEL.get=function(){return 3},Oo.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Oo.DEFAULT_MITRE_LIMIT.get=function(){return 5},Oo.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(ke,Oo);var yr=function(r){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=dt.COUNTERCLOCKWISE,this._inputLine=r||null},ka={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};yr.prototype.isDeletable=function(r,i,a,c){var d=this._inputLine[r],v=this._inputLine[i],M=this._inputLine[a];return!!this.isConcave(d,v,M)&&!!this.isShallow(d,v,M,c)&&this.isShallowSampled(d,v,r,a,c)},yr.prototype.deleteShallowConcavities=function(){for(var r=1,i=this.findNextNonDeletedIndex(r),a=this.findNextNonDeletedIndex(i),c=!1;a<this._inputLine.length;){var d=!1;this.isDeletable(r,i,a,this._distanceTol)&&(this._isDeleted[i]=yr.DELETE,d=!0,c=!0),r=d?a:i,i=this.findNextNonDeletedIndex(r),a=this.findNextNonDeletedIndex(i)}return c},yr.prototype.isShallowConcavity=function(r,i,a,c){return dt.computeOrientation(r,i,a)!==this._angleOrientation?!1:dt.distancePointLine(i,r,a)<c},yr.prototype.isShallowSampled=function(r,i,a,c,d){var v=Math.trunc((c-a)/yr.NUM_PTS_TO_CHECK);v<=0&&(v=1);for(var M=a;M<c;M+=v)if(!this.isShallow(r,i,this._inputLine[M],d))return!1;return!0},yr.prototype.isConcave=function(r,i,a){var c=dt.computeOrientation(r,i,a)===this._angleOrientation;return c},yr.prototype.simplify=function(r){this._distanceTol=Math.abs(r),r<0&&(this._angleOrientation=dt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},yr.prototype.findNextNonDeletedIndex=function(r){for(var i=r+1;i<this._inputLine.length&&this._isDeleted[i]===yr.DELETE;)i++;return i},yr.prototype.isShallow=function(r,i,a,c){return dt.distancePointLine(i,r,a)<c},yr.prototype.collapseLine=function(){for(var r=new et,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==yr.DELETE&&r.add(this._inputLine[i]);return r.toCoordinateArray()},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.simplify=function(r,i){return new yr(r).simplify(i)},ka.INIT.get=function(){return 0},ka.DELETE.get=function(){return 1},ka.KEEP.get=function(){return 1},ka.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(yr,ka);var $i=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new G},kh={COORDINATE_ARRAY_TYPE:{configurable:!0}};$i.prototype.getCoordinates=function(){return this._ptList.toArray($i.COORDINATE_ARRAY_TYPE)},$i.prototype.setPrecisionModel=function(r){this._precisionModel=r},$i.prototype.addPt=function(r){var i=new D(r);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},$i.prototype.revere=function(){},$i.prototype.addPts=function(r,i){if(i)for(var a=0;a<r.length;a++)this.addPt(r[a]);else for(var c=r.length-1;c>=0;c--)this.addPt(r[c])},$i.prototype.isRedundant=function(r){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return r.distance(i)<this._minimimVertexDistance},$i.prototype.toString=function(){return new Le().createLineString(this.getCoordinates()).toString()},$i.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var r=new D(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(r.equals(i))return null;this._ptList.add(r)},$i.prototype.setMinimumVertexDistance=function(r){this._minimimVertexDistance=r},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},kh.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties($i,kh);var Ve=function(){},ca={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.toDegrees=function(r){return 180*r/Math.PI},Ve.normalize=function(r){for(;r>Math.PI;)r-=Ve.PI_TIMES_2;for(;r<=-Math.PI;)r+=Ve.PI_TIMES_2;return r},Ve.angle=function(){if(arguments.length===1){var r=arguments[0];return Math.atan2(r.y,r.x)}if(arguments.length===2){var i=arguments[0],a=arguments[1],c=a.x-i.x,d=a.y-i.y;return Math.atan2(d,c)}},Ve.isAcute=function(r,i,a){var c=r.x-i.x,d=r.y-i.y;return c*(a.x-i.x)+d*(a.y-i.y)>0},Ve.isObtuse=function(r,i,a){var c=r.x-i.x,d=r.y-i.y;return c*(a.x-i.x)+d*(a.y-i.y)<0},Ve.interiorAngle=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a);return Math.abs(d-c)},Ve.normalizePositive=function(r){if(r<0){for(;r<0;)r+=Ve.PI_TIMES_2;r>=Ve.PI_TIMES_2&&(r=0)}else{for(;r>=Ve.PI_TIMES_2;)r-=Ve.PI_TIMES_2;r<0&&(r=0)}return r},Ve.angleBetween=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a);return Ve.diff(c,d)},Ve.diff=function(r,i){var a=null;return(a=r<i?i-r:r-i)>Math.PI&&(a=2*Math.PI-a),a},Ve.toRadians=function(r){return r*Math.PI/180},Ve.getTurn=function(r,i){var a=Math.sin(i-r);return a>0?Ve.COUNTERCLOCKWISE:a<0?Ve.CLOCKWISE:Ve.NONE},Ve.angleBetweenOriented=function(r,i,a){var c=Ve.angle(i,r),d=Ve.angle(i,a)-c;return d<=-Math.PI?d+Ve.PI_TIMES_2:d>Math.PI?d-Ve.PI_TIMES_2:d},ca.PI_TIMES_2.get=function(){return 2*Math.PI},ca.PI_OVER_2.get=function(){return Math.PI/2},ca.PI_OVER_4.get=function(){return Math.PI/4},ca.COUNTERCLOCKWISE.get=function(){return dt.COUNTERCLOCKWISE},ca.CLOCKWISE.get=function(){return dt.CLOCKWISE},ca.NONE.get=function(){return dt.COLLINEAR},Object.defineProperties(Ve,ca);var Kn=function r(){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 ie,this._seg1=new ie,this._offset0=new ie,this._offset1=new ie,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],a=arguments[1],c=arguments[2];this._precisionModel=i,this._bufParams=a,this._li=new z,this._filletAngleQuantum=Math.PI/2/a.getQuadrantSegments(),a.getQuadrantSegments()>=8&&a.getJoinStyle()===ke.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(c)},xs={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}};Kn.prototype.addNextSegment=function(r,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=r,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 a=dt.computeOrientation(this._s0,this._s1,this._s2),c=a===dt.CLOCKWISE&&this._side===Xt.LEFT||a===dt.COUNTERCLOCKWISE&&this._side===Xt.RIGHT;a===0?this.addCollinear(i):c?this.addOutsideTurn(a,i):this.addInsideTurn(a,i)},Kn.prototype.addLineEndCap=function(r,i){var a=new ie(r,i),c=new ie;this.computeOffsetSegment(a,Xt.LEFT,this._distance,c);var d=new ie;this.computeOffsetSegment(a,Xt.RIGHT,this._distance,d);var v=i.x-r.x,M=i.y-r.y,L=Math.atan2(M,v);switch(this._bufParams.getEndCapStyle()){case ke.CAP_ROUND:this._segList.addPt(c.p1),this.addFilletArc(i,L+Math.PI/2,L-Math.PI/2,dt.CLOCKWISE,this._distance),this._segList.addPt(d.p1);break;case ke.CAP_FLAT:this._segList.addPt(c.p1),this._segList.addPt(d.p1);break;case ke.CAP_SQUARE:var H=new D;H.x=Math.abs(this._distance)*Math.cos(L),H.y=Math.abs(this._distance)*Math.sin(L);var it=new D(c.p1.x+H.x,c.p1.y+H.y),bt=new D(d.p1.x+H.x,d.p1.y+H.y);this._segList.addPt(it),this._segList.addPt(bt)}},Kn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Kn.prototype.addMitreJoin=function(r,i,a,c){var d=!0,v=null;try{v=$t.intersection(i.p0,i.p1,a.p0,a.p1),(c<=0?1:v.distance(r)/Math.abs(c))>this._bufParams.getMitreLimit()&&(d=!1)}catch(M){if(!(M instanceof ce))throw M;v=new D(0,0),d=!1}d?this._segList.addPt(v):this.addLimitedMitreJoin(i,a,c,this._bufParams.getMitreLimit())},Kn.prototype.addFilletCorner=function(r,i,a,c,d){var v=i.x-r.x,M=i.y-r.y,L=Math.atan2(M,v),H=a.x-r.x,it=a.y-r.y,bt=Math.atan2(it,H);c===dt.CLOCKWISE?L<=bt&&(L+=2*Math.PI):L>=bt&&(L-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(r,L,bt,c,d),this._segList.addPt(a)},Kn.prototype.addOutsideTurn=function(r,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Kn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===ke.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===ke.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,r,this._distance),this._segList.addPt(this._offset1.p0))},Kn.prototype.createSquare=function(r){this._segList.addPt(new D(r.x+this._distance,r.y+this._distance)),this._segList.addPt(new D(r.x+this._distance,r.y-this._distance)),this._segList.addPt(new D(r.x-this._distance,r.y-this._distance)),this._segList.addPt(new D(r.x-this._distance,r.y+this._distance)),this._segList.closeRing()},Kn.prototype.addSegments=function(r,i){this._segList.addPts(r,i)},Kn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Kn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Kn.prototype.initSideSegments=function(r,i,a){this._s1=r,this._s2=i,this._side=a,this._seg1.setCoordinates(r,i),this.computeOffsetSegment(this._seg1,a,this._distance,this._offset1)},Kn.prototype.addLimitedMitreJoin=function(r,i,a,c){var d=this._seg0.p1,v=Ve.angle(d,this._seg0.p0),M=Ve.angleBetweenOriented(this._seg0.p0,d,this._seg1.p1)/2,L=Ve.normalize(v+M),H=Ve.normalize(L+Math.PI),it=c*a,bt=a-it*Math.abs(Math.sin(M)),Tt=d.x+it*Math.cos(H),Kt=d.y+it*Math.sin(H),Qt=new D(Tt,Kt),le=new ie(d,Qt),Ee=le.pointAlongOffset(1,bt),Dn=le.pointAlongOffset(1,-bt);this._side===Xt.LEFT?(this._segList.addPt(Ee),this._segList.addPt(Dn)):(this._segList.addPt(Dn),this._segList.addPt(Ee))},Kn.prototype.computeOffsetSegment=function(r,i,a,c){var d=i===Xt.LEFT?1:-1,v=r.p1.x-r.p0.x,M=r.p1.y-r.p0.y,L=Math.sqrt(v*v+M*M),H=d*a*v/L,it=d*a*M/L;c.p0.x=r.p0.x-it,c.p0.y=r.p0.y+H,c.p1.x=r.p1.x-it,c.p1.y=r.p1.y+H},Kn.prototype.addFilletArc=function(r,i,a,c,d){var v=c===dt.CLOCKWISE?-1:1,M=Math.abs(i-a),L=Math.trunc(M/this._filletAngleQuantum+.5);if(L<1)return null;for(var H=M/L,it=0,bt=new D;it<M;){var Tt=i+v*it;bt.x=r.x+d*Math.cos(Tt),bt.y=r.y+d*Math.sin(Tt),this._segList.addPt(bt),it+=H}},Kn.prototype.addInsideTurn=function(r,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*Kn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var a=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(a);var c=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(c)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Kn.prototype.createCircle=function(r){var i=new D(r.x+this._distance,r.y);this._segList.addPt(i),this.addFilletArc(r,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Kn.prototype.addBevelJoin=function(r,i){this._segList.addPt(r.p1),this._segList.addPt(i.p0)},Kn.prototype.init=function(r){this._distance=r,this._maxCurveSegmentError=r*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $i,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(r*Kn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Kn.prototype.addCollinear=function(r){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===ke.JOIN_BEVEL||this._bufParams.getJoinStyle()===ke.JOIN_MITRE?(r&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,dt.CLOCKWISE,this._distance))},Kn.prototype.closeRing=function(){this._segList.closeRing()},Kn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},xs.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},xs.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},xs.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},xs.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Kn,xs);var pi=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var r=arguments[0],i=arguments[1];this._precisionModel=r,this._bufParams=i};pi.prototype.getOffsetCurve=function(r,i){if(this._distance=i,i===0)return null;var a=i<0,c=Math.abs(i),d=this.getSegGen(c);r.length<=1?this.computePointCurve(r[0],d):this.computeOffsetCurve(r,a,d);var v=d.getCoordinates();return a&<.reverse(v),v},pi.prototype.computeSingleSidedBufferCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);if(i){a.addSegments(r,!0);var d=yr.simplify(r,-c),v=d.length-1;a.initSideSegments(d[v],d[v-1],Xt.LEFT),a.addFirstSegment();for(var M=v-2;M>=0;M--)a.addNextSegment(d[M],!0)}else{a.addSegments(r,!1);var L=yr.simplify(r,c),H=L.length-1;a.initSideSegments(L[0],L[1],Xt.LEFT),a.addFirstSegment();for(var it=2;it<=H;it++)a.addNextSegment(L[it],!0)}a.addLastSegment(),a.closeRing()},pi.prototype.computeRingBufferCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);i===Xt.RIGHT&&(c=-c);var d=yr.simplify(r,c),v=d.length-1;a.initSideSegments(d[v-1],d[0],i);for(var M=1;M<=v;M++){var L=M!==1;a.addNextSegment(d[M],L)}a.closeRing()},pi.prototype.computeLineBufferCurve=function(r,i){var a=this.simplifyTolerance(this._distance),c=yr.simplify(r,a),d=c.length-1;i.initSideSegments(c[0],c[1],Xt.LEFT);for(var v=2;v<=d;v++)i.addNextSegment(c[v],!0);i.addLastSegment(),i.addLineEndCap(c[d-1],c[d]);var M=yr.simplify(r,-a),L=M.length-1;i.initSideSegments(M[L],M[L-1],Xt.LEFT);for(var H=L-2;H>=0;H--)i.addNextSegment(M[H],!0);i.addLastSegment(),i.addLineEndCap(M[1],M[0]),i.closeRing()},pi.prototype.computePointCurve=function(r,i){switch(this._bufParams.getEndCapStyle()){case ke.CAP_ROUND:i.createCircle(r);break;case ke.CAP_SQUARE:i.createSquare(r)}},pi.prototype.getLineCurve=function(r,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var a=Math.abs(i),c=this.getSegGen(a);if(r.length<=1)this.computePointCurve(r[0],c);else if(this._bufParams.isSingleSided()){var d=i<0;this.computeSingleSidedBufferCurve(r,d,c)}else this.computeLineBufferCurve(r,c);return c.getCoordinates()},pi.prototype.getBufferParameters=function(){return this._bufParams},pi.prototype.simplifyTolerance=function(r){return r*this._bufParams.getSimplifyFactor()},pi.prototype.getRingCurve=function(r,i,a){if(this._distance=a,r.length<=2)return this.getLineCurve(r,a);if(a===0)return pi.copyCoordinates(r);var c=this.getSegGen(a);return this.computeRingBufferCurve(r,i,c),c.getCoordinates()},pi.prototype.computeOffsetCurve=function(r,i,a){var c=this.simplifyTolerance(this._distance);if(i){var d=yr.simplify(r,-c),v=d.length-1;a.initSideSegments(d[v],d[v-1],Xt.LEFT),a.addFirstSegment();for(var M=v-2;M>=0;M--)a.addNextSegment(d[M],!0)}else{var L=yr.simplify(r,c),H=L.length-1;a.initSideSegments(L[0],L[1],Xt.LEFT),a.addFirstSegment();for(var it=2;it<=H;it++)a.addNextSegment(L[it],!0)}a.addLastSegment()},pi.prototype.getSegGen=function(r){return new Kn(this._precisionModel,this._bufParams,r)},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},pi.copyCoordinates=function(r){for(var i=new Array(r.length).fill(null),a=0;a<i.length;a++)i[a]=new D(r[a]);return i};var fa=function(){this._subgraphs=null,this._seg=new ie,this._cga=new dt;var r=arguments[0];this._subgraphs=r},Mf={DepthSegment:{configurable:!0}};fa.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var r=arguments[0],i=new G,a=this._subgraphs.iterator();a.hasNext();){var c=a.next(),d=c.getEnvelope();r.y<d.getMinY()||r.y>d.getMaxY()||this.findStabbedSegments(r,c.getDirectedEdges(),i)}return i}if(arguments.length===3){if(Q(arguments[2],Et)&&arguments[0]instanceof D&&arguments[1]instanceof Ef){for(var v=arguments[0],M=arguments[1],L=arguments[2],H=M.getEdge().getCoordinates(),it=0;it<H.length-1;it++)if(this._seg.p0=H[it],this._seg.p1=H[it+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||dt.computeOrientation(this._seg.p0,this._seg.p1,v)===dt.RIGHT)){var bt=M.getDepth(Xt.LEFT);this._seg.p0.equals(H[it])||(bt=M.getDepth(Xt.RIGHT));var Tt=new Es(this._seg,bt);L.add(Tt)}}else if(Q(arguments[2],Et)&&arguments[0]instanceof D&&Q(arguments[1],Et))for(var Kt=arguments[0],Qt=arguments[1],le=arguments[2],Ee=Qt.iterator();Ee.hasNext();){var Dn=Ee.next();Dn.isForward()&&this.findStabbedSegments(Kt,Dn,le)}}},fa.prototype.getDepth=function(r){var i=this.findStabbedSegments(r);return i.size()===0?0:ho.min(i)._leftDepth},fa.prototype.interfaces_=function(){return[]},fa.prototype.getClass=function(){return fa},Mf.DepthSegment.get=function(){return Es},Object.defineProperties(fa,Mf);var Es=function(){this._upwardSeg=null,this._leftDepth=null;var r=arguments[0],i=arguments[1];this._upwardSeg=new ie(r),this._leftDepth=i};Es.prototype.compareTo=function(r){var i=r;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var a=this._upwardSeg.orientationIndex(i._upwardSeg);return a!==0||(a=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?a:this._upwardSeg.compareTo(i._upwardSeg)},Es.prototype.compareX=function(r,i){var a=r.p0.compareTo(i.p0);return a!==0?a:r.p1.compareTo(i.p1)},Es.prototype.toString=function(){return this._upwardSeg.toString()},Es.prototype.interfaces_=function(){return[V]},Es.prototype.getClass=function(){return Es};var Ze=function(r,i,a){this.p0=r||null,this.p1=i||null,this.p2=a||null};Ze.prototype.area=function(){return Ze.area(this.p0,this.p1,this.p2)},Ze.prototype.signedArea=function(){return Ze.signedArea(this.p0,this.p1,this.p2)},Ze.prototype.interpolateZ=function(r){if(r===null)throw new I("Supplied point is null.");return Ze.interpolateZ(r,this.p0,this.p1,this.p2)},Ze.prototype.longestSideLength=function(){return Ze.longestSideLength(this.p0,this.p1,this.p2)},Ze.prototype.isAcute=function(){return Ze.isAcute(this.p0,this.p1,this.p2)},Ze.prototype.circumcentre=function(){return Ze.circumcentre(this.p0,this.p1,this.p2)},Ze.prototype.area3D=function(){return Ze.area3D(this.p0,this.p1,this.p2)},Ze.prototype.centroid=function(){return Ze.centroid(this.p0,this.p1,this.p2)},Ze.prototype.inCentre=function(){return Ze.inCentre(this.p0,this.p1,this.p2)},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.area=function(r,i,a){return Math.abs(((a.x-r.x)*(i.y-r.y)-(i.x-r.x)*(a.y-r.y))/2)},Ze.signedArea=function(r,i,a){return((a.x-r.x)*(i.y-r.y)-(i.x-r.x)*(a.y-r.y))/2},Ze.det=function(r,i,a,c){return r*c-i*a},Ze.interpolateZ=function(r,i,a,c){var d=i.x,v=i.y,M=a.x-d,L=c.x-d,H=a.y-v,it=c.y-v,bt=M*it-L*H,Tt=r.x-d,Kt=r.y-v,Qt=(it*Tt-L*Kt)/bt,le=(-H*Tt+M*Kt)/bt;return i.z+Qt*(a.z-i.z)+le*(c.z-i.z)},Ze.longestSideLength=function(r,i,a){var c=r.distance(i),d=i.distance(a),v=a.distance(r),M=c;return d>M&&(M=d),v>M&&(M=v),M},Ze.isAcute=function(r,i,a){return!!Ve.isAcute(r,i,a)&&!!Ve.isAcute(i,a,r)&&!!Ve.isAcute(a,r,i)},Ze.circumcentre=function(r,i,a){var c=a.x,d=a.y,v=r.x-c,M=r.y-d,L=i.x-c,H=i.y-d,it=2*Ze.det(v,M,L,H),bt=Ze.det(M,v*v+M*M,H,L*L+H*H),Tt=Ze.det(v,v*v+M*M,L,L*L+H*H);return new D(c-bt/it,d+Tt/it)},Ze.perpendicularBisector=function(r,i){var a=i.x-r.x,c=i.y-r.y,d=new $t(r.x+a/2,r.y+c/2,1),v=new $t(r.x-c+a/2,r.y+a+c/2,1);return new $t(d,v)},Ze.angleBisector=function(r,i,a){var c=i.distance(r),d=c/(c+i.distance(a)),v=a.x-r.x,M=a.y-r.y;return new D(r.x+d*v,r.y+d*M)},Ze.area3D=function(r,i,a){var c=i.x-r.x,d=i.y-r.y,v=i.z-r.z,M=a.x-r.x,L=a.y-r.y,H=a.z-r.z,it=d*H-v*L,bt=v*M-c*H,Tt=c*L-d*M,Kt=it*it+bt*bt+Tt*Tt,Qt=Math.sqrt(Kt)/2;return Qt},Ze.centroid=function(r,i,a){var c=(r.x+i.x+a.x)/3,d=(r.y+i.y+a.y)/3;return new D(c,d)},Ze.inCentre=function(r,i,a){var c=i.distance(a),d=r.distance(a),v=r.distance(i),M=c+d+v,L=(c*r.x+d*i.x+v*a.x)/M,H=(c*r.y+d*i.y+v*a.y)/M;return new D(L,H)};var Zi=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new G;var r=arguments[0],i=arguments[1],a=arguments[2];this._inputGeom=r,this._distance=i,this._curveBuilder=a};Zi.prototype.addPoint=function(r){if(this._distance<=0)return null;var i=r.getCoordinates(),a=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(a,K.EXTERIOR,K.INTERIOR)},Zi.prototype.addPolygon=function(r){var i=this._distance,a=Xt.LEFT;this._distance<0&&(i=-this._distance,a=Xt.RIGHT);var c=r.getExteriorRing(),d=lt.removeRepeatedPoints(c.getCoordinates());if(this._distance<0&&this.isErodedCompletely(c,this._distance)||this._distance<=0&&d.length<3)return null;this.addPolygonRing(d,i,a,K.EXTERIOR,K.INTERIOR);for(var v=0;v<r.getNumInteriorRing();v++){var M=r.getInteriorRingN(v),L=lt.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(L,i,Xt.opposite(a),K.INTERIOR,K.EXTERIOR)}},Zi.prototype.isTriangleErodedCompletely=function(r,i){var a=new Ze(r[0],r[1],r[2]),c=a.inCentre();return dt.distancePointLine(c,a.p0,a.p1)<Math.abs(i)},Zi.prototype.addLineString=function(r){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=lt.removeRepeatedPoints(r.getCoordinates()),a=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(a,K.EXTERIOR,K.INTERIOR)},Zi.prototype.addCurve=function(r,i,a){if(r===null||r.length<2)return null;var c=new mr(r,new On(0,K.BOUNDARY,i,a));this._curveList.add(c)},Zi.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Zi.prototype.addPolygonRing=function(r,i,a,c,d){if(i===0&&r.length<Ae.MINIMUM_VALID_SIZE)return null;var v=c,M=d;r.length>=Ae.MINIMUM_VALID_SIZE&&dt.isCCW(r)&&(v=d,M=c,a=Xt.opposite(a));var L=this._curveBuilder.getRingCurve(r,a,i);this.addCurve(L,v,M)},Zi.prototype.add=function(r){if(r.isEmpty())return null;r instanceof de?this.addPolygon(r):r instanceof vt?this.addLineString(r):r instanceof ue?this.addPoint(r):r instanceof Be?this.addCollection(r):r instanceof bi?this.addCollection(r):r instanceof Pe?this.addCollection(r):r instanceof Qn&&this.addCollection(r)},Zi.prototype.isErodedCompletely=function(r,i){var a=r.getCoordinates();if(a.length<4)return i<0;if(a.length===4)return this.isTriangleErodedCompletely(a,i);var c=r.getEnvelopeInternal(),d=Math.min(c.getHeight(),c.getWidth());return i<0&&2*Math.abs(i)>d},Zi.prototype.addCollection=function(r){for(var i=0;i<r.getNumGeometries();i++){var a=r.getGeometryN(i);this.add(a)}},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi};var xu=function(){};xu.prototype.locate=function(r){},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu};var go=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var r=arguments[0];this._parent=r,this._atStart=!0,this._index=0,this._max=r.getNumGeometries()};go.prototype.next=function(){if(this._atStart)return this._atStart=!1,go.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 r=this._parent.getGeometryN(this._index++);return r instanceof Qn?(this._subcollectionIterator=new go(r),this._subcollectionIterator.next()):r},go.prototype.remove=function(){throw new Error(this.getClass().getName())},go.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)},go.prototype.interfaces_=function(){return[wt]},go.prototype.getClass=function(){return go},go.isAtomic=function(r){return!(r instanceof Qn)};var di=function(){this._geom=null;var r=arguments[0];this._geom=r};di.prototype.locate=function(r){return di.locate(r,this._geom)},di.prototype.interfaces_=function(){return[xu]},di.prototype.getClass=function(){return di},di.isPointInRing=function(r,i){return!!i.getEnvelopeInternal().intersects(r)&&dt.isPointInRing(r,i.getCoordinates())},di.containsPointInPolygon=function(r,i){if(i.isEmpty())return!1;var a=i.getExteriorRing();if(!di.isPointInRing(r,a))return!1;for(var c=0;c<i.getNumInteriorRing();c++){var d=i.getInteriorRingN(c);if(di.isPointInRing(r,d))return!1}return!0},di.containsPoint=function(r,i){if(i instanceof de)return di.containsPointInPolygon(r,i);if(i instanceof Qn)for(var a=new go(i);a.hasNext();){var c=a.next();if(c!==i&&di.containsPoint(r,c))return!0}return!1},di.locate=function(r,i){return i.isEmpty()?K.EXTERIOR:di.containsPoint(r,i)?K.INTERIOR:K.EXTERIOR};var ti=function(){this._edgeMap=new w,this._edgeList=null,this._ptInAreaLocation=[K.NONE,K.NONE]};ti.prototype.getNextCW=function(r){this.getEdges();var i=this._edgeList.indexOf(r),a=i-1;return i===0&&(a=this._edgeList.size()-1),this._edgeList.get(a)},ti.prototype.propagateSideLabels=function(r){for(var i=K.NONE,a=this.iterator();a.hasNext();){var c=a.next().getLabel();c.isArea(r)&&c.getLocation(r,Xt.LEFT)!==K.NONE&&(i=c.getLocation(r,Xt.LEFT))}if(i===K.NONE)return null;for(var d=i,v=this.iterator();v.hasNext();){var M=v.next(),L=M.getLabel();if(L.getLocation(r,Xt.ON)===K.NONE&&L.setLocation(r,Xt.ON,d),L.isArea(r)){var H=L.getLocation(r,Xt.LEFT),it=L.getLocation(r,Xt.RIGHT);if(it!==K.NONE){if(it!==d)throw new Qo("side location conflict",M.getCoordinate());H===K.NONE&&Wt.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),d=H}else Wt.isTrue(L.getLocation(r,Xt.LEFT)===K.NONE,"found single null side"),L.setLocation(r,Xt.RIGHT,d),L.setLocation(r,Xt.LEFT,d)}}},ti.prototype.getCoordinate=function(){var r=this.iterator();return r.hasNext()?r.next().getCoordinate():null},ti.prototype.print=function(r){te.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(r)},ti.prototype.isAreaLabelsConsistent=function(r){return this.computeEdgeEndLabels(r.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ti.prototype.checkAreaLabelsConsistent=function(r){var i=this.getEdges();if(i.size()<=0)return!0;var a=i.size()-1,c=i.get(a).getLabel().getLocation(r,Xt.LEFT);Wt.isTrue(c!==K.NONE,"Found unlabelled area edge");for(var d=c,v=this.iterator();v.hasNext();){var M=v.next().getLabel();Wt.isTrue(M.isArea(r),"Found non-area edge");var L=M.getLocation(r,Xt.LEFT),H=M.getLocation(r,Xt.RIGHT);if(L===H||H!==d)return!1;d=L}return!0},ti.prototype.findIndex=function(r){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===r)return i;return-1},ti.prototype.iterator=function(){return this.getEdges().iterator()},ti.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new G(this._edgeMap.values())),this._edgeList},ti.prototype.getLocation=function(r,i,a){return this._ptInAreaLocation[r]===K.NONE&&(this._ptInAreaLocation[r]=di.locate(i,a[r].getGeometry())),this._ptInAreaLocation[r]},ti.prototype.toString=function(){var r=new Lt;r.append("EdgeEndStar: "+this.getCoordinate()),r.append(`
|
|
6
6
|
`);for(var i=this.iterator();i.hasNext();){var a=i.next();r.append(a),r.append(`
|
|
7
|
-
`)}return r.toString()},ti.prototype.computeEdgeEndLabels=function(r){for(var i=this.iterator();i.hasNext();)i.next().computeLabel(r)},ti.prototype.computeLabelling=function(r){this.computeEdgeEndLabels(r[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var i=[!1,!1],a=this.iterator();a.hasNext();)for(var c=a.next().getLabel(),d=0;d<2;d++)c.isLine(d)&&c.getLocation(d)===K.BOUNDARY&&(i[d]=!0);for(var v=this.iterator();v.hasNext();)for(var M=v.next(),L=M.getLabel(),H=0;H<2;H++)if(L.isAnyNull(H)){var it=K.NONE;if(i[H])it=K.EXTERIOR;else{var bt=M.getCoordinate();it=this.getLocation(H,bt,r)}L.setAllLocationsIfNull(H,it)}},ti.prototype.getDegree=function(){return this._edgeMap.size()},ti.prototype.insertEdgeEnd=function(r,i){this._edgeMap.put(r,i),this._edgeList=null},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var qh=function(r){function i(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var a=null,c=null,d=this._SCANNING_FOR_INCOMING,v=0;v<this._resultAreaEdgeList.size();v++){var M=this._resultAreaEdgeList.get(v),L=M.getSym();if(M.getLabel().isArea())switch(a===null&&M.isInResult()&&(a=M),d){case this._SCANNING_FOR_INCOMING:if(!L.isInResult())continue;c=L,d=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;c.setNext(M),d=this._SCANNING_FOR_INCOMING}}if(d===this._LINKING_TO_OUTGOING){if(a===null)throw new Qo("no outgoing dirEdge found",this.getCoordinate());Wt.isTrue(a.isInResult(),"unable to link last incoming dirEdge"),c.setNext(a)}},i.prototype.insert=function(a){var c=a;this.insertEdgeEnd(c,c)},i.prototype.getRightmostEdge=function(){var a=this.getEdges(),c=a.size();if(c<1)return null;var d=a.get(0);if(c===1)return d;var v=a.get(c-1),M=d.getQuadrant(),L=v.getQuadrant();return Yn.isNorthern(M)&&Yn.isNorthern(L)?d:Yn.isNorthern(M)||Yn.isNorthern(L)?d.getDy()!==0?d:v.getDy()!==0?v:(Wt.shouldNeverReachHere("found two horizontal edges incident on node"),null):v},i.prototype.print=function(a){te.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var c=this.iterator();c.hasNext();){var d=c.next();a.print("out "),d.print(a),a.println(),a.print("in "),d.getSym().print(a),a.println()}},i.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new G;for(var a=this.iterator();a.hasNext();){var c=a.next();(c.isInResult()||c.getSym().isInResult())&&this._resultAreaEdgeList.add(c)}return this._resultAreaEdgeList},i.prototype.updateLabelling=function(a){for(var c=this.iterator();c.hasNext();){var d=c.next().getLabel();d.setAllLocationsIfNull(0,a.getLocation(0)),d.setAllLocationsIfNull(1,a.getLocation(1))}},i.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var a=null,c=null,d=this._edgeList.size()-1;d>=0;d--){var v=this._edgeList.get(d),M=v.getSym();c===null&&(c=M),a!==null&&M.setNext(a),a=v}c.setNext(a)},i.prototype.computeDepths=function(){if(arguments.length===1){var a=arguments[0],c=this.findIndex(a),d=a.getDepth(Xt.LEFT),v=a.getDepth(Xt.RIGHT),M=this.computeDepths(c+1,this._edgeList.size(),d);if(this.computeDepths(0,c,M)!==v)throw new Qo("depth mismatch at "+a.getCoordinate())}else if(arguments.length===3){for(var L=arguments[0],H=arguments[1],it=arguments[2],bt=L;bt<H;bt++){var Tt=this._edgeList.get(bt);Tt.setEdgeDepths(Xt.RIGHT,it),it=Tt.getDepth(Xt.LEFT)}return it}},i.prototype.mergeSymLabels=function(){for(var a=this.iterator();a.hasNext();){var c=a.next();c.getLabel().merge(c.getSym().getLabel())}},i.prototype.linkMinimalDirectedEdges=function(a){for(var c=null,d=null,v=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var L=this._resultAreaEdgeList.get(M),H=L.getSym();switch(c===null&&L.getEdgeRing()===a&&(c=L),v){case this._SCANNING_FOR_INCOMING:if(H.getEdgeRing()!==a)continue;d=H,v=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(L.getEdgeRing()!==a)continue;d.setNextMin(L),v=this._SCANNING_FOR_INCOMING}}v===this._LINKING_TO_OUTGOING&&(Wt.isTrue(c!==null,"found null for first outgoing dirEdge"),Wt.isTrue(c.getEdgeRing()===a,"unable to link last incoming dirEdge"),d.setNextMin(c))},i.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var a=0,c=this.iterator();c.hasNext();)c.next().isInResult()&&a++;return a}if(arguments.length===1){for(var d=arguments[0],v=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===d&&v++;return v}},i.prototype.getLabel=function(){return this._label},i.prototype.findCoveredLineEdges=function(){for(var a=K.NONE,c=this.iterator();c.hasNext();){var d=c.next(),v=d.getSym();if(!d.isLineEdge()){if(d.isInResult()){a=K.INTERIOR;break}if(v.isInResult()){a=K.EXTERIOR;break}}}if(a===K.NONE)return null;for(var M=a,L=this.iterator();L.hasNext();){var H=L.next(),it=H.getSym();H.isLineEdge()?H.getEdge().setCovered(M===K.INTERIOR):(H.isInResult()&&(M=K.EXTERIOR),it.isInResult()&&(M=K.INTERIOR))}},i.prototype.computeLabelling=function(a){r.prototype.computeLabelling.call(this,a),this._label=new On(K.NONE);for(var c=this.iterator();c.hasNext();)for(var d=c.next().getEdge().getLabel(),v=0;v<2;v++){var M=d.getLocation(v);M!==K.INTERIOR&&M!==K.BOUNDARY||this._label.setLocation(v,K.INTERIOR)}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ti),io=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.createNode=function(a){return new Kl(a,new qh)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vu),ts=function r(){this._pts=null,this._orientation=null;var i=arguments[0];this._pts=i,this._orientation=r.orientation(i)};ts.prototype.compareTo=function(r){var i=r;return ts.compareOriented(this._pts,this._orientation,i._pts,i._orientation)},ts.prototype.interfaces_=function(){return[V]},ts.prototype.getClass=function(){return ts},ts.orientation=function(r){return lt.increasingDirection(r)===1},ts.compareOriented=function(r,i,a,c){for(var d=i?1:-1,v=c?1:-1,M=i?r.length:-1,L=c?a.length:-1,H=i?0:r.length-1,it=c?0:a.length-1;;){var bt=r[H].compareTo(a[it]);if(bt!==0)return bt;var Tt=(H+=d)===M,Kt=(it+=v)===L;if(Tt&&!Kt)return-1;if(!Tt&&Kt)return 1;if(Tt&&Kt)return 0}};var gi=function(){this._edges=new G,this._ocaMap=new w};gi.prototype.print=function(r){r.print("MULTILINESTRING ( ");for(var i=0;i<this._edges.size();i++){var a=this._edges.get(i);i>0&&r.print(","),r.print("(");for(var c=a.getCoordinates(),d=0;d<c.length;d++)d>0&&r.print(","),r.print(c[d].x+" "+c[d].y);r.println(")")}r.print(") ")},gi.prototype.addAll=function(r){for(var i=r.iterator();i.hasNext();)this.add(i.next())},gi.prototype.findEdgeIndex=function(r){for(var i=0;i<this._edges.size();i++)if(this._edges.get(i).equals(r))return i;return-1},gi.prototype.iterator=function(){return this._edges.iterator()},gi.prototype.getEdges=function(){return this._edges},gi.prototype.get=function(r){return this._edges.get(r)},gi.prototype.findEqualEdge=function(r){var i=new ts(r.getCoordinates());return this._ocaMap.get(i)},gi.prototype.add=function(r){this._edges.add(r);var i=new ts(r.getCoordinates());this._ocaMap.put(i,r)},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi};var Bs=function(){};Bs.prototype.processIntersections=function(r,i,a,c){},Bs.prototype.isDone=function(){},Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs};var Ri=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var r=arguments[0];this._li=r};Ri.prototype.isTrivialIntersection=function(r,i,a,c){if(r===a&&this._li.getIntersectionNum()===1){if(Ri.isAdjacentSegments(i,c))return!0;if(r.isClosed()){var d=r.size()-1;if(i===0&&c===d||c===0&&i===d)return!0}}return!1},Ri.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ri.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ri.prototype.getLineIntersector=function(){return this._li},Ri.prototype.hasProperIntersection=function(){return this._hasProper},Ri.prototype.processIntersections=function(r,i,a,c){if(r===a&&i===c)return null;this.numTests++;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(r,i,a,c)||(this._hasIntersection=!0,r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Ri.prototype.hasIntersection=function(){return this._hasIntersection},Ri.prototype.isDone=function(){return!1},Ri.prototype.hasInteriorIntersection=function(){return this._hasInterior},Ri.prototype.interfaces_=function(){return[Bs]},Ri.prototype.getClass=function(){return Ri},Ri.isAdjacentSegments=function(r,i){return Math.abs(r-i)===1};var Do=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var r=arguments[0],i=arguments[1],a=arguments[2];this.coord=new D(r),this.segmentIndex=i,this.dist=a};Do.prototype.getSegmentIndex=function(){return this.segmentIndex},Do.prototype.getCoordinate=function(){return this.coord},Do.prototype.print=function(r){r.print(this.coord),r.print(" seg # = "+this.segmentIndex),r.println(" dist = "+this.dist)},Do.prototype.compareTo=function(r){var i=r;return this.compare(i.segmentIndex,i.dist)},Do.prototype.isEndPoint=function(r){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===r},Do.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Do.prototype.getDistance=function(){return this.dist},Do.prototype.compare=function(r,i){return this.segmentIndex<r?-1:this.segmentIndex>r?1:this.dist<i?-1:this.dist>i?1:0},Do.prototype.interfaces_=function(){return[V]},Do.prototype.getClass=function(){return Do};var es=function(){this._nodeMap=new w,this.edge=null;var r=arguments[0];this.edge=r};es.prototype.print=function(r){r.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(r)},es.prototype.iterator=function(){return this._nodeMap.values().iterator()},es.prototype.addSplitEdges=function(r){this.addEndpoints();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next(),d=this.createSplitEdge(a,c);r.add(d),a=c}},es.prototype.addEndpoints=function(){var r=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[r],r,0)},es.prototype.createSplitEdge=function(r,i){var a=i.segmentIndex-r.segmentIndex+2,c=this.edge.pts[i.segmentIndex],d=i.dist>0||!i.coord.equals2D(c);d||a--;var v=new Array(a).fill(null),M=0;v[M++]=new D(r.coord);for(var L=r.segmentIndex+1;L<=i.segmentIndex;L++)v[M++]=this.edge.pts[L];return d&&(v[M]=i.coord),new jl(v,new On(this.edge._label))},es.prototype.add=function(r,i,a){var c=new Do(r,i,a),d=this._nodeMap.get(c);return d!==null?d:(this._nodeMap.put(c,c),c)},es.prototype.isIntersection=function(r){for(var i=this.iterator();i.hasNext();)if(i.next().coord.equals(r))return!0;return!1},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var ha=function(){};ha.prototype.getChainStartIndices=function(r){var i=0,a=new G;a.add(new pt(i));do{var c=this.findChainEnd(r,i);a.add(new pt(c)),i=c}while(i<r.length-1);return ha.toIntArray(a)},ha.prototype.findChainEnd=function(r,i){for(var a=Yn.quadrant(r[i],r[i+1]),c=i+1;c<r.length&&Yn.quadrant(r[c-1],r[c])===a;)c++;return c-1},ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha},ha.toIntArray=function(r){for(var i=new Array(r.size()).fill(null),a=0;a<i.length;a++)i[a]=r.get(a).intValue();return i};var ws=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new qt,this.env2=new qt;var r=arguments[0];this.e=r,this.pts=r.getCoordinates();var i=new ha;this.startIndex=i.getChainStartIndices(this.pts)};ws.prototype.getCoordinates=function(){return this.pts},ws.prototype.getMaxX=function(r){var i=this.pts[this.startIndex[r]].x,a=this.pts[this.startIndex[r+1]].x;return i>a?i:a},ws.prototype.getMinX=function(r){var i=this.pts[this.startIndex[r]].x,a=this.pts[this.startIndex[r+1]].x;return i<a?i:a},ws.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this.computeIntersectsForChain(this.startIndex[r],this.startIndex[r+1],i,i.startIndex[a],i.startIndex[a+1],c)}else if(arguments.length===6){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=arguments[4],it=arguments[5],bt=this.pts[d],Tt=this.pts[v],Kt=M.pts[L],Qt=M.pts[H];if(v-d==1&&H-L==1)return it.addIntersections(this.e,d,M.e,L),null;if(this.env1.init(bt,Tt),this.env2.init(Kt,Qt),!this.env1.intersects(this.env2))return null;var le=Math.trunc((d+v)/2),Ee=Math.trunc((L+H)/2);d<le&&(L<Ee&&this.computeIntersectsForChain(d,le,M,L,Ee,it),Ee<H&&this.computeIntersectsForChain(d,le,M,Ee,H,it)),le<v&&(L<Ee&&this.computeIntersectsForChain(le,v,M,L,Ee,it),Ee<H&&this.computeIntersectsForChain(le,v,M,Ee,H,it))}},ws.prototype.getStartIndexes=function(){return this.startIndex},ws.prototype.computeIntersects=function(r,i){for(var a=0;a<this.startIndex.length-1;a++)for(var c=0;c<r.startIndex.length-1;c++)this.computeIntersectsForChain(a,r,c,i)},ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws};var Vr=function r(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var i=0;i<2;i++)for(var a=0;a<3;a++)this._depth[i][a]=r.NULL_VALUE},qa={NULL_VALUE:{configurable:!0}};Vr.prototype.getDepth=function(r,i){return this._depth[r][i]},Vr.prototype.setDepth=function(r,i,a){this._depth[r][i]=a},Vr.prototype.isNull=function(){if(arguments.length===0){for(var r=0;r<2;r++)for(var i=0;i<3;i++)if(this._depth[r][i]!==Vr.NULL_VALUE)return!1;return!0}if(arguments.length===1){var a=arguments[0];return this._depth[a][1]===Vr.NULL_VALUE}if(arguments.length===2){var c=arguments[0],d=arguments[1];return this._depth[c][d]===Vr.NULL_VALUE}},Vr.prototype.normalize=function(){for(var r=0;r<2;r++)if(!this.isNull(r)){var i=this._depth[r][1];this._depth[r][2]<i&&(i=this._depth[r][2]),i<0&&(i=0);for(var a=1;a<3;a++){var c=0;this._depth[r][a]>i&&(c=1),this._depth[r][a]=c}}},Vr.prototype.getDelta=function(r){return this._depth[r][Xt.RIGHT]-this._depth[r][Xt.LEFT]},Vr.prototype.getLocation=function(r,i){return this._depth[r][i]<=0?K.EXTERIOR:K.INTERIOR},Vr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Vr.prototype.add=function(){if(arguments.length===1)for(var r=arguments[0],i=0;i<2;i++)for(var a=1;a<3;a++){var c=r.getLocation(i,a);c!==K.EXTERIOR&&c!==K.INTERIOR||(this.isNull(i,a)?this._depth[i][a]=Vr.depthAtLocation(c):this._depth[i][a]+=Vr.depthAtLocation(c))}else if(arguments.length===3){var d=arguments[0],v=arguments[1];arguments[2]===K.INTERIOR&&this._depth[d][v]++}},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.depthAtLocation=function(r){return r===K.EXTERIOR?0:r===K.INTERIOR?1:Vr.NULL_VALUE},qa.NULL_VALUE.get=function(){return-1},Object.defineProperties(Vr,qa);var jl=function(r){function i(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new es(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Vr,this._depthDelta=0,arguments.length===1){var a=arguments[0];i.call(this,a,null)}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.pts=c,this._label=d}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.getDepth=function(){return this._depth},i.prototype.getCollapsedEdge=function(){var a=new Array(2).fill(null);return a[0]=this.pts[0],a[1]=this.pts[1],new i(a,On.toLineLabel(this._label))},i.prototype.isIsolated=function(){return this._isIsolated},i.prototype.getCoordinates=function(){return this.pts},i.prototype.setIsolated=function(a){this._isIsolated=a},i.prototype.setName=function(a){this._name=a},i.prototype.equals=function(a){if(!(a instanceof i))return!1;var c=a;if(this.pts.length!==c.pts.length)return!1;for(var d=!0,v=!0,M=this.pts.length,L=0;L<this.pts.length;L++)if(this.pts[L].equals2D(c.pts[L])||(d=!1),this.pts[L].equals2D(c.pts[--M])||(v=!1),!d&&!v)return!1;return!0},i.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var a=arguments[0];return this.pts[a]}},i.prototype.print=function(a){a.print("edge "+this._name+": "),a.print("LINESTRING (");for(var c=0;c<this.pts.length;c++)c>0&&a.print(","),a.print(this.pts[c].x+" "+this.pts[c].y);a.print(") "+this._label+" "+this._depthDelta)},i.prototype.computeIM=function(a){i.updateIM(this._label,a)},i.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},i.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},i.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},i.prototype.getDepthDelta=function(){return this._depthDelta},i.prototype.getNumPoints=function(){return this.pts.length},i.prototype.printReverse=function(a){a.print("edge "+this._name+": ");for(var c=this.pts.length-1;c>=0;c--)a.print(this.pts[c]+" ");a.println("")},i.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ws(this)),this._mce},i.prototype.getEnvelope=function(){if(this._env===null){this._env=new qt;for(var a=0;a<this.pts.length;a++)this._env.expandToInclude(this.pts[a])}return this._env},i.prototype.addIntersection=function(a,c,d,v){var M=new D(a.getIntersection(v)),L=c,H=a.getEdgeDistance(d,v),it=L+1;if(it<this.pts.length){var bt=this.pts[it];M.equals2D(bt)&&(L=it,H=0)}this.eiList.add(M,L,H)},i.prototype.toString=function(){var a=new Lt;a.append("edge "+this._name+": "),a.append("LINESTRING (");for(var c=0;c<this.pts.length;c++)c>0&&a.append(","),a.append(this.pts[c].x+" "+this.pts[c].y);return a.append(") "+this._label+" "+this._depthDelta),a.toString()},i.prototype.isPointwiseEqual=function(a){if(this.pts.length!==a.pts.length)return!1;for(var c=0;c<this.pts.length;c++)if(!this.pts[c].equals2D(a.pts[c]))return!1;return!0},i.prototype.setDepthDelta=function(a){this._depthDelta=a},i.prototype.getEdgeIntersectionList=function(){return this.eiList},i.prototype.addIntersections=function(a,c,d){for(var v=0;v<a.getIntersectionNum();v++)this.addIntersection(a,c,d,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.updateIM=function(){if(arguments.length!==2)return r.prototype.updateIM.apply(this,arguments);var a=arguments[0],c=arguments[1];c.setAtLeastIfValid(a.getLocation(0,Xt.ON),a.getLocation(1,Xt.ON),1),a.isArea()&&(c.setAtLeastIfValid(a.getLocation(0,Xt.LEFT),a.getLocation(1,Xt.LEFT),2),c.setAtLeastIfValid(a.getLocation(0,Xt.RIGHT),a.getLocation(1,Xt.RIGHT),2))},i}(Xi),ai=function(r){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new gi,this._bufParams=r||null};ai.prototype.setWorkingPrecisionModel=function(r){this._workingPrecisionModel=r},ai.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var a=i.getLabel(),c=r.getLabel();i.isPointwiseEqual(r)||(c=new On(r.getLabel())).flip(),a.merge(c);var d=ai.depthDelta(c),v=i.getDepthDelta()+d;i.setDepthDelta(v)}else this._edgeList.add(r),r.setDepthDelta(ai.depthDelta(r.getLabel()))},ai.prototype.buildSubgraphs=function(r,i){for(var a=new G,c=r.iterator();c.hasNext();){var d=c.next(),v=d.getRightmostCoordinate(),M=new fa(a).getDepth(v);d.computeDepth(M),d.findResultEdges(),a.add(d),i.add(d.getDirectedEdges(),d.getNodes())}},ai.prototype.createSubgraphs=function(r){for(var i=new G,a=r.getNodes().iterator();a.hasNext();){var c=a.next();if(!c.isVisited()){var d=new Jr;d.create(c),i.add(d)}}return ho.sort(i,ho.reverseOrder()),i},ai.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},ai.prototype.getNoder=function(r){if(this._workingNoder!==null)return this._workingNoder;var i=new hl,a=new z;return a.setPrecisionModel(r),i.setSegmentIntersector(new Ri(a)),i},ai.prototype.buffer=function(r,i){var a=this._workingPrecisionModel;a===null&&(a=r.getPrecisionModel()),this._geomFact=r.getFactory();var c=new pi(a,this._bufParams),d=new Zi(r,i,c).getCurves();if(d.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(d,a),this._graph=new dr(new io),this._graph.addEdges(this._edgeList.getEdges());var v=this.createSubgraphs(this._graph),M=new Ci(this._geomFact);this.buildSubgraphs(v,M);var L=M.getPolygons();return L.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(L)},ai.prototype.computeNodedEdges=function(r,i){var a=this.getNoder(i);a.computeNodes(r);for(var c=a.getNodedSubstrings().iterator();c.hasNext();){var d=c.next(),v=d.getCoordinates();if(v.length!==2||!v[0].equals2D(v[1])){var M=d.getData(),L=new jl(d.getCoordinates(),new On(M));this.insertUniqueEdge(L)}}},ai.prototype.setNoder=function(r){this._workingNoder=r},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.depthDelta=function(r){var i=r.getLocation(0,Xt.LEFT),a=r.getLocation(0,Xt.RIGHT);return i===K.INTERIOR&&a===K.EXTERIOR?1:i===K.EXTERIOR&&a===K.INTERIOR?-1:0},ai.convertSegStrings=function(r){for(var i=new Le,a=new G;r.hasNext();){var c=r.next(),d=i.createLineString(c.getCoordinates());a.add(d)}return i.buildGeometry(a)};var ns=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var r=arguments[0],i=arguments[1];this._noder=r,this._scaleFactor=i,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var a=arguments[0],c=arguments[1],d=arguments[2],v=arguments[3];this._noder=a,this._scaleFactor=c,this._offsetX=d,this._offsetY=v,this._isScaled=!this.isIntegerPrecision()}};ns.prototype.rescale=function(){if(Q(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var i=r.next();this.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var a=arguments[0],c=0;c<a.length;c++)a[c].x=a[c].x/this._scaleFactor+this._offsetX,a[c].y=a[c].y/this._scaleFactor+this._offsetY;a.length===2&&a[0].equals2D(a[1])&&te.out.println(a)}},ns.prototype.scale=function(){if(Q(arguments[0],at)){for(var r=arguments[0],i=new G,a=r.iterator();a.hasNext();){var c=a.next();i.add(new mr(this.scale(c.getCoordinates()),c.getData()))}return i}if(arguments[0]instanceof Array){for(var d=arguments[0],v=new Array(d.length).fill(null),M=0;M<d.length;M++)v[M]=new D(Math.round((d[M].x-this._offsetX)*this._scaleFactor),Math.round((d[M].y-this._offsetY)*this._scaleFactor),d[M].z);return lt.removeRepeatedPoints(v)}},ns.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ns.prototype.getNodedSubstrings=function(){var r=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(r),r},ns.prototype.computeNodes=function(r){var i=r;this._isScaled&&(i=this.scale(r)),this._noder.computeNodes(i)},ns.prototype.interfaces_=function(){return[Yi]},ns.prototype.getClass=function(){return ns};var mo=function(){this._li=new z,this._segStrings=null;var r=arguments[0];this._segStrings=r},zs={fact:{configurable:!0}};mo.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var i=r.next().getCoordinates();this.checkEndPtVertexIntersections(i[0],this._segStrings),this.checkEndPtVertexIntersections(i[i.length-1],this._segStrings)}else if(arguments.length===2){for(var a=arguments[0],c=arguments[1].iterator();c.hasNext();)for(var d=c.next().getCoordinates(),v=1;v<d.length-1;v++)if(d[v].equals(a))throw new Te("found endpt/interior pt intersection at index "+v+" :pt "+a)}},mo.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();)for(var i=r.next(),a=this._segStrings.iterator();a.hasNext();){var c=a.next();this.checkInteriorIntersections(i,c)}else if(arguments.length===2)for(var d=arguments[0],v=arguments[1],M=d.getCoordinates(),L=v.getCoordinates(),H=0;H<M.length-1;H++)for(var it=0;it<L.length-1;it++)this.checkInteriorIntersections(d,H,v,it);else if(arguments.length===4){var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=arguments[3];if(bt===Kt&&Tt===Qt)return null;var le=bt.getCoordinates()[Tt],Ee=bt.getCoordinates()[Tt+1],Dn=Kt.getCoordinates()[Qt],Jn=Kt.getCoordinates()[Qt+1];if(this._li.computeIntersection(le,Ee,Dn,Jn),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,le,Ee)||this.hasInteriorIntersection(this._li,Dn,Jn)))throw new Te("found non-noded intersection at "+le+"-"+Ee+" and "+Dn+"-"+Jn)}},mo.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mo.prototype.checkCollapses=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var i=r.next();this.checkCollapses(i)}else if(arguments.length===1)for(var a=arguments[0].getCoordinates(),c=0;c<a.length-2;c++)this.checkCollapse(a[c],a[c+1],a[c+2])},mo.prototype.hasInteriorIntersection=function(r,i,a){for(var c=0;c<r.getIntersectionNum();c++){var d=r.getIntersection(c);if(!d.equals(i)&&!d.equals(a))return!0}return!1},mo.prototype.checkCollapse=function(r,i,a){if(r.equals(a))throw new Te("found non-noded collapse at "+mo.fact.createLineString([r,i,a]))},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},zs.fact.get=function(){return new Le},Object.defineProperties(mo,zs);var Wr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var r=arguments[0],i=arguments[1],a=arguments[2];if(this._originalPt=r,this._pt=r,this._scaleFactor=i,this._li=a,i<=0)throw new I("Scale factor must be non-zero");i!==1&&(this._pt=new D(this.scale(r.x),this.scale(r.y)),this._p0Scaled=new D,this._p1Scaled=new D),this.initCorners(this._pt)},Hh={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Wr.prototype.intersectsScaled=function(r,i){var a=Math.min(r.x,i.x),c=Math.max(r.x,i.x),d=Math.min(r.y,i.y),v=Math.max(r.y,i.y),M=this._maxx<a||this._minx>c||this._maxy<d||this._miny>v;if(M)return!1;var L=this.intersectsToleranceSquare(r,i);return Wt.isTrue(!(M&&L),"Found bad envelope test"),L},Wr.prototype.initCorners=function(r){this._minx=r.x-.5,this._maxx=r.x+.5,this._miny=r.y-.5,this._maxy=r.y+.5,this._corner[0]=new D(this._maxx,this._maxy),this._corner[1]=new D(this._minx,this._maxy),this._corner[2]=new D(this._minx,this._miny),this._corner[3]=new D(this._maxx,this._miny)},Wr.prototype.intersects=function(r,i){return this._scaleFactor===1?this.intersectsScaled(r,i):(this.copyScaled(r,this._p0Scaled),this.copyScaled(i,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Wr.prototype.scale=function(r){return Math.round(r*this._scaleFactor)},Wr.prototype.getCoordinate=function(){return this._originalPt},Wr.prototype.copyScaled=function(r,i){i.x=this.scale(r.x),i.y=this.scale(r.y)},Wr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var r=Wr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new qt(this._originalPt.x-r,this._originalPt.x+r,this._originalPt.y-r,this._originalPt.y+r)}return this._safeEnv},Wr.prototype.intersectsPixelClosure=function(r,i){return this._li.computeIntersection(r,i,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Wr.prototype.intersectsToleranceSquare=function(r,i){var a=!1,c=!1;return this._li.computeIntersection(r,i,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(r,i,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(a=!0),this._li.computeIntersection(r,i,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(c=!0),this._li.computeIntersection(r,i,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!a||!c)||!!r.equals(this._pt)||!!i.equals(this._pt))))},Wr.prototype.addSnappedNode=function(r,i){var a=r.getCoordinate(i),c=r.getCoordinate(i+1);return!!this.intersects(a,c)&&(r.addIntersection(this.getCoordinate(),i),!0)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Hh.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Wr,Hh);var pl=function(){this.tempEnv1=new qt,this.selectedSegment=new ie};pl.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var r=arguments[0],i=arguments[1];r.getLineSegment(i,this.selectedSegment),this.select(this.selectedSegment)}}},pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl};var Eu=function(){this._index=null;var r=arguments[0];this._index=r},Ha={HotPixelSnapAction:{configurable:!0}};Eu.prototype.snap=function(){if(arguments.length===1){var r=arguments[0];return this.snap(r,null,-1)}if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2],d=i.getSafeEnvelope(),v=new Fo(i,a,c);return this._index.query(d,{interfaces_:function(){return[Us]},visitItem:function(M){M.select(d,v)}}),v.isNodeAdded()}},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},Ha.HotPixelSnapAction.get=function(){return Fo},Object.defineProperties(Eu,Ha);var Fo=function(r){function i(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var a=arguments[0],c=arguments[1],d=arguments[2];this._hotPixel=a,this._parentEdge=c,this._hotPixelVertexIndex=d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isNodeAdded=function(){return this._isNodeAdded},i.prototype.select=function(){if(arguments.length!==2)return r.prototype.select.apply(this,arguments);var a=arguments[0],c=arguments[1],d=a.getContext();if(this._parentEdge!==null&&d===this._parentEdge&&c===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(d,c)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pl),pa=function(){this._li=null,this._interiorIntersections=null;var r=arguments[0];this._li=r,this._interiorIntersections=new G};pa.prototype.processIntersections=function(r,i,a,c){if(r===a&&i===c)return null;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];if(this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var H=0;H<this._li.getIntersectionNum();H++)this._interiorIntersections.add(this._li.getIntersection(H));r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1)}},pa.prototype.isDone=function(){return!1},pa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pa.prototype.interfaces_=function(){return[Bs]},pa.prototype.getClass=function(){return pa};var rs=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var r=arguments[0];this._pm=r,this._li=new z,this._li.setPrecisionModel(r),this._scaleFactor=r.getScale()};rs.prototype.checkCorrectness=function(r){var i=mr.getNodedSubstrings(r),a=new mo(i);try{a.checkValid()}catch(c){if(!(c instanceof jt))throw c;c.printStackTrace()}},rs.prototype.getNodedSubstrings=function(){return mr.getNodedSubstrings(this._nodedSegStrings)},rs.prototype.snapRound=function(r,i){var a=this.findInteriorIntersections(r,i);this.computeIntersectionSnaps(a),this.computeVertexSnaps(r)},rs.prototype.findInteriorIntersections=function(r,i){var a=new pa(i);return this._noder.setSegmentIntersector(a),this._noder.computeNodes(r),a.getInteriorIntersections()},rs.prototype.computeVertexSnaps=function(){if(Q(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var i=r.next();this.computeVertexSnaps(i)}else if(arguments[0]instanceof mr)for(var a=arguments[0],c=a.getCoordinates(),d=0;d<c.length;d++){var v=new Wr(c[d],this._scaleFactor,this._li);this._pointSnapper.snap(v,a,d)&&a.addIntersection(c[d],d)}},rs.prototype.computeNodes=function(r){this._nodedSegStrings=r,this._noder=new hl,this._pointSnapper=new Eu(this._noder.getIndex()),this.snapRound(r,this._li)},rs.prototype.computeIntersectionSnaps=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next(),c=new Wr(a,this._scaleFactor,this._li);this._pointSnapper.snap(c)}},rs.prototype.interfaces_=function(){return[Yi]},rs.prototype.getClass=function(){return rs};var Xr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new ke,this._resultGeometry=null,this._saveException=null,arguments.length===1){var r=arguments[0];this._argGeom=r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this._argGeom=i,this._bufParams=a}},wu={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Xr.prototype.bufferFixedPrecision=function(r){var i=new ns(new rs(new Ge(1)),r.getScale()),a=new ai(this._bufParams);a.setWorkingPrecisionModel(r),a.setNoder(i),this._resultGeometry=a.buffer(this._argGeom,this._distance)},Xr.prototype.bufferReducedPrecision=function(){var r=this;if(arguments.length===0){for(var i=Xr.MAX_PRECISION_DIGITS;i>=0;i--){try{r.bufferReducedPrecision(i)}catch(v){if(!(v instanceof Qo))throw v;r._saveException=v}if(r._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var a=arguments[0],c=Xr.precisionScaleFactor(this._argGeom,this._distance,a),d=new Ge(c);this.bufferFixedPrecision(d)}},Xr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var r=this._argGeom.getFactory().getPrecisionModel();r.getType()===Ge.FIXED?this.bufferFixedPrecision(r):this.bufferReducedPrecision()},Xr.prototype.setQuadrantSegments=function(r){this._bufParams.setQuadrantSegments(r)},Xr.prototype.bufferOriginalPrecision=function(){try{var r=new ai(this._bufParams);this._resultGeometry=r.buffer(this._argGeom,this._distance)}catch(i){if(!(i instanceof Te))throw i;this._saveException=i}},Xr.prototype.getResultGeometry=function(r){return this._distance=r,this.computeGeometry(),this._resultGeometry},Xr.prototype.setEndCapStyle=function(r){this._bufParams.setEndCapStyle(r)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.bufferOp=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return new Xr(r).getResultGeometry(i)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Vt&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],d=arguments[2],v=new Xr(a);return v.setQuadrantSegments(d),v.getResultGeometry(c)}if(arguments[2]instanceof ke&&arguments[0]instanceof Vt&&typeof arguments[1]=="number"){var M=arguments[0],L=arguments[1],H=arguments[2];return new Xr(M,H).getResultGeometry(L)}}else if(arguments.length===4){var it=arguments[0],bt=arguments[1],Tt=arguments[2],Kt=arguments[3],Qt=new Xr(it);return Qt.setQuadrantSegments(Tt),Qt.setEndCapStyle(Kt),Qt.getResultGeometry(bt)}},Xr.precisionScaleFactor=function(r,i,a){var c=r.getEnvelopeInternal(),d=At.max(Math.abs(c.getMaxX()),Math.abs(c.getMaxY()),Math.abs(c.getMinX()),Math.abs(c.getMinY()))+2*(i>0?i:0),v=a-Math.trunc(Math.log(d)/Math.log(10)+1);return Math.pow(10,v)},wu.CAP_ROUND.get=function(){return ke.CAP_ROUND},wu.CAP_BUTT.get=function(){return ke.CAP_FLAT},wu.CAP_FLAT.get=function(){return ke.CAP_FLAT},wu.CAP_SQUARE.get=function(){return ke.CAP_SQUARE},wu.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Xr,wu);var ui=function(){this._pt=[new D,new D],this._distance=A.NaN,this._isNull=!0};ui.prototype.getCoordinates=function(){return this._pt},ui.prototype.getCoordinate=function(r){return this._pt[r]},ui.prototype.setMinimum=function(){if(arguments.length===1){var r=arguments[0];this.setMinimum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c<this._distance&&this.initialize(i,a,c)}},ui.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=r.distance(i),this._isNull=!1}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(c),this._distance=d,this._isNull=!1}},ui.prototype.getDistance=function(){return this._distance},ui.prototype.setMaximum=function(){if(arguments.length===1){var r=arguments[0];this.setMaximum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c>this._distance&&this.initialize(i,a,c)}},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var is=function(){};is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},is.computeDistance=function(){if(arguments[2]instanceof ui&&arguments[0]instanceof vt&&arguments[1]instanceof D)for(var r=arguments[0],i=arguments[1],a=arguments[2],c=r.getCoordinates(),d=new ie,v=0;v<c.length-1;v++){d.setCoordinates(c[v],c[v+1]);var M=d.closestPoint(i);a.setMinimum(M,i)}else if(arguments[2]instanceof ui&&arguments[0]instanceof de&&arguments[1]instanceof D){var L=arguments[0],H=arguments[1],it=arguments[2];is.computeDistance(L.getExteriorRing(),H,it);for(var bt=0;bt<L.getNumInteriorRing();bt++)is.computeDistance(L.getInteriorRingN(bt),H,it)}else if(arguments[2]instanceof ui&&arguments[0]instanceof Vt&&arguments[1]instanceof D){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2];if(Tt instanceof vt)is.computeDistance(Tt,Kt,Qt);else if(Tt instanceof de)is.computeDistance(Tt,Kt,Qt);else if(Tt instanceof Qn)for(var le=Tt,Ee=0;Ee<le.getNumGeometries();Ee++){var Dn=le.getGeometryN(Ee);is.computeDistance(Dn,Kt,Qt)}else Qt.setMinimum(Tt.getCoordinate(),Kt)}else if(arguments[2]instanceof ui&&arguments[0]instanceof ie&&arguments[1]instanceof D){var Jn=arguments[0],fi=arguments[1],as=arguments[2],qs=Jn.closestPoint(fi);as.setMinimum(qs,fi)}};var Ki=function(r){this._maxPtDist=new ui,this._inputGeom=r||null},gt={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ki.prototype.computeMaxMidpointDistance=function(r){var i=new Ct(this._inputGeom);r.apply(i),this._maxPtDist.setMaximum(i.getMaxPointDistance())},Ki.prototype.computeMaxVertexDistance=function(r){var i=new Nt(this._inputGeom);r.apply(i),this._maxPtDist.setMaximum(i.getMaxPointDistance())},Ki.prototype.findDistance=function(r){return this.computeMaxVertexDistance(r),this.computeMaxMidpointDistance(r),this._maxPtDist.getDistance()},Ki.prototype.getDistancePoints=function(){return this._maxPtDist},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki},gt.MaxPointDistanceFilter.get=function(){return Nt},gt.MaxMidpointDistanceFilter.get=function(){return Ct},Object.defineProperties(Ki,gt);var Nt=function(r){this._maxPtDist=new ui,this._minPtDist=new ui,this._geom=r||null};Nt.prototype.filter=function(r){this._minPtDist.initialize(),is.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Nt.prototype.getMaxPointDistance=function(){return this._maxPtDist},Nt.prototype.interfaces_=function(){return[rt]},Nt.prototype.getClass=function(){return Nt};var Ct=function(r){this._maxPtDist=new ui,this._minPtDist=new ui,this._geom=r||null};Ct.prototype.filter=function(r,i){if(i===0)return null;var a=r.getCoordinate(i-1),c=r.getCoordinate(i),d=new D((a.x+c.x)/2,(a.y+c.y)/2);this._minPtDist.initialize(),is.computeDistance(this._geom,d,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ct.prototype.isDone=function(){return!1},Ct.prototype.isGeometryChanged=function(){return!1},Ct.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ct.prototype.interfaces_=function(){return[ur]},Ct.prototype.getClass=function(){return Ct};var se=function(r){this._comps=r||null};se.prototype.filter=function(r){r instanceof de&&this._comps.add(r)},se.prototype.interfaces_=function(){return[pr]},se.prototype.getClass=function(){return se},se.getPolygons=function(){if(arguments.length===1){var r=arguments[0];return se.getPolygons(r,new G)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i instanceof de?a.add(i):i instanceof Qn&&i.apply(new se(a)),a}};var _e=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var r=arguments[0];this._lines=r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this._lines=i,this._isForcedToLineString=a}};_e.prototype.filter=function(r){if(this._isForcedToLineString&&r instanceof Ae){var i=r.getFactory().createLineString(r.getCoordinateSequence());return this._lines.add(i),null}r instanceof vt&&this._lines.add(r)},_e.prototype.setForceToLineString=function(r){this._isForcedToLineString=r},_e.prototype.interfaces_=function(){return[Ce]},_e.prototype.getClass=function(){return _e},_e.getGeometry=function(){if(arguments.length===1){var r=arguments[0];return r.getFactory().buildGeometry(_e.getLines(r))}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i.getFactory().buildGeometry(_e.getLines(i,a))}},_e.getLines=function(){if(arguments.length===1){var r=arguments[0];return _e.getLines(r,!1)}if(arguments.length===2){if(Q(arguments[0],at)&&Q(arguments[1],at)){for(var i=arguments[0],a=arguments[1],c=i.iterator();c.hasNext();){var d=c.next();_e.getLines(d,a)}return a}if(arguments[0]instanceof Vt&&typeof arguments[1]=="boolean"){var v=arguments[0],M=arguments[1],L=new G;return v.apply(new _e(L,M)),L}if(arguments[0]instanceof Vt&&Q(arguments[1],at)){var H=arguments[0],it=arguments[1];return H instanceof vt?it.add(H):H.apply(new _e(it)),it}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&Q(arguments[0],at)&&Q(arguments[1],at)){for(var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=bt.iterator();Qt.hasNext();){var le=Qt.next();_e.getLines(le,Tt,Kt)}return Tt}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Vt&&Q(arguments[1],at)){var Ee=arguments[0],Dn=arguments[1],Jn=arguments[2];return Ee.apply(new _e(Dn,Jn)),Dn}}};var qe=function(){if(this._boundaryRule=P.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];if(r===null)throw new I("Rule must be non-null");this._boundaryRule=r}}};qe.prototype.locateInternal=function(){if(arguments[0]instanceof D&&arguments[1]instanceof de){var r=arguments[0],i=arguments[1];if(i.isEmpty())return K.EXTERIOR;var a=i.getExteriorRing(),c=this.locateInPolygonRing(r,a);if(c===K.EXTERIOR)return K.EXTERIOR;if(c===K.BOUNDARY)return K.BOUNDARY;for(var d=0;d<i.getNumInteriorRing();d++){var v=i.getInteriorRingN(d),M=this.locateInPolygonRing(r,v);if(M===K.INTERIOR)return K.EXTERIOR;if(M===K.BOUNDARY)return K.BOUNDARY}return K.INTERIOR}if(arguments[0]instanceof D&&arguments[1]instanceof vt){var L=arguments[0],H=arguments[1];if(!H.getEnvelopeInternal().intersects(L))return K.EXTERIOR;var it=H.getCoordinates();return H.isClosed()||!L.equals(it[0])&&!L.equals(it[it.length-1])?dt.isOnLine(L,it)?K.INTERIOR:K.EXTERIOR:K.BOUNDARY}if(arguments[0]instanceof D&&arguments[1]instanceof ue){var bt=arguments[0];return arguments[1].getCoordinate().equals2D(bt)?K.INTERIOR:K.EXTERIOR}},qe.prototype.locateInPolygonRing=function(r,i){return i.getEnvelopeInternal().intersects(r)?dt.locatePointInRing(r,i.getCoordinates()):K.EXTERIOR},qe.prototype.intersects=function(r,i){return this.locate(r,i)!==K.EXTERIOR},qe.prototype.updateLocationInfo=function(r){r===K.INTERIOR&&(this._isIn=!0),r===K.BOUNDARY&&this._numBoundaries++},qe.prototype.computeLocation=function(r,i){if(i instanceof ue&&this.updateLocationInfo(this.locateInternal(r,i)),i instanceof vt)this.updateLocationInfo(this.locateInternal(r,i));else if(i instanceof de)this.updateLocationInfo(this.locateInternal(r,i));else if(i instanceof bi)for(var a=i,c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);this.updateLocationInfo(this.locateInternal(r,d))}else if(i instanceof Pe)for(var v=i,M=0;M<v.getNumGeometries();M++){var L=v.getGeometryN(M);this.updateLocationInfo(this.locateInternal(r,L))}else if(i instanceof Qn)for(var H=new go(i);H.hasNext();){var it=H.next();it!==i&&this.computeLocation(r,it)}},qe.prototype.locate=function(r,i){return i.isEmpty()?K.EXTERIOR:i instanceof vt?this.locateInternal(r,i):i instanceof de?this.locateInternal(r,i):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(r,i),this._boundaryRule.isInBoundary(this._numBoundaries)?K.BOUNDARY:this._numBoundaries>0||this._isIn?K.INTERIOR:K.EXTERIOR)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var ln=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var i=arguments[0],a=arguments[1];r.call(this,i,r.INSIDE_AREA,a)}else if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._component=c,this._segIndex=d,this._pt=v}},cr={INSIDE_AREA:{configurable:!0}};ln.prototype.isInsideArea=function(){return this._segIndex===ln.INSIDE_AREA},ln.prototype.getCoordinate=function(){return this._pt},ln.prototype.getGeometryComponent=function(){return this._component},ln.prototype.getSegmentIndex=function(){return this._segIndex},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},cr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ln,cr);var os=function(r){this._pts=r||null};os.prototype.filter=function(r){r instanceof ue&&this._pts.add(r)},os.prototype.interfaces_=function(){return[pr]},os.prototype.getClass=function(){return os},os.getPoints=function(){if(arguments.length===1){var r=arguments[0];return r instanceof ue?ho.singletonList(r):os.getPoints(r,new G)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i instanceof ue?a.add(i):i instanceof Qn&&i.apply(new os(a)),a}};var Va=function(){this._locations=null;var r=arguments[0];this._locations=r};Va.prototype.filter=function(r){(r instanceof ue||r instanceof vt||r instanceof de)&&this._locations.add(new ln(r,0,r.getCoordinate()))},Va.prototype.interfaces_=function(){return[pr]},Va.prototype.getClass=function(){return Va},Va.getLocations=function(r){var i=new G;return r.apply(new Va(i)),i};var tr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new qe,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=[r,i],this._terminateDistance=0}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=c,this._terminateDistance=d}};tr.prototype.computeContainmentDistance=function(){if(arguments.length===0){var r=new Array(2).fill(null);if(this.computeContainmentDistance(0,r),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=1-i,d=se.getPolygons(this._geom[i]);if(d.size()>0){var v=Va.getLocations(this._geom[c]);if(this.computeContainmentDistance(v,d,a),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[c]=a[0],this._minDistanceLocation[i]=a[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Q(arguments[0],Et)&&Q(arguments[1],Et)){for(var M=arguments[0],L=arguments[1],H=arguments[2],it=0;it<M.size();it++)for(var bt=M.get(it),Tt=0;Tt<L.size();Tt++)if(this.computeContainmentDistance(bt,L.get(Tt),H),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ln&&arguments[1]instanceof de){var Kt=arguments[0],Qt=arguments[1],le=arguments[2],Ee=Kt.getCoordinate();if(K.EXTERIOR!==this._ptLocator.locate(Ee,Qt))return this._minDistance=0,le[0]=Kt,le[1]=new ln(Qt,Ee),null}}},tr.prototype.computeMinDistanceLinesPoints=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v);if(this.computeMinDistance(d,M,a),this._minDistance<=this._terminateDistance)return null}},tr.prototype.computeFacetDistance=function(){var r=new Array(2).fill(null),i=_e.getLines(this._geom[0]),a=_e.getLines(this._geom[1]),c=os.getPoints(this._geom[0]),d=os.getPoints(this._geom[1]);return this.computeMinDistanceLines(i,a,r),this.updateMinDistance(r,!1),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistanceLinesPoints(i,d,r),this.updateMinDistance(r,!1),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistanceLinesPoints(a,c,r),this.updateMinDistance(r,!0),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistancePoints(c,d,r),void this.updateMinDistance(r,!1))))},tr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},tr.prototype.updateMinDistance=function(r,i){if(r[0]===null)return null;i?(this._minDistanceLocation[0]=r[1],this._minDistanceLocation[1]=r[0]):(this._minDistanceLocation[0]=r[0],this._minDistanceLocation[1]=r[1])},tr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},tr.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof vt&&arguments[1]instanceof ue){var r=arguments[0],i=arguments[1],a=arguments[2];if(r.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var c=r.getCoordinates(),d=i.getCoordinate(),v=0;v<c.length-1;v++){var M=dt.distancePointLine(d,c[v],c[v+1]);if(M<this._minDistance){this._minDistance=M;var L=new ie(c[v],c[v+1]).closestPoint(d);a[0]=new ln(r,v,L),a[1]=new ln(i,0,d)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof vt&&arguments[1]instanceof vt){var H=arguments[0],it=arguments[1],bt=arguments[2];if(H.getEnvelopeInternal().distance(it.getEnvelopeInternal())>this._minDistance)return null;for(var Tt=H.getCoordinates(),Kt=it.getCoordinates(),Qt=0;Qt<Tt.length-1;Qt++)for(var le=0;le<Kt.length-1;le++){var Ee=dt.distanceLineLine(Tt[Qt],Tt[Qt+1],Kt[le],Kt[le+1]);if(Ee<this._minDistance){this._minDistance=Ee;var Dn=new ie(Tt[Qt],Tt[Qt+1]),Jn=new ie(Kt[le],Kt[le+1]),fi=Dn.closestPoints(Jn);bt[0]=new ln(H,Qt,fi[0]),bt[1]=new ln(it,le,fi[1])}if(this._minDistance<=this._terminateDistance)return null}}}},tr.prototype.computeMinDistancePoints=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v),L=d.getCoordinate().distance(M.getCoordinate());if(L<this._minDistance&&(this._minDistance=L,a[0]=new ln(d,0,d.getCoordinate()),a[1]=new ln(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},tr.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new I("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},tr.prototype.computeMinDistanceLines=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v);if(this.computeMinDistance(d,M,a),this._minDistance<=this._terminateDistance)return null}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.distance=function(r,i){return new tr(r,i).distance()},tr.isWithinDistance=function(r,i,a){return new tr(r,i,a).distance()<=a},tr.nearestPoints=function(r,i){return new tr(r,i).nearestPoints()};var Nr=function(){this._pt=[new D,new D],this._distance=A.NaN,this._isNull=!0};Nr.prototype.getCoordinates=function(){return this._pt},Nr.prototype.getCoordinate=function(r){return this._pt[r]},Nr.prototype.setMinimum=function(){if(arguments.length===1){var r=arguments[0];this.setMinimum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c<this._distance&&this.initialize(i,a,c)}},Nr.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=r.distance(i),this._isNull=!1}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(c),this._distance=d,this._isNull=!1}},Nr.prototype.toString=function(){return fe.toLineString(this._pt[0],this._pt[1])},Nr.prototype.getDistance=function(){return this._distance},Nr.prototype.setMaximum=function(){if(arguments.length===1){var r=arguments[0];this.setMaximum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c>this._distance&&this.initialize(i,a,c)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Uo=function(){};Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo},Uo.computeDistance=function(){if(arguments[2]instanceof Nr&&arguments[0]instanceof vt&&arguments[1]instanceof D)for(var r=arguments[0],i=arguments[1],a=arguments[2],c=new ie,d=r.getCoordinates(),v=0;v<d.length-1;v++){c.setCoordinates(d[v],d[v+1]);var M=c.closestPoint(i);a.setMinimum(M,i)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof de&&arguments[1]instanceof D){var L=arguments[0],H=arguments[1],it=arguments[2];Uo.computeDistance(L.getExteriorRing(),H,it);for(var bt=0;bt<L.getNumInteriorRing();bt++)Uo.computeDistance(L.getInteriorRingN(bt),H,it)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof Vt&&arguments[1]instanceof D){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2];if(Tt instanceof vt)Uo.computeDistance(Tt,Kt,Qt);else if(Tt instanceof de)Uo.computeDistance(Tt,Kt,Qt);else if(Tt instanceof Qn)for(var le=Tt,Ee=0;Ee<le.getNumGeometries();Ee++){var Dn=le.getGeometryN(Ee);Uo.computeDistance(Dn,Kt,Qt)}else Qt.setMinimum(Tt.getCoordinate(),Kt)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof ie&&arguments[1]instanceof D){var Jn=arguments[0],fi=arguments[1],as=arguments[2],qs=Jn.closestPoint(fi);as.setMinimum(qs,fi)}};var ei=function(){this._g0=null,this._g1=null,this._ptDist=new Nr,this._densifyFrac=0;var r=arguments[0],i=arguments[1];this._g0=r,this._g1=i},Su={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ei.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ei.prototype.setDensifyFraction=function(r){if(r>1||r<=0)throw new I("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=r},ei.prototype.compute=function(r,i){this.computeOrientedDistance(r,i,this._ptDist),this.computeOrientedDistance(i,r,this._ptDist)},ei.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ei.prototype.computeOrientedDistance=function(r,i,a){var c=new Ss(i);if(r.apply(c),a.setMaximum(c.getMaxPointDistance()),this._densifyFrac>0){var d=new sn(i,this._densifyFrac);r.apply(d),a.setMaximum(d.getMaxPointDistance())}},ei.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.distance=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return new ei(r,i).distance()}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2],v=new ei(a,c);return v.setDensifyFraction(d),v.distance()}},Su.MaxPointDistanceFilter.get=function(){return Ss},Su.MaxDensifiedByFractionDistanceFilter.get=function(){return sn},Object.defineProperties(ei,Su);var Ss=function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._euclideanDist=new Uo,this._geom=null;var r=arguments[0];this._geom=r};Ss.prototype.filter=function(r){this._minPtDist.initialize(),Uo.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ss.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ss.prototype.interfaces_=function(){return[rt]},Ss.prototype.getClass=function(){return Ss};var sn=function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._geom=null,this._numSubSegs=0;var r=arguments[0],i=arguments[1];this._geom=r,this._numSubSegs=Math.trunc(Math.round(1/i))};sn.prototype.filter=function(r,i){if(i===0)return null;for(var a=r.getCoordinate(i-1),c=r.getCoordinate(i),d=(c.x-a.x)/this._numSubSegs,v=(c.y-a.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var L=a.x+M*d,H=a.y+M*v,it=new D(L,H);this._minPtDist.initialize(),Uo.computeDistance(this._geom,it,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},sn.prototype.isDone=function(){return!1},sn.prototype.isGeometryChanged=function(){return!1},sn.prototype.getMaxPointDistance=function(){return this._maxPtDist},sn.prototype.interfaces_=function(){return[ur]},sn.prototype.getClass=function(){return sn};var Li=function(r,i,a){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=r||null,this._bufDistance=i||null,this._result=a||null},Ql={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Li.prototype.checkMaximumDistance=function(r,i,a){var c=new ei(i,r);if(c.setDensifyFraction(.25),this._maxDistanceFound=c.orientedDistance(),this._maxDistanceFound>a){this._isValid=!1;var d=c.getCoordinates();this._errorLocation=d[1],this._errorIndicator=r.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+fe.toLineString(d[0],d[1])+")"}},Li.prototype.isValid=function(){var r=Math.abs(this._bufDistance),i=Li.MAX_DISTANCE_DIFF_FRAC*r;return this._minValidDistance=r-i,this._maxValidDistance=r+i,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Li.VERBOSE&&te.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Li.prototype.checkNegativeValid=function(){if(!(this._input instanceof de||this._input instanceof Pe||this._input instanceof Qn))return null;var r=this.getPolygonLines(this._input);if(this.checkMinimumDistance(r,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(r,this._result,this._maxValidDistance)},Li.prototype.getErrorIndicator=function(){return this._errorIndicator},Li.prototype.checkMinimumDistance=function(r,i,a){var c=new tr(r,i,a);if(this._minDistanceFound=c.distance(),this._minDistanceFound<a){this._isValid=!1;var d=c.nearestPoints();this._errorLocation=c.nearestPoints()[1],this._errorIndicator=r.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+fe.toLineString(d[0],d[1])+" )"}},Li.prototype.checkPositiveValid=function(){var r=this._result.getBoundary();if(this.checkMinimumDistance(this._input,r,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,r,this._maxValidDistance)},Li.prototype.getErrorLocation=function(){return this._errorLocation},Li.prototype.getPolygonLines=function(r){for(var i=new G,a=new _e(i),c=se.getPolygons(r).iterator();c.hasNext();)c.next().apply(a);return r.getFactory().buildGeometry(i)},Li.prototype.getErrorMessage=function(){return this._errMsg},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Ql.VERBOSE.get=function(){return!1},Ql.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Li,Ql);var Rr=function(r,i,a){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=r||null,this._distance=i||null,this._result=a||null},bf={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Rr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Rr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var r=this._distance*Rr.MAX_ENV_DIFF_FRAC;r===0&&(r=.001);var i=new qt(this._input.getEnvelopeInternal());i.expandBy(this._distance);var a=new qt(this._result.getEnvelopeInternal());a.expandBy(r),a.contains(i)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(a)),this.report("Envelope")},Rr.prototype.checkDistance=function(){var r=new Li(this._input,this._distance,this._result);r.isValid()||(this._isValid=!1,this._errorMsg=r.getErrorMessage(),this._errorLocation=r.getErrorLocation(),this._errorIndicator=r.getErrorIndicator()),this.report("Distance")},Rr.prototype.checkArea=function(){var r=this._input.getArea(),i=this._result.getArea();this._distance>0&&r>i&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&r<i&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Rr.prototype.checkPolygonal=function(){this._result instanceof de||this._result instanceof Pe||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Rr.prototype.getErrorIndicator=function(){return this._errorIndicator},Rr.prototype.getErrorLocation=function(){return this._errorLocation},Rr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Rr.prototype.report=function(r){if(!Rr.VERBOSE)return null;te.out.println("Check "+r+": "+(this._isValid?"passed":"FAILED"))},Rr.prototype.getErrorMessage=function(){return this._errorMsg},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.isValidMsg=function(r,i,a){var c=new Rr(r,i,a);return c.isValid()?null:c.getErrorMessage()},Rr.isValid=function(r,i,a){return!!new Rr(r,i,a).isValid()},bf.VERBOSE.get=function(){return!1},bf.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Rr,bf);var Bo=function(){this._pts=null,this._data=null;var r=arguments[0],i=arguments[1];this._pts=r,this._data=i};Bo.prototype.getCoordinates=function(){return this._pts},Bo.prototype.size=function(){return this._pts.length},Bo.prototype.getCoordinate=function(r){return this._pts[r]},Bo.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Bo.prototype.getSegmentOctant=function(r){return r===this._pts.length-1?-1:ua.octant(this.getCoordinate(r),this.getCoordinate(r+1))},Bo.prototype.setData=function(r){this._data=r},Bo.prototype.getData=function(){return this._data},Bo.prototype.toString=function(){return fe.toLineString(new ye(this._pts))},Bo.prototype.interfaces_=function(){return[No]},Bo.prototype.getClass=function(){return Bo};var Br=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new G,this._intersectionCount=0,this._keepIntersections=!0;var r=arguments[0];this._li=r,this._interiorIntersection=null};Br.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Br.prototype.setCheckEndSegmentsOnly=function(r){this._isCheckEndSegmentsOnly=r},Br.prototype.getIntersectionSegments=function(){return this._intSegments},Br.prototype.count=function(){return this._intersectionCount},Br.prototype.getIntersections=function(){return this._intersections},Br.prototype.setFindAllIntersections=function(r){this._findAllIntersections=r},Br.prototype.setKeepIntersections=function(r){this._keepIntersections=r},Br.prototype.processIntersections=function(r,i,a,c){if(!this._findAllIntersections&&this.hasIntersection()||r===a&&i===c||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(r,i)||this.isEndSegment(a,c)))return null;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=d,this._intSegments[1]=v,this._intSegments[2]=M,this._intSegments[3]=L,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Br.prototype.isEndSegment=function(r,i){return i===0||i>=r.size()-2},Br.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Br.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Br.prototype.interfaces_=function(){return[Bs]},Br.prototype.getClass=function(){return Br},Br.createAllIntersectionsFinder=function(r){var i=new Br(r);return i.setFindAllIntersections(!0),i},Br.createAnyIntersectionFinder=function(r){return new Br(r)},Br.createIntersectionCounter=function(r){var i=new Br(r);return i.setFindAllIntersections(!0),i.setKeepIntersections(!1),i};var Ni=function(){this._li=new z,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var r=arguments[0];this._segStrings=r};Ni.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ni.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ni.prototype.isValid=function(){return this.execute(),this._isValid},Ni.prototype.setFindAllIntersections=function(r){this._findAllIntersections=r},Ni.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Br(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var r=new hl;if(r.setSegmentIntersector(this._segInt),r.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ni.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qo(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ni.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var r=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+fe.toLineString(r[0],r[1])+" and "+fe.toLineString(r[2],r[3])},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.computeIntersections=function(r){var i=new Ni(r);return i.setFindAllIntersections(!0),i.isValid(),i.getIntersections()};var Ji=function r(){this._nv=null;var i=arguments[0];this._nv=new Ni(r.toSegmentStrings(i))};Ji.prototype.checkValid=function(){this._nv.checkValid()},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji},Ji.toSegmentStrings=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next();i.add(new Bo(c.getCoordinates(),c))}return i},Ji.checkValid=function(r){new Ji(r).checkValid()};var Ms=function(r){this._mapOp=r};Ms.prototype.map=function(r){for(var i=new G,a=0;a<r.getNumGeometries();a++){var c=this._mapOp.map(r.getGeometryN(a));c.isEmpty()||i.add(c)}return r.getFactory().createGeometryCollection(Le.toGeometryArray(i))},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms},Ms.map=function(r,i){return new Ms(i).map(r)};var yo=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new G,this._resultLineList=new G;var r=arguments[0],i=arguments[1],a=arguments[2];this._op=r,this._geometryFactory=i,this._ptLocator=a};yo.prototype.collectLines=function(r){for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var a=i.next();this.collectLineEdge(a,r,this._lineEdgesList),this.collectBoundaryTouchEdge(a,r,this._lineEdgesList)}},yo.prototype.labelIsolatedLine=function(r,i){var a=this._ptLocator.locate(r.getCoordinate(),this._op.getArgGeometry(i));r.getLabel().setLocation(i,a)},yo.prototype.build=function(r){return this.findCoveredLineEdges(),this.collectLines(r),this.buildLines(r),this._resultLineList},yo.prototype.collectLineEdge=function(r,i,a){var c=r.getLabel(),d=r.getEdge();r.isLineEdge()&&(r.isVisited()||!Re.isResultOfOp(c,i)||d.isCovered()||(a.add(d),r.setVisitedEdge(!0)))},yo.prototype.findCoveredLineEdges=function(){for(var r=this._op.getGraph().getNodes().iterator();r.hasNext();)r.next().getEdges().findCoveredLineEdges();for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var a=i.next(),c=a.getEdge();if(a.isLineEdge()&&!c.isCoveredSet()){var d=this._op.isCoveredByA(a.getCoordinate());c.setCovered(d)}}},yo.prototype.labelIsolatedLines=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next(),c=a.getLabel();a.isIsolated()&&(c.isNull(0)?this.labelIsolatedLine(a,0):this.labelIsolatedLine(a,1))}},yo.prototype.buildLines=function(r){for(var i=this._lineEdgesList.iterator();i.hasNext();){var a=i.next(),c=this._geometryFactory.createLineString(a.getCoordinates());this._resultLineList.add(c),a.setInResult(!0)}},yo.prototype.collectBoundaryTouchEdge=function(r,i,a){var c=r.getLabel();return r.isLineEdge()||r.isVisited()||r.isInteriorAreaEdge()||r.getEdge().isInResult()?null:(Wt.isTrue(!(r.isInResult()||r.getSym().isInResult())||!r.getEdge().isInResult()),void(Re.isResultOfOp(c,i)&&i===Re.INTERSECTION&&(a.add(r.getEdge()),r.setVisitedEdge(!0))))},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var bs=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new G;var r=arguments[0],i=arguments[1];this._op=r,this._geometryFactory=i};bs.prototype.filterCoveredNodeToPoint=function(r){var i=r.getCoordinate();if(!this._op.isCoveredByLA(i)){var a=this._geometryFactory.createPoint(i);this._resultPointList.add(a)}},bs.prototype.extractNonCoveredResultNodes=function(r){for(var i=this._op.getGraph().getNodes().iterator();i.hasNext();){var a=i.next();if(!a.isInResult()&&!a.isIncidentEdgeInResult()&&(a.getEdges().getDegree()===0||r===Re.INTERSECTION)){var c=a.getLabel();Re.isResultOfOp(c,r)&&this.filterCoveredNodeToPoint(a)}}},bs.prototype.build=function(r){return this.extractNonCoveredResultNodes(r),this._resultPointList},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var li=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};li.prototype.transformPoint=function(r,i){return this._factory.createPoint(this.transformCoordinates(r.getCoordinateSequence(),r))},li.prototype.transformPolygon=function(r,i){var a=!0,c=this.transformLinearRing(r.getExteriorRing(),r);c!==null&&c instanceof Ae&&!c.isEmpty()||(a=!1);for(var d=new G,v=0;v<r.getNumInteriorRing();v++){var M=this.transformLinearRing(r.getInteriorRingN(v),r);M===null||M.isEmpty()||(M instanceof Ae||(a=!1),d.add(M))}if(a)return this._factory.createPolygon(c,d.toArray([]));var L=new G;return c!==null&&L.add(c),L.addAll(d),this._factory.buildGeometry(L)},li.prototype.createCoordinateSequence=function(r){return this._factory.getCoordinateSequenceFactory().create(r)},li.prototype.getInputGeometry=function(){return this._inputGeom},li.prototype.transformMultiLineString=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformLineString(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.transformCoordinates=function(r,i){return this.copy(r)},li.prototype.transformLineString=function(r,i){return this._factory.createLineString(this.transformCoordinates(r.getCoordinateSequence(),r))},li.prototype.transformMultiPoint=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformPoint(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.transformMultiPolygon=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformPolygon(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.copy=function(r){return r.copy()},li.prototype.transformGeometryCollection=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transform(r.getGeometryN(c));d!==null&&(this._pruneEmptyGeometry&&d.isEmpty()||a.add(d))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Le.toGeometryArray(a)):this._factory.buildGeometry(a)},li.prototype.transform=function(r){if(this._inputGeom=r,this._factory=r.getFactory(),r instanceof ue)return this.transformPoint(r,null);if(r instanceof Be)return this.transformMultiPoint(r,null);if(r instanceof Ae)return this.transformLinearRing(r,null);if(r instanceof vt)return this.transformLineString(r,null);if(r instanceof bi)return this.transformMultiLineString(r,null);if(r instanceof de)return this.transformPolygon(r,null);if(r instanceof Pe)return this.transformMultiPolygon(r,null);if(r instanceof Qn)return this.transformGeometryCollection(r,null);throw new I("Unknown Geometry subtype: "+r.getClass().getName())},li.prototype.transformLinearRing=function(r,i){var a=this.transformCoordinates(r.getCoordinateSequence(),r);if(a===null)return this._factory.createLinearRing(null);var c=a.size();return c>0&&c<4&&!this._preserveType?this._factory.createLineString(a):this._factory.createLinearRing(a)},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var zo=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ie,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof vt&&typeof arguments[1]=="number"){var i=arguments[0],a=arguments[1];r.call(this,i.getCoordinates(),a)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var c=arguments[0],d=arguments[1];this._srcPts=c,this._isClosed=r.isClosed(c),this._snapTolerance=d}};zo.prototype.snapVertices=function(r,i){for(var a=this._isClosed?r.size()-1:r.size(),c=0;c<a;c++){var d=r.get(c),v=this.findSnapForVertex(d,i);v!==null&&(r.set(c,new D(v)),c===0&&this._isClosed&&r.set(r.size()-1,new D(v)))}},zo.prototype.findSnapForVertex=function(r,i){for(var a=0;a<i.length;a++){if(r.equals2D(i[a]))return null;if(r.distance(i[a])<this._snapTolerance)return i[a]}return null},zo.prototype.snapTo=function(r){var i=new et(this._srcPts);return this.snapVertices(i,r),this.snapSegments(i,r),i.toCoordinateArray()},zo.prototype.snapSegments=function(r,i){if(i.length===0)return null;var a=i.length;i[0].equals2D(i[i.length-1])&&(a=i.length-1);for(var c=0;c<a;c++){var d=i[c],v=this.findSegmentIndexToSnap(d,r);v>=0&&r.add(v+1,new D(d),!1)}},zo.prototype.findSegmentIndexToSnap=function(r,i){for(var a=A.MAX_VALUE,c=-1,d=0;d<i.size()-1;d++){if(this._seg.p0=i.get(d),this._seg.p1=i.get(d+1),this._seg.p0.equals2D(r)||this._seg.p1.equals2D(r)){if(this._allowSnappingToSourceVertices)continue;return-1}var v=this._seg.distance(r);v<this._snapTolerance&&v<a&&(a=v,c=d)}return c},zo.prototype.setAllowSnappingToSourceVertices=function(r){this._allowSnappingToSourceVertices=r},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},zo.isClosed=function(r){return!(r.length<=1)&&r[0].equals2D(r[r.length-1])};var fr=function(r){this._srcGeom=r||null},Af={SNAP_PRECISION_FACTOR:{configurable:!0}};fr.prototype.snapTo=function(r,i){var a=this.extractTargetCoordinates(r);return new Mu(i,a).transform(this._srcGeom)},fr.prototype.snapToSelf=function(r,i){var a=this.extractTargetCoordinates(this._srcGeom),c=new Mu(r,a,!0).transform(this._srcGeom),d=c;return i&&Q(d,we)&&(d=c.buffer(0)),d},fr.prototype.computeSnapTolerance=function(r){return this.computeMinimumSegmentLength(r)/10},fr.prototype.extractTargetCoordinates=function(r){for(var i=new b,a=r.getCoordinates(),c=0;c<a.length;c++)i.add(a[c]);return i.toArray(new Array(0).fill(null))},fr.prototype.computeMinimumSegmentLength=function(r){for(var i=A.MAX_VALUE,a=0;a<r.length-1;a++){var c=r[a].distance(r[a+1]);c<i&&(i=c)}return i},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr},fr.snap=function(r,i,a){var c=new Array(2).fill(null),d=new fr(r);c[0]=d.snapTo(i,a);var v=new fr(i);return c[1]=v.snapTo(c[0],a),c},fr.computeOverlaySnapTolerance=function(){if(arguments.length===1){var r=arguments[0],i=fr.computeSizeBasedSnapTolerance(r),a=r.getPrecisionModel();if(a.getType()===Ge.FIXED){var c=1/a.getScale()*2/1.415;c>i&&(i=c)}return i}if(arguments.length===2){var d=arguments[0],v=arguments[1];return Math.min(fr.computeOverlaySnapTolerance(d),fr.computeOverlaySnapTolerance(v))}},fr.computeSizeBasedSnapTolerance=function(r){var i=r.getEnvelopeInternal();return Math.min(i.getHeight(),i.getWidth())*fr.SNAP_PRECISION_FACTOR},fr.snapToSelf=function(r,i,a){return new fr(r).snapToSelf(i,a)},Af.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(fr,Af);var Mu=function(r){function i(a,c,d){r.call(this),this._snapTolerance=a||null,this._snapPts=c||null,this._isSelfSnap=d!==void 0&&d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.snapLine=function(a,c){var d=new zo(a,this._snapTolerance);return d.setAllowSnappingToSourceVertices(this._isSelfSnap),d.snapTo(c)},i.prototype.transformCoordinates=function(a,c){var d=a.toCoordinateArray(),v=this.snapLine(d,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(li),Tr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Tr.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Tr.prototype.add=function(r){var i=A.doubleToLongBits(r);if(this._isFirst)return this._commonBits=i,this._commonSignExp=Tr.signExpBits(this._commonBits),this._isFirst=!1,null;if(Tr.signExpBits(i)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Tr.numCommonMostSigMantissaBits(this._commonBits,i),this._commonBits=Tr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Tr.prototype.toString=function(){if(arguments.length===1){var r=arguments[0],i=A.longBitsToDouble(r),a="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(r),c=a.substring(a.length-64);return c.substring(0,1)+" "+c.substring(1,12)+"(exp) "+c.substring(12)+" [ "+i+" ]"}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.getBit=function(r,i){return r&1<<i?1:0},Tr.signExpBits=function(r){return r>>52},Tr.zeroLowerBits=function(r,i){return r&~((1<<i)-1)},Tr.numCommonMostSigMantissaBits=function(r,i){for(var a=0,c=52;c>=0;c--){if(Tr.getBit(r,c)!==Tr.getBit(i,c))return a;a++}return 52};var Go=function(){this._commonCoord=null,this._ccFilter=new Wa},Tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Go.prototype.addCommonBits=function(r){var i=new Gs(this._commonCoord);r.apply(i),r.geometryChanged()},Go.prototype.removeCommonBits=function(r){if(this._commonCoord.x===0&&this._commonCoord.y===0)return r;var i=new D(this._commonCoord);i.x=-i.x,i.y=-i.y;var a=new Gs(i);return r.apply(a),r.geometryChanged(),r},Go.prototype.getCommonCoordinate=function(){return this._commonCoord},Go.prototype.add=function(r){r.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go},Tf.CommonCoordinateFilter.get=function(){return Wa},Tf.Translater.get=function(){return Gs},Object.defineProperties(Go,Tf);var Wa=function(){this._commonBitsX=new Tr,this._commonBitsY=new Tr};Wa.prototype.filter=function(r){this._commonBitsX.add(r.x),this._commonBitsY.add(r.y)},Wa.prototype.getCommonCoordinate=function(){return new D(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Wa.prototype.interfaces_=function(){return[rt]},Wa.prototype.getClass=function(){return Wa};var Gs=function(){this.trans=null;var r=arguments[0];this.trans=r};Gs.prototype.filter=function(r,i){var a=r.getOrdinate(i,0)+this.trans.x,c=r.getOrdinate(i,1)+this.trans.y;r.setOrdinate(i,0,a),r.setOrdinate(i,1,c)},Gs.prototype.isDone=function(){return!1},Gs.prototype.isGeometryChanged=function(){return!0},Gs.prototype.interfaces_=function(){return[ur]},Gs.prototype.getClass=function(){return Gs};var Cr=function(r,i){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=r,this._geom[1]=i,this.computeSnapTolerance()};Cr.prototype.selfSnap=function(r){return new fr(r).snapTo(r,this._snapTolerance)},Cr.prototype.removeCommonBits=function(r){this._cbr=new Go,this._cbr.add(r[0]),this._cbr.add(r[1]);var i=new Array(2).fill(null);return i[0]=this._cbr.removeCommonBits(r[0].copy()),i[1]=this._cbr.removeCommonBits(r[1].copy()),i},Cr.prototype.prepareResult=function(r){return this._cbr.addCommonBits(r),r},Cr.prototype.getResultGeometry=function(r){var i=this.snap(this._geom),a=Re.overlayOp(i[0],i[1],r);return this.prepareResult(a)},Cr.prototype.checkValid=function(r){r.isValid()||te.out.println("Snapped geometry is invalid")},Cr.prototype.computeSnapTolerance=function(){this._snapTolerance=fr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Cr.prototype.snap=function(r){var i=this.removeCommonBits(r);return fr.snap(i[0],i[1],this._snapTolerance)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.overlayOp=function(r,i,a){return new Cr(r,i).getResultGeometry(a)},Cr.union=function(r,i){return Cr.overlayOp(r,i,Re.UNION)},Cr.intersection=function(r,i){return Cr.overlayOp(r,i,Re.INTERSECTION)},Cr.symDifference=function(r,i){return Cr.overlayOp(r,i,Re.SYMDIFFERENCE)},Cr.difference=function(r,i){return Cr.overlayOp(r,i,Re.DIFFERENCE)};var zr=function(r,i){this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i};zr.prototype.getResultGeometry=function(r){var i=null,a=!1,c=null;try{i=Re.overlayOp(this._geom[0],this._geom[1],r),a=!0}catch(d){if(!(d instanceof Te))throw d;c=d}if(!a)try{i=Cr.overlayOp(this._geom[0],this._geom[1],r)}catch(d){throw d instanceof Te?c:d}return i},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.overlayOp=function(r,i,a){return new zr(r,i).getResultGeometry(a)},zr.union=function(r,i){return zr.overlayOp(r,i,Re.UNION)},zr.intersection=function(r,i){return zr.overlayOp(r,i,Re.INTERSECTION)},zr.symDifference=function(r,i){return zr.overlayOp(r,i,Re.SYMDIFFERENCE)},zr.difference=function(r,i){return zr.overlayOp(r,i,Re.DIFFERENCE)};var Xa=function(){this.mce=null,this.chainIndex=null;var r=arguments[0],i=arguments[1];this.mce=r,this.chainIndex=i};Xa.prototype.computeIntersections=function(r,i){this.mce.computeIntersectsForChain(this.chainIndex,r.mce,r.chainIndex,i)},Xa.prototype.interfaces_=function(){return[]},Xa.prototype.getClass=function(){return Xa};var Oi=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var i=arguments[0],a=arguments[1];this._eventType=r.DELETE,this._xValue=i,this._insertEvent=a}else if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._eventType=r.INSERT,this._label=c,this._xValue=d,this._obj=v}},tc={INSERT:{configurable:!0},DELETE:{configurable:!0}};Oi.prototype.isDelete=function(){return this._eventType===Oi.DELETE},Oi.prototype.setDeleteEventIndex=function(r){this._deleteEventIndex=r},Oi.prototype.getObject=function(){return this._obj},Oi.prototype.compareTo=function(r){var i=r;return this._xValue<i._xValue?-1:this._xValue>i._xValue?1:this._eventType<i._eventType?-1:this._eventType>i._eventType?1:0},Oi.prototype.getInsertEvent=function(){return this._insertEvent},Oi.prototype.isInsert=function(){return this._eventType===Oi.INSERT},Oi.prototype.isSameLabel=function(r){return this._label!==null&&this._label===r._label},Oi.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Oi.prototype.interfaces_=function(){return[V]},Oi.prototype.getClass=function(){return Oi},tc.INSERT.get=function(){return 1},tc.DELETE.get=function(){return 2},Object.defineProperties(Oi,tc);var ec=function(){};ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec};var Yr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var r=arguments[0],i=arguments[1],a=arguments[2];this._li=r,this._includeProper=i,this._recordIsolated=a};Yr.prototype.isTrivialIntersection=function(r,i,a,c){if(r===a&&this._li.getIntersectionNum()===1){if(Yr.isAdjacentSegments(i,c))return!0;if(r.isClosed()){var d=r.getNumPoints()-1;if(i===0&&c===d||c===0&&i===d)return!0}}return!1},Yr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Yr.prototype.setIsDoneIfProperInt=function(r){this._isDoneWhenProperInt=r},Yr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Yr.prototype.isBoundaryPointInternal=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next().getCoordinate();if(r.isIntersection(c))return!0}return!1},Yr.prototype.hasProperIntersection=function(){return this._hasProper},Yr.prototype.hasIntersection=function(){return this._hasIntersection},Yr.prototype.isDone=function(){return this._isDone},Yr.prototype.isBoundaryPoint=function(r,i){return i!==null&&(!!this.isBoundaryPointInternal(r,i[0])||!!this.isBoundaryPointInternal(r,i[1]))},Yr.prototype.setBoundaryNodes=function(r,i){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=r,this._bdyNodes[1]=i},Yr.prototype.addIntersections=function(r,i,a,c){if(r===a&&i===c)return null;this.numTests++;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&(this._recordIsolated&&(r.setIsolated(!1),a.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(r,i,a,c)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.isAdjacentSegments=function(r,i){return Math.abs(r-i)===1};var ni=function(r){function i(){r.call(this),this.events=new G,this.nOverlaps=null}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.prepareEvents=function(){ho.sort(this.events);for(var a=0;a<this.events.size();a++){var c=this.events.get(a);c.isDelete()&&c.getInsertEvent().setDeleteEventIndex(a)}},i.prototype.computeIntersections=function(){if(arguments.length===1){var a=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var c=0;c<this.events.size();c++){var d=this.events.get(c);if(d.isInsert()&&this.processOverlaps(c,d.getDeleteEventIndex(),d,a),a.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Yr&&Q(arguments[0],Et)&&Q(arguments[1],Et)){var v=arguments[0],M=arguments[1],L=arguments[2];this.addEdges(v,v),this.addEdges(M,M),this.computeIntersections(L)}else if(typeof arguments[2]=="boolean"&&Q(arguments[0],Et)&&arguments[1]instanceof Yr){var H=arguments[0],it=arguments[1];arguments[2]?this.addEdges(H,null):this.addEdges(H),this.computeIntersections(it)}}},i.prototype.addEdge=function(a,c){for(var d=a.getMonotoneChainEdge(),v=d.getStartIndexes(),M=0;M<v.length-1;M++){var L=new Xa(d,M),H=new Oi(c,d.getMinX(M),L);this.events.add(H),this.events.add(new Oi(d.getMaxX(M),H))}},i.prototype.processOverlaps=function(a,c,d,v){for(var M=d.getObject(),L=a;L<c;L++){var H=this.events.get(L);if(H.isInsert()){var it=H.getObject();d.isSameLabel(H)||(M.computeIntersections(it,v),this.nOverlaps++)}}},i.prototype.addEdges=function(){if(arguments.length===1)for(var a=arguments[0].iterator();a.hasNext();){var c=a.next();this.addEdge(c,c)}else if(arguments.length===2)for(var d=arguments[0],v=arguments[1],M=d.iterator();M.hasNext();){var L=M.next();this.addEdge(L,v)}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ec),vr=function(){this._min=A.POSITIVE_INFINITY,this._max=A.NEGATIVE_INFINITY},Vh={NodeComparator:{configurable:!0}};vr.prototype.getMin=function(){return this._min},vr.prototype.intersects=function(r,i){return!(this._min>i||this._max<r)},vr.prototype.getMax=function(){return this._max},vr.prototype.toString=function(){return fe.toLineString(new D(this._min,0),new D(this._max,0))},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},Vh.NodeComparator.get=function(){return dl},Object.defineProperties(vr,Vh);var dl=function(){};dl.prototype.compare=function(r,i){var a=r,c=i,d=(a._min+a._max)/2,v=(c._min+c._max)/2;return d<v?-1:d>v?1:0},dl.prototype.interfaces_=function(){return[q]},dl.prototype.getClass=function(){return dl};var Wh=function(r){function i(){r.call(this),this._item=null;var a=arguments[0],c=arguments[1],d=arguments[2];this._min=a,this._max=c,this._item=d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.query=function(a,c,d){if(!this.intersects(a,c))return null;d.visitItem(this._item)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vr),nm=function(r){function i(){r.call(this),this._node1=null,this._node2=null;var a=arguments[0],c=arguments[1];this._node1=a,this._node2=c,this.buildExtent(this._node1,this._node2)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.buildExtent=function(a,c){this._min=Math.min(a._min,c._min),this._max=Math.max(a._max,c._max)},i.prototype.query=function(a,c,d){if(!this.intersects(a,c))return null;this._node1!==null&&this._node1.query(a,c,d),this._node2!==null&&this._node2.query(a,c,d)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vr),vo=function(){this._leaves=new G,this._root=null,this._level=0};vo.prototype.buildTree=function(){ho.sort(this._leaves,new vr.NodeComparator);for(var r=this._leaves,i=null,a=new G;;){if(this.buildLevel(r,a),a.size()===1)return a.get(0);i=r,r=a,a=i}},vo.prototype.insert=function(r,i,a){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Wh(r,i,a))},vo.prototype.query=function(r,i,a){this.init(),this._root.query(r,i,a)},vo.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},vo.prototype.printNode=function(r){te.out.println(fe.toLineString(new D(r._min,this._level),new D(r._max,this._level)))},vo.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},vo.prototype.buildLevel=function(r,i){this._level++,i.clear();for(var a=0;a<r.size();a+=2){var c=r.get(a);if((a+1<r.size()?r.get(a):null)===null)i.add(c);else{var d=new nm(r.get(a),r.get(a+1));i.add(d)}}},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var As=function(){this._items=new G};As.prototype.visitItem=function(r){this._items.add(r)},As.prototype.getItems=function(){return this._items},As.prototype.interfaces_=function(){return[Us]},As.prototype.getClass=function(){return As};var da=function(){this._index=null;var r=arguments[0];if(!Q(r,we))throw new I("Argument must be Polygonal");this._index=new ko(r)},ga={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};da.prototype.locate=function(r){var i=new Ot(r),a=new Ts(i);return this._index.query(r.y,r.y,a),i.getLocation()},da.prototype.interfaces_=function(){return[xu]},da.prototype.getClass=function(){return da},ga.SegmentVisitor.get=function(){return Ts},ga.IntervalIndexedGeometry.get=function(){return ko},Object.defineProperties(da,ga);var Ts=function(){this._counter=null;var r=arguments[0];this._counter=r};Ts.prototype.visitItem=function(r){var i=r;this._counter.countSegment(i.getCoordinate(0),i.getCoordinate(1))},Ts.prototype.interfaces_=function(){return[Us]},Ts.prototype.getClass=function(){return Ts};var ko=function(){this._index=new vo;var r=arguments[0];this.init(r)};ko.prototype.init=function(r){for(var i=_e.getLines(r).iterator();i.hasNext();){var a=i.next().getCoordinates();this.addLine(a)}},ko.prototype.addLine=function(r){for(var i=1;i<r.length;i++){var a=new ie(r[i-1],r[i]),c=Math.min(a.p0.y,a.p1.y),d=Math.max(a.p0.y,a.p1.y);this._index.insert(c,d,a)}},ko.prototype.query=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new As;return this._index.query(r,i,a),a.getItems()}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._index.query(c,d,v)}},ko.prototype.interfaces_=function(){return[]},ko.prototype.getClass=function(){return ko};var ma=function(r){function i(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new ul,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new qe,arguments.length===2){var a=arguments[0],c=arguments[1],d=P.OGC_SFS_BOUNDARY_RULE;this._argIndex=a,this._parentGeom=c,this._boundaryNodeRule=d,c!==null&&this.add(c)}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this._argIndex=v,this._parentGeom=M,this._boundaryNodeRule=L,M!==null&&this.add(M)}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.insertBoundaryPoint=function(a,c){var d=this._nodes.addNode(c).getLabel(),v=1;K.NONE,d.getLocation(a,Xt.ON)===K.BOUNDARY&&v++;var M=i.determineBoundary(this._boundaryNodeRule,v);d.setLocation(a,M)},i.prototype.computeSelfNodes=function(){if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.computeSelfNodes(a,c,!1)}if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2],L=new Yr(d,!0,!1);L.setIsDoneIfProperInt(M);var H=this.createEdgeSetIntersector(),it=this._parentGeom instanceof Ae||this._parentGeom instanceof de||this._parentGeom instanceof Pe,bt=v||!it;return H.computeIntersections(this._edges,L,bt),this.addSelfIntersectionNodes(this._argIndex),L}},i.prototype.computeSplitEdges=function(a){for(var c=this._edges.iterator();c.hasNext();)c.next().eiList.addSplitEdges(a)},i.prototype.computeEdgeIntersections=function(a,c,d){var v=new Yr(c,d,!0);return v.setBoundaryNodes(this.getBoundaryNodes(),a.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,a._edges,v),v},i.prototype.getGeometry=function(){return this._parentGeom},i.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},i.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},i.prototype.addPoint=function(){if(arguments[0]instanceof ue){var a=arguments[0].getCoordinate();this.insertPoint(this._argIndex,a,K.INTERIOR)}else if(arguments[0]instanceof D){var c=arguments[0];this.insertPoint(this._argIndex,c,K.INTERIOR)}},i.prototype.addPolygon=function(a){this.addPolygonRing(a.getExteriorRing(),K.EXTERIOR,K.INTERIOR);for(var c=0;c<a.getNumInteriorRing();c++){var d=a.getInteriorRingN(c);this.addPolygonRing(d,K.INTERIOR,K.EXTERIOR)}},i.prototype.addEdge=function(a){this.insertEdge(a);var c=a.getCoordinates();this.insertPoint(this._argIndex,c[0],K.BOUNDARY),this.insertPoint(this._argIndex,c[c.length-1],K.BOUNDARY)},i.prototype.addLineString=function(a){var c=lt.removeRepeatedPoints(a.getCoordinates());if(c.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=c[0],null;var d=new jl(c,new On(this._argIndex,K.INTERIOR));this._lineEdgeMap.put(a,d),this.insertEdge(d),Wt.isTrue(c.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,c[0]),this.insertBoundaryPoint(this._argIndex,c[c.length-1])},i.prototype.getInvalidPoint=function(){return this._invalidPoint},i.prototype.getBoundaryPoints=function(){for(var a=this.getBoundaryNodes(),c=new Array(a.size()).fill(null),d=0,v=a.iterator();v.hasNext();){var M=v.next();c[d++]=M.getCoordinate().copy()}return c},i.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},i.prototype.addSelfIntersectionNode=function(a,c,d){if(this.isBoundaryNode(a,c))return null;d===K.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(a,c):this.insertPoint(a,c,d)},i.prototype.addPolygonRing=function(a,c,d){if(a.isEmpty())return null;var v=lt.removeRepeatedPoints(a.getCoordinates());if(v.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=v[0],null;var M=c,L=d;dt.isCCW(v)&&(M=d,L=c);var H=new jl(v,new On(this._argIndex,K.BOUNDARY,M,L));this._lineEdgeMap.put(a,H),this.insertEdge(H),this.insertPoint(this._argIndex,v[0],K.BOUNDARY)},i.prototype.insertPoint=function(a,c,d){var v=this._nodes.addNode(c),M=v.getLabel();M===null?v._label=new On(a,d):M.setLocation(a,d)},i.prototype.createEdgeSetIntersector=function(){return new ni},i.prototype.addSelfIntersectionNodes=function(a){for(var c=this._edges.iterator();c.hasNext();)for(var d=c.next(),v=d.getLabel().getLocation(a),M=d.eiList.iterator();M.hasNext();){var L=M.next();this.addSelfIntersectionNode(a,L.coord,v)}},i.prototype.add=function(){if(arguments.length!==1)return r.prototype.add.apply(this,arguments);var a=arguments[0];if(a.isEmpty())return null;if(a instanceof Pe&&(this._useBoundaryDeterminationRule=!1),a instanceof de)this.addPolygon(a);else if(a instanceof vt)this.addLineString(a);else if(a instanceof ue)this.addPoint(a);else if(a instanceof Be)this.addCollection(a);else if(a instanceof bi)this.addCollection(a);else if(a instanceof Pe)this.addCollection(a);else{if(!(a instanceof Qn))throw new Error(a.getClass().getName());this.addCollection(a)}},i.prototype.addCollection=function(a){for(var c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);this.add(d)}},i.prototype.locate=function(a){return Q(this._parentGeom,we)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new da(this._parentGeom)),this._areaPtLocator.locate(a)):this._ptLocator.locate(a,this._parentGeom)},i.prototype.findEdge=function(){if(arguments.length===1){var a=arguments[0];return this._lineEdgeMap.get(a)}return r.prototype.findEdge.apply(this,arguments)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.determineBoundary=function(a,c){return a.isInBoundary(c)?K.BOUNDARY:K.INTERIOR},i}(dr),ss=function(){if(this._li=new z,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var r=arguments[0];this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new ma(0,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=P.OGC_SFS_BOUNDARY_RULE;i.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ma(0,i,c),this._arg[1]=new ma(1,a,c)}else if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2];d.getPrecisionModel().compareTo(v.getPrecisionModel())>=0?this.setComputationPrecision(d.getPrecisionModel()):this.setComputationPrecision(v.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ma(0,d,M),this._arg[1]=new ma(1,v,M)}};ss.prototype.getArgGeometry=function(r){return this._arg[r].getGeometry()},ss.prototype.setComputationPrecision=function(r){this._resultPrecisionModel=r,this._li.setPrecisionModel(this._resultPrecisionModel)},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss};var ya=function(){};ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya},ya.map=function(){if(arguments[0]instanceof Vt&&Q(arguments[1],ya.MapOp)){for(var r=arguments[0],i=arguments[1],a=new G,c=0;c<r.getNumGeometries();c++){var d=i.map(r.getGeometryN(c));d!==null&&a.add(d)}return r.getFactory().buildGeometry(a)}if(Q(arguments[0],at)&&Q(arguments[1],ya.MapOp)){for(var v=arguments[0],M=arguments[1],L=new G,H=v.iterator();H.hasNext();){var it=H.next(),bt=M.map(it);bt!==null&&L.add(bt)}return L}},ya.MapOp=function(){};var Re=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c),this._ptLocator=new qe,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new gi,this._resultPolyList=new G,this._resultLineList=new G,this._resultPointList=new G,this._graph=new dr(new io),this._geomFact=a.getFactory()}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.insertUniqueEdge=function(a){var c=this._edgeList.findEqualEdge(a);if(c!==null){var d=c.getLabel(),v=a.getLabel();c.isPointwiseEqual(a)||(v=new On(a.getLabel())).flip();var M=c.getDepth();M.isNull()&&M.add(d),M.add(v),d.merge(v)}else this._edgeList.add(a)},i.prototype.getGraph=function(){return this._graph},i.prototype.cancelDuplicateResultEdges=function(){for(var a=this._graph.getEdgeEnds().iterator();a.hasNext();){var c=a.next(),d=c.getSym();c.isInResult()&&d.isInResult()&&(c.setInResult(!1),d.setInResult(!1))}},i.prototype.isCoveredByLA=function(a){return!!this.isCovered(a,this._resultLineList)||!!this.isCovered(a,this._resultPolyList)},i.prototype.computeGeometry=function(a,c,d,v){var M=new G;return M.addAll(a),M.addAll(c),M.addAll(d),M.isEmpty()?i.createEmptyResult(v,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},i.prototype.mergeSymLabels=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();)a.next().getEdges().mergeSymLabels()},i.prototype.isCovered=function(a,c){for(var d=c.iterator();d.hasNext();){var v=d.next();if(this._ptLocator.locate(a,v)!==K.EXTERIOR)return!0}return!1},i.prototype.replaceCollapsedEdges=function(){for(var a=new G,c=this._edgeList.iterator();c.hasNext();){var d=c.next();d.isCollapsed()&&(c.remove(),a.add(d.getCollapsedEdge()))}this._edgeList.addAll(a)},i.prototype.updateNodeLabelling=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();){var c=a.next(),d=c.getEdges().getLabel();c.getLabel().merge(d)}},i.prototype.getResultGeometry=function(a){return this.computeOverlay(a),this._resultGeom},i.prototype.insertUniqueEdges=function(a){for(var c=a.iterator();c.hasNext();){var d=c.next();this.insertUniqueEdge(d)}},i.prototype.computeOverlay=function(a){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var c=new G;this._arg[0].computeSplitEdges(c),this._arg[1].computeSplitEdges(c),this.insertUniqueEdges(c),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ji.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(a),this.cancelDuplicateResultEdges();var d=new Ci(this._geomFact);d.add(this._graph),this._resultPolyList=d.getPolygons();var v=new yo(this,this._geomFact,this._ptLocator);this._resultLineList=v.build(a);var M=new bs(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(a),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,a)},i.prototype.labelIncompleteNode=function(a,c){var d=this._ptLocator.locate(a.getCoordinate(),this._arg[c].getGeometry());a.getLabel().setLocation(c,d)},i.prototype.copyPoints=function(a){for(var c=this._arg[a].getNodeIterator();c.hasNext();){var d=c.next();this._graph.addNode(d.getCoordinate()).setLabel(a,d.getLabel().getLocation(a))}},i.prototype.findResultAreaEdges=function(a){for(var c=this._graph.getEdgeEnds().iterator();c.hasNext();){var d=c.next(),v=d.getLabel();v.isArea()&&!d.isInteriorAreaEdge()&&i.isResultOfOp(v.getLocation(0,Xt.RIGHT),v.getLocation(1,Xt.RIGHT),a)&&d.setInResult(!0)}},i.prototype.computeLabelsFromDepths=function(){for(var a=this._edgeList.iterator();a.hasNext();){var c=a.next(),d=c.getLabel(),v=c.getDepth();if(!v.isNull()){v.normalize();for(var M=0;M<2;M++)d.isNull(M)||!d.isArea()||v.isNull(M)||(v.getDelta(M)===0?d.toLine(M):(Wt.isTrue(!v.isNull(M,Xt.LEFT),"depth of LEFT side has not been initialized"),d.setLocation(M,Xt.LEFT,v.getLocation(M,Xt.LEFT)),Wt.isTrue(!v.isNull(M,Xt.RIGHT),"depth of RIGHT side has not been initialized"),d.setLocation(M,Xt.RIGHT,v.getLocation(M,Xt.RIGHT))))}}},i.prototype.computeLabelling=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();)a.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},i.prototype.labelIncompleteNodes=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();){var c=a.next(),d=c.getLabel();c.isIsolated()&&(d.isNull(0)?this.labelIncompleteNode(c,0):this.labelIncompleteNode(c,1)),c.getEdges().updateLabelling(d)}},i.prototype.isCoveredByA=function(a){return!!this.isCovered(a,this._resultPolyList)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ss);Re.overlayOp=function(r,i,a){return new Re(r,i).getResultGeometry(a)},Re.intersection=function(r,i){if(r.isEmpty()||i.isEmpty())return Re.createEmptyResult(Re.INTERSECTION,r,i,r.getFactory());if(r.isGeometryCollection()){var a=i;return Ms.map(r,{interfaces_:function(){return[ya.MapOp]},map:function(c){return c.intersection(a)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.INTERSECTION)},Re.symDifference=function(r,i){if(r.isEmpty()||i.isEmpty()){if(r.isEmpty()&&i.isEmpty())return Re.createEmptyResult(Re.SYMDIFFERENCE,r,i,r.getFactory());if(r.isEmpty())return i.copy();if(i.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.SYMDIFFERENCE)},Re.resultDimension=function(r,i,a){var c=i.getDimension(),d=a.getDimension(),v=-1;switch(r){case Re.INTERSECTION:v=Math.min(c,d);break;case Re.UNION:v=Math.max(c,d);break;case Re.DIFFERENCE:v=c;break;case Re.SYMDIFFERENCE:v=Math.max(c,d)}return v},Re.createEmptyResult=function(r,i,a,c){var d=null;switch(Re.resultDimension(r,i,a)){case-1:d=c.createGeometryCollection(new Array(0).fill(null));break;case 0:d=c.createPoint();break;case 1:d=c.createLineString();break;case 2:d=c.createPolygon()}return d},Re.difference=function(r,i){return r.isEmpty()?Re.createEmptyResult(Re.DIFFERENCE,r,i,r.getFactory()):i.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.DIFFERENCE))},Re.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=r.getLocation(0),c=r.getLocation(1);return Re.isResultOfOp(a,c,i)}if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2];switch(d===K.BOUNDARY&&(d=K.INTERIOR),v===K.BOUNDARY&&(v=K.INTERIOR),M){case Re.INTERSECTION:return d===K.INTERIOR&&v===K.INTERIOR;case Re.UNION:return d===K.INTERIOR||v===K.INTERIOR;case Re.DIFFERENCE:return d===K.INTERIOR&&v!==K.INTERIOR;case Re.SYMDIFFERENCE:return d===K.INTERIOR&&v!==K.INTERIOR||d!==K.INTERIOR&&v===K.INTERIOR}return!1}},Re.INTERSECTION=1,Re.UNION=2,Re.DIFFERENCE=3,Re.SYMDIFFERENCE=4;var ks=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new qe,this._seg=new ie;var r=arguments[0],i=arguments[1];this._g=r,this._boundaryDistanceTolerance=i,this._linework=this.extractLinework(r)};ks.prototype.isWithinToleranceOfBoundary=function(r){for(var i=0;i<this._linework.getNumGeometries();i++)for(var a=this._linework.getGeometryN(i).getCoordinateSequence(),c=0;c<a.size()-1;c++)if(a.getCoordinate(c,this._seg.p0),a.getCoordinate(c+1,this._seg.p1),this._seg.distance(r)<=this._boundaryDistanceTolerance)return!0;return!1},ks.prototype.getLocation=function(r){return this.isWithinToleranceOfBoundary(r)?K.BOUNDARY:this._ptLocator.locate(r,this._g)},ks.prototype.extractLinework=function(r){var i=new bu;r.apply(i);var a=i.getLinework(),c=Le.toLineStringArray(a);return r.getFactory().createMultiLineString(c)},ks.prototype.interfaces_=function(){return[]},ks.prototype.getClass=function(){return ks};var bu=function(){this._linework=null,this._linework=new G};bu.prototype.getLinework=function(){return this._linework},bu.prototype.filter=function(r){if(r instanceof de){var i=r;this._linework.add(i.getExteriorRing());for(var a=0;a<i.getNumInteriorRing();a++)this._linework.add(i.getInteriorRingN(a))}},bu.prototype.interfaces_=function(){return[pr]},bu.prototype.getClass=function(){return bu};var va=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var r=arguments[0];this._g=r};va.prototype.extractPoints=function(r,i,a){for(var c=r.getCoordinates(),d=0;d<c.length-1;d++)this.computeOffsetPoints(c[d],c[d+1],i,a)},va.prototype.setSidesToGenerate=function(r,i){this._doLeft=r,this._doRight=i},va.prototype.getPoints=function(r){for(var i=new G,a=_e.getLines(this._g).iterator();a.hasNext();){var c=a.next();this.extractPoints(c,r,i)}return i},va.prototype.computeOffsetPoints=function(r,i,a,c){var d=i.x-r.x,v=i.y-r.y,M=Math.sqrt(d*d+v*v),L=a*d/M,H=a*v/M,it=(i.x+r.x)/2,bt=(i.y+r.y)/2;if(this._doLeft){var Tt=new D(it-H,bt+L);c.add(Tt)}if(this._doRight){var Kt=new D(it+H,bt-L);c.add(Kt)}},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var ci=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new G;var i=arguments[0],a=arguments[1],c=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(i,a),this._geom=[i,a,c],this._locFinder=[new ks(this._geom[0],this._boundaryDistanceTolerance),new ks(this._geom[1],this._boundaryDistanceTolerance),new ks(this._geom[2],this._boundaryDistanceTolerance)]},Au={TOLERANCE:{configurable:!0}};ci.prototype.reportResult=function(r,i,a){te.out.println("Overlay result invalid - A:"+K.toLocationSymbol(i[0])+" B:"+K.toLocationSymbol(i[1])+" expected:"+(a?"i":"e")+" actual:"+K.toLocationSymbol(i[2]))},ci.prototype.isValid=function(r){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var i=this.checkValid(r);return i},ci.prototype.checkValid=function(){if(arguments.length===1){for(var r=arguments[0],i=0;i<this._testCoords.size();i++){var a=this._testCoords.get(i);if(!this.checkValid(r,a))return this._invalidLocation=a,!1}return!0}if(arguments.length===2){var c=arguments[0],d=arguments[1];return this._location[0]=this._locFinder[0].getLocation(d),this._location[1]=this._locFinder[1].getLocation(d),this._location[2]=this._locFinder[2].getLocation(d),!!ci.hasLocation(this._location,K.BOUNDARY)||this.isValidResult(c,this._location)}},ci.prototype.addTestPts=function(r){var i=new va(r);this._testCoords.addAll(i.getPoints(5*this._boundaryDistanceTolerance))},ci.prototype.isValidResult=function(r,i){var a=Re.isResultOfOp(i[0],i[1],r),c=!(a^i[2]===K.INTERIOR);return c||this.reportResult(r,i,a),c},ci.prototype.getInvalidLocation=function(){return this._invalidLocation},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.hasLocation=function(r,i){for(var a=0;a<3;a++)if(r[a]===i)return!0;return!1},ci.computeBoundaryDistanceTolerance=function(r,i){return Math.min(fr.computeSizeBasedSnapTolerance(r),fr.computeSizeBasedSnapTolerance(i))},ci.isValid=function(r,i,a,c){return new ci(r,i,c).isValid(a)},Au.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(ci,Au);var Di=function r(i){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(i),this._inputGeoms=i};Di.prototype.extractElements=function(r,i){if(r===null)return null;for(var a=0;a<r.getNumGeometries();a++){var c=r.getGeometryN(a);this._skipEmpty&&c.isEmpty()||i.add(c)}},Di.prototype.combine=function(){for(var r=new G,i=this._inputGeoms.iterator();i.hasNext();){var a=i.next();this.extractElements(a,r)}return r.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(r)},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.combine=function(){if(arguments.length===1){var r=arguments[0];return new Di(r).combine()}if(arguments.length===2){var i=arguments[0],a=arguments[1];return new Di(Di.createList(i,a)).combine()}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];return new Di(Di.createList(c,d,v)).combine()}},Di.extractFactory=function(r){return r.isEmpty()?null:r.iterator().next().getFactory()},Di.createList=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new G;return a.add(r),a.add(i),a}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2],M=new G;return M.add(c),M.add(d),M.add(v),M}};var U=function(){this._inputPolys=null,this._geomFactory=null;var r=arguments[0];this._inputPolys=r,this._inputPolys===null&&(this._inputPolys=new G)},Ya={STRTREE_NODE_CAPACITY:{configurable:!0}};U.prototype.reduceToGeometries=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next(),d=null;Q(c,Et)?d=this.unionTree(c):c instanceof Vt&&(d=c),i.add(d)}return i},U.prototype.extractByEnvelope=function(r,i,a){for(var c=new G,d=0;d<i.getNumGeometries();d++){var v=i.getGeometryN(d);v.getEnvelopeInternal().intersects(r)?c.add(v):a.add(v)}return this._geomFactory.buildGeometry(c)},U.prototype.unionOptimized=function(r,i){var a=r.getEnvelopeInternal(),c=i.getEnvelopeInternal();if(!a.intersects(c))return Di.combine(r,i);if(r.getNumGeometries()<=1&&i.getNumGeometries()<=1)return this.unionActual(r,i);var d=a.intersection(c);return this.unionUsingEnvelopeIntersection(r,i,d)},U.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var r=new Sf(U.STRTREE_NODE_CAPACITY),i=this._inputPolys.iterator();i.hasNext();){var a=i.next();r.insert(a.getEnvelopeInternal(),a)}this._inputPolys=null;var c=r.itemsTree();return this.unionTree(c)},U.prototype.binaryUnion=function(){if(arguments.length===1){var r=arguments[0];return this.binaryUnion(r,0,r.size())}if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2];if(c-a<=1){var d=U.getGeometry(i,a);return this.unionSafe(d,null)}if(c-a==2)return this.unionSafe(U.getGeometry(i,a),U.getGeometry(i,a+1));var v=Math.trunc((c+a)/2),M=this.binaryUnion(i,a,v),L=this.binaryUnion(i,v,c);return this.unionSafe(M,L)}},U.prototype.repeatedUnion=function(r){for(var i=null,a=r.iterator();a.hasNext();){var c=a.next();i=i===null?c.copy():i.union(c)}return i},U.prototype.unionSafe=function(r,i){return r===null&&i===null?null:r===null?i.copy():i===null?r.copy():this.unionOptimized(r,i)},U.prototype.unionActual=function(r,i){return U.restrictToPolygons(r.union(i))},U.prototype.unionTree=function(r){var i=this.reduceToGeometries(r);return this.binaryUnion(i)},U.prototype.unionUsingEnvelopeIntersection=function(r,i,a){var c=new G,d=this.extractByEnvelope(a,r,c),v=this.extractByEnvelope(a,i,c),M=this.unionActual(d,v);return c.add(M),Di.combine(c)},U.prototype.bufferUnion=function(){if(arguments.length===1){var r=arguments[0];return r.get(0).getFactory().buildGeometry(r).buffer(0)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i.getFactory().createGeometryCollection([i,a]).buffer(0)}},U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.restrictToPolygons=function(r){if(Q(r,we))return r;var i=se.getPolygons(r);return i.size()===1?i.get(0):r.getFactory().createMultiPolygon(Le.toPolygonArray(i))},U.getGeometry=function(r,i){return i>=r.size()?null:r.get(i)},U.union=function(r){return new U(r).union()},Ya.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(U,Ya);var _a=function(){};_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a},_a.union=function(r,i){if(r.isEmpty()||i.isEmpty()){if(r.isEmpty()&&i.isEmpty())return Re.createEmptyResult(Re.UNION,r,i,r.getFactory());if(r.isEmpty())return i.copy();if(i.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.UNION)},n.GeoJSONReader=ll,n.GeoJSONWriter=Ba,n.OverlayOp=Re,n.UnionOp=_a,n.BufferOp=Xr,Object.defineProperty(n,"__esModule",{value:!0})})});var AN=ot((vf,Uh)=>{(function(){var n,t="4.17.21",e=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",m=1,_=2,w=4,S=1,b=2,C=1,R=2,x=4,E=8,I=16,A=32,F=64,V=128,X=256,q=512,D=30,xt="...",B=800,j=16,K=1,Dt=2,Q=3,At=1/0,Mt=9007199254740991,Lt=17976931348623157e292,pt=NaN,yt=4294967295,J=yt-1,Bt=yt>>>1,Gt=[["ary",V],["bind",C],["bindKey",R],["curry",E],["curryRight",I],["flip",q],["partial",A],["partialRight",F],["rearg",X]],ae="[object Arguments]",ut="[object Array]",Ut="[object AsyncFunction]",jt="[object Boolean]",ce="[object Date]",te="[object DOMException]",$t="[object Error]",qt="[object Function]",xe="[object GeneratorFunction]",ft="[object Map]",Xe="[object Number]",ee="[object Null]",ge="[object Object]",fe="[object Promise]",Te="[object Proxy]",be="[object RegExp]",Wt="[object Set]",Me="[object String]",tt="[object Symbol]",z="[object Undefined]",It="[object WeakMap]",Ot="[object WeakSet]",dt="[object ArrayBuffer]",Ht="[object DataView]",Ce="[object Float32Array]",Vt="[object Float64Array]",Zt="[object Int8Array]",ne="[object Int16Array]",rt="[object Int32Array]",P="[object Uint8Array]",N="[object Uint8ClampedArray]",k="[object Uint16Array]",$="[object Uint32Array]",W=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,Et=/[&<>"']/g,G=RegExp(wt.source),st=RegExp(Et.source),et=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,me=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,He=/[\\^$.*+?()[\]{}|]/g,Ue=RegExp(He.source),Ye=/^\s+/,Qe=/\s/,wr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Kr=/\{\n\/\* \[wrapped with (.+)\] \*/,nr=/,? & /,Ie=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rr=/[()=,{}\[\]\/\s]/,pr=/\\(\\)?/g,ur=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qn=/\w*$/,bi=/^[-+]0x[0-9a-f]+$/i,oi=/^0b[01]+$/i,Z=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,Rt=/^(?:0|[1-9]\d*)$/,St=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,he=/['\n\r\u2028\u2029\\]/g,ue="\\ud800-\\udfff",we="\\u0300-\\u036f",de="\\ufe20-\\ufe2f",Be="\\u20d0-\\u20ff",Ae=we+de+Be,Pe="\\u2700-\\u27bf",rn="a-z\\xdf-\\xf6\\xf8-\\xff",si="\\xac\\xb1\\xd7\\xf7",br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wi="\\u2000-\\u206f",sr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="A-Z\\xc0-\\xd6\\xd8-\\xde",Fa="\\ufe0e\\ufe0f",on=si+br+Wi+sr,fo="['\u2019]",ul="["+ue+"]",Ge="["+on+"]",ys="["+Ae+"]",ir="\\d+",jo="["+Pe+"]",Le="["+rn+"]",Ai="[^"+ue+on+ir+Pe+rn+ye+"]",Ua="\\ud83c[\\udffb-\\udfff]",yu="(?:"+ys+"|"+Ua+")",Ti="[^"+ue+"]",Po="(?:\\ud83c[\\udde6-\\uddff]){2}",ll="[\\ud800-\\udbff][\\udc00-\\udfff]",Ba="["+ye+"]",Xt="\\u200d",cl="(?:"+Le+"|"+Ai+")",Io="(?:"+Ba+"|"+Ai+")",Qo="(?:"+fo+"(?:d|ll|m|re|s|t|ve))?",fl="(?:"+fo+"(?:D|LL|M|RE|S|T|VE))?",Jr=yu+"?",Zn="["+Fa+"]?",On="(?:"+Xt+"(?:"+[Ti,Po,ll].join("|")+")"+Zn+Jr+")*",Ar="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",em="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bh=Zn+Jr+On,Xi="(?:"+[jo,Po,ll].join("|")+")"+Bh,Kl="(?:"+[Ti+ys+"?",ys,Po,ll,ul].join("|")+")",Ro=RegExp(fo,"g"),Yn=RegExp(ys,"g"),za=RegExp(Ua+"(?="+Ua+")|"+Kl+Bh,"g"),jr=RegExp([Ba+"?"+Le+"+"+Qo+"(?="+[Ge,Ba,"$"].join("|")+")",Io+"+"+fl+"(?="+[Ge,Ba+cl,"$"].join("|")+")",Ba+"?"+cl+"+"+Qo,Ba+"+"+fl,em,Ar,ir,Xi].join("|"),"g"),Ef=RegExp("["+Xt+ue+Ae+Fa+"]"),vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ci=-1,or={};or[Ce]=or[Vt]=or[Zt]=or[ne]=or[rt]=or[P]=or[N]=or[k]=or[$]=!0,or[ae]=or[ut]=or[dt]=or[jt]=or[Ht]=or[ce]=or[$t]=or[qt]=or[ft]=or[Xe]=or[ge]=or[be]=or[Wt]=or[Me]=or[It]=!1;var tn={};tn[ae]=tn[ut]=tn[dt]=tn[Ht]=tn[jt]=tn[ce]=tn[Ce]=tn[Vt]=tn[Zt]=tn[ne]=tn[rt]=tn[ft]=tn[Xe]=tn[ge]=tn[be]=tn[Wt]=tn[Me]=tn[tt]=tn[P]=tn[N]=tn[k]=tn[$]=!0,tn[$t]=tn[qt]=tn[It]=!1;var vs={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Us={"&":"&","<":"<",">":">",'"':""","'":"'"},Ga={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ir={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zh=parseFloat,ho=parseInt,Sr=typeof global=="object"&&global&&global.Object===Object&&global,Fr=typeof self=="object"&&self&&self.Object===Object&&self,Ur=Sr||Fr||Function("return this")(),wf=typeof vf=="object"&&vf&&!vf.nodeType&&vf,Lo=wf&&typeof Uh=="object"&&Uh&&!Uh.nodeType&&Uh,Sf=Lo&&Lo.exports===wf,Jl=Sf&&Sr.process,lr=function(){try{var gt=Lo&&Lo.require&&Lo.require("util").types;return gt||Jl&&Jl.binding&&Jl.binding("util")}catch(Nt){}}(),_s=lr&&lr.isArrayBuffer,Qr=lr&&lr.isDate,ua=lr&&lr.isMap,No=lr&&lr.isRegExp,_u=lr&&lr.isSet,mr=lr&&lr.isTypedArray;function ie(gt,Nt,Ct){switch(Ct.length){case 0:return gt.call(Nt);case 1:return gt.call(Nt,Ct[0]);case 2:return gt.call(Nt,Ct[0],Ct[1]);case 3:return gt.call(Nt,Ct[0],Ct[1],Ct[2])}return gt.apply(Nt,Ct)}function Gh(gt,Nt,Ct,se){for(var _e=-1,qe=gt==null?0:gt.length;++_e<qe;){var ln=gt[_e];Nt(se,ln,Ct(ln),gt)}return se}function Pi(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se&&Nt(gt[Ct],Ct,gt)!==!1;);return gt}function Ii(gt,Nt){for(var Ct=gt==null?0:gt.length;Ct--&&Nt(gt[Ct],Ct,gt)!==!1;);return gt}function po(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se;)if(!Nt(gt[Ct],Ct,gt))return!1;return!0}function Yi(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length,_e=0,qe=[];++Ct<se;){var ln=gt[Ct];Nt(ln,Ct,gt)&&(qe[_e++]=ln)}return qe}function la(gt,Nt){var Ct=gt==null?0:gt.length;return!!Ct&&xs(gt,Nt,0)>-1}function hl(gt,Nt,Ct){for(var se=-1,_e=gt==null?0:gt.length;++se<_e;)if(Ct(Nt,gt[se]))return!0;return!1}function Mr(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length,_e=Array(se);++Ct<se;)_e[Ct]=Nt(gt[Ct],Ct,gt);return _e}function ke(gt,Nt){for(var Ct=-1,se=Nt.length,_e=gt.length;++Ct<se;)gt[_e+Ct]=Nt[Ct];return gt}function Oo(gt,Nt,Ct,se){var _e=-1,qe=gt==null?0:gt.length;for(se&&qe&&(Ct=gt[++_e]);++_e<qe;)Ct=Nt(Ct,gt[_e],_e,gt);return Ct}function yr(gt,Nt,Ct,se){var _e=gt==null?0:gt.length;for(se&&_e&&(Ct=gt[--_e]);_e--;)Ct=Nt(Ct,gt[_e],_e,gt);return Ct}function ka(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se;)if(Nt(gt[Ct],Ct,gt))return!0;return!1}var $i=Es("length");function kh(gt){return gt.split("")}function Ve(gt){return gt.match(Ie)||[]}function ca(gt,Nt,Ct){var se;return Ct(gt,function(_e,qe,ln){if(Nt(_e,qe,ln))return se=qe,!1}),se}function Kn(gt,Nt,Ct,se){for(var _e=gt.length,qe=Ct+(se?1:-1);se?qe--:++qe<_e;)if(Nt(gt[qe],qe,gt))return qe;return-1}function xs(gt,Nt,Ct){return Nt===Nt?pl(gt,Nt,Ct):Kn(gt,fa,Ct)}function pi(gt,Nt,Ct,se){for(var _e=Ct-1,qe=gt.length;++_e<qe;)if(se(gt[_e],Nt))return _e;return-1}function fa(gt){return gt!==gt}function Mf(gt,Nt){var Ct=gt==null?0:gt.length;return Ct?go(gt,Nt)/Ct:pt}function Es(gt){return function(Nt){return Nt==null?n:Nt[gt]}}function Ke(gt){return function(Nt){return gt==null?n:gt[Nt]}}function Zi(gt,Nt,Ct,se,_e){return _e(gt,function(qe,ln,cr){Ct=se?(se=!1,qe):Nt(Ct,qe,ln,cr)}),Ct}function xu(gt,Nt){var Ct=gt.length;for(gt.sort(Nt);Ct--;)gt[Ct]=gt[Ct].value;return gt}function go(gt,Nt){for(var Ct,se=-1,_e=gt.length;++se<_e;){var qe=Nt(gt[se]);qe!==n&&(Ct=Ct===n?qe:Ct+qe)}return Ct}function di(gt,Nt){for(var Ct=-1,se=Array(gt);++Ct<gt;)se[Ct]=Nt(Ct);return se}function ti(gt,Nt){return Mr(Nt,function(Ct){return[Ct,gt[Ct]]})}function qh(gt){return gt&>.slice(0,pa(gt)+1).replace(Ye,"")}function io(gt){return function(Nt){return gt(Nt)}}function ts(gt,Nt){return Mr(Nt,function(Ct){return gt[Ct]})}function gi(gt,Nt){return gt.has(Nt)}function Bs(gt,Nt){for(var Ct=-1,se=gt.length;++Ct<se&&xs(Nt,gt[Ct],0)>-1;);return Ct}function Ri(gt,Nt){for(var Ct=gt.length;Ct--&&xs(Nt,gt[Ct],0)>-1;);return Ct}function Do(gt,Nt){for(var Ct=gt.length,se=0;Ct--;)gt[Ct]===Nt&&++se;return se}var es=Ke(vs),ha=Ke(Us);function ws(gt){return"\\"+Ir[gt]}function Vr(gt,Nt){return gt==null?n:gt[Nt]}function qa(gt){return Ef.test(gt)}function jl(gt){return vu.test(gt)}function ai(gt){for(var Nt,Ct=[];!(Nt=gt.next()).done;)Ct.push(Nt.value);return Ct}function ns(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se,_e){Ct[++Nt]=[_e,se]}),Ct}function mo(gt,Nt){return function(Ct){return gt(Nt(Ct))}}function zs(gt,Nt){for(var Ct=-1,se=gt.length,_e=0,qe=[];++Ct<se;){var ln=gt[Ct];(ln===Nt||ln===g)&&(gt[Ct]=g,qe[_e++]=Ct)}return qe}function Wr(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se){Ct[++Nt]=se}),Ct}function Hh(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se){Ct[++Nt]=[se,se]}),Ct}function pl(gt,Nt,Ct){for(var se=Ct-1,_e=gt.length;++se<_e;)if(gt[se]===Nt)return se;return-1}function Eu(gt,Nt,Ct){for(var se=Ct+1;se--;)if(gt[se]===Nt)return se;return se}function Ha(gt){return qa(gt)?Xr(gt):$i(gt)}function Fo(gt){return qa(gt)?wu(gt):kh(gt)}function pa(gt){for(var Nt=gt.length;Nt--&&Qe.test(gt.charAt(Nt)););return Nt}var rs=Ke(Ga);function Xr(gt){for(var Nt=za.lastIndex=0;za.test(gt);)++Nt;return Nt}function wu(gt){return gt.match(za)||[]}function ui(gt){return gt.match(jr)||[]}var is=function gt(Nt){Nt=Nt==null?Ur:Ki.defaults(Ur.Object(),Nt,Ki.pick(Ur,dr));var Ct=Nt.Array,se=Nt.Date,_e=Nt.Error,qe=Nt.Function,ln=Nt.Math,cr=Nt.Object,os=Nt.RegExp,Va=Nt.String,tr=Nt.TypeError,Nr=Ct.prototype,Uo=qe.prototype,ei=cr.prototype,Su=Nt["__core-js_shared__"],Ss=Uo.toString,sn=ei.hasOwnProperty,Li=0,Ql=function(){var u=/[^.]+$/.exec(Su&&Su.keys&&Su.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Rr=ei.toString,bf=Ss.call(cr),Bo=Ur._,Br=os("^"+Ss.call(sn).replace(He,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ni=Sf?Nt.Buffer:n,Ji=Nt.Symbol,Ms=Nt.Uint8Array,yo=Ni?Ni.allocUnsafe:n,bs=mo(cr.getPrototypeOf,cr),li=cr.create,zo=ei.propertyIsEnumerable,fr=Nr.splice,Af=Ji?Ji.isConcatSpreadable:n,Mu=Ji?Ji.iterator:n,Tr=Ji?Ji.toStringTag:n,Go=function(){try{var u=vl(cr,"defineProperty");return u({},"",{}),u}catch(f){}}(),Tf=Nt.clearTimeout!==Ur.clearTimeout&&Nt.clearTimeout,Wa=se&&se.now!==Ur.Date.now&&se.now,Gs=Nt.setTimeout!==Ur.setTimeout&&Nt.setTimeout,Cr=ln.ceil,zr=ln.floor,Xa=cr.getOwnPropertySymbols,Oi=Ni?Ni.isBuffer:n,tc=Nt.isFinite,ec=Nr.join,Yr=mo(cr.keys,cr),ni=ln.max,vr=ln.min,Vh=se.now,dl=Nt.parseInt,Wh=ln.random,nm=Nr.reverse,vo=vl(Nt,"DataView"),As=vl(Nt,"Map"),da=vl(Nt,"Promise"),ga=vl(Nt,"Set"),Ts=vl(Nt,"WeakMap"),ko=vl(cr,"create"),ma=Ts&&new Ts,ss={},ya=_l(vo),Re=_l(As),ks=_l(da),bu=_l(ga),va=_l(Ts),ci=Ji?Ji.prototype:n,Au=ci?ci.valueOf:n,Di=ci?ci.toString:n;function U(u){if($r(u)&&!We(u)&&!(u instanceof i)){if(u instanceof r)return u;if(sn.call(u,"__wrapped__"))return Gx(u)}return new r(u)}var Ya=function(){function u(){}return function(f){if(!Gr(f))return{};if(li)return li(f);u.prototype=f;var y=new u;return u.prototype=n,y}}();function _a(){}function r(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}U.templateSettings={escape:et,evaluate:lt,interpolate:Ft,variable:"",imports:{_:U}},U.prototype=_a.prototype,U.prototype.constructor=U,r.prototype=Ya(_a.prototype),r.prototype.constructor=r;function i(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=yt,this.__views__=[]}function a(){var u=new i(this.__wrapped__);return u.__actions__=qo(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qo(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qo(this.__views__),u}function c(){if(this.__filtered__){var u=new i(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function d(){var u=this.__wrapped__.value(),f=this.__dir__,y=We(u),T=f<0,O=y?u.length:0,Y=oO(0,O,this.__views__),nt=Y.start,ct=Y.end,_t=ct-nt,zt=T?ct:nt-1,kt=this.__iteratees__,Yt=kt.length,pe=0,Se=vr(_t,this.__takeCount__);if(!y||!T&&O==_t&&Se==_t)return lx(u,this.__actions__);var De=[];t:for(;_t--&&pe<Se;){zt+=f;for(var en=-1,Fe=u[zt];++en<Yt;){var Fn=kt[en],$n=Fn.iteratee,cs=Fn.type,Eo=$n(Fe);if(cs==Dt)Fe=Eo;else if(!Eo){if(cs==K)continue t;break t}}De[pe++]=Fe}return De}i.prototype=Ya(_a.prototype),i.prototype.constructor=i;function v(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function M(){this.__data__=ko?ko(null):{},this.size=0}function L(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}function H(u){var f=this.__data__;if(ko){var y=f[u];return y===p?n:y}return sn.call(f,u)?f[u]:n}function it(u){var f=this.__data__;return ko?f[u]!==n:sn.call(f,u)}function bt(u,f){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=ko&&f===n?p:f,this}v.prototype.clear=M,v.prototype.delete=L,v.prototype.get=H,v.prototype.has=it,v.prototype.set=bt;function Tt(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function Kt(){this.__data__=[],this.size=0}function Qt(u){var f=this.__data__,y=Xh(f,u);if(y<0)return!1;var T=f.length-1;return y==T?f.pop():fr.call(f,y,1),--this.size,!0}function le(u){var f=this.__data__,y=Xh(f,u);return y<0?n:f[y][1]}function Ee(u){return Xh(this.__data__,u)>-1}function Dn(u,f){var y=this.__data__,T=Xh(y,u);return T<0?(++this.size,y.push([u,f])):y[T][1]=f,this}Tt.prototype.clear=Kt,Tt.prototype.delete=Qt,Tt.prototype.get=le,Tt.prototype.has=Ee,Tt.prototype.set=Dn;function Jn(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function fi(){this.size=0,this.__data__={hash:new v,map:new(As||Tt),string:new v}}function as(u){var f=ip(this,u).delete(u);return this.size-=f?1:0,f}function qs(u){return ip(this,u).get(u)}function Cf(u){return ip(this,u).has(u)}function u2(u,f){var y=ip(this,u),T=y.size;return y.set(u,f),this.size+=y.size==T?0:1,this}Jn.prototype.clear=fi,Jn.prototype.delete=as,Jn.prototype.get=qs,Jn.prototype.has=Cf,Jn.prototype.set=u2;function gl(u){var f=-1,y=u==null?0:u.length;for(this.__data__=new Jn;++f<y;)this.add(u[f])}function l2(u){return this.__data__.set(u,p),this}function c2(u){return this.__data__.has(u)}gl.prototype.add=gl.prototype.push=l2,gl.prototype.has=c2;function Hs(u){var f=this.__data__=new Tt(u);this.size=f.size}function f2(){this.__data__=new Tt,this.size=0}function h2(u){var f=this.__data__,y=f.delete(u);return this.size=f.size,y}function p2(u){return this.__data__.get(u)}function d2(u){return this.__data__.has(u)}function g2(u,f){var y=this.__data__;if(y instanceof Tt){var T=y.__data__;if(!As||T.length<e-1)return T.push([u,f]),this.size=++y.size,this;y=this.__data__=new Jn(T)}return y.set(u,f),this.size=y.size,this}Hs.prototype.clear=f2,Hs.prototype.delete=h2,Hs.prototype.get=p2,Hs.prototype.has=d2,Hs.prototype.set=g2;function G1(u,f){var y=We(u),T=!y&&xl(u),O=!y&&!T&&Ru(u),Y=!y&&!T&&!O&&oc(u),nt=y||T||O||Y,ct=nt?di(u.length,Va):[],_t=ct.length;for(var zt in u)(f||sn.call(u,zt))&&!(nt&&(zt=="length"||O&&(zt=="offset"||zt=="parent")||Y&&(zt=="buffer"||zt=="byteLength"||zt=="byteOffset")||Ja(zt,_t)))&&ct.push(zt);return ct}function k1(u){var f=u.length;return f?u[pm(0,f-1)]:n}function m2(u,f){return op(qo(u),ml(f,0,u.length))}function y2(u){return op(qo(u))}function rm(u,f,y){(y!==n&&!Vs(u[f],y)||y===n&&!(f in u))&&$a(u,f,y)}function Pf(u,f,y){var T=u[f];(!(sn.call(u,f)&&Vs(T,y))||y===n&&!(f in u))&&$a(u,f,y)}function Xh(u,f){for(var y=u.length;y--;)if(Vs(u[y][0],f))return y;return-1}function v2(u,f,y,T){return Tu(u,function(O,Y,nt){f(T,O,y(O),nt)}),T}function q1(u,f){return u&&Ea(f,Fi(f),u)}function _2(u,f){return u&&Ea(f,Vo(f),u)}function $a(u,f,y){f=="__proto__"&&Go?Go(u,f,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[f]=y}function im(u,f){for(var y=-1,T=f.length,O=Ct(T),Y=u==null;++y<T;)O[y]=Y?n:Bm(u,f[y]);return O}function ml(u,f,y){return u===u&&(y!==n&&(u=u<=y?u:y),f!==n&&(u=u>=f?u:f)),u}function Cs(u,f,y,T,O,Y){var nt,ct=f&m,_t=f&_,zt=f&w;if(y&&(nt=O?y(u,T,O,Y):y(u)),nt!==n)return nt;if(!Gr(u))return u;var kt=We(u);if(kt){if(nt=aO(u),!ct)return qo(u,nt)}else{var Yt=oo(u),pe=Yt==qt||Yt==xe;if(Ru(u))return hx(u,ct);if(Yt==ge||Yt==ae||pe&&!O){if(nt=_t||pe?{}:Rx(u),!ct)return _t?K2(u,_2(nt,u)):Z2(u,q1(nt,u))}else{if(!tn[Yt])return O?u:{};nt=uO(u,Yt,ct)}}Y||(Y=new Hs);var Se=Y.get(u);if(Se)return Se;Y.set(u,nt),sE(u)?u.forEach(function(Fe){nt.add(Cs(Fe,f,y,Fe,u,Y))}):iE(u)&&u.forEach(function(Fe,Fn){nt.set(Fn,Cs(Fe,f,y,Fn,u,Y))});var De=zt?_t?Mm:Sm:_t?Vo:Fi,en=kt?n:De(u);return Pi(en||u,function(Fe,Fn){en&&(Fn=Fe,Fe=u[Fn]),Pf(nt,Fn,Cs(Fe,f,y,Fn,u,Y))}),nt}function x2(u){var f=Fi(u);return function(y){return H1(y,u,f)}}function H1(u,f,y){var T=y.length;if(u==null)return!T;for(u=cr(u);T--;){var O=y[T],Y=f[O],nt=u[O];if(nt===n&&!(O in u)||!Y(nt))return!1}return!0}function V1(u,f,y){if(typeof u!="function")throw new tr(s);return Ff(function(){u.apply(n,y)},f)}function If(u,f,y,T){var O=-1,Y=la,nt=!0,ct=u.length,_t=[],zt=f.length;if(!ct)return _t;y&&(f=Mr(f,io(y))),T?(Y=hl,nt=!1):f.length>=e&&(Y=gi,nt=!1,f=new gl(f));t:for(;++O<ct;){var kt=u[O],Yt=y==null?kt:y(kt);if(kt=T||kt!==0?kt:0,nt&&Yt===Yt){for(var pe=zt;pe--;)if(f[pe]===Yt)continue t;_t.push(kt)}else Y(f,Yt,T)||_t.push(kt)}return _t}var Tu=yx(xa),W1=yx(sm,!0);function E2(u,f){var y=!0;return Tu(u,function(T,O,Y){return y=!!f(T,O,Y),y}),y}function Yh(u,f,y){for(var T=-1,O=u.length;++T<O;){var Y=u[T],nt=f(Y);if(nt!=null&&(ct===n?nt===nt&&!ls(nt):y(nt,ct)))var ct=nt,_t=Y}return _t}function w2(u,f,y,T){var O=u.length;for(y=Je(y),y<0&&(y=-y>O?0:O+y),T=T===n||T>O?O:Je(T),T<0&&(T+=O),T=y>T?0:uE(T);y<T;)u[y++]=f;return u}function X1(u,f){var y=[];return Tu(u,function(T,O,Y){f(T,O,Y)&&y.push(T)}),y}function ji(u,f,y,T,O){var Y=-1,nt=u.length;for(y||(y=cO),O||(O=[]);++Y<nt;){var ct=u[Y];f>0&&y(ct)?f>1?ji(ct,f-1,y,T,O):ke(O,ct):T||(O[O.length]=ct)}return O}var om=vx(),Y1=vx(!0);function xa(u,f){return u&&om(u,f,Fi)}function sm(u,f){return u&&Y1(u,f,Fi)}function $h(u,f){return Yi(f,function(y){return ja(u[y])})}function yl(u,f){f=Pu(f,u);for(var y=0,T=f.length;u!=null&&y<T;)u=u[wa(f[y++])];return y&&y==T?u:n}function $1(u,f,y){var T=f(u);return We(u)?T:ke(T,y(u))}function _o(u){return u==null?u===n?z:ee:Tr&&Tr in cr(u)?iO(u):yO(u)}function am(u,f){return u>f}function S2(u,f){return u!=null&&sn.call(u,f)}function M2(u,f){return u!=null&&f in cr(u)}function b2(u,f,y){return u>=vr(f,y)&&u<ni(f,y)}function um(u,f,y){for(var T=y?hl:la,O=u[0].length,Y=u.length,nt=Y,ct=Ct(Y),_t=1/0,zt=[];nt--;){var kt=u[nt];nt&&f&&(kt=Mr(kt,io(f))),_t=vr(kt.length,_t),ct[nt]=!y&&(f||O>=120&&kt.length>=120)?new gl(nt&&kt):n}kt=u[0];var Yt=-1,pe=ct[0];t:for(;++Yt<O&&zt.length<_t;){var Se=kt[Yt],De=f?f(Se):Se;if(Se=y||Se!==0?Se:0,!(pe?gi(pe,De):T(zt,De,y))){for(nt=Y;--nt;){var en=ct[nt];if(!(en?gi(en,De):T(u[nt],De,y)))continue t}pe&&pe.push(De),zt.push(Se)}}return zt}function A2(u,f,y,T){return xa(u,function(O,Y,nt){f(T,y(O),Y,nt)}),T}function Rf(u,f,y){f=Pu(f,u),u=Dx(u,f);var T=u==null?u:u[wa(Is(f))];return T==null?n:ie(T,u,y)}function Z1(u){return $r(u)&&_o(u)==ae}function T2(u){return $r(u)&&_o(u)==dt}function C2(u){return $r(u)&&_o(u)==ce}function Lf(u,f,y,T,O){return u===f?!0:u==null||f==null||!$r(u)&&!$r(f)?u!==u&&f!==f:P2(u,f,y,T,Lf,O)}function P2(u,f,y,T,O,Y){var nt=We(u),ct=We(f),_t=nt?ut:oo(u),zt=ct?ut:oo(f);_t=_t==ae?ge:_t,zt=zt==ae?ge:zt;var kt=_t==ge,Yt=zt==ge,pe=_t==zt;if(pe&&Ru(u)){if(!Ru(f))return!1;nt=!0,kt=!1}if(pe&&!kt)return Y||(Y=new Hs),nt||oc(u)?Cx(u,f,y,T,O,Y):nO(u,f,_t,y,T,O,Y);if(!(y&S)){var Se=kt&&sn.call(u,"__wrapped__"),De=Yt&&sn.call(f,"__wrapped__");if(Se||De){var en=Se?u.value():u,Fe=De?f.value():f;return Y||(Y=new Hs),O(en,Fe,y,T,Y)}}return pe?(Y||(Y=new Hs),rO(u,f,y,T,O,Y)):!1}function I2(u){return $r(u)&&oo(u)==ft}function lm(u,f,y,T){var O=y.length,Y=O,nt=!T;if(u==null)return!Y;for(u=cr(u);O--;){var ct=y[O];if(nt&&ct[2]?ct[1]!==u[ct[0]]:!(ct[0]in u))return!1}for(;++O<Y;){ct=y[O];var _t=ct[0],zt=u[_t],kt=ct[1];if(nt&&ct[2]){if(zt===n&&!(_t in u))return!1}else{var Yt=new Hs;if(T)var pe=T(zt,kt,_t,u,f,Yt);if(!(pe===n?Lf(kt,zt,S|b,T,Yt):pe))return!1}}return!0}function K1(u){if(!Gr(u)||hO(u))return!1;var f=ja(u)?Br:Z;return f.test(_l(u))}function R2(u){return $r(u)&&_o(u)==be}function L2(u){return $r(u)&&oo(u)==Wt}function N2(u){return $r(u)&&fp(u.length)&&!!or[_o(u)]}function J1(u){return typeof u=="function"?u:u==null?Wo:typeof u=="object"?We(u)?tx(u[0],u[1]):Q1(u):_E(u)}function cm(u){if(!Df(u))return Yr(u);var f=[];for(var y in cr(u))sn.call(u,y)&&y!="constructor"&&f.push(y);return f}function O2(u){if(!Gr(u))return mO(u);var f=Df(u),y=[];for(var T in u)T=="constructor"&&(f||!sn.call(u,T))||y.push(T);return y}function fm(u,f){return u<f}function j1(u,f){var y=-1,T=Ho(u)?Ct(u.length):[];return Tu(u,function(O,Y,nt){T[++y]=f(O,Y,nt)}),T}function Q1(u){var f=Am(u);return f.length==1&&f[0][2]?Nx(f[0][0],f[0][1]):function(y){return y===u||lm(y,u,f)}}function tx(u,f){return Cm(u)&&Lx(f)?Nx(wa(u),f):function(y){var T=Bm(y,u);return T===n&&T===f?zm(y,u):Lf(f,T,S|b)}}function Zh(u,f,y,T,O){u!==f&&om(f,function(Y,nt){if(O||(O=new Hs),Gr(Y))D2(u,f,nt,y,Zh,T,O);else{var ct=T?T(Im(u,nt),Y,nt+"",u,f,O):n;ct===n&&(ct=Y),rm(u,nt,ct)}},Vo)}function D2(u,f,y,T,O,Y,nt){var ct=Im(u,y),_t=Im(f,y),zt=nt.get(_t);if(zt){rm(u,y,zt);return}var kt=Y?Y(ct,_t,y+"",u,f,nt):n,Yt=kt===n;if(Yt){var pe=We(_t),Se=!pe&&Ru(_t),De=!pe&&!Se&&oc(_t);kt=_t,pe||Se||De?We(ct)?kt=ct:ri(ct)?kt=qo(ct):Se?(Yt=!1,kt=hx(_t,!0)):De?(Yt=!1,kt=px(_t,!0)):kt=[]:Uf(_t)||xl(_t)?(kt=ct,xl(ct)?kt=lE(ct):(!Gr(ct)||ja(ct))&&(kt=Rx(_t))):Yt=!1}Yt&&(nt.set(_t,kt),O(kt,_t,T,Y,nt),nt.delete(_t)),rm(u,y,kt)}function ex(u,f){var y=u.length;if(y)return f+=f<0?y:0,Ja(f,y)?u[f]:n}function nx(u,f,y){f.length?f=Mr(f,function(Y){return We(Y)?function(nt){return yl(nt,Y.length===1?Y[0]:Y)}:Y}):f=[Wo];var T=-1;f=Mr(f,io(Ne()));var O=j1(u,function(Y,nt,ct){var _t=Mr(f,function(zt){return zt(Y)});return{criteria:_t,index:++T,value:Y}});return xu(O,function(Y,nt){return $2(Y,nt,y)})}function F2(u,f){return rx(u,f,function(y,T){return zm(u,T)})}function rx(u,f,y){for(var T=-1,O=f.length,Y={};++T<O;){var nt=f[T],ct=yl(u,nt);y(ct,nt)&&Nf(Y,Pu(nt,u),ct)}return Y}function U2(u){return function(f){return yl(f,u)}}function hm(u,f,y,T){var O=T?pi:xs,Y=-1,nt=f.length,ct=u;for(u===f&&(f=qo(f)),y&&(ct=Mr(u,io(y)));++Y<nt;)for(var _t=0,zt=f[Y],kt=y?y(zt):zt;(_t=O(ct,kt,_t,T))>-1;)ct!==u&&fr.call(ct,_t,1),fr.call(u,_t,1);return u}function ix(u,f){for(var y=u?f.length:0,T=y-1;y--;){var O=f[y];if(y==T||O!==Y){var Y=O;Ja(O)?fr.call(u,O,1):mm(u,O)}}return u}function pm(u,f){return u+zr(Wh()*(f-u+1))}function B2(u,f,y,T){for(var O=-1,Y=ni(Cr((f-u)/(y||1)),0),nt=Ct(Y);Y--;)nt[T?Y:++O]=u,u+=y;return nt}function dm(u,f){var y="";if(!u||f<1||f>Mt)return y;do f%2&&(y+=u),f=zr(f/2),f&&(u+=u);while(f);return y}function an(u,f){return Rm(Ox(u,f,Wo),u+"")}function z2(u){return k1(sc(u))}function G2(u,f){var y=sc(u);return op(y,ml(f,0,y.length))}function Nf(u,f,y,T){if(!Gr(u))return u;f=Pu(f,u);for(var O=-1,Y=f.length,nt=Y-1,ct=u;ct!=null&&++O<Y;){var _t=wa(f[O]),zt=y;if(_t==="__proto__"||_t==="constructor"||_t==="prototype")return u;if(O!=nt){var kt=ct[_t];zt=T?T(kt,_t,ct):n,zt===n&&(zt=Gr(kt)?kt:Ja(f[O+1])?[]:{})}Pf(ct,_t,zt),ct=ct[_t]}return u}var ox=ma?function(u,f){return ma.set(u,f),u}:Wo,k2=Go?function(u,f){return Go(u,"toString",{configurable:!0,enumerable:!1,value:km(f),writable:!0})}:Wo;function q2(u){return op(sc(u))}function Ps(u,f,y){var T=-1,O=u.length;f<0&&(f=-f>O?0:O+f),y=y>O?O:y,y<0&&(y+=O),O=f>y?0:y-f>>>0,f>>>=0;for(var Y=Ct(O);++T<O;)Y[T]=u[T+f];return Y}function H2(u,f){var y;return Tu(u,function(T,O,Y){return y=f(T,O,Y),!y}),!!y}function Kh(u,f,y){var T=0,O=u==null?T:u.length;if(typeof f=="number"&&f===f&&O<=Bt){for(;T<O;){var Y=T+O>>>1,nt=u[Y];nt!==null&&!ls(nt)&&(y?nt<=f:nt<f)?T=Y+1:O=Y}return O}return gm(u,f,Wo,y)}function gm(u,f,y,T){var O=0,Y=u==null?0:u.length;if(Y===0)return 0;f=y(f);for(var nt=f!==f,ct=f===null,_t=ls(f),zt=f===n;O<Y;){var kt=zr((O+Y)/2),Yt=y(u[kt]),pe=Yt!==n,Se=Yt===null,De=Yt===Yt,en=ls(Yt);if(nt)var Fe=T||De;else zt?Fe=De&&(T||pe):ct?Fe=De&&pe&&(T||!Se):_t?Fe=De&&pe&&!Se&&(T||!en):Se||en?Fe=!1:Fe=T?Yt<=f:Yt<f;Fe?O=kt+1:Y=kt}return vr(Y,J)}function sx(u,f){for(var y=-1,T=u.length,O=0,Y=[];++y<T;){var nt=u[y],ct=f?f(nt):nt;if(!y||!Vs(ct,_t)){var _t=ct;Y[O++]=nt===0?0:nt}}return Y}function ax(u){return typeof u=="number"?u:ls(u)?pt:+u}function us(u){if(typeof u=="string")return u;if(We(u))return Mr(u,us)+"";if(ls(u))return Di?Di.call(u):"";var f=u+"";return f=="0"&&1/u==-At?"-0":f}function Cu(u,f,y){var T=-1,O=la,Y=u.length,nt=!0,ct=[],_t=ct;if(y)nt=!1,O=hl;else if(Y>=e){var zt=f?null:tO(u);if(zt)return Wr(zt);nt=!1,O=gi,_t=new gl}else _t=f?[]:ct;t:for(;++T<Y;){var kt=u[T],Yt=f?f(kt):kt;if(kt=y||kt!==0?kt:0,nt&&Yt===Yt){for(var pe=_t.length;pe--;)if(_t[pe]===Yt)continue t;f&&_t.push(Yt),ct.push(kt)}else O(_t,Yt,y)||(_t!==ct&&_t.push(Yt),ct.push(kt))}return ct}function mm(u,f){return f=Pu(f,u),u=Dx(u,f),u==null||delete u[wa(Is(f))]}function ux(u,f,y,T){return Nf(u,f,y(yl(u,f)),T)}function Jh(u,f,y,T){for(var O=u.length,Y=T?O:-1;(T?Y--:++Y<O)&&f(u[Y],Y,u););return y?Ps(u,T?0:Y,T?Y+1:O):Ps(u,T?Y+1:0,T?O:Y)}function lx(u,f){var y=u;return y instanceof i&&(y=y.value()),Oo(f,function(T,O){return O.func.apply(O.thisArg,ke([T],O.args))},y)}function ym(u,f,y){var T=u.length;if(T<2)return T?Cu(u[0]):[];for(var O=-1,Y=Ct(T);++O<T;)for(var nt=u[O],ct=-1;++ct<T;)ct!=O&&(Y[O]=If(Y[O]||nt,u[ct],f,y));return Cu(ji(Y,1),f,y)}function cx(u,f,y){for(var T=-1,O=u.length,Y=f.length,nt={};++T<O;){var ct=T<Y?f[T]:n;y(nt,u[T],ct)}return nt}function vm(u){return ri(u)?u:[]}function _m(u){return typeof u=="function"?u:Wo}function Pu(u,f){return We(u)?u:Cm(u,f)?[u]:zx(hr(u))}var V2=an;function Iu(u,f,y){var T=u.length;return y=y===n?T:y,!f&&y>=T?u:Ps(u,f,y)}var fx=Tf||function(u){return Ur.clearTimeout(u)};function hx(u,f){if(f)return u.slice();var y=u.length,T=yo?yo(y):new u.constructor(y);return u.copy(T),T}function xm(u){var f=new u.constructor(u.byteLength);return new Ms(f).set(new Ms(u)),f}function W2(u,f){var y=f?xm(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function X2(u){var f=new u.constructor(u.source,Qn.exec(u));return f.lastIndex=u.lastIndex,f}function Y2(u){return Au?cr(Au.call(u)):{}}function px(u,f){var y=f?xm(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function dx(u,f){if(u!==f){var y=u!==n,T=u===null,O=u===u,Y=ls(u),nt=f!==n,ct=f===null,_t=f===f,zt=ls(f);if(!ct&&!zt&&!Y&&u>f||Y&&nt&&_t&&!ct&&!zt||T&&nt&&_t||!y&&_t||!O)return 1;if(!T&&!Y&&!zt&&u<f||zt&&y&&O&&!T&&!Y||ct&&y&&O||!nt&&O||!_t)return-1}return 0}function $2(u,f,y){for(var T=-1,O=u.criteria,Y=f.criteria,nt=O.length,ct=y.length;++T<nt;){var _t=dx(O[T],Y[T]);if(_t){if(T>=ct)return _t;var zt=y[T];return _t*(zt=="desc"?-1:1)}}return u.index-f.index}function gx(u,f,y,T){for(var O=-1,Y=u.length,nt=y.length,ct=-1,_t=f.length,zt=ni(Y-nt,0),kt=Ct(_t+zt),Yt=!T;++ct<_t;)kt[ct]=f[ct];for(;++O<nt;)(Yt||O<Y)&&(kt[y[O]]=u[O]);for(;zt--;)kt[ct++]=u[O++];return kt}function mx(u,f,y,T){for(var O=-1,Y=u.length,nt=-1,ct=y.length,_t=-1,zt=f.length,kt=ni(Y-ct,0),Yt=Ct(kt+zt),pe=!T;++O<kt;)Yt[O]=u[O];for(var Se=O;++_t<zt;)Yt[Se+_t]=f[_t];for(;++nt<ct;)(pe||O<Y)&&(Yt[Se+y[nt]]=u[O++]);return Yt}function qo(u,f){var y=-1,T=u.length;for(f||(f=Ct(T));++y<T;)f[y]=u[y];return f}function Ea(u,f,y,T){var O=!y;y||(y={});for(var Y=-1,nt=f.length;++Y<nt;){var ct=f[Y],_t=T?T(y[ct],u[ct],ct,y,u):n;_t===n&&(_t=u[ct]),O?$a(y,ct,_t):Pf(y,ct,_t)}return y}function Z2(u,f){return Ea(u,Tm(u),f)}function K2(u,f){return Ea(u,Px(u),f)}function jh(u,f){return function(y,T){var O=We(y)?Gh:v2,Y=f?f():{};return O(y,u,Ne(T,2),Y)}}function nc(u){return an(function(f,y){var T=-1,O=y.length,Y=O>1?y[O-1]:n,nt=O>2?y[2]:n;for(Y=u.length>3&&typeof Y=="function"?(O--,Y):n,nt&&xo(y[0],y[1],nt)&&(Y=O<3?n:Y,O=1),f=cr(f);++T<O;){var ct=y[T];ct&&u(f,ct,T,Y)}return f})}function yx(u,f){return function(y,T){if(y==null)return y;if(!Ho(y))return u(y,T);for(var O=y.length,Y=f?O:-1,nt=cr(y);(f?Y--:++Y<O)&&T(nt[Y],Y,nt)!==!1;);return y}}function vx(u){return function(f,y,T){for(var O=-1,Y=cr(f),nt=T(f),ct=nt.length;ct--;){var _t=nt[u?ct:++O];if(y(Y[_t],_t,Y)===!1)break}return f}}function J2(u,f,y){var T=f&C,O=Of(u);function Y(){var nt=this&&this!==Ur&&this instanceof Y?O:u;return nt.apply(T?y:this,arguments)}return Y}function _x(u){return function(f){f=hr(f);var y=qa(f)?Fo(f):n,T=y?y[0]:f.charAt(0),O=y?Iu(y,1).join(""):f.slice(1);return T[u]()+O}}function rc(u){return function(f){return Oo(yE(mE(f).replace(Ro,"")),u,"")}}function Of(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var y=Ya(u.prototype),T=u.apply(y,f);return Gr(T)?T:y}}function j2(u,f,y){var T=Of(u);function O(){for(var Y=arguments.length,nt=Ct(Y),ct=Y,_t=ic(O);ct--;)nt[ct]=arguments[ct];var zt=Y<3&&nt[0]!==_t&&nt[Y-1]!==_t?[]:zs(nt,_t);if(Y-=zt.length,Y<y)return Mx(u,f,Qh,O.placeholder,n,nt,zt,n,n,y-Y);var kt=this&&this!==Ur&&this instanceof O?T:u;return ie(kt,this,nt)}return O}function xx(u){return function(f,y,T){var O=cr(f);if(!Ho(f)){var Y=Ne(y,3);f=Fi(f),y=function(ct){return Y(O[ct],ct,O)}}var nt=u(f,y,T);return nt>-1?O[Y?f[nt]:nt]:n}}function Ex(u){return Ka(function(f){var y=f.length,T=y,O=r.prototype.thru;for(u&&f.reverse();T--;){var Y=f[T];if(typeof Y!="function")throw new tr(s);if(O&&!nt&&rp(Y)=="wrapper")var nt=new r([],!0)}for(T=nt?T:y;++T<y;){Y=f[T];var ct=rp(Y),_t=ct=="wrapper"?bm(Y):n;_t&&Pm(_t[0])&&_t[1]==(V|E|A|X)&&!_t[4].length&&_t[9]==1?nt=nt[rp(_t[0])].apply(nt,_t[3]):nt=Y.length==1&&Pm(Y)?nt[ct]():nt.thru(Y)}return function(){var zt=arguments,kt=zt[0];if(nt&&zt.length==1&&We(kt))return nt.plant(kt).value();for(var Yt=0,pe=y?f[Yt].apply(this,zt):kt;++Yt<y;)pe=f[Yt].call(this,pe);return pe}})}function Qh(u,f,y,T,O,Y,nt,ct,_t,zt){var kt=f&V,Yt=f&C,pe=f&R,Se=f&(E|I),De=f&q,en=pe?n:Of(u);function Fe(){for(var Fn=arguments.length,$n=Ct(Fn),cs=Fn;cs--;)$n[cs]=arguments[cs];if(Se)var Eo=ic(Fe),fs=Do($n,Eo);if(T&&($n=gx($n,T,O,Se)),Y&&($n=mx($n,Y,nt,Se)),Fn-=fs,Se&&Fn<zt){var ii=zs($n,Eo);return Mx(u,f,Qh,Fe.placeholder,y,$n,ii,ct,_t,zt-Fn)}var Ws=Yt?y:this,tu=pe?Ws[u]:u;return Fn=$n.length,ct?$n=vO($n,ct):De&&Fn>1&&$n.reverse(),kt&&_t<Fn&&($n.length=_t),this&&this!==Ur&&this instanceof Fe&&(tu=en||Of(tu)),tu.apply(Ws,$n)}return Fe}function wx(u,f){return function(y,T){return A2(y,u,f(T),{})}}function tp(u,f){return function(y,T){var O;if(y===n&&T===n)return f;if(y!==n&&(O=y),T!==n){if(O===n)return T;typeof y=="string"||typeof T=="string"?(y=us(y),T=us(T)):(y=ax(y),T=ax(T)),O=u(y,T)}return O}}function Em(u){return Ka(function(f){return f=Mr(f,io(Ne())),an(function(y){var T=this;return u(f,function(O){return ie(O,T,y)})})})}function ep(u,f){f=f===n?" ":us(f);var y=f.length;if(y<2)return y?dm(f,u):f;var T=dm(f,Cr(u/Ha(f)));return qa(f)?Iu(Fo(T),0,u).join(""):T.slice(0,u)}function Q2(u,f,y,T){var O=f&C,Y=Of(u);function nt(){for(var ct=-1,_t=arguments.length,zt=-1,kt=T.length,Yt=Ct(kt+_t),pe=this&&this!==Ur&&this instanceof nt?Y:u;++zt<kt;)Yt[zt]=T[zt];for(;_t--;)Yt[zt++]=arguments[++ct];return ie(pe,O?y:this,Yt)}return nt}function Sx(u){return function(f,y,T){return T&&typeof T!="number"&&xo(f,y,T)&&(y=T=n),f=Qa(f),y===n?(y=f,f=0):y=Qa(y),T=T===n?f<y?1:-1:Qa(T),B2(f,y,T,u)}}function np(u){return function(f,y){return typeof f=="string"&&typeof y=="string"||(f=Rs(f),y=Rs(y)),u(f,y)}}function Mx(u,f,y,T,O,Y,nt,ct,_t,zt){var kt=f&E,Yt=kt?nt:n,pe=kt?n:nt,Se=kt?Y:n,De=kt?n:Y;f|=kt?A:F,f&=~(kt?F:A),f&x||(f&=~(C|R));var en=[u,f,O,Se,Yt,De,pe,ct,_t,zt],Fe=y.apply(n,en);return Pm(u)&&Fx(Fe,en),Fe.placeholder=T,Ux(Fe,u,f)}function wm(u){var f=ln[u];return function(y,T){if(y=Rs(y),T=T==null?0:vr(Je(T),292),T&&tc(y)){var O=(hr(y)+"e").split("e"),Y=f(O[0]+"e"+(+O[1]+T));return O=(hr(Y)+"e").split("e"),+(O[0]+"e"+(+O[1]-T))}return f(y)}}var tO=ga&&1/Wr(new ga([,-0]))[1]==At?function(u){return new ga(u)}:Vm;function bx(u){return function(f){var y=oo(f);return y==ft?ns(f):y==Wt?Hh(f):ti(f,u(f))}}function Za(u,f,y,T,O,Y,nt,ct){var _t=f&R;if(!_t&&typeof u!="function")throw new tr(s);var zt=T?T.length:0;if(zt||(f&=~(A|F),T=O=n),nt=nt===n?nt:ni(Je(nt),0),ct=ct===n?ct:Je(ct),zt-=O?O.length:0,f&F){var kt=T,Yt=O;T=O=n}var pe=_t?n:bm(u),Se=[u,f,y,T,O,kt,Yt,Y,nt,ct];if(pe&&gO(Se,pe),u=Se[0],f=Se[1],y=Se[2],T=Se[3],O=Se[4],ct=Se[9]=Se[9]===n?_t?0:u.length:ni(Se[9]-zt,0),!ct&&f&(E|I)&&(f&=~(E|I)),!f||f==C)var De=J2(u,f,y);else f==E||f==I?De=j2(u,f,ct):(f==A||f==(C|A))&&!O.length?De=Q2(u,f,y,T):De=Qh.apply(n,Se);var en=pe?ox:Fx;return Ux(en(De,Se),u,f)}function Ax(u,f,y,T){return u===n||Vs(u,ei[y])&&!sn.call(T,y)?f:u}function Tx(u,f,y,T,O,Y){return Gr(u)&&Gr(f)&&(Y.set(f,u),Zh(u,f,n,Tx,Y),Y.delete(f)),u}function eO(u){return Uf(u)?n:u}function Cx(u,f,y,T,O,Y){var nt=y&S,ct=u.length,_t=f.length;if(ct!=_t&&!(nt&&_t>ct))return!1;var zt=Y.get(u),kt=Y.get(f);if(zt&&kt)return zt==f&&kt==u;var Yt=-1,pe=!0,Se=y&b?new gl:n;for(Y.set(u,f),Y.set(f,u);++Yt<ct;){var De=u[Yt],en=f[Yt];if(T)var Fe=nt?T(en,De,Yt,f,u,Y):T(De,en,Yt,u,f,Y);if(Fe!==n){if(Fe)continue;pe=!1;break}if(Se){if(!ka(f,function(Fn,$n){if(!gi(Se,$n)&&(De===Fn||O(De,Fn,y,T,Y)))return Se.push($n)})){pe=!1;break}}else if(!(De===en||O(De,en,y,T,Y))){pe=!1;break}}return Y.delete(u),Y.delete(f),pe}function nO(u,f,y,T,O,Y,nt){switch(y){case Ht:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case dt:return!(u.byteLength!=f.byteLength||!Y(new Ms(u),new Ms(f)));case jt:case ce:case Xe:return Vs(+u,+f);case $t:return u.name==f.name&&u.message==f.message;case be:case Me:return u==f+"";case ft:var ct=ns;case Wt:var _t=T&S;if(ct||(ct=Wr),u.size!=f.size&&!_t)return!1;var zt=nt.get(u);if(zt)return zt==f;T|=b,nt.set(u,f);var kt=Cx(ct(u),ct(f),T,O,Y,nt);return nt.delete(u),kt;case tt:if(Au)return Au.call(u)==Au.call(f)}return!1}function rO(u,f,y,T,O,Y){var nt=y&S,ct=Sm(u),_t=ct.length,zt=Sm(f),kt=zt.length;if(_t!=kt&&!nt)return!1;for(var Yt=_t;Yt--;){var pe=ct[Yt];if(!(nt?pe in f:sn.call(f,pe)))return!1}var Se=Y.get(u),De=Y.get(f);if(Se&&De)return Se==f&&De==u;var en=!0;Y.set(u,f),Y.set(f,u);for(var Fe=nt;++Yt<_t;){pe=ct[Yt];var Fn=u[pe],$n=f[pe];if(T)var cs=nt?T($n,Fn,pe,f,u,Y):T(Fn,$n,pe,u,f,Y);if(!(cs===n?Fn===$n||O(Fn,$n,y,T,Y):cs)){en=!1;break}Fe||(Fe=pe=="constructor")}if(en&&!Fe){var Eo=u.constructor,fs=f.constructor;Eo!=fs&&"constructor"in u&&"constructor"in f&&!(typeof Eo=="function"&&Eo instanceof Eo&&typeof fs=="function"&&fs instanceof fs)&&(en=!1)}return Y.delete(u),Y.delete(f),en}function Ka(u){return Rm(Ox(u,n,Hx),u+"")}function Sm(u){return $1(u,Fi,Tm)}function Mm(u){return $1(u,Vo,Px)}var bm=ma?function(u){return ma.get(u)}:Vm;function rp(u){for(var f=u.name+"",y=ss[f],T=sn.call(ss,f)?y.length:0;T--;){var O=y[T],Y=O.func;if(Y==null||Y==u)return O.name}return f}function ic(u){var f=sn.call(U,"placeholder")?U:u;return f.placeholder}function Ne(){var u=U.iteratee||qm;return u=u===qm?J1:u,arguments.length?u(arguments[0],arguments[1]):u}function ip(u,f){var y=u.__data__;return fO(f)?y[typeof f=="string"?"string":"hash"]:y.map}function Am(u){for(var f=Fi(u),y=f.length;y--;){var T=f[y],O=u[T];f[y]=[T,O,Lx(O)]}return f}function vl(u,f){var y=Vr(u,f);return K1(y)?y:n}function iO(u){var f=sn.call(u,Tr),y=u[Tr];try{u[Tr]=n;var T=!0}catch(Y){}var O=Rr.call(u);return T&&(f?u[Tr]=y:delete u[Tr]),O}var Tm=Xa?function(u){return u==null?[]:(u=cr(u),Yi(Xa(u),function(f){return zo.call(u,f)}))}:Wm,Px=Xa?function(u){for(var f=[];u;)ke(f,Tm(u)),u=bs(u);return f}:Wm,oo=_o;(vo&&oo(new vo(new ArrayBuffer(1)))!=Ht||As&&oo(new As)!=ft||da&&oo(da.resolve())!=fe||ga&&oo(new ga)!=Wt||Ts&&oo(new Ts)!=It)&&(oo=function(u){var f=_o(u),y=f==ge?u.constructor:n,T=y?_l(y):"";if(T)switch(T){case ya:return Ht;case Re:return ft;case ks:return fe;case bu:return Wt;case va:return It}return f});function oO(u,f,y){for(var T=-1,O=y.length;++T<O;){var Y=y[T],nt=Y.size;switch(Y.type){case"drop":u+=nt;break;case"dropRight":f-=nt;break;case"take":f=vr(f,u+nt);break;case"takeRight":u=ni(u,f-nt);break}}return{start:u,end:f}}function sO(u){var f=u.match(Kr);return f?f[1].split(nr):[]}function Ix(u,f,y){f=Pu(f,u);for(var T=-1,O=f.length,Y=!1;++T<O;){var nt=wa(f[T]);if(!(Y=u!=null&&y(u,nt)))break;u=u[nt]}return Y||++T!=O?Y:(O=u==null?0:u.length,!!O&&fp(O)&&Ja(nt,O)&&(We(u)||xl(u)))}function aO(u){var f=u.length,y=new u.constructor(f);return f&&typeof u[0]=="string"&&sn.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function Rx(u){return typeof u.constructor=="function"&&!Df(u)?Ya(bs(u)):{}}function uO(u,f,y){var T=u.constructor;switch(f){case dt:return xm(u);case jt:case ce:return new T(+u);case Ht:return W2(u,y);case Ce:case Vt:case Zt:case ne:case rt:case P:case N:case k:case $:return px(u,y);case ft:return new T;case Xe:case Me:return new T(u);case be:return X2(u);case Wt:return new T;case tt:return Y2(u)}}function lO(u,f){var y=f.length;if(!y)return u;var T=y-1;return f[T]=(y>1?"& ":"")+f[T],f=f.join(y>2?", ":" "),u.replace(wr,`{
|
|
7
|
+
`)}return r.toString()},ti.prototype.computeEdgeEndLabels=function(r){for(var i=this.iterator();i.hasNext();)i.next().computeLabel(r)},ti.prototype.computeLabelling=function(r){this.computeEdgeEndLabels(r[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var i=[!1,!1],a=this.iterator();a.hasNext();)for(var c=a.next().getLabel(),d=0;d<2;d++)c.isLine(d)&&c.getLocation(d)===K.BOUNDARY&&(i[d]=!0);for(var v=this.iterator();v.hasNext();)for(var M=v.next(),L=M.getLabel(),H=0;H<2;H++)if(L.isAnyNull(H)){var it=K.NONE;if(i[H])it=K.EXTERIOR;else{var bt=M.getCoordinate();it=this.getLocation(H,bt,r)}L.setAllLocationsIfNull(H,it)}},ti.prototype.getDegree=function(){return this._edgeMap.size()},ti.prototype.insertEdgeEnd=function(r,i){this._edgeMap.put(r,i),this._edgeList=null},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var qh=function(r){function i(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var a=null,c=null,d=this._SCANNING_FOR_INCOMING,v=0;v<this._resultAreaEdgeList.size();v++){var M=this._resultAreaEdgeList.get(v),L=M.getSym();if(M.getLabel().isArea())switch(a===null&&M.isInResult()&&(a=M),d){case this._SCANNING_FOR_INCOMING:if(!L.isInResult())continue;c=L,d=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;c.setNext(M),d=this._SCANNING_FOR_INCOMING}}if(d===this._LINKING_TO_OUTGOING){if(a===null)throw new Qo("no outgoing dirEdge found",this.getCoordinate());Wt.isTrue(a.isInResult(),"unable to link last incoming dirEdge"),c.setNext(a)}},i.prototype.insert=function(a){var c=a;this.insertEdgeEnd(c,c)},i.prototype.getRightmostEdge=function(){var a=this.getEdges(),c=a.size();if(c<1)return null;var d=a.get(0);if(c===1)return d;var v=a.get(c-1),M=d.getQuadrant(),L=v.getQuadrant();return Yn.isNorthern(M)&&Yn.isNorthern(L)?d:Yn.isNorthern(M)||Yn.isNorthern(L)?d.getDy()!==0?d:v.getDy()!==0?v:(Wt.shouldNeverReachHere("found two horizontal edges incident on node"),null):v},i.prototype.print=function(a){te.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var c=this.iterator();c.hasNext();){var d=c.next();a.print("out "),d.print(a),a.println(),a.print("in "),d.getSym().print(a),a.println()}},i.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new G;for(var a=this.iterator();a.hasNext();){var c=a.next();(c.isInResult()||c.getSym().isInResult())&&this._resultAreaEdgeList.add(c)}return this._resultAreaEdgeList},i.prototype.updateLabelling=function(a){for(var c=this.iterator();c.hasNext();){var d=c.next().getLabel();d.setAllLocationsIfNull(0,a.getLocation(0)),d.setAllLocationsIfNull(1,a.getLocation(1))}},i.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var a=null,c=null,d=this._edgeList.size()-1;d>=0;d--){var v=this._edgeList.get(d),M=v.getSym();c===null&&(c=M),a!==null&&M.setNext(a),a=v}c.setNext(a)},i.prototype.computeDepths=function(){if(arguments.length===1){var a=arguments[0],c=this.findIndex(a),d=a.getDepth(Xt.LEFT),v=a.getDepth(Xt.RIGHT),M=this.computeDepths(c+1,this._edgeList.size(),d);if(this.computeDepths(0,c,M)!==v)throw new Qo("depth mismatch at "+a.getCoordinate())}else if(arguments.length===3){for(var L=arguments[0],H=arguments[1],it=arguments[2],bt=L;bt<H;bt++){var Tt=this._edgeList.get(bt);Tt.setEdgeDepths(Xt.RIGHT,it),it=Tt.getDepth(Xt.LEFT)}return it}},i.prototype.mergeSymLabels=function(){for(var a=this.iterator();a.hasNext();){var c=a.next();c.getLabel().merge(c.getSym().getLabel())}},i.prototype.linkMinimalDirectedEdges=function(a){for(var c=null,d=null,v=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var L=this._resultAreaEdgeList.get(M),H=L.getSym();switch(c===null&&L.getEdgeRing()===a&&(c=L),v){case this._SCANNING_FOR_INCOMING:if(H.getEdgeRing()!==a)continue;d=H,v=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(L.getEdgeRing()!==a)continue;d.setNextMin(L),v=this._SCANNING_FOR_INCOMING}}v===this._LINKING_TO_OUTGOING&&(Wt.isTrue(c!==null,"found null for first outgoing dirEdge"),Wt.isTrue(c.getEdgeRing()===a,"unable to link last incoming dirEdge"),d.setNextMin(c))},i.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var a=0,c=this.iterator();c.hasNext();)c.next().isInResult()&&a++;return a}if(arguments.length===1){for(var d=arguments[0],v=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===d&&v++;return v}},i.prototype.getLabel=function(){return this._label},i.prototype.findCoveredLineEdges=function(){for(var a=K.NONE,c=this.iterator();c.hasNext();){var d=c.next(),v=d.getSym();if(!d.isLineEdge()){if(d.isInResult()){a=K.INTERIOR;break}if(v.isInResult()){a=K.EXTERIOR;break}}}if(a===K.NONE)return null;for(var M=a,L=this.iterator();L.hasNext();){var H=L.next(),it=H.getSym();H.isLineEdge()?H.getEdge().setCovered(M===K.INTERIOR):(H.isInResult()&&(M=K.EXTERIOR),it.isInResult()&&(M=K.INTERIOR))}},i.prototype.computeLabelling=function(a){r.prototype.computeLabelling.call(this,a),this._label=new On(K.NONE);for(var c=this.iterator();c.hasNext();)for(var d=c.next().getEdge().getLabel(),v=0;v<2;v++){var M=d.getLocation(v);M!==K.INTERIOR&&M!==K.BOUNDARY||this._label.setLocation(v,K.INTERIOR)}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ti),io=function(r){function i(){r.apply(this,arguments)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.createNode=function(a){return new Kl(a,new qh)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vu),ts=function r(){this._pts=null,this._orientation=null;var i=arguments[0];this._pts=i,this._orientation=r.orientation(i)};ts.prototype.compareTo=function(r){var i=r;return ts.compareOriented(this._pts,this._orientation,i._pts,i._orientation)},ts.prototype.interfaces_=function(){return[V]},ts.prototype.getClass=function(){return ts},ts.orientation=function(r){return lt.increasingDirection(r)===1},ts.compareOriented=function(r,i,a,c){for(var d=i?1:-1,v=c?1:-1,M=i?r.length:-1,L=c?a.length:-1,H=i?0:r.length-1,it=c?0:a.length-1;;){var bt=r[H].compareTo(a[it]);if(bt!==0)return bt;var Tt=(H+=d)===M,Kt=(it+=v)===L;if(Tt&&!Kt)return-1;if(!Tt&&Kt)return 1;if(Tt&&Kt)return 0}};var gi=function(){this._edges=new G,this._ocaMap=new w};gi.prototype.print=function(r){r.print("MULTILINESTRING ( ");for(var i=0;i<this._edges.size();i++){var a=this._edges.get(i);i>0&&r.print(","),r.print("(");for(var c=a.getCoordinates(),d=0;d<c.length;d++)d>0&&r.print(","),r.print(c[d].x+" "+c[d].y);r.println(")")}r.print(") ")},gi.prototype.addAll=function(r){for(var i=r.iterator();i.hasNext();)this.add(i.next())},gi.prototype.findEdgeIndex=function(r){for(var i=0;i<this._edges.size();i++)if(this._edges.get(i).equals(r))return i;return-1},gi.prototype.iterator=function(){return this._edges.iterator()},gi.prototype.getEdges=function(){return this._edges},gi.prototype.get=function(r){return this._edges.get(r)},gi.prototype.findEqualEdge=function(r){var i=new ts(r.getCoordinates());return this._ocaMap.get(i)},gi.prototype.add=function(r){this._edges.add(r);var i=new ts(r.getCoordinates());this._ocaMap.put(i,r)},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi};var Bs=function(){};Bs.prototype.processIntersections=function(r,i,a,c){},Bs.prototype.isDone=function(){},Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs};var Ri=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var r=arguments[0];this._li=r};Ri.prototype.isTrivialIntersection=function(r,i,a,c){if(r===a&&this._li.getIntersectionNum()===1){if(Ri.isAdjacentSegments(i,c))return!0;if(r.isClosed()){var d=r.size()-1;if(i===0&&c===d||c===0&&i===d)return!0}}return!1},Ri.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ri.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ri.prototype.getLineIntersector=function(){return this._li},Ri.prototype.hasProperIntersection=function(){return this._hasProper},Ri.prototype.processIntersections=function(r,i,a,c){if(r===a&&i===c)return null;this.numTests++;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(r,i,a,c)||(this._hasIntersection=!0,r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Ri.prototype.hasIntersection=function(){return this._hasIntersection},Ri.prototype.isDone=function(){return!1},Ri.prototype.hasInteriorIntersection=function(){return this._hasInterior},Ri.prototype.interfaces_=function(){return[Bs]},Ri.prototype.getClass=function(){return Ri},Ri.isAdjacentSegments=function(r,i){return Math.abs(r-i)===1};var Do=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var r=arguments[0],i=arguments[1],a=arguments[2];this.coord=new D(r),this.segmentIndex=i,this.dist=a};Do.prototype.getSegmentIndex=function(){return this.segmentIndex},Do.prototype.getCoordinate=function(){return this.coord},Do.prototype.print=function(r){r.print(this.coord),r.print(" seg # = "+this.segmentIndex),r.println(" dist = "+this.dist)},Do.prototype.compareTo=function(r){var i=r;return this.compare(i.segmentIndex,i.dist)},Do.prototype.isEndPoint=function(r){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===r},Do.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Do.prototype.getDistance=function(){return this.dist},Do.prototype.compare=function(r,i){return this.segmentIndex<r?-1:this.segmentIndex>r?1:this.dist<i?-1:this.dist>i?1:0},Do.prototype.interfaces_=function(){return[V]},Do.prototype.getClass=function(){return Do};var es=function(){this._nodeMap=new w,this.edge=null;var r=arguments[0];this.edge=r};es.prototype.print=function(r){r.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(r)},es.prototype.iterator=function(){return this._nodeMap.values().iterator()},es.prototype.addSplitEdges=function(r){this.addEndpoints();for(var i=this.iterator(),a=i.next();i.hasNext();){var c=i.next(),d=this.createSplitEdge(a,c);r.add(d),a=c}},es.prototype.addEndpoints=function(){var r=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[r],r,0)},es.prototype.createSplitEdge=function(r,i){var a=i.segmentIndex-r.segmentIndex+2,c=this.edge.pts[i.segmentIndex],d=i.dist>0||!i.coord.equals2D(c);d||a--;var v=new Array(a).fill(null),M=0;v[M++]=new D(r.coord);for(var L=r.segmentIndex+1;L<=i.segmentIndex;L++)v[M++]=this.edge.pts[L];return d&&(v[M]=i.coord),new jl(v,new On(this.edge._label))},es.prototype.add=function(r,i,a){var c=new Do(r,i,a),d=this._nodeMap.get(c);return d!==null?d:(this._nodeMap.put(c,c),c)},es.prototype.isIntersection=function(r){for(var i=this.iterator();i.hasNext();)if(i.next().coord.equals(r))return!0;return!1},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var ha=function(){};ha.prototype.getChainStartIndices=function(r){var i=0,a=new G;a.add(new pt(i));do{var c=this.findChainEnd(r,i);a.add(new pt(c)),i=c}while(i<r.length-1);return ha.toIntArray(a)},ha.prototype.findChainEnd=function(r,i){for(var a=Yn.quadrant(r[i],r[i+1]),c=i+1;c<r.length&&Yn.quadrant(r[c-1],r[c])===a;)c++;return c-1},ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha},ha.toIntArray=function(r){for(var i=new Array(r.size()).fill(null),a=0;a<i.length;a++)i[a]=r.get(a).intValue();return i};var ws=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new qt,this.env2=new qt;var r=arguments[0];this.e=r,this.pts=r.getCoordinates();var i=new ha;this.startIndex=i.getChainStartIndices(this.pts)};ws.prototype.getCoordinates=function(){return this.pts},ws.prototype.getMaxX=function(r){var i=this.pts[this.startIndex[r]].x,a=this.pts[this.startIndex[r+1]].x;return i>a?i:a},ws.prototype.getMinX=function(r){var i=this.pts[this.startIndex[r]].x,a=this.pts[this.startIndex[r+1]].x;return i<a?i:a},ws.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],c=arguments[3];this.computeIntersectsForChain(this.startIndex[r],this.startIndex[r+1],i,i.startIndex[a],i.startIndex[a+1],c)}else if(arguments.length===6){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=arguments[4],it=arguments[5],bt=this.pts[d],Tt=this.pts[v],Kt=M.pts[L],Qt=M.pts[H];if(v-d==1&&H-L==1)return it.addIntersections(this.e,d,M.e,L),null;if(this.env1.init(bt,Tt),this.env2.init(Kt,Qt),!this.env1.intersects(this.env2))return null;var le=Math.trunc((d+v)/2),Ee=Math.trunc((L+H)/2);d<le&&(L<Ee&&this.computeIntersectsForChain(d,le,M,L,Ee,it),Ee<H&&this.computeIntersectsForChain(d,le,M,Ee,H,it)),le<v&&(L<Ee&&this.computeIntersectsForChain(le,v,M,L,Ee,it),Ee<H&&this.computeIntersectsForChain(le,v,M,Ee,H,it))}},ws.prototype.getStartIndexes=function(){return this.startIndex},ws.prototype.computeIntersects=function(r,i){for(var a=0;a<this.startIndex.length-1;a++)for(var c=0;c<r.startIndex.length-1;c++)this.computeIntersectsForChain(a,r,c,i)},ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws};var Vr=function r(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var i=0;i<2;i++)for(var a=0;a<3;a++)this._depth[i][a]=r.NULL_VALUE},qa={NULL_VALUE:{configurable:!0}};Vr.prototype.getDepth=function(r,i){return this._depth[r][i]},Vr.prototype.setDepth=function(r,i,a){this._depth[r][i]=a},Vr.prototype.isNull=function(){if(arguments.length===0){for(var r=0;r<2;r++)for(var i=0;i<3;i++)if(this._depth[r][i]!==Vr.NULL_VALUE)return!1;return!0}if(arguments.length===1){var a=arguments[0];return this._depth[a][1]===Vr.NULL_VALUE}if(arguments.length===2){var c=arguments[0],d=arguments[1];return this._depth[c][d]===Vr.NULL_VALUE}},Vr.prototype.normalize=function(){for(var r=0;r<2;r++)if(!this.isNull(r)){var i=this._depth[r][1];this._depth[r][2]<i&&(i=this._depth[r][2]),i<0&&(i=0);for(var a=1;a<3;a++){var c=0;this._depth[r][a]>i&&(c=1),this._depth[r][a]=c}}},Vr.prototype.getDelta=function(r){return this._depth[r][Xt.RIGHT]-this._depth[r][Xt.LEFT]},Vr.prototype.getLocation=function(r,i){return this._depth[r][i]<=0?K.EXTERIOR:K.INTERIOR},Vr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Vr.prototype.add=function(){if(arguments.length===1)for(var r=arguments[0],i=0;i<2;i++)for(var a=1;a<3;a++){var c=r.getLocation(i,a);c!==K.EXTERIOR&&c!==K.INTERIOR||(this.isNull(i,a)?this._depth[i][a]=Vr.depthAtLocation(c):this._depth[i][a]+=Vr.depthAtLocation(c))}else if(arguments.length===3){var d=arguments[0],v=arguments[1];arguments[2]===K.INTERIOR&&this._depth[d][v]++}},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.depthAtLocation=function(r){return r===K.EXTERIOR?0:r===K.INTERIOR?1:Vr.NULL_VALUE},qa.NULL_VALUE.get=function(){return-1},Object.defineProperties(Vr,qa);var jl=function(r){function i(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new es(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Vr,this._depthDelta=0,arguments.length===1){var a=arguments[0];i.call(this,a,null)}else if(arguments.length===2){var c=arguments[0],d=arguments[1];this.pts=c,this._label=d}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.getDepth=function(){return this._depth},i.prototype.getCollapsedEdge=function(){var a=new Array(2).fill(null);return a[0]=this.pts[0],a[1]=this.pts[1],new i(a,On.toLineLabel(this._label))},i.prototype.isIsolated=function(){return this._isIsolated},i.prototype.getCoordinates=function(){return this.pts},i.prototype.setIsolated=function(a){this._isIsolated=a},i.prototype.setName=function(a){this._name=a},i.prototype.equals=function(a){if(!(a instanceof i))return!1;var c=a;if(this.pts.length!==c.pts.length)return!1;for(var d=!0,v=!0,M=this.pts.length,L=0;L<this.pts.length;L++)if(this.pts[L].equals2D(c.pts[L])||(d=!1),this.pts[L].equals2D(c.pts[--M])||(v=!1),!d&&!v)return!1;return!0},i.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var a=arguments[0];return this.pts[a]}},i.prototype.print=function(a){a.print("edge "+this._name+": "),a.print("LINESTRING (");for(var c=0;c<this.pts.length;c++)c>0&&a.print(","),a.print(this.pts[c].x+" "+this.pts[c].y);a.print(") "+this._label+" "+this._depthDelta)},i.prototype.computeIM=function(a){i.updateIM(this._label,a)},i.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},i.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},i.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},i.prototype.getDepthDelta=function(){return this._depthDelta},i.prototype.getNumPoints=function(){return this.pts.length},i.prototype.printReverse=function(a){a.print("edge "+this._name+": ");for(var c=this.pts.length-1;c>=0;c--)a.print(this.pts[c]+" ");a.println("")},i.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ws(this)),this._mce},i.prototype.getEnvelope=function(){if(this._env===null){this._env=new qt;for(var a=0;a<this.pts.length;a++)this._env.expandToInclude(this.pts[a])}return this._env},i.prototype.addIntersection=function(a,c,d,v){var M=new D(a.getIntersection(v)),L=c,H=a.getEdgeDistance(d,v),it=L+1;if(it<this.pts.length){var bt=this.pts[it];M.equals2D(bt)&&(L=it,H=0)}this.eiList.add(M,L,H)},i.prototype.toString=function(){var a=new Lt;a.append("edge "+this._name+": "),a.append("LINESTRING (");for(var c=0;c<this.pts.length;c++)c>0&&a.append(","),a.append(this.pts[c].x+" "+this.pts[c].y);return a.append(") "+this._label+" "+this._depthDelta),a.toString()},i.prototype.isPointwiseEqual=function(a){if(this.pts.length!==a.pts.length)return!1;for(var c=0;c<this.pts.length;c++)if(!this.pts[c].equals2D(a.pts[c]))return!1;return!0},i.prototype.setDepthDelta=function(a){this._depthDelta=a},i.prototype.getEdgeIntersectionList=function(){return this.eiList},i.prototype.addIntersections=function(a,c,d){for(var v=0;v<a.getIntersectionNum();v++)this.addIntersection(a,c,d,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.updateIM=function(){if(arguments.length!==2)return r.prototype.updateIM.apply(this,arguments);var a=arguments[0],c=arguments[1];c.setAtLeastIfValid(a.getLocation(0,Xt.ON),a.getLocation(1,Xt.ON),1),a.isArea()&&(c.setAtLeastIfValid(a.getLocation(0,Xt.LEFT),a.getLocation(1,Xt.LEFT),2),c.setAtLeastIfValid(a.getLocation(0,Xt.RIGHT),a.getLocation(1,Xt.RIGHT),2))},i}(Xi),ai=function(r){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new gi,this._bufParams=r||null};ai.prototype.setWorkingPrecisionModel=function(r){this._workingPrecisionModel=r},ai.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var a=i.getLabel(),c=r.getLabel();i.isPointwiseEqual(r)||(c=new On(r.getLabel())).flip(),a.merge(c);var d=ai.depthDelta(c),v=i.getDepthDelta()+d;i.setDepthDelta(v)}else this._edgeList.add(r),r.setDepthDelta(ai.depthDelta(r.getLabel()))},ai.prototype.buildSubgraphs=function(r,i){for(var a=new G,c=r.iterator();c.hasNext();){var d=c.next(),v=d.getRightmostCoordinate(),M=new fa(a).getDepth(v);d.computeDepth(M),d.findResultEdges(),a.add(d),i.add(d.getDirectedEdges(),d.getNodes())}},ai.prototype.createSubgraphs=function(r){for(var i=new G,a=r.getNodes().iterator();a.hasNext();){var c=a.next();if(!c.isVisited()){var d=new Jr;d.create(c),i.add(d)}}return ho.sort(i,ho.reverseOrder()),i},ai.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},ai.prototype.getNoder=function(r){if(this._workingNoder!==null)return this._workingNoder;var i=new hl,a=new z;return a.setPrecisionModel(r),i.setSegmentIntersector(new Ri(a)),i},ai.prototype.buffer=function(r,i){var a=this._workingPrecisionModel;a===null&&(a=r.getPrecisionModel()),this._geomFact=r.getFactory();var c=new pi(a,this._bufParams),d=new Zi(r,i,c).getCurves();if(d.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(d,a),this._graph=new dr(new io),this._graph.addEdges(this._edgeList.getEdges());var v=this.createSubgraphs(this._graph),M=new Ci(this._geomFact);this.buildSubgraphs(v,M);var L=M.getPolygons();return L.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(L)},ai.prototype.computeNodedEdges=function(r,i){var a=this.getNoder(i);a.computeNodes(r);for(var c=a.getNodedSubstrings().iterator();c.hasNext();){var d=c.next(),v=d.getCoordinates();if(v.length!==2||!v[0].equals2D(v[1])){var M=d.getData(),L=new jl(d.getCoordinates(),new On(M));this.insertUniqueEdge(L)}}},ai.prototype.setNoder=function(r){this._workingNoder=r},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.depthDelta=function(r){var i=r.getLocation(0,Xt.LEFT),a=r.getLocation(0,Xt.RIGHT);return i===K.INTERIOR&&a===K.EXTERIOR?1:i===K.EXTERIOR&&a===K.INTERIOR?-1:0},ai.convertSegStrings=function(r){for(var i=new Le,a=new G;r.hasNext();){var c=r.next(),d=i.createLineString(c.getCoordinates());a.add(d)}return i.buildGeometry(a)};var ns=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var r=arguments[0],i=arguments[1];this._noder=r,this._scaleFactor=i,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var a=arguments[0],c=arguments[1],d=arguments[2],v=arguments[3];this._noder=a,this._scaleFactor=c,this._offsetX=d,this._offsetY=v,this._isScaled=!this.isIntegerPrecision()}};ns.prototype.rescale=function(){if(Q(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var i=r.next();this.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var a=arguments[0],c=0;c<a.length;c++)a[c].x=a[c].x/this._scaleFactor+this._offsetX,a[c].y=a[c].y/this._scaleFactor+this._offsetY;a.length===2&&a[0].equals2D(a[1])&&te.out.println(a)}},ns.prototype.scale=function(){if(Q(arguments[0],at)){for(var r=arguments[0],i=new G,a=r.iterator();a.hasNext();){var c=a.next();i.add(new mr(this.scale(c.getCoordinates()),c.getData()))}return i}if(arguments[0]instanceof Array){for(var d=arguments[0],v=new Array(d.length).fill(null),M=0;M<d.length;M++)v[M]=new D(Math.round((d[M].x-this._offsetX)*this._scaleFactor),Math.round((d[M].y-this._offsetY)*this._scaleFactor),d[M].z);return lt.removeRepeatedPoints(v)}},ns.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ns.prototype.getNodedSubstrings=function(){var r=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(r),r},ns.prototype.computeNodes=function(r){var i=r;this._isScaled&&(i=this.scale(r)),this._noder.computeNodes(i)},ns.prototype.interfaces_=function(){return[Yi]},ns.prototype.getClass=function(){return ns};var mo=function(){this._li=new z,this._segStrings=null;var r=arguments[0];this._segStrings=r},zs={fact:{configurable:!0}};mo.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var i=r.next().getCoordinates();this.checkEndPtVertexIntersections(i[0],this._segStrings),this.checkEndPtVertexIntersections(i[i.length-1],this._segStrings)}else if(arguments.length===2){for(var a=arguments[0],c=arguments[1].iterator();c.hasNext();)for(var d=c.next().getCoordinates(),v=1;v<d.length-1;v++)if(d[v].equals(a))throw new Te("found endpt/interior pt intersection at index "+v+" :pt "+a)}},mo.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();)for(var i=r.next(),a=this._segStrings.iterator();a.hasNext();){var c=a.next();this.checkInteriorIntersections(i,c)}else if(arguments.length===2)for(var d=arguments[0],v=arguments[1],M=d.getCoordinates(),L=v.getCoordinates(),H=0;H<M.length-1;H++)for(var it=0;it<L.length-1;it++)this.checkInteriorIntersections(d,H,v,it);else if(arguments.length===4){var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=arguments[3];if(bt===Kt&&Tt===Qt)return null;var le=bt.getCoordinates()[Tt],Ee=bt.getCoordinates()[Tt+1],Dn=Kt.getCoordinates()[Qt],Jn=Kt.getCoordinates()[Qt+1];if(this._li.computeIntersection(le,Ee,Dn,Jn),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,le,Ee)||this.hasInteriorIntersection(this._li,Dn,Jn)))throw new Te("found non-noded intersection at "+le+"-"+Ee+" and "+Dn+"-"+Jn)}},mo.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mo.prototype.checkCollapses=function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var i=r.next();this.checkCollapses(i)}else if(arguments.length===1)for(var a=arguments[0].getCoordinates(),c=0;c<a.length-2;c++)this.checkCollapse(a[c],a[c+1],a[c+2])},mo.prototype.hasInteriorIntersection=function(r,i,a){for(var c=0;c<r.getIntersectionNum();c++){var d=r.getIntersection(c);if(!d.equals(i)&&!d.equals(a))return!0}return!1},mo.prototype.checkCollapse=function(r,i,a){if(r.equals(a))throw new Te("found non-noded collapse at "+mo.fact.createLineString([r,i,a]))},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},zs.fact.get=function(){return new Le},Object.defineProperties(mo,zs);var Wr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var r=arguments[0],i=arguments[1],a=arguments[2];if(this._originalPt=r,this._pt=r,this._scaleFactor=i,this._li=a,i<=0)throw new I("Scale factor must be non-zero");i!==1&&(this._pt=new D(this.scale(r.x),this.scale(r.y)),this._p0Scaled=new D,this._p1Scaled=new D),this.initCorners(this._pt)},Hh={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Wr.prototype.intersectsScaled=function(r,i){var a=Math.min(r.x,i.x),c=Math.max(r.x,i.x),d=Math.min(r.y,i.y),v=Math.max(r.y,i.y),M=this._maxx<a||this._minx>c||this._maxy<d||this._miny>v;if(M)return!1;var L=this.intersectsToleranceSquare(r,i);return Wt.isTrue(!(M&&L),"Found bad envelope test"),L},Wr.prototype.initCorners=function(r){this._minx=r.x-.5,this._maxx=r.x+.5,this._miny=r.y-.5,this._maxy=r.y+.5,this._corner[0]=new D(this._maxx,this._maxy),this._corner[1]=new D(this._minx,this._maxy),this._corner[2]=new D(this._minx,this._miny),this._corner[3]=new D(this._maxx,this._miny)},Wr.prototype.intersects=function(r,i){return this._scaleFactor===1?this.intersectsScaled(r,i):(this.copyScaled(r,this._p0Scaled),this.copyScaled(i,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Wr.prototype.scale=function(r){return Math.round(r*this._scaleFactor)},Wr.prototype.getCoordinate=function(){return this._originalPt},Wr.prototype.copyScaled=function(r,i){i.x=this.scale(r.x),i.y=this.scale(r.y)},Wr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var r=Wr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new qt(this._originalPt.x-r,this._originalPt.x+r,this._originalPt.y-r,this._originalPt.y+r)}return this._safeEnv},Wr.prototype.intersectsPixelClosure=function(r,i){return this._li.computeIntersection(r,i,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,i,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Wr.prototype.intersectsToleranceSquare=function(r,i){var a=!1,c=!1;return this._li.computeIntersection(r,i,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(r,i,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(a=!0),this._li.computeIntersection(r,i,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(c=!0),this._li.computeIntersection(r,i,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!a||!c)||!!r.equals(this._pt)||!!i.equals(this._pt))))},Wr.prototype.addSnappedNode=function(r,i){var a=r.getCoordinate(i),c=r.getCoordinate(i+1);return!!this.intersects(a,c)&&(r.addIntersection(this.getCoordinate(),i),!0)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Hh.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Wr,Hh);var pl=function(){this.tempEnv1=new qt,this.selectedSegment=new ie};pl.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var r=arguments[0],i=arguments[1];r.getLineSegment(i,this.selectedSegment),this.select(this.selectedSegment)}}},pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl};var Eu=function(){this._index=null;var r=arguments[0];this._index=r},Ha={HotPixelSnapAction:{configurable:!0}};Eu.prototype.snap=function(){if(arguments.length===1){var r=arguments[0];return this.snap(r,null,-1)}if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2],d=i.getSafeEnvelope(),v=new Fo(i,a,c);return this._index.query(d,{interfaces_:function(){return[Us]},visitItem:function(M){M.select(d,v)}}),v.isNodeAdded()}},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},Ha.HotPixelSnapAction.get=function(){return Fo},Object.defineProperties(Eu,Ha);var Fo=function(r){function i(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var a=arguments[0],c=arguments[1],d=arguments[2];this._hotPixel=a,this._parentEdge=c,this._hotPixelVertexIndex=d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.isNodeAdded=function(){return this._isNodeAdded},i.prototype.select=function(){if(arguments.length!==2)return r.prototype.select.apply(this,arguments);var a=arguments[0],c=arguments[1],d=a.getContext();if(this._parentEdge!==null&&d===this._parentEdge&&c===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(d,c)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pl),pa=function(){this._li=null,this._interiorIntersections=null;var r=arguments[0];this._li=r,this._interiorIntersections=new G};pa.prototype.processIntersections=function(r,i,a,c){if(r===a&&i===c)return null;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];if(this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var H=0;H<this._li.getIntersectionNum();H++)this._interiorIntersections.add(this._li.getIntersection(H));r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1)}},pa.prototype.isDone=function(){return!1},pa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pa.prototype.interfaces_=function(){return[Bs]},pa.prototype.getClass=function(){return pa};var rs=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var r=arguments[0];this._pm=r,this._li=new z,this._li.setPrecisionModel(r),this._scaleFactor=r.getScale()};rs.prototype.checkCorrectness=function(r){var i=mr.getNodedSubstrings(r),a=new mo(i);try{a.checkValid()}catch(c){if(!(c instanceof jt))throw c;c.printStackTrace()}},rs.prototype.getNodedSubstrings=function(){return mr.getNodedSubstrings(this._nodedSegStrings)},rs.prototype.snapRound=function(r,i){var a=this.findInteriorIntersections(r,i);this.computeIntersectionSnaps(a),this.computeVertexSnaps(r)},rs.prototype.findInteriorIntersections=function(r,i){var a=new pa(i);return this._noder.setSegmentIntersector(a),this._noder.computeNodes(r),a.getInteriorIntersections()},rs.prototype.computeVertexSnaps=function(){if(Q(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var i=r.next();this.computeVertexSnaps(i)}else if(arguments[0]instanceof mr)for(var a=arguments[0],c=a.getCoordinates(),d=0;d<c.length;d++){var v=new Wr(c[d],this._scaleFactor,this._li);this._pointSnapper.snap(v,a,d)&&a.addIntersection(c[d],d)}},rs.prototype.computeNodes=function(r){this._nodedSegStrings=r,this._noder=new hl,this._pointSnapper=new Eu(this._noder.getIndex()),this.snapRound(r,this._li)},rs.prototype.computeIntersectionSnaps=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next(),c=new Wr(a,this._scaleFactor,this._li);this._pointSnapper.snap(c)}},rs.prototype.interfaces_=function(){return[Yi]},rs.prototype.getClass=function(){return rs};var Xr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new ke,this._resultGeometry=null,this._saveException=null,arguments.length===1){var r=arguments[0];this._argGeom=r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this._argGeom=i,this._bufParams=a}},wu={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Xr.prototype.bufferFixedPrecision=function(r){var i=new ns(new rs(new Ge(1)),r.getScale()),a=new ai(this._bufParams);a.setWorkingPrecisionModel(r),a.setNoder(i),this._resultGeometry=a.buffer(this._argGeom,this._distance)},Xr.prototype.bufferReducedPrecision=function(){var r=this;if(arguments.length===0){for(var i=Xr.MAX_PRECISION_DIGITS;i>=0;i--){try{r.bufferReducedPrecision(i)}catch(v){if(!(v instanceof Qo))throw v;r._saveException=v}if(r._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var a=arguments[0],c=Xr.precisionScaleFactor(this._argGeom,this._distance,a),d=new Ge(c);this.bufferFixedPrecision(d)}},Xr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var r=this._argGeom.getFactory().getPrecisionModel();r.getType()===Ge.FIXED?this.bufferFixedPrecision(r):this.bufferReducedPrecision()},Xr.prototype.setQuadrantSegments=function(r){this._bufParams.setQuadrantSegments(r)},Xr.prototype.bufferOriginalPrecision=function(){try{var r=new ai(this._bufParams);this._resultGeometry=r.buffer(this._argGeom,this._distance)}catch(i){if(!(i instanceof Te))throw i;this._saveException=i}},Xr.prototype.getResultGeometry=function(r){return this._distance=r,this.computeGeometry(),this._resultGeometry},Xr.prototype.setEndCapStyle=function(r){this._bufParams.setEndCapStyle(r)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.bufferOp=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return new Xr(r).getResultGeometry(i)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Vt&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],d=arguments[2],v=new Xr(a);return v.setQuadrantSegments(d),v.getResultGeometry(c)}if(arguments[2]instanceof ke&&arguments[0]instanceof Vt&&typeof arguments[1]=="number"){var M=arguments[0],L=arguments[1],H=arguments[2];return new Xr(M,H).getResultGeometry(L)}}else if(arguments.length===4){var it=arguments[0],bt=arguments[1],Tt=arguments[2],Kt=arguments[3],Qt=new Xr(it);return Qt.setQuadrantSegments(Tt),Qt.setEndCapStyle(Kt),Qt.getResultGeometry(bt)}},Xr.precisionScaleFactor=function(r,i,a){var c=r.getEnvelopeInternal(),d=At.max(Math.abs(c.getMaxX()),Math.abs(c.getMaxY()),Math.abs(c.getMinX()),Math.abs(c.getMinY()))+2*(i>0?i:0),v=a-Math.trunc(Math.log(d)/Math.log(10)+1);return Math.pow(10,v)},wu.CAP_ROUND.get=function(){return ke.CAP_ROUND},wu.CAP_BUTT.get=function(){return ke.CAP_FLAT},wu.CAP_FLAT.get=function(){return ke.CAP_FLAT},wu.CAP_SQUARE.get=function(){return ke.CAP_SQUARE},wu.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Xr,wu);var ui=function(){this._pt=[new D,new D],this._distance=A.NaN,this._isNull=!0};ui.prototype.getCoordinates=function(){return this._pt},ui.prototype.getCoordinate=function(r){return this._pt[r]},ui.prototype.setMinimum=function(){if(arguments.length===1){var r=arguments[0];this.setMinimum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c<this._distance&&this.initialize(i,a,c)}},ui.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=r.distance(i),this._isNull=!1}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(c),this._distance=d,this._isNull=!1}},ui.prototype.getDistance=function(){return this._distance},ui.prototype.setMaximum=function(){if(arguments.length===1){var r=arguments[0];this.setMaximum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c>this._distance&&this.initialize(i,a,c)}},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var is=function(){};is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},is.computeDistance=function(){if(arguments[2]instanceof ui&&arguments[0]instanceof vt&&arguments[1]instanceof D)for(var r=arguments[0],i=arguments[1],a=arguments[2],c=r.getCoordinates(),d=new ie,v=0;v<c.length-1;v++){d.setCoordinates(c[v],c[v+1]);var M=d.closestPoint(i);a.setMinimum(M,i)}else if(arguments[2]instanceof ui&&arguments[0]instanceof de&&arguments[1]instanceof D){var L=arguments[0],H=arguments[1],it=arguments[2];is.computeDistance(L.getExteriorRing(),H,it);for(var bt=0;bt<L.getNumInteriorRing();bt++)is.computeDistance(L.getInteriorRingN(bt),H,it)}else if(arguments[2]instanceof ui&&arguments[0]instanceof Vt&&arguments[1]instanceof D){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2];if(Tt instanceof vt)is.computeDistance(Tt,Kt,Qt);else if(Tt instanceof de)is.computeDistance(Tt,Kt,Qt);else if(Tt instanceof Qn)for(var le=Tt,Ee=0;Ee<le.getNumGeometries();Ee++){var Dn=le.getGeometryN(Ee);is.computeDistance(Dn,Kt,Qt)}else Qt.setMinimum(Tt.getCoordinate(),Kt)}else if(arguments[2]instanceof ui&&arguments[0]instanceof ie&&arguments[1]instanceof D){var Jn=arguments[0],fi=arguments[1],as=arguments[2],qs=Jn.closestPoint(fi);as.setMinimum(qs,fi)}};var Ki=function(r){this._maxPtDist=new ui,this._inputGeom=r||null},gt={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ki.prototype.computeMaxMidpointDistance=function(r){var i=new Ct(this._inputGeom);r.apply(i),this._maxPtDist.setMaximum(i.getMaxPointDistance())},Ki.prototype.computeMaxVertexDistance=function(r){var i=new Nt(this._inputGeom);r.apply(i),this._maxPtDist.setMaximum(i.getMaxPointDistance())},Ki.prototype.findDistance=function(r){return this.computeMaxVertexDistance(r),this.computeMaxMidpointDistance(r),this._maxPtDist.getDistance()},Ki.prototype.getDistancePoints=function(){return this._maxPtDist},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki},gt.MaxPointDistanceFilter.get=function(){return Nt},gt.MaxMidpointDistanceFilter.get=function(){return Ct},Object.defineProperties(Ki,gt);var Nt=function(r){this._maxPtDist=new ui,this._minPtDist=new ui,this._geom=r||null};Nt.prototype.filter=function(r){this._minPtDist.initialize(),is.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Nt.prototype.getMaxPointDistance=function(){return this._maxPtDist},Nt.prototype.interfaces_=function(){return[rt]},Nt.prototype.getClass=function(){return Nt};var Ct=function(r){this._maxPtDist=new ui,this._minPtDist=new ui,this._geom=r||null};Ct.prototype.filter=function(r,i){if(i===0)return null;var a=r.getCoordinate(i-1),c=r.getCoordinate(i),d=new D((a.x+c.x)/2,(a.y+c.y)/2);this._minPtDist.initialize(),is.computeDistance(this._geom,d,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ct.prototype.isDone=function(){return!1},Ct.prototype.isGeometryChanged=function(){return!1},Ct.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ct.prototype.interfaces_=function(){return[ur]},Ct.prototype.getClass=function(){return Ct};var se=function(r){this._comps=r||null};se.prototype.filter=function(r){r instanceof de&&this._comps.add(r)},se.prototype.interfaces_=function(){return[pr]},se.prototype.getClass=function(){return se},se.getPolygons=function(){if(arguments.length===1){var r=arguments[0];return se.getPolygons(r,new G)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i instanceof de?a.add(i):i instanceof Qn&&i.apply(new se(a)),a}};var _e=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var r=arguments[0];this._lines=r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this._lines=i,this._isForcedToLineString=a}};_e.prototype.filter=function(r){if(this._isForcedToLineString&&r instanceof Ae){var i=r.getFactory().createLineString(r.getCoordinateSequence());return this._lines.add(i),null}r instanceof vt&&this._lines.add(r)},_e.prototype.setForceToLineString=function(r){this._isForcedToLineString=r},_e.prototype.interfaces_=function(){return[Ce]},_e.prototype.getClass=function(){return _e},_e.getGeometry=function(){if(arguments.length===1){var r=arguments[0];return r.getFactory().buildGeometry(_e.getLines(r))}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i.getFactory().buildGeometry(_e.getLines(i,a))}},_e.getLines=function(){if(arguments.length===1){var r=arguments[0];return _e.getLines(r,!1)}if(arguments.length===2){if(Q(arguments[0],at)&&Q(arguments[1],at)){for(var i=arguments[0],a=arguments[1],c=i.iterator();c.hasNext();){var d=c.next();_e.getLines(d,a)}return a}if(arguments[0]instanceof Vt&&typeof arguments[1]=="boolean"){var v=arguments[0],M=arguments[1],L=new G;return v.apply(new _e(L,M)),L}if(arguments[0]instanceof Vt&&Q(arguments[1],at)){var H=arguments[0],it=arguments[1];return H instanceof vt?it.add(H):H.apply(new _e(it)),it}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&Q(arguments[0],at)&&Q(arguments[1],at)){for(var bt=arguments[0],Tt=arguments[1],Kt=arguments[2],Qt=bt.iterator();Qt.hasNext();){var le=Qt.next();_e.getLines(le,Tt,Kt)}return Tt}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Vt&&Q(arguments[1],at)){var Ee=arguments[0],Dn=arguments[1],Jn=arguments[2];return Ee.apply(new _e(Dn,Jn)),Dn}}};var qe=function(){if(this._boundaryRule=P.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var r=arguments[0];if(r===null)throw new I("Rule must be non-null");this._boundaryRule=r}}};qe.prototype.locateInternal=function(){if(arguments[0]instanceof D&&arguments[1]instanceof de){var r=arguments[0],i=arguments[1];if(i.isEmpty())return K.EXTERIOR;var a=i.getExteriorRing(),c=this.locateInPolygonRing(r,a);if(c===K.EXTERIOR)return K.EXTERIOR;if(c===K.BOUNDARY)return K.BOUNDARY;for(var d=0;d<i.getNumInteriorRing();d++){var v=i.getInteriorRingN(d),M=this.locateInPolygonRing(r,v);if(M===K.INTERIOR)return K.EXTERIOR;if(M===K.BOUNDARY)return K.BOUNDARY}return K.INTERIOR}if(arguments[0]instanceof D&&arguments[1]instanceof vt){var L=arguments[0],H=arguments[1];if(!H.getEnvelopeInternal().intersects(L))return K.EXTERIOR;var it=H.getCoordinates();return H.isClosed()||!L.equals(it[0])&&!L.equals(it[it.length-1])?dt.isOnLine(L,it)?K.INTERIOR:K.EXTERIOR:K.BOUNDARY}if(arguments[0]instanceof D&&arguments[1]instanceof ue){var bt=arguments[0];return arguments[1].getCoordinate().equals2D(bt)?K.INTERIOR:K.EXTERIOR}},qe.prototype.locateInPolygonRing=function(r,i){return i.getEnvelopeInternal().intersects(r)?dt.locatePointInRing(r,i.getCoordinates()):K.EXTERIOR},qe.prototype.intersects=function(r,i){return this.locate(r,i)!==K.EXTERIOR},qe.prototype.updateLocationInfo=function(r){r===K.INTERIOR&&(this._isIn=!0),r===K.BOUNDARY&&this._numBoundaries++},qe.prototype.computeLocation=function(r,i){if(i instanceof ue&&this.updateLocationInfo(this.locateInternal(r,i)),i instanceof vt)this.updateLocationInfo(this.locateInternal(r,i));else if(i instanceof de)this.updateLocationInfo(this.locateInternal(r,i));else if(i instanceof bi)for(var a=i,c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);this.updateLocationInfo(this.locateInternal(r,d))}else if(i instanceof Pe)for(var v=i,M=0;M<v.getNumGeometries();M++){var L=v.getGeometryN(M);this.updateLocationInfo(this.locateInternal(r,L))}else if(i instanceof Qn)for(var H=new go(i);H.hasNext();){var it=H.next();it!==i&&this.computeLocation(r,it)}},qe.prototype.locate=function(r,i){return i.isEmpty()?K.EXTERIOR:i instanceof vt?this.locateInternal(r,i):i instanceof de?this.locateInternal(r,i):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(r,i),this._boundaryRule.isInBoundary(this._numBoundaries)?K.BOUNDARY:this._numBoundaries>0||this._isIn?K.INTERIOR:K.EXTERIOR)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var ln=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var i=arguments[0],a=arguments[1];r.call(this,i,r.INSIDE_AREA,a)}else if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._component=c,this._segIndex=d,this._pt=v}},cr={INSIDE_AREA:{configurable:!0}};ln.prototype.isInsideArea=function(){return this._segIndex===ln.INSIDE_AREA},ln.prototype.getCoordinate=function(){return this._pt},ln.prototype.getGeometryComponent=function(){return this._component},ln.prototype.getSegmentIndex=function(){return this._segIndex},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},cr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ln,cr);var os=function(r){this._pts=r||null};os.prototype.filter=function(r){r instanceof ue&&this._pts.add(r)},os.prototype.interfaces_=function(){return[pr]},os.prototype.getClass=function(){return os},os.getPoints=function(){if(arguments.length===1){var r=arguments[0];return r instanceof ue?ho.singletonList(r):os.getPoints(r,new G)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i instanceof ue?a.add(i):i instanceof Qn&&i.apply(new os(a)),a}};var Va=function(){this._locations=null;var r=arguments[0];this._locations=r};Va.prototype.filter=function(r){(r instanceof ue||r instanceof vt||r instanceof de)&&this._locations.add(new ln(r,0,r.getCoordinate()))},Va.prototype.interfaces_=function(){return[pr]},Va.prototype.getClass=function(){return Va},Va.getLocations=function(r){var i=new G;return r.apply(new Va(i)),i};var tr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new qe,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=[r,i],this._terminateDistance=0}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=c,this._terminateDistance=d}};tr.prototype.computeContainmentDistance=function(){if(arguments.length===0){var r=new Array(2).fill(null);if(this.computeContainmentDistance(0,r),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=1-i,d=se.getPolygons(this._geom[i]);if(d.size()>0){var v=Va.getLocations(this._geom[c]);if(this.computeContainmentDistance(v,d,a),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[c]=a[0],this._minDistanceLocation[i]=a[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Q(arguments[0],Et)&&Q(arguments[1],Et)){for(var M=arguments[0],L=arguments[1],H=arguments[2],it=0;it<M.size();it++)for(var bt=M.get(it),Tt=0;Tt<L.size();Tt++)if(this.computeContainmentDistance(bt,L.get(Tt),H),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ln&&arguments[1]instanceof de){var Kt=arguments[0],Qt=arguments[1],le=arguments[2],Ee=Kt.getCoordinate();if(K.EXTERIOR!==this._ptLocator.locate(Ee,Qt))return this._minDistance=0,le[0]=Kt,le[1]=new ln(Qt,Ee),null}}},tr.prototype.computeMinDistanceLinesPoints=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v);if(this.computeMinDistance(d,M,a),this._minDistance<=this._terminateDistance)return null}},tr.prototype.computeFacetDistance=function(){var r=new Array(2).fill(null),i=_e.getLines(this._geom[0]),a=_e.getLines(this._geom[1]),c=os.getPoints(this._geom[0]),d=os.getPoints(this._geom[1]);return this.computeMinDistanceLines(i,a,r),this.updateMinDistance(r,!1),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistanceLinesPoints(i,d,r),this.updateMinDistance(r,!1),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistanceLinesPoints(a,c,r),this.updateMinDistance(r,!0),this._minDistance<=this._terminateDistance?null:(r[0]=null,r[1]=null,this.computeMinDistancePoints(c,d,r),void this.updateMinDistance(r,!1))))},tr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},tr.prototype.updateMinDistance=function(r,i){if(r[0]===null)return null;i?(this._minDistanceLocation[0]=r[1],this._minDistanceLocation[1]=r[0]):(this._minDistanceLocation[0]=r[0],this._minDistanceLocation[1]=r[1])},tr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},tr.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof vt&&arguments[1]instanceof ue){var r=arguments[0],i=arguments[1],a=arguments[2];if(r.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var c=r.getCoordinates(),d=i.getCoordinate(),v=0;v<c.length-1;v++){var M=dt.distancePointLine(d,c[v],c[v+1]);if(M<this._minDistance){this._minDistance=M;var L=new ie(c[v],c[v+1]).closestPoint(d);a[0]=new ln(r,v,L),a[1]=new ln(i,0,d)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof vt&&arguments[1]instanceof vt){var H=arguments[0],it=arguments[1],bt=arguments[2];if(H.getEnvelopeInternal().distance(it.getEnvelopeInternal())>this._minDistance)return null;for(var Tt=H.getCoordinates(),Kt=it.getCoordinates(),Qt=0;Qt<Tt.length-1;Qt++)for(var le=0;le<Kt.length-1;le++){var Ee=dt.distanceLineLine(Tt[Qt],Tt[Qt+1],Kt[le],Kt[le+1]);if(Ee<this._minDistance){this._minDistance=Ee;var Dn=new ie(Tt[Qt],Tt[Qt+1]),Jn=new ie(Kt[le],Kt[le+1]),fi=Dn.closestPoints(Jn);bt[0]=new ln(H,Qt,fi[0]),bt[1]=new ln(it,le,fi[1])}if(this._minDistance<=this._terminateDistance)return null}}}},tr.prototype.computeMinDistancePoints=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v),L=d.getCoordinate().distance(M.getCoordinate());if(L<this._minDistance&&(this._minDistance=L,a[0]=new ln(d,0,d.getCoordinate()),a[1]=new ln(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},tr.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new I("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},tr.prototype.computeMinDistanceLines=function(r,i,a){for(var c=0;c<r.size();c++)for(var d=r.get(c),v=0;v<i.size();v++){var M=i.get(v);if(this.computeMinDistance(d,M,a),this._minDistance<=this._terminateDistance)return null}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.distance=function(r,i){return new tr(r,i).distance()},tr.isWithinDistance=function(r,i,a){return new tr(r,i,a).distance()<=a},tr.nearestPoints=function(r,i){return new tr(r,i).nearestPoints()};var Nr=function(){this._pt=[new D,new D],this._distance=A.NaN,this._isNull=!0};Nr.prototype.getCoordinates=function(){return this._pt},Nr.prototype.getCoordinate=function(r){return this._pt[r]},Nr.prototype.setMinimum=function(){if(arguments.length===1){var r=arguments[0];this.setMinimum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c<this._distance&&this.initialize(i,a,c)}},Nr.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=r.distance(i),this._isNull=!1}else if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(c),this._distance=d,this._isNull=!1}},Nr.prototype.toString=function(){return fe.toLineString(this._pt[0],this._pt[1])},Nr.prototype.getDistance=function(){return this._distance},Nr.prototype.setMaximum=function(){if(arguments.length===1){var r=arguments[0];this.setMaximum(r._pt[0],r._pt[1])}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this._isNull)return this.initialize(i,a),null;var c=i.distance(a);c>this._distance&&this.initialize(i,a,c)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Uo=function(){};Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo},Uo.computeDistance=function(){if(arguments[2]instanceof Nr&&arguments[0]instanceof vt&&arguments[1]instanceof D)for(var r=arguments[0],i=arguments[1],a=arguments[2],c=new ie,d=r.getCoordinates(),v=0;v<d.length-1;v++){c.setCoordinates(d[v],d[v+1]);var M=c.closestPoint(i);a.setMinimum(M,i)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof de&&arguments[1]instanceof D){var L=arguments[0],H=arguments[1],it=arguments[2];Uo.computeDistance(L.getExteriorRing(),H,it);for(var bt=0;bt<L.getNumInteriorRing();bt++)Uo.computeDistance(L.getInteriorRingN(bt),H,it)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof Vt&&arguments[1]instanceof D){var Tt=arguments[0],Kt=arguments[1],Qt=arguments[2];if(Tt instanceof vt)Uo.computeDistance(Tt,Kt,Qt);else if(Tt instanceof de)Uo.computeDistance(Tt,Kt,Qt);else if(Tt instanceof Qn)for(var le=Tt,Ee=0;Ee<le.getNumGeometries();Ee++){var Dn=le.getGeometryN(Ee);Uo.computeDistance(Dn,Kt,Qt)}else Qt.setMinimum(Tt.getCoordinate(),Kt)}else if(arguments[2]instanceof Nr&&arguments[0]instanceof ie&&arguments[1]instanceof D){var Jn=arguments[0],fi=arguments[1],as=arguments[2],qs=Jn.closestPoint(fi);as.setMinimum(qs,fi)}};var ei=function(){this._g0=null,this._g1=null,this._ptDist=new Nr,this._densifyFrac=0;var r=arguments[0],i=arguments[1];this._g0=r,this._g1=i},Su={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ei.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ei.prototype.setDensifyFraction=function(r){if(r>1||r<=0)throw new I("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=r},ei.prototype.compute=function(r,i){this.computeOrientedDistance(r,i,this._ptDist),this.computeOrientedDistance(i,r,this._ptDist)},ei.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ei.prototype.computeOrientedDistance=function(r,i,a){var c=new Ss(i);if(r.apply(c),a.setMaximum(c.getMaxPointDistance()),this._densifyFrac>0){var d=new sn(i,this._densifyFrac);r.apply(d),a.setMaximum(d.getMaxPointDistance())}},ei.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.distance=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return new ei(r,i).distance()}if(arguments.length===3){var a=arguments[0],c=arguments[1],d=arguments[2],v=new ei(a,c);return v.setDensifyFraction(d),v.distance()}},Su.MaxPointDistanceFilter.get=function(){return Ss},Su.MaxDensifiedByFractionDistanceFilter.get=function(){return sn},Object.defineProperties(ei,Su);var Ss=function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._euclideanDist=new Uo,this._geom=null;var r=arguments[0];this._geom=r};Ss.prototype.filter=function(r){this._minPtDist.initialize(),Uo.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ss.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ss.prototype.interfaces_=function(){return[rt]},Ss.prototype.getClass=function(){return Ss};var sn=function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._geom=null,this._numSubSegs=0;var r=arguments[0],i=arguments[1];this._geom=r,this._numSubSegs=Math.trunc(Math.round(1/i))};sn.prototype.filter=function(r,i){if(i===0)return null;for(var a=r.getCoordinate(i-1),c=r.getCoordinate(i),d=(c.x-a.x)/this._numSubSegs,v=(c.y-a.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var L=a.x+M*d,H=a.y+M*v,it=new D(L,H);this._minPtDist.initialize(),Uo.computeDistance(this._geom,it,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},sn.prototype.isDone=function(){return!1},sn.prototype.isGeometryChanged=function(){return!1},sn.prototype.getMaxPointDistance=function(){return this._maxPtDist},sn.prototype.interfaces_=function(){return[ur]},sn.prototype.getClass=function(){return sn};var Li=function(r,i,a){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=r||null,this._bufDistance=i||null,this._result=a||null},Ql={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Li.prototype.checkMaximumDistance=function(r,i,a){var c=new ei(i,r);if(c.setDensifyFraction(.25),this._maxDistanceFound=c.orientedDistance(),this._maxDistanceFound>a){this._isValid=!1;var d=c.getCoordinates();this._errorLocation=d[1],this._errorIndicator=r.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+fe.toLineString(d[0],d[1])+")"}},Li.prototype.isValid=function(){var r=Math.abs(this._bufDistance),i=Li.MAX_DISTANCE_DIFF_FRAC*r;return this._minValidDistance=r-i,this._maxValidDistance=r+i,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Li.VERBOSE&&te.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Li.prototype.checkNegativeValid=function(){if(!(this._input instanceof de||this._input instanceof Pe||this._input instanceof Qn))return null;var r=this.getPolygonLines(this._input);if(this.checkMinimumDistance(r,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(r,this._result,this._maxValidDistance)},Li.prototype.getErrorIndicator=function(){return this._errorIndicator},Li.prototype.checkMinimumDistance=function(r,i,a){var c=new tr(r,i,a);if(this._minDistanceFound=c.distance(),this._minDistanceFound<a){this._isValid=!1;var d=c.nearestPoints();this._errorLocation=c.nearestPoints()[1],this._errorIndicator=r.getFactory().createLineString(d),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+fe.toLineString(d[0],d[1])+" )"}},Li.prototype.checkPositiveValid=function(){var r=this._result.getBoundary();if(this.checkMinimumDistance(this._input,r,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,r,this._maxValidDistance)},Li.prototype.getErrorLocation=function(){return this._errorLocation},Li.prototype.getPolygonLines=function(r){for(var i=new G,a=new _e(i),c=se.getPolygons(r).iterator();c.hasNext();)c.next().apply(a);return r.getFactory().buildGeometry(i)},Li.prototype.getErrorMessage=function(){return this._errMsg},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Ql.VERBOSE.get=function(){return!1},Ql.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Li,Ql);var Rr=function(r,i,a){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=r||null,this._distance=i||null,this._result=a||null},bf={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Rr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Rr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var r=this._distance*Rr.MAX_ENV_DIFF_FRAC;r===0&&(r=.001);var i=new qt(this._input.getEnvelopeInternal());i.expandBy(this._distance);var a=new qt(this._result.getEnvelopeInternal());a.expandBy(r),a.contains(i)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(a)),this.report("Envelope")},Rr.prototype.checkDistance=function(){var r=new Li(this._input,this._distance,this._result);r.isValid()||(this._isValid=!1,this._errorMsg=r.getErrorMessage(),this._errorLocation=r.getErrorLocation(),this._errorIndicator=r.getErrorIndicator()),this.report("Distance")},Rr.prototype.checkArea=function(){var r=this._input.getArea(),i=this._result.getArea();this._distance>0&&r>i&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&r<i&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Rr.prototype.checkPolygonal=function(){this._result instanceof de||this._result instanceof Pe||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Rr.prototype.getErrorIndicator=function(){return this._errorIndicator},Rr.prototype.getErrorLocation=function(){return this._errorLocation},Rr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Rr.prototype.report=function(r){if(!Rr.VERBOSE)return null;te.out.println("Check "+r+": "+(this._isValid?"passed":"FAILED"))},Rr.prototype.getErrorMessage=function(){return this._errorMsg},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.isValidMsg=function(r,i,a){var c=new Rr(r,i,a);return c.isValid()?null:c.getErrorMessage()},Rr.isValid=function(r,i,a){return!!new Rr(r,i,a).isValid()},bf.VERBOSE.get=function(){return!1},bf.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Rr,bf);var Bo=function(){this._pts=null,this._data=null;var r=arguments[0],i=arguments[1];this._pts=r,this._data=i};Bo.prototype.getCoordinates=function(){return this._pts},Bo.prototype.size=function(){return this._pts.length},Bo.prototype.getCoordinate=function(r){return this._pts[r]},Bo.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Bo.prototype.getSegmentOctant=function(r){return r===this._pts.length-1?-1:ua.octant(this.getCoordinate(r),this.getCoordinate(r+1))},Bo.prototype.setData=function(r){this._data=r},Bo.prototype.getData=function(){return this._data},Bo.prototype.toString=function(){return fe.toLineString(new ye(this._pts))},Bo.prototype.interfaces_=function(){return[No]},Bo.prototype.getClass=function(){return Bo};var Br=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new G,this._intersectionCount=0,this._keepIntersections=!0;var r=arguments[0];this._li=r,this._interiorIntersection=null};Br.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Br.prototype.setCheckEndSegmentsOnly=function(r){this._isCheckEndSegmentsOnly=r},Br.prototype.getIntersectionSegments=function(){return this._intSegments},Br.prototype.count=function(){return this._intersectionCount},Br.prototype.getIntersections=function(){return this._intersections},Br.prototype.setFindAllIntersections=function(r){this._findAllIntersections=r},Br.prototype.setKeepIntersections=function(r){this._keepIntersections=r},Br.prototype.processIntersections=function(r,i,a,c){if(!this._findAllIntersections&&this.hasIntersection()||r===a&&i===c||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(r,i)||this.isEndSegment(a,c)))return null;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=d,this._intSegments[1]=v,this._intSegments[2]=M,this._intSegments[3]=L,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Br.prototype.isEndSegment=function(r,i){return i===0||i>=r.size()-2},Br.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Br.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Br.prototype.interfaces_=function(){return[Bs]},Br.prototype.getClass=function(){return Br},Br.createAllIntersectionsFinder=function(r){var i=new Br(r);return i.setFindAllIntersections(!0),i},Br.createAnyIntersectionFinder=function(r){return new Br(r)},Br.createIntersectionCounter=function(r){var i=new Br(r);return i.setFindAllIntersections(!0),i.setKeepIntersections(!1),i};var Ni=function(){this._li=new z,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var r=arguments[0];this._segStrings=r};Ni.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ni.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ni.prototype.isValid=function(){return this.execute(),this._isValid},Ni.prototype.setFindAllIntersections=function(r){this._findAllIntersections=r},Ni.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Br(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var r=new hl;if(r.setSegmentIntersector(this._segInt),r.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ni.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qo(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ni.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var r=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+fe.toLineString(r[0],r[1])+" and "+fe.toLineString(r[2],r[3])},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.computeIntersections=function(r){var i=new Ni(r);return i.setFindAllIntersections(!0),i.isValid(),i.getIntersections()};var Ji=function r(){this._nv=null;var i=arguments[0];this._nv=new Ni(r.toSegmentStrings(i))};Ji.prototype.checkValid=function(){this._nv.checkValid()},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji},Ji.toSegmentStrings=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next();i.add(new Bo(c.getCoordinates(),c))}return i},Ji.checkValid=function(r){new Ji(r).checkValid()};var Ms=function(r){this._mapOp=r};Ms.prototype.map=function(r){for(var i=new G,a=0;a<r.getNumGeometries();a++){var c=this._mapOp.map(r.getGeometryN(a));c.isEmpty()||i.add(c)}return r.getFactory().createGeometryCollection(Le.toGeometryArray(i))},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms},Ms.map=function(r,i){return new Ms(i).map(r)};var yo=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new G,this._resultLineList=new G;var r=arguments[0],i=arguments[1],a=arguments[2];this._op=r,this._geometryFactory=i,this._ptLocator=a};yo.prototype.collectLines=function(r){for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var a=i.next();this.collectLineEdge(a,r,this._lineEdgesList),this.collectBoundaryTouchEdge(a,r,this._lineEdgesList)}},yo.prototype.labelIsolatedLine=function(r,i){var a=this._ptLocator.locate(r.getCoordinate(),this._op.getArgGeometry(i));r.getLabel().setLocation(i,a)},yo.prototype.build=function(r){return this.findCoveredLineEdges(),this.collectLines(r),this.buildLines(r),this._resultLineList},yo.prototype.collectLineEdge=function(r,i,a){var c=r.getLabel(),d=r.getEdge();r.isLineEdge()&&(r.isVisited()||!Re.isResultOfOp(c,i)||d.isCovered()||(a.add(d),r.setVisitedEdge(!0)))},yo.prototype.findCoveredLineEdges=function(){for(var r=this._op.getGraph().getNodes().iterator();r.hasNext();)r.next().getEdges().findCoveredLineEdges();for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var a=i.next(),c=a.getEdge();if(a.isLineEdge()&&!c.isCoveredSet()){var d=this._op.isCoveredByA(a.getCoordinate());c.setCovered(d)}}},yo.prototype.labelIsolatedLines=function(r){for(var i=r.iterator();i.hasNext();){var a=i.next(),c=a.getLabel();a.isIsolated()&&(c.isNull(0)?this.labelIsolatedLine(a,0):this.labelIsolatedLine(a,1))}},yo.prototype.buildLines=function(r){for(var i=this._lineEdgesList.iterator();i.hasNext();){var a=i.next(),c=this._geometryFactory.createLineString(a.getCoordinates());this._resultLineList.add(c),a.setInResult(!0)}},yo.prototype.collectBoundaryTouchEdge=function(r,i,a){var c=r.getLabel();return r.isLineEdge()||r.isVisited()||r.isInteriorAreaEdge()||r.getEdge().isInResult()?null:(Wt.isTrue(!(r.isInResult()||r.getSym().isInResult())||!r.getEdge().isInResult()),void(Re.isResultOfOp(c,i)&&i===Re.INTERSECTION&&(a.add(r.getEdge()),r.setVisitedEdge(!0))))},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var bs=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new G;var r=arguments[0],i=arguments[1];this._op=r,this._geometryFactory=i};bs.prototype.filterCoveredNodeToPoint=function(r){var i=r.getCoordinate();if(!this._op.isCoveredByLA(i)){var a=this._geometryFactory.createPoint(i);this._resultPointList.add(a)}},bs.prototype.extractNonCoveredResultNodes=function(r){for(var i=this._op.getGraph().getNodes().iterator();i.hasNext();){var a=i.next();if(!a.isInResult()&&!a.isIncidentEdgeInResult()&&(a.getEdges().getDegree()===0||r===Re.INTERSECTION)){var c=a.getLabel();Re.isResultOfOp(c,r)&&this.filterCoveredNodeToPoint(a)}}},bs.prototype.build=function(r){return this.extractNonCoveredResultNodes(r),this._resultPointList},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var li=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};li.prototype.transformPoint=function(r,i){return this._factory.createPoint(this.transformCoordinates(r.getCoordinateSequence(),r))},li.prototype.transformPolygon=function(r,i){var a=!0,c=this.transformLinearRing(r.getExteriorRing(),r);c!==null&&c instanceof Ae&&!c.isEmpty()||(a=!1);for(var d=new G,v=0;v<r.getNumInteriorRing();v++){var M=this.transformLinearRing(r.getInteriorRingN(v),r);M===null||M.isEmpty()||(M instanceof Ae||(a=!1),d.add(M))}if(a)return this._factory.createPolygon(c,d.toArray([]));var L=new G;return c!==null&&L.add(c),L.addAll(d),this._factory.buildGeometry(L)},li.prototype.createCoordinateSequence=function(r){return this._factory.getCoordinateSequenceFactory().create(r)},li.prototype.getInputGeometry=function(){return this._inputGeom},li.prototype.transformMultiLineString=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformLineString(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.transformCoordinates=function(r,i){return this.copy(r)},li.prototype.transformLineString=function(r,i){return this._factory.createLineString(this.transformCoordinates(r.getCoordinateSequence(),r))},li.prototype.transformMultiPoint=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformPoint(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.transformMultiPolygon=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transformPolygon(r.getGeometryN(c),r);d!==null&&(d.isEmpty()||a.add(d))}return this._factory.buildGeometry(a)},li.prototype.copy=function(r){return r.copy()},li.prototype.transformGeometryCollection=function(r,i){for(var a=new G,c=0;c<r.getNumGeometries();c++){var d=this.transform(r.getGeometryN(c));d!==null&&(this._pruneEmptyGeometry&&d.isEmpty()||a.add(d))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Le.toGeometryArray(a)):this._factory.buildGeometry(a)},li.prototype.transform=function(r){if(this._inputGeom=r,this._factory=r.getFactory(),r instanceof ue)return this.transformPoint(r,null);if(r instanceof Be)return this.transformMultiPoint(r,null);if(r instanceof Ae)return this.transformLinearRing(r,null);if(r instanceof vt)return this.transformLineString(r,null);if(r instanceof bi)return this.transformMultiLineString(r,null);if(r instanceof de)return this.transformPolygon(r,null);if(r instanceof Pe)return this.transformMultiPolygon(r,null);if(r instanceof Qn)return this.transformGeometryCollection(r,null);throw new I("Unknown Geometry subtype: "+r.getClass().getName())},li.prototype.transformLinearRing=function(r,i){var a=this.transformCoordinates(r.getCoordinateSequence(),r);if(a===null)return this._factory.createLinearRing(null);var c=a.size();return c>0&&c<4&&!this._preserveType?this._factory.createLineString(a):this._factory.createLinearRing(a)},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var zo=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ie,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof vt&&typeof arguments[1]=="number"){var i=arguments[0],a=arguments[1];r.call(this,i.getCoordinates(),a)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var c=arguments[0],d=arguments[1];this._srcPts=c,this._isClosed=r.isClosed(c),this._snapTolerance=d}};zo.prototype.snapVertices=function(r,i){for(var a=this._isClosed?r.size()-1:r.size(),c=0;c<a;c++){var d=r.get(c),v=this.findSnapForVertex(d,i);v!==null&&(r.set(c,new D(v)),c===0&&this._isClosed&&r.set(r.size()-1,new D(v)))}},zo.prototype.findSnapForVertex=function(r,i){for(var a=0;a<i.length;a++){if(r.equals2D(i[a]))return null;if(r.distance(i[a])<this._snapTolerance)return i[a]}return null},zo.prototype.snapTo=function(r){var i=new et(this._srcPts);return this.snapVertices(i,r),this.snapSegments(i,r),i.toCoordinateArray()},zo.prototype.snapSegments=function(r,i){if(i.length===0)return null;var a=i.length;i[0].equals2D(i[i.length-1])&&(a=i.length-1);for(var c=0;c<a;c++){var d=i[c],v=this.findSegmentIndexToSnap(d,r);v>=0&&r.add(v+1,new D(d),!1)}},zo.prototype.findSegmentIndexToSnap=function(r,i){for(var a=A.MAX_VALUE,c=-1,d=0;d<i.size()-1;d++){if(this._seg.p0=i.get(d),this._seg.p1=i.get(d+1),this._seg.p0.equals2D(r)||this._seg.p1.equals2D(r)){if(this._allowSnappingToSourceVertices)continue;return-1}var v=this._seg.distance(r);v<this._snapTolerance&&v<a&&(a=v,c=d)}return c},zo.prototype.setAllowSnappingToSourceVertices=function(r){this._allowSnappingToSourceVertices=r},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},zo.isClosed=function(r){return!(r.length<=1)&&r[0].equals2D(r[r.length-1])};var fr=function(r){this._srcGeom=r||null},Af={SNAP_PRECISION_FACTOR:{configurable:!0}};fr.prototype.snapTo=function(r,i){var a=this.extractTargetCoordinates(r);return new Mu(i,a).transform(this._srcGeom)},fr.prototype.snapToSelf=function(r,i){var a=this.extractTargetCoordinates(this._srcGeom),c=new Mu(r,a,!0).transform(this._srcGeom),d=c;return i&&Q(d,we)&&(d=c.buffer(0)),d},fr.prototype.computeSnapTolerance=function(r){return this.computeMinimumSegmentLength(r)/10},fr.prototype.extractTargetCoordinates=function(r){for(var i=new b,a=r.getCoordinates(),c=0;c<a.length;c++)i.add(a[c]);return i.toArray(new Array(0).fill(null))},fr.prototype.computeMinimumSegmentLength=function(r){for(var i=A.MAX_VALUE,a=0;a<r.length-1;a++){var c=r[a].distance(r[a+1]);c<i&&(i=c)}return i},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr},fr.snap=function(r,i,a){var c=new Array(2).fill(null),d=new fr(r);c[0]=d.snapTo(i,a);var v=new fr(i);return c[1]=v.snapTo(c[0],a),c},fr.computeOverlaySnapTolerance=function(){if(arguments.length===1){var r=arguments[0],i=fr.computeSizeBasedSnapTolerance(r),a=r.getPrecisionModel();if(a.getType()===Ge.FIXED){var c=1/a.getScale()*2/1.415;c>i&&(i=c)}return i}if(arguments.length===2){var d=arguments[0],v=arguments[1];return Math.min(fr.computeOverlaySnapTolerance(d),fr.computeOverlaySnapTolerance(v))}},fr.computeSizeBasedSnapTolerance=function(r){var i=r.getEnvelopeInternal();return Math.min(i.getHeight(),i.getWidth())*fr.SNAP_PRECISION_FACTOR},fr.snapToSelf=function(r,i,a){return new fr(r).snapToSelf(i,a)},Af.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(fr,Af);var Mu=function(r){function i(a,c,d){r.call(this),this._snapTolerance=a||null,this._snapPts=c||null,this._isSelfSnap=d!==void 0&&d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.snapLine=function(a,c){var d=new zo(a,this._snapTolerance);return d.setAllowSnappingToSourceVertices(this._isSelfSnap),d.snapTo(c)},i.prototype.transformCoordinates=function(a,c){var d=a.toCoordinateArray(),v=this.snapLine(d,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(li),Tr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Tr.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Tr.prototype.add=function(r){var i=A.doubleToLongBits(r);if(this._isFirst)return this._commonBits=i,this._commonSignExp=Tr.signExpBits(this._commonBits),this._isFirst=!1,null;if(Tr.signExpBits(i)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Tr.numCommonMostSigMantissaBits(this._commonBits,i),this._commonBits=Tr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Tr.prototype.toString=function(){if(arguments.length===1){var r=arguments[0],i=A.longBitsToDouble(r),a="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(r),c=a.substring(a.length-64);return c.substring(0,1)+" "+c.substring(1,12)+"(exp) "+c.substring(12)+" [ "+i+" ]"}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.getBit=function(r,i){return r&1<<i?1:0},Tr.signExpBits=function(r){return r>>52},Tr.zeroLowerBits=function(r,i){return r&~((1<<i)-1)},Tr.numCommonMostSigMantissaBits=function(r,i){for(var a=0,c=52;c>=0;c--){if(Tr.getBit(r,c)!==Tr.getBit(i,c))return a;a++}return 52};var Go=function(){this._commonCoord=null,this._ccFilter=new Wa},Tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Go.prototype.addCommonBits=function(r){var i=new Gs(this._commonCoord);r.apply(i),r.geometryChanged()},Go.prototype.removeCommonBits=function(r){if(this._commonCoord.x===0&&this._commonCoord.y===0)return r;var i=new D(this._commonCoord);i.x=-i.x,i.y=-i.y;var a=new Gs(i);return r.apply(a),r.geometryChanged(),r},Go.prototype.getCommonCoordinate=function(){return this._commonCoord},Go.prototype.add=function(r){r.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go},Tf.CommonCoordinateFilter.get=function(){return Wa},Tf.Translater.get=function(){return Gs},Object.defineProperties(Go,Tf);var Wa=function(){this._commonBitsX=new Tr,this._commonBitsY=new Tr};Wa.prototype.filter=function(r){this._commonBitsX.add(r.x),this._commonBitsY.add(r.y)},Wa.prototype.getCommonCoordinate=function(){return new D(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Wa.prototype.interfaces_=function(){return[rt]},Wa.prototype.getClass=function(){return Wa};var Gs=function(){this.trans=null;var r=arguments[0];this.trans=r};Gs.prototype.filter=function(r,i){var a=r.getOrdinate(i,0)+this.trans.x,c=r.getOrdinate(i,1)+this.trans.y;r.setOrdinate(i,0,a),r.setOrdinate(i,1,c)},Gs.prototype.isDone=function(){return!1},Gs.prototype.isGeometryChanged=function(){return!0},Gs.prototype.interfaces_=function(){return[ur]},Gs.prototype.getClass=function(){return Gs};var Cr=function(r,i){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=r,this._geom[1]=i,this.computeSnapTolerance()};Cr.prototype.selfSnap=function(r){return new fr(r).snapTo(r,this._snapTolerance)},Cr.prototype.removeCommonBits=function(r){this._cbr=new Go,this._cbr.add(r[0]),this._cbr.add(r[1]);var i=new Array(2).fill(null);return i[0]=this._cbr.removeCommonBits(r[0].copy()),i[1]=this._cbr.removeCommonBits(r[1].copy()),i},Cr.prototype.prepareResult=function(r){return this._cbr.addCommonBits(r),r},Cr.prototype.getResultGeometry=function(r){var i=this.snap(this._geom),a=Re.overlayOp(i[0],i[1],r);return this.prepareResult(a)},Cr.prototype.checkValid=function(r){r.isValid()||te.out.println("Snapped geometry is invalid")},Cr.prototype.computeSnapTolerance=function(){this._snapTolerance=fr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Cr.prototype.snap=function(r){var i=this.removeCommonBits(r);return fr.snap(i[0],i[1],this._snapTolerance)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.overlayOp=function(r,i,a){return new Cr(r,i).getResultGeometry(a)},Cr.union=function(r,i){return Cr.overlayOp(r,i,Re.UNION)},Cr.intersection=function(r,i){return Cr.overlayOp(r,i,Re.INTERSECTION)},Cr.symDifference=function(r,i){return Cr.overlayOp(r,i,Re.SYMDIFFERENCE)},Cr.difference=function(r,i){return Cr.overlayOp(r,i,Re.DIFFERENCE)};var zr=function(r,i){this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i};zr.prototype.getResultGeometry=function(r){var i=null,a=!1,c=null;try{i=Re.overlayOp(this._geom[0],this._geom[1],r),a=!0}catch(d){if(!(d instanceof Te))throw d;c=d}if(!a)try{i=Cr.overlayOp(this._geom[0],this._geom[1],r)}catch(d){throw d instanceof Te?c:d}return i},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.overlayOp=function(r,i,a){return new zr(r,i).getResultGeometry(a)},zr.union=function(r,i){return zr.overlayOp(r,i,Re.UNION)},zr.intersection=function(r,i){return zr.overlayOp(r,i,Re.INTERSECTION)},zr.symDifference=function(r,i){return zr.overlayOp(r,i,Re.SYMDIFFERENCE)},zr.difference=function(r,i){return zr.overlayOp(r,i,Re.DIFFERENCE)};var Xa=function(){this.mce=null,this.chainIndex=null;var r=arguments[0],i=arguments[1];this.mce=r,this.chainIndex=i};Xa.prototype.computeIntersections=function(r,i){this.mce.computeIntersectsForChain(this.chainIndex,r.mce,r.chainIndex,i)},Xa.prototype.interfaces_=function(){return[]},Xa.prototype.getClass=function(){return Xa};var Oi=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var i=arguments[0],a=arguments[1];this._eventType=r.DELETE,this._xValue=i,this._insertEvent=a}else if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._eventType=r.INSERT,this._label=c,this._xValue=d,this._obj=v}},tc={INSERT:{configurable:!0},DELETE:{configurable:!0}};Oi.prototype.isDelete=function(){return this._eventType===Oi.DELETE},Oi.prototype.setDeleteEventIndex=function(r){this._deleteEventIndex=r},Oi.prototype.getObject=function(){return this._obj},Oi.prototype.compareTo=function(r){var i=r;return this._xValue<i._xValue?-1:this._xValue>i._xValue?1:this._eventType<i._eventType?-1:this._eventType>i._eventType?1:0},Oi.prototype.getInsertEvent=function(){return this._insertEvent},Oi.prototype.isInsert=function(){return this._eventType===Oi.INSERT},Oi.prototype.isSameLabel=function(r){return this._label!==null&&this._label===r._label},Oi.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Oi.prototype.interfaces_=function(){return[V]},Oi.prototype.getClass=function(){return Oi},tc.INSERT.get=function(){return 1},tc.DELETE.get=function(){return 2},Object.defineProperties(Oi,tc);var ec=function(){};ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec};var Yr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var r=arguments[0],i=arguments[1],a=arguments[2];this._li=r,this._includeProper=i,this._recordIsolated=a};Yr.prototype.isTrivialIntersection=function(r,i,a,c){if(r===a&&this._li.getIntersectionNum()===1){if(Yr.isAdjacentSegments(i,c))return!0;if(r.isClosed()){var d=r.getNumPoints()-1;if(i===0&&c===d||c===0&&i===d)return!0}}return!1},Yr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Yr.prototype.setIsDoneIfProperInt=function(r){this._isDoneWhenProperInt=r},Yr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Yr.prototype.isBoundaryPointInternal=function(r,i){for(var a=i.iterator();a.hasNext();){var c=a.next().getCoordinate();if(r.isIntersection(c))return!0}return!1},Yr.prototype.hasProperIntersection=function(){return this._hasProper},Yr.prototype.hasIntersection=function(){return this._hasIntersection},Yr.prototype.isDone=function(){return this._isDone},Yr.prototype.isBoundaryPoint=function(r,i){return i!==null&&(!!this.isBoundaryPointInternal(r,i[0])||!!this.isBoundaryPointInternal(r,i[1]))},Yr.prototype.setBoundaryNodes=function(r,i){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=r,this._bdyNodes[1]=i},Yr.prototype.addIntersections=function(r,i,a,c){if(r===a&&i===c)return null;this.numTests++;var d=r.getCoordinates()[i],v=r.getCoordinates()[i+1],M=a.getCoordinates()[c],L=a.getCoordinates()[c+1];this._li.computeIntersection(d,v,M,L),this._li.hasIntersection()&&(this._recordIsolated&&(r.setIsolated(!1),a.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(r,i,a,c)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(r.addIntersections(this._li,i,0),a.addIntersections(this._li,c,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.isAdjacentSegments=function(r,i){return Math.abs(r-i)===1};var ni=function(r){function i(){r.call(this),this.events=new G,this.nOverlaps=null}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.prepareEvents=function(){ho.sort(this.events);for(var a=0;a<this.events.size();a++){var c=this.events.get(a);c.isDelete()&&c.getInsertEvent().setDeleteEventIndex(a)}},i.prototype.computeIntersections=function(){if(arguments.length===1){var a=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var c=0;c<this.events.size();c++){var d=this.events.get(c);if(d.isInsert()&&this.processOverlaps(c,d.getDeleteEventIndex(),d,a),a.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Yr&&Q(arguments[0],Et)&&Q(arguments[1],Et)){var v=arguments[0],M=arguments[1],L=arguments[2];this.addEdges(v,v),this.addEdges(M,M),this.computeIntersections(L)}else if(typeof arguments[2]=="boolean"&&Q(arguments[0],Et)&&arguments[1]instanceof Yr){var H=arguments[0],it=arguments[1];arguments[2]?this.addEdges(H,null):this.addEdges(H),this.computeIntersections(it)}}},i.prototype.addEdge=function(a,c){for(var d=a.getMonotoneChainEdge(),v=d.getStartIndexes(),M=0;M<v.length-1;M++){var L=new Xa(d,M),H=new Oi(c,d.getMinX(M),L);this.events.add(H),this.events.add(new Oi(d.getMaxX(M),H))}},i.prototype.processOverlaps=function(a,c,d,v){for(var M=d.getObject(),L=a;L<c;L++){var H=this.events.get(L);if(H.isInsert()){var it=H.getObject();d.isSameLabel(H)||(M.computeIntersections(it,v),this.nOverlaps++)}}},i.prototype.addEdges=function(){if(arguments.length===1)for(var a=arguments[0].iterator();a.hasNext();){var c=a.next();this.addEdge(c,c)}else if(arguments.length===2)for(var d=arguments[0],v=arguments[1],M=d.iterator();M.hasNext();){var L=M.next();this.addEdge(L,v)}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ec),vr=function(){this._min=A.POSITIVE_INFINITY,this._max=A.NEGATIVE_INFINITY},Vh={NodeComparator:{configurable:!0}};vr.prototype.getMin=function(){return this._min},vr.prototype.intersects=function(r,i){return!(this._min>i||this._max<r)},vr.prototype.getMax=function(){return this._max},vr.prototype.toString=function(){return fe.toLineString(new D(this._min,0),new D(this._max,0))},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},Vh.NodeComparator.get=function(){return dl},Object.defineProperties(vr,Vh);var dl=function(){};dl.prototype.compare=function(r,i){var a=r,c=i,d=(a._min+a._max)/2,v=(c._min+c._max)/2;return d<v?-1:d>v?1:0},dl.prototype.interfaces_=function(){return[q]},dl.prototype.getClass=function(){return dl};var Wh=function(r){function i(){r.call(this),this._item=null;var a=arguments[0],c=arguments[1],d=arguments[2];this._min=a,this._max=c,this._item=d}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.query=function(a,c,d){if(!this.intersects(a,c))return null;d.visitItem(this._item)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vr),nm=function(r){function i(){r.call(this),this._node1=null,this._node2=null;var a=arguments[0],c=arguments[1];this._node1=a,this._node2=c,this.buildExtent(this._node1,this._node2)}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.buildExtent=function(a,c){this._min=Math.min(a._min,c._min),this._max=Math.max(a._max,c._max)},i.prototype.query=function(a,c,d){if(!this.intersects(a,c))return null;this._node1!==null&&this._node1.query(a,c,d),this._node2!==null&&this._node2.query(a,c,d)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(vr),vo=function(){this._leaves=new G,this._root=null,this._level=0};vo.prototype.buildTree=function(){ho.sort(this._leaves,new vr.NodeComparator);for(var r=this._leaves,i=null,a=new G;;){if(this.buildLevel(r,a),a.size()===1)return a.get(0);i=r,r=a,a=i}},vo.prototype.insert=function(r,i,a){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Wh(r,i,a))},vo.prototype.query=function(r,i,a){this.init(),this._root.query(r,i,a)},vo.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},vo.prototype.printNode=function(r){te.out.println(fe.toLineString(new D(r._min,this._level),new D(r._max,this._level)))},vo.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},vo.prototype.buildLevel=function(r,i){this._level++,i.clear();for(var a=0;a<r.size();a+=2){var c=r.get(a);if((a+1<r.size()?r.get(a):null)===null)i.add(c);else{var d=new nm(r.get(a),r.get(a+1));i.add(d)}}},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var As=function(){this._items=new G};As.prototype.visitItem=function(r){this._items.add(r)},As.prototype.getItems=function(){return this._items},As.prototype.interfaces_=function(){return[Us]},As.prototype.getClass=function(){return As};var da=function(){this._index=null;var r=arguments[0];if(!Q(r,we))throw new I("Argument must be Polygonal");this._index=new ko(r)},ga={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};da.prototype.locate=function(r){var i=new Ot(r),a=new Ts(i);return this._index.query(r.y,r.y,a),i.getLocation()},da.prototype.interfaces_=function(){return[xu]},da.prototype.getClass=function(){return da},ga.SegmentVisitor.get=function(){return Ts},ga.IntervalIndexedGeometry.get=function(){return ko},Object.defineProperties(da,ga);var Ts=function(){this._counter=null;var r=arguments[0];this._counter=r};Ts.prototype.visitItem=function(r){var i=r;this._counter.countSegment(i.getCoordinate(0),i.getCoordinate(1))},Ts.prototype.interfaces_=function(){return[Us]},Ts.prototype.getClass=function(){return Ts};var ko=function(){this._index=new vo;var r=arguments[0];this.init(r)};ko.prototype.init=function(r){for(var i=_e.getLines(r).iterator();i.hasNext();){var a=i.next().getCoordinates();this.addLine(a)}},ko.prototype.addLine=function(r){for(var i=1;i<r.length;i++){var a=new ie(r[i-1],r[i]),c=Math.min(a.p0.y,a.p1.y),d=Math.max(a.p0.y,a.p1.y);this._index.insert(c,d,a)}},ko.prototype.query=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new As;return this._index.query(r,i,a),a.getItems()}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];this._index.query(c,d,v)}},ko.prototype.interfaces_=function(){return[]},ko.prototype.getClass=function(){return ko};var ma=function(r){function i(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new ul,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new qe,arguments.length===2){var a=arguments[0],c=arguments[1],d=P.OGC_SFS_BOUNDARY_RULE;this._argIndex=a,this._parentGeom=c,this._boundaryNodeRule=d,c!==null&&this.add(c)}else if(arguments.length===3){var v=arguments[0],M=arguments[1],L=arguments[2];this._argIndex=v,this._parentGeom=M,this._boundaryNodeRule=L,M!==null&&this.add(M)}}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.insertBoundaryPoint=function(a,c){var d=this._nodes.addNode(c).getLabel(),v=1;K.NONE,d.getLocation(a,Xt.ON)===K.BOUNDARY&&v++;var M=i.determineBoundary(this._boundaryNodeRule,v);d.setLocation(a,M)},i.prototype.computeSelfNodes=function(){if(arguments.length===2){var a=arguments[0],c=arguments[1];return this.computeSelfNodes(a,c,!1)}if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2],L=new Yr(d,!0,!1);L.setIsDoneIfProperInt(M);var H=this.createEdgeSetIntersector(),it=this._parentGeom instanceof Ae||this._parentGeom instanceof de||this._parentGeom instanceof Pe,bt=v||!it;return H.computeIntersections(this._edges,L,bt),this.addSelfIntersectionNodes(this._argIndex),L}},i.prototype.computeSplitEdges=function(a){for(var c=this._edges.iterator();c.hasNext();)c.next().eiList.addSplitEdges(a)},i.prototype.computeEdgeIntersections=function(a,c,d){var v=new Yr(c,d,!0);return v.setBoundaryNodes(this.getBoundaryNodes(),a.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,a._edges,v),v},i.prototype.getGeometry=function(){return this._parentGeom},i.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},i.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},i.prototype.addPoint=function(){if(arguments[0]instanceof ue){var a=arguments[0].getCoordinate();this.insertPoint(this._argIndex,a,K.INTERIOR)}else if(arguments[0]instanceof D){var c=arguments[0];this.insertPoint(this._argIndex,c,K.INTERIOR)}},i.prototype.addPolygon=function(a){this.addPolygonRing(a.getExteriorRing(),K.EXTERIOR,K.INTERIOR);for(var c=0;c<a.getNumInteriorRing();c++){var d=a.getInteriorRingN(c);this.addPolygonRing(d,K.INTERIOR,K.EXTERIOR)}},i.prototype.addEdge=function(a){this.insertEdge(a);var c=a.getCoordinates();this.insertPoint(this._argIndex,c[0],K.BOUNDARY),this.insertPoint(this._argIndex,c[c.length-1],K.BOUNDARY)},i.prototype.addLineString=function(a){var c=lt.removeRepeatedPoints(a.getCoordinates());if(c.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=c[0],null;var d=new jl(c,new On(this._argIndex,K.INTERIOR));this._lineEdgeMap.put(a,d),this.insertEdge(d),Wt.isTrue(c.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,c[0]),this.insertBoundaryPoint(this._argIndex,c[c.length-1])},i.prototype.getInvalidPoint=function(){return this._invalidPoint},i.prototype.getBoundaryPoints=function(){for(var a=this.getBoundaryNodes(),c=new Array(a.size()).fill(null),d=0,v=a.iterator();v.hasNext();){var M=v.next();c[d++]=M.getCoordinate().copy()}return c},i.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},i.prototype.addSelfIntersectionNode=function(a,c,d){if(this.isBoundaryNode(a,c))return null;d===K.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(a,c):this.insertPoint(a,c,d)},i.prototype.addPolygonRing=function(a,c,d){if(a.isEmpty())return null;var v=lt.removeRepeatedPoints(a.getCoordinates());if(v.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=v[0],null;var M=c,L=d;dt.isCCW(v)&&(M=d,L=c);var H=new jl(v,new On(this._argIndex,K.BOUNDARY,M,L));this._lineEdgeMap.put(a,H),this.insertEdge(H),this.insertPoint(this._argIndex,v[0],K.BOUNDARY)},i.prototype.insertPoint=function(a,c,d){var v=this._nodes.addNode(c),M=v.getLabel();M===null?v._label=new On(a,d):M.setLocation(a,d)},i.prototype.createEdgeSetIntersector=function(){return new ni},i.prototype.addSelfIntersectionNodes=function(a){for(var c=this._edges.iterator();c.hasNext();)for(var d=c.next(),v=d.getLabel().getLocation(a),M=d.eiList.iterator();M.hasNext();){var L=M.next();this.addSelfIntersectionNode(a,L.coord,v)}},i.prototype.add=function(){if(arguments.length!==1)return r.prototype.add.apply(this,arguments);var a=arguments[0];if(a.isEmpty())return null;if(a instanceof Pe&&(this._useBoundaryDeterminationRule=!1),a instanceof de)this.addPolygon(a);else if(a instanceof vt)this.addLineString(a);else if(a instanceof ue)this.addPoint(a);else if(a instanceof Be)this.addCollection(a);else if(a instanceof bi)this.addCollection(a);else if(a instanceof Pe)this.addCollection(a);else{if(!(a instanceof Qn))throw new Error(a.getClass().getName());this.addCollection(a)}},i.prototype.addCollection=function(a){for(var c=0;c<a.getNumGeometries();c++){var d=a.getGeometryN(c);this.add(d)}},i.prototype.locate=function(a){return Q(this._parentGeom,we)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new da(this._parentGeom)),this._areaPtLocator.locate(a)):this._ptLocator.locate(a,this._parentGeom)},i.prototype.findEdge=function(){if(arguments.length===1){var a=arguments[0];return this._lineEdgeMap.get(a)}return r.prototype.findEdge.apply(this,arguments)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.determineBoundary=function(a,c){return a.isInBoundary(c)?K.BOUNDARY:K.INTERIOR},i}(dr),ss=function(){if(this._li=new z,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var r=arguments[0];this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new ma(0,r)}else if(arguments.length===2){var i=arguments[0],a=arguments[1],c=P.OGC_SFS_BOUNDARY_RULE;i.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ma(0,i,c),this._arg[1]=new ma(1,a,c)}else if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2];d.getPrecisionModel().compareTo(v.getPrecisionModel())>=0?this.setComputationPrecision(d.getPrecisionModel()):this.setComputationPrecision(v.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ma(0,d,M),this._arg[1]=new ma(1,v,M)}};ss.prototype.getArgGeometry=function(r){return this._arg[r].getGeometry()},ss.prototype.setComputationPrecision=function(r){this._resultPrecisionModel=r,this._li.setPrecisionModel(this._resultPrecisionModel)},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss};var ya=function(){};ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya},ya.map=function(){if(arguments[0]instanceof Vt&&Q(arguments[1],ya.MapOp)){for(var r=arguments[0],i=arguments[1],a=new G,c=0;c<r.getNumGeometries();c++){var d=i.map(r.getGeometryN(c));d!==null&&a.add(d)}return r.getFactory().buildGeometry(a)}if(Q(arguments[0],at)&&Q(arguments[1],ya.MapOp)){for(var v=arguments[0],M=arguments[1],L=new G,H=v.iterator();H.hasNext();){var it=H.next(),bt=M.map(it);bt!==null&&L.add(bt)}return L}},ya.MapOp=function(){};var Re=function(r){function i(){var a=arguments[0],c=arguments[1];r.call(this,a,c),this._ptLocator=new qe,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new gi,this._resultPolyList=new G,this._resultLineList=new G,this._resultPointList=new G,this._graph=new dr(new io),this._geomFact=a.getFactory()}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.insertUniqueEdge=function(a){var c=this._edgeList.findEqualEdge(a);if(c!==null){var d=c.getLabel(),v=a.getLabel();c.isPointwiseEqual(a)||(v=new On(a.getLabel())).flip();var M=c.getDepth();M.isNull()&&M.add(d),M.add(v),d.merge(v)}else this._edgeList.add(a)},i.prototype.getGraph=function(){return this._graph},i.prototype.cancelDuplicateResultEdges=function(){for(var a=this._graph.getEdgeEnds().iterator();a.hasNext();){var c=a.next(),d=c.getSym();c.isInResult()&&d.isInResult()&&(c.setInResult(!1),d.setInResult(!1))}},i.prototype.isCoveredByLA=function(a){return!!this.isCovered(a,this._resultLineList)||!!this.isCovered(a,this._resultPolyList)},i.prototype.computeGeometry=function(a,c,d,v){var M=new G;return M.addAll(a),M.addAll(c),M.addAll(d),M.isEmpty()?i.createEmptyResult(v,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},i.prototype.mergeSymLabels=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();)a.next().getEdges().mergeSymLabels()},i.prototype.isCovered=function(a,c){for(var d=c.iterator();d.hasNext();){var v=d.next();if(this._ptLocator.locate(a,v)!==K.EXTERIOR)return!0}return!1},i.prototype.replaceCollapsedEdges=function(){for(var a=new G,c=this._edgeList.iterator();c.hasNext();){var d=c.next();d.isCollapsed()&&(c.remove(),a.add(d.getCollapsedEdge()))}this._edgeList.addAll(a)},i.prototype.updateNodeLabelling=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();){var c=a.next(),d=c.getEdges().getLabel();c.getLabel().merge(d)}},i.prototype.getResultGeometry=function(a){return this.computeOverlay(a),this._resultGeom},i.prototype.insertUniqueEdges=function(a){for(var c=a.iterator();c.hasNext();){var d=c.next();this.insertUniqueEdge(d)}},i.prototype.computeOverlay=function(a){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var c=new G;this._arg[0].computeSplitEdges(c),this._arg[1].computeSplitEdges(c),this.insertUniqueEdges(c),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ji.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(a),this.cancelDuplicateResultEdges();var d=new Ci(this._geomFact);d.add(this._graph),this._resultPolyList=d.getPolygons();var v=new yo(this,this._geomFact,this._ptLocator);this._resultLineList=v.build(a);var M=new bs(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(a),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,a)},i.prototype.labelIncompleteNode=function(a,c){var d=this._ptLocator.locate(a.getCoordinate(),this._arg[c].getGeometry());a.getLabel().setLocation(c,d)},i.prototype.copyPoints=function(a){for(var c=this._arg[a].getNodeIterator();c.hasNext();){var d=c.next();this._graph.addNode(d.getCoordinate()).setLabel(a,d.getLabel().getLocation(a))}},i.prototype.findResultAreaEdges=function(a){for(var c=this._graph.getEdgeEnds().iterator();c.hasNext();){var d=c.next(),v=d.getLabel();v.isArea()&&!d.isInteriorAreaEdge()&&i.isResultOfOp(v.getLocation(0,Xt.RIGHT),v.getLocation(1,Xt.RIGHT),a)&&d.setInResult(!0)}},i.prototype.computeLabelsFromDepths=function(){for(var a=this._edgeList.iterator();a.hasNext();){var c=a.next(),d=c.getLabel(),v=c.getDepth();if(!v.isNull()){v.normalize();for(var M=0;M<2;M++)d.isNull(M)||!d.isArea()||v.isNull(M)||(v.getDelta(M)===0?d.toLine(M):(Wt.isTrue(!v.isNull(M,Xt.LEFT),"depth of LEFT side has not been initialized"),d.setLocation(M,Xt.LEFT,v.getLocation(M,Xt.LEFT)),Wt.isTrue(!v.isNull(M,Xt.RIGHT),"depth of RIGHT side has not been initialized"),d.setLocation(M,Xt.RIGHT,v.getLocation(M,Xt.RIGHT))))}}},i.prototype.computeLabelling=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();)a.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},i.prototype.labelIncompleteNodes=function(){for(var a=this._graph.getNodes().iterator();a.hasNext();){var c=a.next(),d=c.getLabel();c.isIsolated()&&(d.isNull(0)?this.labelIncompleteNode(c,0):this.labelIncompleteNode(c,1)),c.getEdges().updateLabelling(d)}},i.prototype.isCoveredByA=function(a){return!!this.isCovered(a,this._resultPolyList)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ss);Re.overlayOp=function(r,i,a){return new Re(r,i).getResultGeometry(a)},Re.intersection=function(r,i){if(r.isEmpty()||i.isEmpty())return Re.createEmptyResult(Re.INTERSECTION,r,i,r.getFactory());if(r.isGeometryCollection()){var a=i;return Ms.map(r,{interfaces_:function(){return[ya.MapOp]},map:function(c){return c.intersection(a)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.INTERSECTION)},Re.symDifference=function(r,i){if(r.isEmpty()||i.isEmpty()){if(r.isEmpty()&&i.isEmpty())return Re.createEmptyResult(Re.SYMDIFFERENCE,r,i,r.getFactory());if(r.isEmpty())return i.copy();if(i.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.SYMDIFFERENCE)},Re.resultDimension=function(r,i,a){var c=i.getDimension(),d=a.getDimension(),v=-1;switch(r){case Re.INTERSECTION:v=Math.min(c,d);break;case Re.UNION:v=Math.max(c,d);break;case Re.DIFFERENCE:v=c;break;case Re.SYMDIFFERENCE:v=Math.max(c,d)}return v},Re.createEmptyResult=function(r,i,a,c){var d=null;switch(Re.resultDimension(r,i,a)){case-1:d=c.createGeometryCollection(new Array(0).fill(null));break;case 0:d=c.createPoint();break;case 1:d=c.createLineString();break;case 2:d=c.createPolygon()}return d},Re.difference=function(r,i){return r.isEmpty()?Re.createEmptyResult(Re.DIFFERENCE,r,i,r.getFactory()):i.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.DIFFERENCE))},Re.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=r.getLocation(0),c=r.getLocation(1);return Re.isResultOfOp(a,c,i)}if(arguments.length===3){var d=arguments[0],v=arguments[1],M=arguments[2];switch(d===K.BOUNDARY&&(d=K.INTERIOR),v===K.BOUNDARY&&(v=K.INTERIOR),M){case Re.INTERSECTION:return d===K.INTERIOR&&v===K.INTERIOR;case Re.UNION:return d===K.INTERIOR||v===K.INTERIOR;case Re.DIFFERENCE:return d===K.INTERIOR&&v!==K.INTERIOR;case Re.SYMDIFFERENCE:return d===K.INTERIOR&&v!==K.INTERIOR||d!==K.INTERIOR&&v===K.INTERIOR}return!1}},Re.INTERSECTION=1,Re.UNION=2,Re.DIFFERENCE=3,Re.SYMDIFFERENCE=4;var ks=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new qe,this._seg=new ie;var r=arguments[0],i=arguments[1];this._g=r,this._boundaryDistanceTolerance=i,this._linework=this.extractLinework(r)};ks.prototype.isWithinToleranceOfBoundary=function(r){for(var i=0;i<this._linework.getNumGeometries();i++)for(var a=this._linework.getGeometryN(i).getCoordinateSequence(),c=0;c<a.size()-1;c++)if(a.getCoordinate(c,this._seg.p0),a.getCoordinate(c+1,this._seg.p1),this._seg.distance(r)<=this._boundaryDistanceTolerance)return!0;return!1},ks.prototype.getLocation=function(r){return this.isWithinToleranceOfBoundary(r)?K.BOUNDARY:this._ptLocator.locate(r,this._g)},ks.prototype.extractLinework=function(r){var i=new bu;r.apply(i);var a=i.getLinework(),c=Le.toLineStringArray(a);return r.getFactory().createMultiLineString(c)},ks.prototype.interfaces_=function(){return[]},ks.prototype.getClass=function(){return ks};var bu=function(){this._linework=null,this._linework=new G};bu.prototype.getLinework=function(){return this._linework},bu.prototype.filter=function(r){if(r instanceof de){var i=r;this._linework.add(i.getExteriorRing());for(var a=0;a<i.getNumInteriorRing();a++)this._linework.add(i.getInteriorRingN(a))}},bu.prototype.interfaces_=function(){return[pr]},bu.prototype.getClass=function(){return bu};var va=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var r=arguments[0];this._g=r};va.prototype.extractPoints=function(r,i,a){for(var c=r.getCoordinates(),d=0;d<c.length-1;d++)this.computeOffsetPoints(c[d],c[d+1],i,a)},va.prototype.setSidesToGenerate=function(r,i){this._doLeft=r,this._doRight=i},va.prototype.getPoints=function(r){for(var i=new G,a=_e.getLines(this._g).iterator();a.hasNext();){var c=a.next();this.extractPoints(c,r,i)}return i},va.prototype.computeOffsetPoints=function(r,i,a,c){var d=i.x-r.x,v=i.y-r.y,M=Math.sqrt(d*d+v*v),L=a*d/M,H=a*v/M,it=(i.x+r.x)/2,bt=(i.y+r.y)/2;if(this._doLeft){var Tt=new D(it-H,bt+L);c.add(Tt)}if(this._doRight){var Kt=new D(it+H,bt-L);c.add(Kt)}},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var ci=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new G;var i=arguments[0],a=arguments[1],c=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(i,a),this._geom=[i,a,c],this._locFinder=[new ks(this._geom[0],this._boundaryDistanceTolerance),new ks(this._geom[1],this._boundaryDistanceTolerance),new ks(this._geom[2],this._boundaryDistanceTolerance)]},Au={TOLERANCE:{configurable:!0}};ci.prototype.reportResult=function(r,i,a){te.out.println("Overlay result invalid - A:"+K.toLocationSymbol(i[0])+" B:"+K.toLocationSymbol(i[1])+" expected:"+(a?"i":"e")+" actual:"+K.toLocationSymbol(i[2]))},ci.prototype.isValid=function(r){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var i=this.checkValid(r);return i},ci.prototype.checkValid=function(){if(arguments.length===1){for(var r=arguments[0],i=0;i<this._testCoords.size();i++){var a=this._testCoords.get(i);if(!this.checkValid(r,a))return this._invalidLocation=a,!1}return!0}if(arguments.length===2){var c=arguments[0],d=arguments[1];return this._location[0]=this._locFinder[0].getLocation(d),this._location[1]=this._locFinder[1].getLocation(d),this._location[2]=this._locFinder[2].getLocation(d),!!ci.hasLocation(this._location,K.BOUNDARY)||this.isValidResult(c,this._location)}},ci.prototype.addTestPts=function(r){var i=new va(r);this._testCoords.addAll(i.getPoints(5*this._boundaryDistanceTolerance))},ci.prototype.isValidResult=function(r,i){var a=Re.isResultOfOp(i[0],i[1],r),c=!(a^i[2]===K.INTERIOR);return c||this.reportResult(r,i,a),c},ci.prototype.getInvalidLocation=function(){return this._invalidLocation},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.hasLocation=function(r,i){for(var a=0;a<3;a++)if(r[a]===i)return!0;return!1},ci.computeBoundaryDistanceTolerance=function(r,i){return Math.min(fr.computeSizeBasedSnapTolerance(r),fr.computeSizeBasedSnapTolerance(i))},ci.isValid=function(r,i,a,c){return new ci(r,i,c).isValid(a)},Au.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(ci,Au);var Di=function r(i){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(i),this._inputGeoms=i};Di.prototype.extractElements=function(r,i){if(r===null)return null;for(var a=0;a<r.getNumGeometries();a++){var c=r.getGeometryN(a);this._skipEmpty&&c.isEmpty()||i.add(c)}},Di.prototype.combine=function(){for(var r=new G,i=this._inputGeoms.iterator();i.hasNext();){var a=i.next();this.extractElements(a,r)}return r.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(r)},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.combine=function(){if(arguments.length===1){var r=arguments[0];return new Di(r).combine()}if(arguments.length===2){var i=arguments[0],a=arguments[1];return new Di(Di.createList(i,a)).combine()}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2];return new Di(Di.createList(c,d,v)).combine()}},Di.extractFactory=function(r){return r.isEmpty()?null:r.iterator().next().getFactory()},Di.createList=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new G;return a.add(r),a.add(i),a}if(arguments.length===3){var c=arguments[0],d=arguments[1],v=arguments[2],M=new G;return M.add(c),M.add(d),M.add(v),M}};var U=function(){this._inputPolys=null,this._geomFactory=null;var r=arguments[0];this._inputPolys=r,this._inputPolys===null&&(this._inputPolys=new G)},Ya={STRTREE_NODE_CAPACITY:{configurable:!0}};U.prototype.reduceToGeometries=function(r){for(var i=new G,a=r.iterator();a.hasNext();){var c=a.next(),d=null;Q(c,Et)?d=this.unionTree(c):c instanceof Vt&&(d=c),i.add(d)}return i},U.prototype.extractByEnvelope=function(r,i,a){for(var c=new G,d=0;d<i.getNumGeometries();d++){var v=i.getGeometryN(d);v.getEnvelopeInternal().intersects(r)?c.add(v):a.add(v)}return this._geomFactory.buildGeometry(c)},U.prototype.unionOptimized=function(r,i){var a=r.getEnvelopeInternal(),c=i.getEnvelopeInternal();if(!a.intersects(c))return Di.combine(r,i);if(r.getNumGeometries()<=1&&i.getNumGeometries()<=1)return this.unionActual(r,i);var d=a.intersection(c);return this.unionUsingEnvelopeIntersection(r,i,d)},U.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var r=new Sf(U.STRTREE_NODE_CAPACITY),i=this._inputPolys.iterator();i.hasNext();){var a=i.next();r.insert(a.getEnvelopeInternal(),a)}this._inputPolys=null;var c=r.itemsTree();return this.unionTree(c)},U.prototype.binaryUnion=function(){if(arguments.length===1){var r=arguments[0];return this.binaryUnion(r,0,r.size())}if(arguments.length===3){var i=arguments[0],a=arguments[1],c=arguments[2];if(c-a<=1){var d=U.getGeometry(i,a);return this.unionSafe(d,null)}if(c-a==2)return this.unionSafe(U.getGeometry(i,a),U.getGeometry(i,a+1));var v=Math.trunc((c+a)/2),M=this.binaryUnion(i,a,v),L=this.binaryUnion(i,v,c);return this.unionSafe(M,L)}},U.prototype.repeatedUnion=function(r){for(var i=null,a=r.iterator();a.hasNext();){var c=a.next();i=i===null?c.copy():i.union(c)}return i},U.prototype.unionSafe=function(r,i){return r===null&&i===null?null:r===null?i.copy():i===null?r.copy():this.unionOptimized(r,i)},U.prototype.unionActual=function(r,i){return U.restrictToPolygons(r.union(i))},U.prototype.unionTree=function(r){var i=this.reduceToGeometries(r);return this.binaryUnion(i)},U.prototype.unionUsingEnvelopeIntersection=function(r,i,a){var c=new G,d=this.extractByEnvelope(a,r,c),v=this.extractByEnvelope(a,i,c),M=this.unionActual(d,v);return c.add(M),Di.combine(c)},U.prototype.bufferUnion=function(){if(arguments.length===1){var r=arguments[0];return r.get(0).getFactory().buildGeometry(r).buffer(0)}if(arguments.length===2){var i=arguments[0],a=arguments[1];return i.getFactory().createGeometryCollection([i,a]).buffer(0)}},U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.restrictToPolygons=function(r){if(Q(r,we))return r;var i=se.getPolygons(r);return i.size()===1?i.get(0):r.getFactory().createMultiPolygon(Le.toPolygonArray(i))},U.getGeometry=function(r,i){return i>=r.size()?null:r.get(i)},U.union=function(r){return new U(r).union()},Ya.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(U,Ya);var _a=function(){};_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a},_a.union=function(r,i){if(r.isEmpty()||i.isEmpty()){if(r.isEmpty()&&i.isEmpty())return Re.createEmptyResult(Re.UNION,r,i,r.getFactory());if(r.isEmpty())return i.copy();if(i.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(i),zr.overlayOp(r,i,Re.UNION)},n.GeoJSONReader=ll,n.GeoJSONWriter=Ba,n.OverlayOp=Re,n.UnionOp=_a,n.BufferOp=Xr,Object.defineProperty(n,"__esModule",{value:!0})})});var AN=ot((vf,Uh)=>{(function(){var n,t="4.17.21",e=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",m=1,_=2,w=4,S=1,b=2,C=1,R=2,x=4,E=8,I=16,A=32,F=64,V=128,X=256,q=512,D=30,xt="...",B=800,j=16,K=1,Dt=2,Q=3,At=1/0,Mt=9007199254740991,Lt=17976931348623157e292,pt=NaN,yt=4294967295,J=yt-1,Bt=yt>>>1,Gt=[["ary",V],["bind",C],["bindKey",R],["curry",E],["curryRight",I],["flip",q],["partial",A],["partialRight",F],["rearg",X]],ae="[object Arguments]",ut="[object Array]",Ut="[object AsyncFunction]",jt="[object Boolean]",ce="[object Date]",te="[object DOMException]",$t="[object Error]",qt="[object Function]",xe="[object GeneratorFunction]",ft="[object Map]",Xe="[object Number]",ee="[object Null]",ge="[object Object]",fe="[object Promise]",Te="[object Proxy]",be="[object RegExp]",Wt="[object Set]",Me="[object String]",tt="[object Symbol]",z="[object Undefined]",It="[object WeakMap]",Ot="[object WeakSet]",dt="[object ArrayBuffer]",Ht="[object DataView]",Ce="[object Float32Array]",Vt="[object Float64Array]",Zt="[object Int8Array]",ne="[object Int16Array]",rt="[object Int32Array]",P="[object Uint8Array]",N="[object Uint8ClampedArray]",k="[object Uint16Array]",$="[object Uint32Array]",W=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,Et=/[&<>"']/g,G=RegExp(wt.source),st=RegExp(Et.source),et=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,me=/^\w*$/,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,He=/[\\^$.*+?()[\]{}|]/g,Ue=RegExp(He.source),Ye=/^\s+/,Qe=/\s/,wr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Kr=/\{\n\/\* \[wrapped with (.+)\] \*/,nr=/,? & /,Ie=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rr=/[()=,{}\[\]\/\s]/,pr=/\\(\\)?/g,ur=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qn=/\w*$/,bi=/^[-+]0x[0-9a-f]+$/i,oi=/^0b[01]+$/i,Z=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,Rt=/^(?:0|[1-9]\d*)$/,St=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,he=/['\n\r\u2028\u2029\\]/g,ue="\\ud800-\\udfff",we="\\u0300-\\u036f",de="\\ufe20-\\ufe2f",Be="\\u20d0-\\u20ff",Ae=we+de+Be,Pe="\\u2700-\\u27bf",rn="a-z\\xdf-\\xf6\\xf8-\\xff",si="\\xac\\xb1\\xd7\\xf7",br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wi="\\u2000-\\u206f",sr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="A-Z\\xc0-\\xd6\\xd8-\\xde",Fa="\\ufe0e\\ufe0f",on=si+br+Wi+sr,fo="['\u2019]",ul="["+ue+"]",Ge="["+on+"]",ys="["+Ae+"]",ir="\\d+",jo="["+Pe+"]",Le="["+rn+"]",Ai="[^"+ue+on+ir+Pe+rn+ye+"]",Ua="\\ud83c[\\udffb-\\udfff]",yu="(?:"+ys+"|"+Ua+")",Ti="[^"+ue+"]",Po="(?:\\ud83c[\\udde6-\\uddff]){2}",ll="[\\ud800-\\udbff][\\udc00-\\udfff]",Ba="["+ye+"]",Xt="\\u200d",cl="(?:"+Le+"|"+Ai+")",Io="(?:"+Ba+"|"+Ai+")",Qo="(?:"+fo+"(?:d|ll|m|re|s|t|ve))?",fl="(?:"+fo+"(?:D|LL|M|RE|S|T|VE))?",Jr=yu+"?",Zn="["+Fa+"]?",On="(?:"+Xt+"(?:"+[Ti,Po,ll].join("|")+")"+Zn+Jr+")*",Ar="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",em="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bh=Zn+Jr+On,Xi="(?:"+[jo,Po,ll].join("|")+")"+Bh,Kl="(?:"+[Ti+ys+"?",ys,Po,ll,ul].join("|")+")",Ro=RegExp(fo,"g"),Yn=RegExp(ys,"g"),za=RegExp(Ua+"(?="+Ua+")|"+Kl+Bh,"g"),jr=RegExp([Ba+"?"+Le+"+"+Qo+"(?="+[Ge,Ba,"$"].join("|")+")",Io+"+"+fl+"(?="+[Ge,Ba+cl,"$"].join("|")+")",Ba+"?"+cl+"+"+Qo,Ba+"+"+fl,em,Ar,ir,Xi].join("|"),"g"),Ef=RegExp("["+Xt+ue+Ae+Fa+"]"),vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ci=-1,or={};or[Ce]=or[Vt]=or[Zt]=or[ne]=or[rt]=or[P]=or[N]=or[k]=or[$]=!0,or[ae]=or[ut]=or[dt]=or[jt]=or[Ht]=or[ce]=or[$t]=or[qt]=or[ft]=or[Xe]=or[ge]=or[be]=or[Wt]=or[Me]=or[It]=!1;var tn={};tn[ae]=tn[ut]=tn[dt]=tn[Ht]=tn[jt]=tn[ce]=tn[Ce]=tn[Vt]=tn[Zt]=tn[ne]=tn[rt]=tn[ft]=tn[Xe]=tn[ge]=tn[be]=tn[Wt]=tn[Me]=tn[tt]=tn[P]=tn[N]=tn[k]=tn[$]=!0,tn[$t]=tn[qt]=tn[It]=!1;var vs={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Us={"&":"&","<":"<",">":">",'"':""","'":"'"},Ga={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ir={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zh=parseFloat,ho=parseInt,Sr=typeof global=="object"&&global&&global.Object===Object&&global,Fr=typeof self=="object"&&self&&self.Object===Object&&self,Ur=Sr||Fr||Function("return this")(),wf=typeof vf=="object"&&vf&&!vf.nodeType&&vf,Lo=wf&&typeof Uh=="object"&&Uh&&!Uh.nodeType&&Uh,Sf=Lo&&Lo.exports===wf,Jl=Sf&&Sr.process,lr=function(){try{var gt=Lo&&Lo.require&&Lo.require("util").types;return gt||Jl&&Jl.binding&&Jl.binding("util")}catch(Nt){}}(),_s=lr&&lr.isArrayBuffer,Qr=lr&&lr.isDate,ua=lr&&lr.isMap,No=lr&&lr.isRegExp,_u=lr&&lr.isSet,mr=lr&&lr.isTypedArray;function ie(gt,Nt,Ct){switch(Ct.length){case 0:return gt.call(Nt);case 1:return gt.call(Nt,Ct[0]);case 2:return gt.call(Nt,Ct[0],Ct[1]);case 3:return gt.call(Nt,Ct[0],Ct[1],Ct[2])}return gt.apply(Nt,Ct)}function Gh(gt,Nt,Ct,se){for(var _e=-1,qe=gt==null?0:gt.length;++_e<qe;){var ln=gt[_e];Nt(se,ln,Ct(ln),gt)}return se}function Pi(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se&&Nt(gt[Ct],Ct,gt)!==!1;);return gt}function Ii(gt,Nt){for(var Ct=gt==null?0:gt.length;Ct--&&Nt(gt[Ct],Ct,gt)!==!1;);return gt}function po(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se;)if(!Nt(gt[Ct],Ct,gt))return!1;return!0}function Yi(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length,_e=0,qe=[];++Ct<se;){var ln=gt[Ct];Nt(ln,Ct,gt)&&(qe[_e++]=ln)}return qe}function la(gt,Nt){var Ct=gt==null?0:gt.length;return!!Ct&&xs(gt,Nt,0)>-1}function hl(gt,Nt,Ct){for(var se=-1,_e=gt==null?0:gt.length;++se<_e;)if(Ct(Nt,gt[se]))return!0;return!1}function Mr(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length,_e=Array(se);++Ct<se;)_e[Ct]=Nt(gt[Ct],Ct,gt);return _e}function ke(gt,Nt){for(var Ct=-1,se=Nt.length,_e=gt.length;++Ct<se;)gt[_e+Ct]=Nt[Ct];return gt}function Oo(gt,Nt,Ct,se){var _e=-1,qe=gt==null?0:gt.length;for(se&&qe&&(Ct=gt[++_e]);++_e<qe;)Ct=Nt(Ct,gt[_e],_e,gt);return Ct}function yr(gt,Nt,Ct,se){var _e=gt==null?0:gt.length;for(se&&_e&&(Ct=gt[--_e]);_e--;)Ct=Nt(Ct,gt[_e],_e,gt);return Ct}function ka(gt,Nt){for(var Ct=-1,se=gt==null?0:gt.length;++Ct<se;)if(Nt(gt[Ct],Ct,gt))return!0;return!1}var $i=Es("length");function kh(gt){return gt.split("")}function Ve(gt){return gt.match(Ie)||[]}function ca(gt,Nt,Ct){var se;return Ct(gt,function(_e,qe,ln){if(Nt(_e,qe,ln))return se=qe,!1}),se}function Kn(gt,Nt,Ct,se){for(var _e=gt.length,qe=Ct+(se?1:-1);se?qe--:++qe<_e;)if(Nt(gt[qe],qe,gt))return qe;return-1}function xs(gt,Nt,Ct){return Nt===Nt?pl(gt,Nt,Ct):Kn(gt,fa,Ct)}function pi(gt,Nt,Ct,se){for(var _e=Ct-1,qe=gt.length;++_e<qe;)if(se(gt[_e],Nt))return _e;return-1}function fa(gt){return gt!==gt}function Mf(gt,Nt){var Ct=gt==null?0:gt.length;return Ct?go(gt,Nt)/Ct:pt}function Es(gt){return function(Nt){return Nt==null?n:Nt[gt]}}function Ze(gt){return function(Nt){return gt==null?n:gt[Nt]}}function Zi(gt,Nt,Ct,se,_e){return _e(gt,function(qe,ln,cr){Ct=se?(se=!1,qe):Nt(Ct,qe,ln,cr)}),Ct}function xu(gt,Nt){var Ct=gt.length;for(gt.sort(Nt);Ct--;)gt[Ct]=gt[Ct].value;return gt}function go(gt,Nt){for(var Ct,se=-1,_e=gt.length;++se<_e;){var qe=Nt(gt[se]);qe!==n&&(Ct=Ct===n?qe:Ct+qe)}return Ct}function di(gt,Nt){for(var Ct=-1,se=Array(gt);++Ct<gt;)se[Ct]=Nt(Ct);return se}function ti(gt,Nt){return Mr(Nt,function(Ct){return[Ct,gt[Ct]]})}function qh(gt){return gt&>.slice(0,pa(gt)+1).replace(Ye,"")}function io(gt){return function(Nt){return gt(Nt)}}function ts(gt,Nt){return Mr(Nt,function(Ct){return gt[Ct]})}function gi(gt,Nt){return gt.has(Nt)}function Bs(gt,Nt){for(var Ct=-1,se=gt.length;++Ct<se&&xs(Nt,gt[Ct],0)>-1;);return Ct}function Ri(gt,Nt){for(var Ct=gt.length;Ct--&&xs(Nt,gt[Ct],0)>-1;);return Ct}function Do(gt,Nt){for(var Ct=gt.length,se=0;Ct--;)gt[Ct]===Nt&&++se;return se}var es=Ze(vs),ha=Ze(Us);function ws(gt){return"\\"+Ir[gt]}function Vr(gt,Nt){return gt==null?n:gt[Nt]}function qa(gt){return Ef.test(gt)}function jl(gt){return vu.test(gt)}function ai(gt){for(var Nt,Ct=[];!(Nt=gt.next()).done;)Ct.push(Nt.value);return Ct}function ns(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se,_e){Ct[++Nt]=[_e,se]}),Ct}function mo(gt,Nt){return function(Ct){return gt(Nt(Ct))}}function zs(gt,Nt){for(var Ct=-1,se=gt.length,_e=0,qe=[];++Ct<se;){var ln=gt[Ct];(ln===Nt||ln===g)&&(gt[Ct]=g,qe[_e++]=Ct)}return qe}function Wr(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se){Ct[++Nt]=se}),Ct}function Hh(gt){var Nt=-1,Ct=Array(gt.size);return gt.forEach(function(se){Ct[++Nt]=[se,se]}),Ct}function pl(gt,Nt,Ct){for(var se=Ct-1,_e=gt.length;++se<_e;)if(gt[se]===Nt)return se;return-1}function Eu(gt,Nt,Ct){for(var se=Ct+1;se--;)if(gt[se]===Nt)return se;return se}function Ha(gt){return qa(gt)?Xr(gt):$i(gt)}function Fo(gt){return qa(gt)?wu(gt):kh(gt)}function pa(gt){for(var Nt=gt.length;Nt--&&Qe.test(gt.charAt(Nt)););return Nt}var rs=Ze(Ga);function Xr(gt){for(var Nt=za.lastIndex=0;za.test(gt);)++Nt;return Nt}function wu(gt){return gt.match(za)||[]}function ui(gt){return gt.match(jr)||[]}var is=function gt(Nt){Nt=Nt==null?Ur:Ki.defaults(Ur.Object(),Nt,Ki.pick(Ur,dr));var Ct=Nt.Array,se=Nt.Date,_e=Nt.Error,qe=Nt.Function,ln=Nt.Math,cr=Nt.Object,os=Nt.RegExp,Va=Nt.String,tr=Nt.TypeError,Nr=Ct.prototype,Uo=qe.prototype,ei=cr.prototype,Su=Nt["__core-js_shared__"],Ss=Uo.toString,sn=ei.hasOwnProperty,Li=0,Ql=function(){var u=/[^.]+$/.exec(Su&&Su.keys&&Su.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Rr=ei.toString,bf=Ss.call(cr),Bo=Ur._,Br=os("^"+Ss.call(sn).replace(He,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ni=Sf?Nt.Buffer:n,Ji=Nt.Symbol,Ms=Nt.Uint8Array,yo=Ni?Ni.allocUnsafe:n,bs=mo(cr.getPrototypeOf,cr),li=cr.create,zo=ei.propertyIsEnumerable,fr=Nr.splice,Af=Ji?Ji.isConcatSpreadable:n,Mu=Ji?Ji.iterator:n,Tr=Ji?Ji.toStringTag:n,Go=function(){try{var u=vl(cr,"defineProperty");return u({},"",{}),u}catch(f){}}(),Tf=Nt.clearTimeout!==Ur.clearTimeout&&Nt.clearTimeout,Wa=se&&se.now!==Ur.Date.now&&se.now,Gs=Nt.setTimeout!==Ur.setTimeout&&Nt.setTimeout,Cr=ln.ceil,zr=ln.floor,Xa=cr.getOwnPropertySymbols,Oi=Ni?Ni.isBuffer:n,tc=Nt.isFinite,ec=Nr.join,Yr=mo(cr.keys,cr),ni=ln.max,vr=ln.min,Vh=se.now,dl=Nt.parseInt,Wh=ln.random,nm=Nr.reverse,vo=vl(Nt,"DataView"),As=vl(Nt,"Map"),da=vl(Nt,"Promise"),ga=vl(Nt,"Set"),Ts=vl(Nt,"WeakMap"),ko=vl(cr,"create"),ma=Ts&&new Ts,ss={},ya=_l(vo),Re=_l(As),ks=_l(da),bu=_l(ga),va=_l(Ts),ci=Ji?Ji.prototype:n,Au=ci?ci.valueOf:n,Di=ci?ci.toString:n;function U(u){if($r(u)&&!We(u)&&!(u instanceof i)){if(u instanceof r)return u;if(sn.call(u,"__wrapped__"))return Gx(u)}return new r(u)}var Ya=function(){function u(){}return function(f){if(!Gr(f))return{};if(li)return li(f);u.prototype=f;var y=new u;return u.prototype=n,y}}();function _a(){}function r(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}U.templateSettings={escape:et,evaluate:lt,interpolate:Ft,variable:"",imports:{_:U}},U.prototype=_a.prototype,U.prototype.constructor=U,r.prototype=Ya(_a.prototype),r.prototype.constructor=r;function i(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=yt,this.__views__=[]}function a(){var u=new i(this.__wrapped__);return u.__actions__=qo(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=qo(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=qo(this.__views__),u}function c(){if(this.__filtered__){var u=new i(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function d(){var u=this.__wrapped__.value(),f=this.__dir__,y=We(u),T=f<0,O=y?u.length:0,Y=oO(0,O,this.__views__),nt=Y.start,ct=Y.end,_t=ct-nt,zt=T?ct:nt-1,kt=this.__iteratees__,Yt=kt.length,pe=0,Se=vr(_t,this.__takeCount__);if(!y||!T&&O==_t&&Se==_t)return lx(u,this.__actions__);var De=[];t:for(;_t--&&pe<Se;){zt+=f;for(var en=-1,Fe=u[zt];++en<Yt;){var Fn=kt[en],$n=Fn.iteratee,cs=Fn.type,Eo=$n(Fe);if(cs==Dt)Fe=Eo;else if(!Eo){if(cs==K)continue t;break t}}De[pe++]=Fe}return De}i.prototype=Ya(_a.prototype),i.prototype.constructor=i;function v(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function M(){this.__data__=ko?ko(null):{},this.size=0}function L(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}function H(u){var f=this.__data__;if(ko){var y=f[u];return y===p?n:y}return sn.call(f,u)?f[u]:n}function it(u){var f=this.__data__;return ko?f[u]!==n:sn.call(f,u)}function bt(u,f){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=ko&&f===n?p:f,this}v.prototype.clear=M,v.prototype.delete=L,v.prototype.get=H,v.prototype.has=it,v.prototype.set=bt;function Tt(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function Kt(){this.__data__=[],this.size=0}function Qt(u){var f=this.__data__,y=Xh(f,u);if(y<0)return!1;var T=f.length-1;return y==T?f.pop():fr.call(f,y,1),--this.size,!0}function le(u){var f=this.__data__,y=Xh(f,u);return y<0?n:f[y][1]}function Ee(u){return Xh(this.__data__,u)>-1}function Dn(u,f){var y=this.__data__,T=Xh(y,u);return T<0?(++this.size,y.push([u,f])):y[T][1]=f,this}Tt.prototype.clear=Kt,Tt.prototype.delete=Qt,Tt.prototype.get=le,Tt.prototype.has=Ee,Tt.prototype.set=Dn;function Jn(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var T=u[f];this.set(T[0],T[1])}}function fi(){this.size=0,this.__data__={hash:new v,map:new(As||Tt),string:new v}}function as(u){var f=ip(this,u).delete(u);return this.size-=f?1:0,f}function qs(u){return ip(this,u).get(u)}function Cf(u){return ip(this,u).has(u)}function u2(u,f){var y=ip(this,u),T=y.size;return y.set(u,f),this.size+=y.size==T?0:1,this}Jn.prototype.clear=fi,Jn.prototype.delete=as,Jn.prototype.get=qs,Jn.prototype.has=Cf,Jn.prototype.set=u2;function gl(u){var f=-1,y=u==null?0:u.length;for(this.__data__=new Jn;++f<y;)this.add(u[f])}function l2(u){return this.__data__.set(u,p),this}function c2(u){return this.__data__.has(u)}gl.prototype.add=gl.prototype.push=l2,gl.prototype.has=c2;function Hs(u){var f=this.__data__=new Tt(u);this.size=f.size}function f2(){this.__data__=new Tt,this.size=0}function h2(u){var f=this.__data__,y=f.delete(u);return this.size=f.size,y}function p2(u){return this.__data__.get(u)}function d2(u){return this.__data__.has(u)}function g2(u,f){var y=this.__data__;if(y instanceof Tt){var T=y.__data__;if(!As||T.length<e-1)return T.push([u,f]),this.size=++y.size,this;y=this.__data__=new Jn(T)}return y.set(u,f),this.size=y.size,this}Hs.prototype.clear=f2,Hs.prototype.delete=h2,Hs.prototype.get=p2,Hs.prototype.has=d2,Hs.prototype.set=g2;function G1(u,f){var y=We(u),T=!y&&xl(u),O=!y&&!T&&Ru(u),Y=!y&&!T&&!O&&oc(u),nt=y||T||O||Y,ct=nt?di(u.length,Va):[],_t=ct.length;for(var zt in u)(f||sn.call(u,zt))&&!(nt&&(zt=="length"||O&&(zt=="offset"||zt=="parent")||Y&&(zt=="buffer"||zt=="byteLength"||zt=="byteOffset")||Ja(zt,_t)))&&ct.push(zt);return ct}function k1(u){var f=u.length;return f?u[pm(0,f-1)]:n}function m2(u,f){return op(qo(u),ml(f,0,u.length))}function y2(u){return op(qo(u))}function rm(u,f,y){(y!==n&&!Vs(u[f],y)||y===n&&!(f in u))&&$a(u,f,y)}function Pf(u,f,y){var T=u[f];(!(sn.call(u,f)&&Vs(T,y))||y===n&&!(f in u))&&$a(u,f,y)}function Xh(u,f){for(var y=u.length;y--;)if(Vs(u[y][0],f))return y;return-1}function v2(u,f,y,T){return Tu(u,function(O,Y,nt){f(T,O,y(O),nt)}),T}function q1(u,f){return u&&Ea(f,Fi(f),u)}function _2(u,f){return u&&Ea(f,Vo(f),u)}function $a(u,f,y){f=="__proto__"&&Go?Go(u,f,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[f]=y}function im(u,f){for(var y=-1,T=f.length,O=Ct(T),Y=u==null;++y<T;)O[y]=Y?n:Bm(u,f[y]);return O}function ml(u,f,y){return u===u&&(y!==n&&(u=u<=y?u:y),f!==n&&(u=u>=f?u:f)),u}function Cs(u,f,y,T,O,Y){var nt,ct=f&m,_t=f&_,zt=f&w;if(y&&(nt=O?y(u,T,O,Y):y(u)),nt!==n)return nt;if(!Gr(u))return u;var kt=We(u);if(kt){if(nt=aO(u),!ct)return qo(u,nt)}else{var Yt=oo(u),pe=Yt==qt||Yt==xe;if(Ru(u))return hx(u,ct);if(Yt==ge||Yt==ae||pe&&!O){if(nt=_t||pe?{}:Rx(u),!ct)return _t?K2(u,_2(nt,u)):Z2(u,q1(nt,u))}else{if(!tn[Yt])return O?u:{};nt=uO(u,Yt,ct)}}Y||(Y=new Hs);var Se=Y.get(u);if(Se)return Se;Y.set(u,nt),sE(u)?u.forEach(function(Fe){nt.add(Cs(Fe,f,y,Fe,u,Y))}):iE(u)&&u.forEach(function(Fe,Fn){nt.set(Fn,Cs(Fe,f,y,Fn,u,Y))});var De=zt?_t?Mm:Sm:_t?Vo:Fi,en=kt?n:De(u);return Pi(en||u,function(Fe,Fn){en&&(Fn=Fe,Fe=u[Fn]),Pf(nt,Fn,Cs(Fe,f,y,Fn,u,Y))}),nt}function x2(u){var f=Fi(u);return function(y){return H1(y,u,f)}}function H1(u,f,y){var T=y.length;if(u==null)return!T;for(u=cr(u);T--;){var O=y[T],Y=f[O],nt=u[O];if(nt===n&&!(O in u)||!Y(nt))return!1}return!0}function V1(u,f,y){if(typeof u!="function")throw new tr(s);return Ff(function(){u.apply(n,y)},f)}function If(u,f,y,T){var O=-1,Y=la,nt=!0,ct=u.length,_t=[],zt=f.length;if(!ct)return _t;y&&(f=Mr(f,io(y))),T?(Y=hl,nt=!1):f.length>=e&&(Y=gi,nt=!1,f=new gl(f));t:for(;++O<ct;){var kt=u[O],Yt=y==null?kt:y(kt);if(kt=T||kt!==0?kt:0,nt&&Yt===Yt){for(var pe=zt;pe--;)if(f[pe]===Yt)continue t;_t.push(kt)}else Y(f,Yt,T)||_t.push(kt)}return _t}var Tu=yx(xa),W1=yx(sm,!0);function E2(u,f){var y=!0;return Tu(u,function(T,O,Y){return y=!!f(T,O,Y),y}),y}function Yh(u,f,y){for(var T=-1,O=u.length;++T<O;){var Y=u[T],nt=f(Y);if(nt!=null&&(ct===n?nt===nt&&!ls(nt):y(nt,ct)))var ct=nt,_t=Y}return _t}function w2(u,f,y,T){var O=u.length;for(y=Ke(y),y<0&&(y=-y>O?0:O+y),T=T===n||T>O?O:Ke(T),T<0&&(T+=O),T=y>T?0:uE(T);y<T;)u[y++]=f;return u}function X1(u,f){var y=[];return Tu(u,function(T,O,Y){f(T,O,Y)&&y.push(T)}),y}function ji(u,f,y,T,O){var Y=-1,nt=u.length;for(y||(y=cO),O||(O=[]);++Y<nt;){var ct=u[Y];f>0&&y(ct)?f>1?ji(ct,f-1,y,T,O):ke(O,ct):T||(O[O.length]=ct)}return O}var om=vx(),Y1=vx(!0);function xa(u,f){return u&&om(u,f,Fi)}function sm(u,f){return u&&Y1(u,f,Fi)}function $h(u,f){return Yi(f,function(y){return ja(u[y])})}function yl(u,f){f=Pu(f,u);for(var y=0,T=f.length;u!=null&&y<T;)u=u[wa(f[y++])];return y&&y==T?u:n}function $1(u,f,y){var T=f(u);return We(u)?T:ke(T,y(u))}function _o(u){return u==null?u===n?z:ee:Tr&&Tr in cr(u)?iO(u):yO(u)}function am(u,f){return u>f}function S2(u,f){return u!=null&&sn.call(u,f)}function M2(u,f){return u!=null&&f in cr(u)}function b2(u,f,y){return u>=vr(f,y)&&u<ni(f,y)}function um(u,f,y){for(var T=y?hl:la,O=u[0].length,Y=u.length,nt=Y,ct=Ct(Y),_t=1/0,zt=[];nt--;){var kt=u[nt];nt&&f&&(kt=Mr(kt,io(f))),_t=vr(kt.length,_t),ct[nt]=!y&&(f||O>=120&&kt.length>=120)?new gl(nt&&kt):n}kt=u[0];var Yt=-1,pe=ct[0];t:for(;++Yt<O&&zt.length<_t;){var Se=kt[Yt],De=f?f(Se):Se;if(Se=y||Se!==0?Se:0,!(pe?gi(pe,De):T(zt,De,y))){for(nt=Y;--nt;){var en=ct[nt];if(!(en?gi(en,De):T(u[nt],De,y)))continue t}pe&&pe.push(De),zt.push(Se)}}return zt}function A2(u,f,y,T){return xa(u,function(O,Y,nt){f(T,y(O),Y,nt)}),T}function Rf(u,f,y){f=Pu(f,u),u=Dx(u,f);var T=u==null?u:u[wa(Is(f))];return T==null?n:ie(T,u,y)}function Z1(u){return $r(u)&&_o(u)==ae}function T2(u){return $r(u)&&_o(u)==dt}function C2(u){return $r(u)&&_o(u)==ce}function Lf(u,f,y,T,O){return u===f?!0:u==null||f==null||!$r(u)&&!$r(f)?u!==u&&f!==f:P2(u,f,y,T,Lf,O)}function P2(u,f,y,T,O,Y){var nt=We(u),ct=We(f),_t=nt?ut:oo(u),zt=ct?ut:oo(f);_t=_t==ae?ge:_t,zt=zt==ae?ge:zt;var kt=_t==ge,Yt=zt==ge,pe=_t==zt;if(pe&&Ru(u)){if(!Ru(f))return!1;nt=!0,kt=!1}if(pe&&!kt)return Y||(Y=new Hs),nt||oc(u)?Cx(u,f,y,T,O,Y):nO(u,f,_t,y,T,O,Y);if(!(y&S)){var Se=kt&&sn.call(u,"__wrapped__"),De=Yt&&sn.call(f,"__wrapped__");if(Se||De){var en=Se?u.value():u,Fe=De?f.value():f;return Y||(Y=new Hs),O(en,Fe,y,T,Y)}}return pe?(Y||(Y=new Hs),rO(u,f,y,T,O,Y)):!1}function I2(u){return $r(u)&&oo(u)==ft}function lm(u,f,y,T){var O=y.length,Y=O,nt=!T;if(u==null)return!Y;for(u=cr(u);O--;){var ct=y[O];if(nt&&ct[2]?ct[1]!==u[ct[0]]:!(ct[0]in u))return!1}for(;++O<Y;){ct=y[O];var _t=ct[0],zt=u[_t],kt=ct[1];if(nt&&ct[2]){if(zt===n&&!(_t in u))return!1}else{var Yt=new Hs;if(T)var pe=T(zt,kt,_t,u,f,Yt);if(!(pe===n?Lf(kt,zt,S|b,T,Yt):pe))return!1}}return!0}function K1(u){if(!Gr(u)||hO(u))return!1;var f=ja(u)?Br:Z;return f.test(_l(u))}function R2(u){return $r(u)&&_o(u)==be}function L2(u){return $r(u)&&oo(u)==Wt}function N2(u){return $r(u)&&fp(u.length)&&!!or[_o(u)]}function J1(u){return typeof u=="function"?u:u==null?Wo:typeof u=="object"?We(u)?tx(u[0],u[1]):Q1(u):_E(u)}function cm(u){if(!Df(u))return Yr(u);var f=[];for(var y in cr(u))sn.call(u,y)&&y!="constructor"&&f.push(y);return f}function O2(u){if(!Gr(u))return mO(u);var f=Df(u),y=[];for(var T in u)T=="constructor"&&(f||!sn.call(u,T))||y.push(T);return y}function fm(u,f){return u<f}function j1(u,f){var y=-1,T=Ho(u)?Ct(u.length):[];return Tu(u,function(O,Y,nt){T[++y]=f(O,Y,nt)}),T}function Q1(u){var f=Am(u);return f.length==1&&f[0][2]?Nx(f[0][0],f[0][1]):function(y){return y===u||lm(y,u,f)}}function tx(u,f){return Cm(u)&&Lx(f)?Nx(wa(u),f):function(y){var T=Bm(y,u);return T===n&&T===f?zm(y,u):Lf(f,T,S|b)}}function Zh(u,f,y,T,O){u!==f&&om(f,function(Y,nt){if(O||(O=new Hs),Gr(Y))D2(u,f,nt,y,Zh,T,O);else{var ct=T?T(Im(u,nt),Y,nt+"",u,f,O):n;ct===n&&(ct=Y),rm(u,nt,ct)}},Vo)}function D2(u,f,y,T,O,Y,nt){var ct=Im(u,y),_t=Im(f,y),zt=nt.get(_t);if(zt){rm(u,y,zt);return}var kt=Y?Y(ct,_t,y+"",u,f,nt):n,Yt=kt===n;if(Yt){var pe=We(_t),Se=!pe&&Ru(_t),De=!pe&&!Se&&oc(_t);kt=_t,pe||Se||De?We(ct)?kt=ct:ri(ct)?kt=qo(ct):Se?(Yt=!1,kt=hx(_t,!0)):De?(Yt=!1,kt=px(_t,!0)):kt=[]:Uf(_t)||xl(_t)?(kt=ct,xl(ct)?kt=lE(ct):(!Gr(ct)||ja(ct))&&(kt=Rx(_t))):Yt=!1}Yt&&(nt.set(_t,kt),O(kt,_t,T,Y,nt),nt.delete(_t)),rm(u,y,kt)}function ex(u,f){var y=u.length;if(y)return f+=f<0?y:0,Ja(f,y)?u[f]:n}function nx(u,f,y){f.length?f=Mr(f,function(Y){return We(Y)?function(nt){return yl(nt,Y.length===1?Y[0]:Y)}:Y}):f=[Wo];var T=-1;f=Mr(f,io(Ne()));var O=j1(u,function(Y,nt,ct){var _t=Mr(f,function(zt){return zt(Y)});return{criteria:_t,index:++T,value:Y}});return xu(O,function(Y,nt){return $2(Y,nt,y)})}function F2(u,f){return rx(u,f,function(y,T){return zm(u,T)})}function rx(u,f,y){for(var T=-1,O=f.length,Y={};++T<O;){var nt=f[T],ct=yl(u,nt);y(ct,nt)&&Nf(Y,Pu(nt,u),ct)}return Y}function U2(u){return function(f){return yl(f,u)}}function hm(u,f,y,T){var O=T?pi:xs,Y=-1,nt=f.length,ct=u;for(u===f&&(f=qo(f)),y&&(ct=Mr(u,io(y)));++Y<nt;)for(var _t=0,zt=f[Y],kt=y?y(zt):zt;(_t=O(ct,kt,_t,T))>-1;)ct!==u&&fr.call(ct,_t,1),fr.call(u,_t,1);return u}function ix(u,f){for(var y=u?f.length:0,T=y-1;y--;){var O=f[y];if(y==T||O!==Y){var Y=O;Ja(O)?fr.call(u,O,1):mm(u,O)}}return u}function pm(u,f){return u+zr(Wh()*(f-u+1))}function B2(u,f,y,T){for(var O=-1,Y=ni(Cr((f-u)/(y||1)),0),nt=Ct(Y);Y--;)nt[T?Y:++O]=u,u+=y;return nt}function dm(u,f){var y="";if(!u||f<1||f>Mt)return y;do f%2&&(y+=u),f=zr(f/2),f&&(u+=u);while(f);return y}function an(u,f){return Rm(Ox(u,f,Wo),u+"")}function z2(u){return k1(sc(u))}function G2(u,f){var y=sc(u);return op(y,ml(f,0,y.length))}function Nf(u,f,y,T){if(!Gr(u))return u;f=Pu(f,u);for(var O=-1,Y=f.length,nt=Y-1,ct=u;ct!=null&&++O<Y;){var _t=wa(f[O]),zt=y;if(_t==="__proto__"||_t==="constructor"||_t==="prototype")return u;if(O!=nt){var kt=ct[_t];zt=T?T(kt,_t,ct):n,zt===n&&(zt=Gr(kt)?kt:Ja(f[O+1])?[]:{})}Pf(ct,_t,zt),ct=ct[_t]}return u}var ox=ma?function(u,f){return ma.set(u,f),u}:Wo,k2=Go?function(u,f){return Go(u,"toString",{configurable:!0,enumerable:!1,value:km(f),writable:!0})}:Wo;function q2(u){return op(sc(u))}function Ps(u,f,y){var T=-1,O=u.length;f<0&&(f=-f>O?0:O+f),y=y>O?O:y,y<0&&(y+=O),O=f>y?0:y-f>>>0,f>>>=0;for(var Y=Ct(O);++T<O;)Y[T]=u[T+f];return Y}function H2(u,f){var y;return Tu(u,function(T,O,Y){return y=f(T,O,Y),!y}),!!y}function Kh(u,f,y){var T=0,O=u==null?T:u.length;if(typeof f=="number"&&f===f&&O<=Bt){for(;T<O;){var Y=T+O>>>1,nt=u[Y];nt!==null&&!ls(nt)&&(y?nt<=f:nt<f)?T=Y+1:O=Y}return O}return gm(u,f,Wo,y)}function gm(u,f,y,T){var O=0,Y=u==null?0:u.length;if(Y===0)return 0;f=y(f);for(var nt=f!==f,ct=f===null,_t=ls(f),zt=f===n;O<Y;){var kt=zr((O+Y)/2),Yt=y(u[kt]),pe=Yt!==n,Se=Yt===null,De=Yt===Yt,en=ls(Yt);if(nt)var Fe=T||De;else zt?Fe=De&&(T||pe):ct?Fe=De&&pe&&(T||!Se):_t?Fe=De&&pe&&!Se&&(T||!en):Se||en?Fe=!1:Fe=T?Yt<=f:Yt<f;Fe?O=kt+1:Y=kt}return vr(Y,J)}function sx(u,f){for(var y=-1,T=u.length,O=0,Y=[];++y<T;){var nt=u[y],ct=f?f(nt):nt;if(!y||!Vs(ct,_t)){var _t=ct;Y[O++]=nt===0?0:nt}}return Y}function ax(u){return typeof u=="number"?u:ls(u)?pt:+u}function us(u){if(typeof u=="string")return u;if(We(u))return Mr(u,us)+"";if(ls(u))return Di?Di.call(u):"";var f=u+"";return f=="0"&&1/u==-At?"-0":f}function Cu(u,f,y){var T=-1,O=la,Y=u.length,nt=!0,ct=[],_t=ct;if(y)nt=!1,O=hl;else if(Y>=e){var zt=f?null:tO(u);if(zt)return Wr(zt);nt=!1,O=gi,_t=new gl}else _t=f?[]:ct;t:for(;++T<Y;){var kt=u[T],Yt=f?f(kt):kt;if(kt=y||kt!==0?kt:0,nt&&Yt===Yt){for(var pe=_t.length;pe--;)if(_t[pe]===Yt)continue t;f&&_t.push(Yt),ct.push(kt)}else O(_t,Yt,y)||(_t!==ct&&_t.push(Yt),ct.push(kt))}return ct}function mm(u,f){return f=Pu(f,u),u=Dx(u,f),u==null||delete u[wa(Is(f))]}function ux(u,f,y,T){return Nf(u,f,y(yl(u,f)),T)}function Jh(u,f,y,T){for(var O=u.length,Y=T?O:-1;(T?Y--:++Y<O)&&f(u[Y],Y,u););return y?Ps(u,T?0:Y,T?Y+1:O):Ps(u,T?Y+1:0,T?O:Y)}function lx(u,f){var y=u;return y instanceof i&&(y=y.value()),Oo(f,function(T,O){return O.func.apply(O.thisArg,ke([T],O.args))},y)}function ym(u,f,y){var T=u.length;if(T<2)return T?Cu(u[0]):[];for(var O=-1,Y=Ct(T);++O<T;)for(var nt=u[O],ct=-1;++ct<T;)ct!=O&&(Y[O]=If(Y[O]||nt,u[ct],f,y));return Cu(ji(Y,1),f,y)}function cx(u,f,y){for(var T=-1,O=u.length,Y=f.length,nt={};++T<O;){var ct=T<Y?f[T]:n;y(nt,u[T],ct)}return nt}function vm(u){return ri(u)?u:[]}function _m(u){return typeof u=="function"?u:Wo}function Pu(u,f){return We(u)?u:Cm(u,f)?[u]:zx(hr(u))}var V2=an;function Iu(u,f,y){var T=u.length;return y=y===n?T:y,!f&&y>=T?u:Ps(u,f,y)}var fx=Tf||function(u){return Ur.clearTimeout(u)};function hx(u,f){if(f)return u.slice();var y=u.length,T=yo?yo(y):new u.constructor(y);return u.copy(T),T}function xm(u){var f=new u.constructor(u.byteLength);return new Ms(f).set(new Ms(u)),f}function W2(u,f){var y=f?xm(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function X2(u){var f=new u.constructor(u.source,Qn.exec(u));return f.lastIndex=u.lastIndex,f}function Y2(u){return Au?cr(Au.call(u)):{}}function px(u,f){var y=f?xm(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function dx(u,f){if(u!==f){var y=u!==n,T=u===null,O=u===u,Y=ls(u),nt=f!==n,ct=f===null,_t=f===f,zt=ls(f);if(!ct&&!zt&&!Y&&u>f||Y&&nt&&_t&&!ct&&!zt||T&&nt&&_t||!y&&_t||!O)return 1;if(!T&&!Y&&!zt&&u<f||zt&&y&&O&&!T&&!Y||ct&&y&&O||!nt&&O||!_t)return-1}return 0}function $2(u,f,y){for(var T=-1,O=u.criteria,Y=f.criteria,nt=O.length,ct=y.length;++T<nt;){var _t=dx(O[T],Y[T]);if(_t){if(T>=ct)return _t;var zt=y[T];return _t*(zt=="desc"?-1:1)}}return u.index-f.index}function gx(u,f,y,T){for(var O=-1,Y=u.length,nt=y.length,ct=-1,_t=f.length,zt=ni(Y-nt,0),kt=Ct(_t+zt),Yt=!T;++ct<_t;)kt[ct]=f[ct];for(;++O<nt;)(Yt||O<Y)&&(kt[y[O]]=u[O]);for(;zt--;)kt[ct++]=u[O++];return kt}function mx(u,f,y,T){for(var O=-1,Y=u.length,nt=-1,ct=y.length,_t=-1,zt=f.length,kt=ni(Y-ct,0),Yt=Ct(kt+zt),pe=!T;++O<kt;)Yt[O]=u[O];for(var Se=O;++_t<zt;)Yt[Se+_t]=f[_t];for(;++nt<ct;)(pe||O<Y)&&(Yt[Se+y[nt]]=u[O++]);return Yt}function qo(u,f){var y=-1,T=u.length;for(f||(f=Ct(T));++y<T;)f[y]=u[y];return f}function Ea(u,f,y,T){var O=!y;y||(y={});for(var Y=-1,nt=f.length;++Y<nt;){var ct=f[Y],_t=T?T(y[ct],u[ct],ct,y,u):n;_t===n&&(_t=u[ct]),O?$a(y,ct,_t):Pf(y,ct,_t)}return y}function Z2(u,f){return Ea(u,Tm(u),f)}function K2(u,f){return Ea(u,Px(u),f)}function jh(u,f){return function(y,T){var O=We(y)?Gh:v2,Y=f?f():{};return O(y,u,Ne(T,2),Y)}}function nc(u){return an(function(f,y){var T=-1,O=y.length,Y=O>1?y[O-1]:n,nt=O>2?y[2]:n;for(Y=u.length>3&&typeof Y=="function"?(O--,Y):n,nt&&xo(y[0],y[1],nt)&&(Y=O<3?n:Y,O=1),f=cr(f);++T<O;){var ct=y[T];ct&&u(f,ct,T,Y)}return f})}function yx(u,f){return function(y,T){if(y==null)return y;if(!Ho(y))return u(y,T);for(var O=y.length,Y=f?O:-1,nt=cr(y);(f?Y--:++Y<O)&&T(nt[Y],Y,nt)!==!1;);return y}}function vx(u){return function(f,y,T){for(var O=-1,Y=cr(f),nt=T(f),ct=nt.length;ct--;){var _t=nt[u?ct:++O];if(y(Y[_t],_t,Y)===!1)break}return f}}function J2(u,f,y){var T=f&C,O=Of(u);function Y(){var nt=this&&this!==Ur&&this instanceof Y?O:u;return nt.apply(T?y:this,arguments)}return Y}function _x(u){return function(f){f=hr(f);var y=qa(f)?Fo(f):n,T=y?y[0]:f.charAt(0),O=y?Iu(y,1).join(""):f.slice(1);return T[u]()+O}}function rc(u){return function(f){return Oo(yE(mE(f).replace(Ro,"")),u,"")}}function Of(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var y=Ya(u.prototype),T=u.apply(y,f);return Gr(T)?T:y}}function j2(u,f,y){var T=Of(u);function O(){for(var Y=arguments.length,nt=Ct(Y),ct=Y,_t=ic(O);ct--;)nt[ct]=arguments[ct];var zt=Y<3&&nt[0]!==_t&&nt[Y-1]!==_t?[]:zs(nt,_t);if(Y-=zt.length,Y<y)return Mx(u,f,Qh,O.placeholder,n,nt,zt,n,n,y-Y);var kt=this&&this!==Ur&&this instanceof O?T:u;return ie(kt,this,nt)}return O}function xx(u){return function(f,y,T){var O=cr(f);if(!Ho(f)){var Y=Ne(y,3);f=Fi(f),y=function(ct){return Y(O[ct],ct,O)}}var nt=u(f,y,T);return nt>-1?O[Y?f[nt]:nt]:n}}function Ex(u){return Ka(function(f){var y=f.length,T=y,O=r.prototype.thru;for(u&&f.reverse();T--;){var Y=f[T];if(typeof Y!="function")throw new tr(s);if(O&&!nt&&rp(Y)=="wrapper")var nt=new r([],!0)}for(T=nt?T:y;++T<y;){Y=f[T];var ct=rp(Y),_t=ct=="wrapper"?bm(Y):n;_t&&Pm(_t[0])&&_t[1]==(V|E|A|X)&&!_t[4].length&&_t[9]==1?nt=nt[rp(_t[0])].apply(nt,_t[3]):nt=Y.length==1&&Pm(Y)?nt[ct]():nt.thru(Y)}return function(){var zt=arguments,kt=zt[0];if(nt&&zt.length==1&&We(kt))return nt.plant(kt).value();for(var Yt=0,pe=y?f[Yt].apply(this,zt):kt;++Yt<y;)pe=f[Yt].call(this,pe);return pe}})}function Qh(u,f,y,T,O,Y,nt,ct,_t,zt){var kt=f&V,Yt=f&C,pe=f&R,Se=f&(E|I),De=f&q,en=pe?n:Of(u);function Fe(){for(var Fn=arguments.length,$n=Ct(Fn),cs=Fn;cs--;)$n[cs]=arguments[cs];if(Se)var Eo=ic(Fe),fs=Do($n,Eo);if(T&&($n=gx($n,T,O,Se)),Y&&($n=mx($n,Y,nt,Se)),Fn-=fs,Se&&Fn<zt){var ii=zs($n,Eo);return Mx(u,f,Qh,Fe.placeholder,y,$n,ii,ct,_t,zt-Fn)}var Ws=Yt?y:this,tu=pe?Ws[u]:u;return Fn=$n.length,ct?$n=vO($n,ct):De&&Fn>1&&$n.reverse(),kt&&_t<Fn&&($n.length=_t),this&&this!==Ur&&this instanceof Fe&&(tu=en||Of(tu)),tu.apply(Ws,$n)}return Fe}function wx(u,f){return function(y,T){return A2(y,u,f(T),{})}}function tp(u,f){return function(y,T){var O;if(y===n&&T===n)return f;if(y!==n&&(O=y),T!==n){if(O===n)return T;typeof y=="string"||typeof T=="string"?(y=us(y),T=us(T)):(y=ax(y),T=ax(T)),O=u(y,T)}return O}}function Em(u){return Ka(function(f){return f=Mr(f,io(Ne())),an(function(y){var T=this;return u(f,function(O){return ie(O,T,y)})})})}function ep(u,f){f=f===n?" ":us(f);var y=f.length;if(y<2)return y?dm(f,u):f;var T=dm(f,Cr(u/Ha(f)));return qa(f)?Iu(Fo(T),0,u).join(""):T.slice(0,u)}function Q2(u,f,y,T){var O=f&C,Y=Of(u);function nt(){for(var ct=-1,_t=arguments.length,zt=-1,kt=T.length,Yt=Ct(kt+_t),pe=this&&this!==Ur&&this instanceof nt?Y:u;++zt<kt;)Yt[zt]=T[zt];for(;_t--;)Yt[zt++]=arguments[++ct];return ie(pe,O?y:this,Yt)}return nt}function Sx(u){return function(f,y,T){return T&&typeof T!="number"&&xo(f,y,T)&&(y=T=n),f=Qa(f),y===n?(y=f,f=0):y=Qa(y),T=T===n?f<y?1:-1:Qa(T),B2(f,y,T,u)}}function np(u){return function(f,y){return typeof f=="string"&&typeof y=="string"||(f=Rs(f),y=Rs(y)),u(f,y)}}function Mx(u,f,y,T,O,Y,nt,ct,_t,zt){var kt=f&E,Yt=kt?nt:n,pe=kt?n:nt,Se=kt?Y:n,De=kt?n:Y;f|=kt?A:F,f&=~(kt?F:A),f&x||(f&=~(C|R));var en=[u,f,O,Se,Yt,De,pe,ct,_t,zt],Fe=y.apply(n,en);return Pm(u)&&Fx(Fe,en),Fe.placeholder=T,Ux(Fe,u,f)}function wm(u){var f=ln[u];return function(y,T){if(y=Rs(y),T=T==null?0:vr(Ke(T),292),T&&tc(y)){var O=(hr(y)+"e").split("e"),Y=f(O[0]+"e"+(+O[1]+T));return O=(hr(Y)+"e").split("e"),+(O[0]+"e"+(+O[1]-T))}return f(y)}}var tO=ga&&1/Wr(new ga([,-0]))[1]==At?function(u){return new ga(u)}:Vm;function bx(u){return function(f){var y=oo(f);return y==ft?ns(f):y==Wt?Hh(f):ti(f,u(f))}}function Za(u,f,y,T,O,Y,nt,ct){var _t=f&R;if(!_t&&typeof u!="function")throw new tr(s);var zt=T?T.length:0;if(zt||(f&=~(A|F),T=O=n),nt=nt===n?nt:ni(Ke(nt),0),ct=ct===n?ct:Ke(ct),zt-=O?O.length:0,f&F){var kt=T,Yt=O;T=O=n}var pe=_t?n:bm(u),Se=[u,f,y,T,O,kt,Yt,Y,nt,ct];if(pe&&gO(Se,pe),u=Se[0],f=Se[1],y=Se[2],T=Se[3],O=Se[4],ct=Se[9]=Se[9]===n?_t?0:u.length:ni(Se[9]-zt,0),!ct&&f&(E|I)&&(f&=~(E|I)),!f||f==C)var De=J2(u,f,y);else f==E||f==I?De=j2(u,f,ct):(f==A||f==(C|A))&&!O.length?De=Q2(u,f,y,T):De=Qh.apply(n,Se);var en=pe?ox:Fx;return Ux(en(De,Se),u,f)}function Ax(u,f,y,T){return u===n||Vs(u,ei[y])&&!sn.call(T,y)?f:u}function Tx(u,f,y,T,O,Y){return Gr(u)&&Gr(f)&&(Y.set(f,u),Zh(u,f,n,Tx,Y),Y.delete(f)),u}function eO(u){return Uf(u)?n:u}function Cx(u,f,y,T,O,Y){var nt=y&S,ct=u.length,_t=f.length;if(ct!=_t&&!(nt&&_t>ct))return!1;var zt=Y.get(u),kt=Y.get(f);if(zt&&kt)return zt==f&&kt==u;var Yt=-1,pe=!0,Se=y&b?new gl:n;for(Y.set(u,f),Y.set(f,u);++Yt<ct;){var De=u[Yt],en=f[Yt];if(T)var Fe=nt?T(en,De,Yt,f,u,Y):T(De,en,Yt,u,f,Y);if(Fe!==n){if(Fe)continue;pe=!1;break}if(Se){if(!ka(f,function(Fn,$n){if(!gi(Se,$n)&&(De===Fn||O(De,Fn,y,T,Y)))return Se.push($n)})){pe=!1;break}}else if(!(De===en||O(De,en,y,T,Y))){pe=!1;break}}return Y.delete(u),Y.delete(f),pe}function nO(u,f,y,T,O,Y,nt){switch(y){case Ht:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case dt:return!(u.byteLength!=f.byteLength||!Y(new Ms(u),new Ms(f)));case jt:case ce:case Xe:return Vs(+u,+f);case $t:return u.name==f.name&&u.message==f.message;case be:case Me:return u==f+"";case ft:var ct=ns;case Wt:var _t=T&S;if(ct||(ct=Wr),u.size!=f.size&&!_t)return!1;var zt=nt.get(u);if(zt)return zt==f;T|=b,nt.set(u,f);var kt=Cx(ct(u),ct(f),T,O,Y,nt);return nt.delete(u),kt;case tt:if(Au)return Au.call(u)==Au.call(f)}return!1}function rO(u,f,y,T,O,Y){var nt=y&S,ct=Sm(u),_t=ct.length,zt=Sm(f),kt=zt.length;if(_t!=kt&&!nt)return!1;for(var Yt=_t;Yt--;){var pe=ct[Yt];if(!(nt?pe in f:sn.call(f,pe)))return!1}var Se=Y.get(u),De=Y.get(f);if(Se&&De)return Se==f&&De==u;var en=!0;Y.set(u,f),Y.set(f,u);for(var Fe=nt;++Yt<_t;){pe=ct[Yt];var Fn=u[pe],$n=f[pe];if(T)var cs=nt?T($n,Fn,pe,f,u,Y):T(Fn,$n,pe,u,f,Y);if(!(cs===n?Fn===$n||O(Fn,$n,y,T,Y):cs)){en=!1;break}Fe||(Fe=pe=="constructor")}if(en&&!Fe){var Eo=u.constructor,fs=f.constructor;Eo!=fs&&"constructor"in u&&"constructor"in f&&!(typeof Eo=="function"&&Eo instanceof Eo&&typeof fs=="function"&&fs instanceof fs)&&(en=!1)}return Y.delete(u),Y.delete(f),en}function Ka(u){return Rm(Ox(u,n,Hx),u+"")}function Sm(u){return $1(u,Fi,Tm)}function Mm(u){return $1(u,Vo,Px)}var bm=ma?function(u){return ma.get(u)}:Vm;function rp(u){for(var f=u.name+"",y=ss[f],T=sn.call(ss,f)?y.length:0;T--;){var O=y[T],Y=O.func;if(Y==null||Y==u)return O.name}return f}function ic(u){var f=sn.call(U,"placeholder")?U:u;return f.placeholder}function Ne(){var u=U.iteratee||qm;return u=u===qm?J1:u,arguments.length?u(arguments[0],arguments[1]):u}function ip(u,f){var y=u.__data__;return fO(f)?y[typeof f=="string"?"string":"hash"]:y.map}function Am(u){for(var f=Fi(u),y=f.length;y--;){var T=f[y],O=u[T];f[y]=[T,O,Lx(O)]}return f}function vl(u,f){var y=Vr(u,f);return K1(y)?y:n}function iO(u){var f=sn.call(u,Tr),y=u[Tr];try{u[Tr]=n;var T=!0}catch(Y){}var O=Rr.call(u);return T&&(f?u[Tr]=y:delete u[Tr]),O}var Tm=Xa?function(u){return u==null?[]:(u=cr(u),Yi(Xa(u),function(f){return zo.call(u,f)}))}:Wm,Px=Xa?function(u){for(var f=[];u;)ke(f,Tm(u)),u=bs(u);return f}:Wm,oo=_o;(vo&&oo(new vo(new ArrayBuffer(1)))!=Ht||As&&oo(new As)!=ft||da&&oo(da.resolve())!=fe||ga&&oo(new ga)!=Wt||Ts&&oo(new Ts)!=It)&&(oo=function(u){var f=_o(u),y=f==ge?u.constructor:n,T=y?_l(y):"";if(T)switch(T){case ya:return Ht;case Re:return ft;case ks:return fe;case bu:return Wt;case va:return It}return f});function oO(u,f,y){for(var T=-1,O=y.length;++T<O;){var Y=y[T],nt=Y.size;switch(Y.type){case"drop":u+=nt;break;case"dropRight":f-=nt;break;case"take":f=vr(f,u+nt);break;case"takeRight":u=ni(u,f-nt);break}}return{start:u,end:f}}function sO(u){var f=u.match(Kr);return f?f[1].split(nr):[]}function Ix(u,f,y){f=Pu(f,u);for(var T=-1,O=f.length,Y=!1;++T<O;){var nt=wa(f[T]);if(!(Y=u!=null&&y(u,nt)))break;u=u[nt]}return Y||++T!=O?Y:(O=u==null?0:u.length,!!O&&fp(O)&&Ja(nt,O)&&(We(u)||xl(u)))}function aO(u){var f=u.length,y=new u.constructor(f);return f&&typeof u[0]=="string"&&sn.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function Rx(u){return typeof u.constructor=="function"&&!Df(u)?Ya(bs(u)):{}}function uO(u,f,y){var T=u.constructor;switch(f){case dt:return xm(u);case jt:case ce:return new T(+u);case Ht:return W2(u,y);case Ce:case Vt:case Zt:case ne:case rt:case P:case N:case k:case $:return px(u,y);case ft:return new T;case Xe:case Me:return new T(u);case be:return X2(u);case Wt:return new T;case tt:return Y2(u)}}function lO(u,f){var y=f.length;if(!y)return u;var T=y-1;return f[T]=(y>1?"& ":"")+f[T],f=f.join(y>2?", ":" "),u.replace(wr,`{
|
|
8
8
|
/* [wrapped with `+f+`] */
|
|
9
|
-
`)}function cO(u){return We(u)||xl(u)||!!(Af&&u&&u[Af])}function Ja(u,f){var y=typeof u;return f=f==null?Mt:f,!!f&&(y=="number"||y!="symbol"&&Rt.test(u))&&u>-1&&u%1==0&&u<f}function xo(u,f,y){if(!Gr(y))return!1;var T=typeof f;return(T=="number"?Ho(y)&&Ja(f,y.length):T=="string"&&f in y)?Vs(y[f],u):!1}function Cm(u,f){if(We(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||ls(u)?!0:me.test(u)||!Jt.test(u)||f!=null&&u in cr(f)}function fO(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}function Pm(u){var f=rp(u),y=U[f];if(typeof y!="function"||!(f in i.prototype))return!1;if(u===y)return!0;var T=bm(y);return!!T&&u===T[0]}function hO(u){return!!Ql&&Ql in u}var pO=Su?ja:Xm;function Df(u){var f=u&&u.constructor,y=typeof f=="function"&&f.prototype||ei;return u===y}function Lx(u){return u===u&&!Gr(u)}function Nx(u,f){return function(y){return y==null?!1:y[u]===f&&(f!==n||u in cr(y))}}function dO(u){var f=lp(u,function(T){return y.size===h&&y.clear(),T}),y=f.cache;return f}function gO(u,f){var y=u[1],T=f[1],O=y|T,Y=O<(C|R|V),nt=T==V&&y==E||T==V&&y==X&&u[7].length<=f[8]||T==(V|X)&&f[7].length<=f[8]&&y==E;if(!(Y||nt))return u;T&C&&(u[2]=f[2],O|=y&C?0:x);var ct=f[3];if(ct){var _t=u[3];u[3]=_t?gx(_t,ct,f[4]):ct,u[4]=_t?zs(u[3],g):f[4]}return ct=f[5],ct&&(_t=u[5],u[5]=_t?mx(_t,ct,f[6]):ct,u[6]=_t?zs(u[5],g):f[6]),ct=f[7],ct&&(u[7]=ct),T&V&&(u[8]=u[8]==null?f[8]:vr(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=O,u}function mO(u){var f=[];if(u!=null)for(var y in cr(u))f.push(y);return f}function yO(u){return Rr.call(u)}function Ox(u,f,y){return f=ni(f===n?u.length-1:f,0),function(){for(var T=arguments,O=-1,Y=ni(T.length-f,0),nt=Ct(Y);++O<Y;)nt[O]=T[f+O];O=-1;for(var ct=Ct(f+1);++O<f;)ct[O]=T[O];return ct[f]=y(nt),ie(u,this,ct)}}function Dx(u,f){return f.length<2?u:yl(u,Ps(f,0,-1))}function vO(u,f){for(var y=u.length,T=vr(f.length,y),O=qo(u);T--;){var Y=f[T];u[T]=Ja(Y,y)?O[Y]:n}return u}function Im(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}var Fx=Bx(ox),Ff=Gs||function(u,f){return Ur.setTimeout(u,f)},Rm=Bx(k2);function Ux(u,f,y){var T=f+"";return Rm(u,lO(T,_O(sO(T),y)))}function Bx(u){var f=0,y=0;return function(){var T=Vh(),O=j-(T-y);if(y=T,O>0){if(++f>=B)return arguments[0]}else f=0;return u.apply(n,arguments)}}function op(u,f){var y=-1,T=u.length,O=T-1;for(f=f===n?T:f;++y<f;){var Y=pm(y,O),nt=u[Y];u[Y]=u[y],u[y]=nt}return u.length=f,u}var zx=dO(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(ve,function(y,T,O,Y){f.push(O?Y.replace(pr,"$1"):T||y)}),f});function wa(u){if(typeof u=="string"||ls(u))return u;var f=u+"";return f=="0"&&1/u==-At?"-0":f}function _l(u){if(u!=null){try{return Ss.call(u)}catch(f){}try{return u+""}catch(f){}}return""}function _O(u,f){return Pi(Gt,function(y){var T="_."+y[0];f&y[1]&&!la(u,T)&&u.push(T)}),u.sort()}function Gx(u){if(u instanceof i)return u.clone();var f=new r(u.__wrapped__,u.__chain__);return f.__actions__=qo(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}function xO(u,f,y){(y?xo(u,f,y):f===n)?f=1:f=ni(Je(f),0);var T=u==null?0:u.length;if(!T||f<1)return[];for(var O=0,Y=0,nt=Ct(Cr(T/f));O<T;)nt[Y++]=Ps(u,O,O+=f);return nt}function EO(u){for(var f=-1,y=u==null?0:u.length,T=0,O=[];++f<y;){var Y=u[f];Y&&(O[T++]=Y)}return O}function wO(){var u=arguments.length;if(!u)return[];for(var f=Ct(u-1),y=arguments[0],T=u;T--;)f[T-1]=arguments[T];return ke(We(y)?qo(y):[y],ji(f,1))}var SO=an(function(u,f){return ri(u)?If(u,ji(f,1,ri,!0)):[]}),MO=an(function(u,f){var y=Is(f);return ri(y)&&(y=n),ri(u)?If(u,ji(f,1,ri,!0),Ne(y,2)):[]}),bO=an(function(u,f){var y=Is(f);return ri(y)&&(y=n),ri(u)?If(u,ji(f,1,ri,!0),n,y):[]});function AO(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Je(f),Ps(u,f<0?0:f,T)):[]}function TO(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Je(f),f=T-f,Ps(u,0,f<0?0:f)):[]}function CO(u,f){return u&&u.length?Jh(u,Ne(f,3),!0,!0):[]}function PO(u,f){return u&&u.length?Jh(u,Ne(f,3),!0):[]}function IO(u,f,y,T){var O=u==null?0:u.length;return O?(y&&typeof y!="number"&&xo(u,f,y)&&(y=0,T=O),w2(u,f,y,T)):[]}function kx(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=y==null?0:Je(y);return O<0&&(O=ni(T+O,0)),Kn(u,Ne(f,3),O)}function qx(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=T-1;return y!==n&&(O=Je(y),O=y<0?ni(T+O,0):vr(O,T-1)),Kn(u,Ne(f,3),O,!0)}function Hx(u){var f=u==null?0:u.length;return f?ji(u,1):[]}function RO(u){var f=u==null?0:u.length;return f?ji(u,At):[]}function LO(u,f){var y=u==null?0:u.length;return y?(f=f===n?1:Je(f),ji(u,f)):[]}function NO(u){for(var f=-1,y=u==null?0:u.length,T={};++f<y;){var O=u[f];T[O[0]]=O[1]}return T}function Vx(u){return u&&u.length?u[0]:n}function OO(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=y==null?0:Je(y);return O<0&&(O=ni(T+O,0)),xs(u,f,O)}function DO(u){var f=u==null?0:u.length;return f?Ps(u,0,-1):[]}var FO=an(function(u){var f=Mr(u,vm);return f.length&&f[0]===u[0]?um(f):[]}),UO=an(function(u){var f=Is(u),y=Mr(u,vm);return f===Is(y)?f=n:y.pop(),y.length&&y[0]===u[0]?um(y,Ne(f,2)):[]}),BO=an(function(u){var f=Is(u),y=Mr(u,vm);return f=typeof f=="function"?f:n,f&&y.pop(),y.length&&y[0]===u[0]?um(y,n,f):[]});function zO(u,f){return u==null?"":ec.call(u,f)}function Is(u){var f=u==null?0:u.length;return f?u[f-1]:n}function GO(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=T;return y!==n&&(O=Je(y),O=O<0?ni(T+O,0):vr(O,T-1)),f===f?Eu(u,f,O):Kn(u,fa,O,!0)}function kO(u,f){return u&&u.length?ex(u,Je(f)):n}var qO=an(Wx);function Wx(u,f){return u&&u.length&&f&&f.length?hm(u,f):u}function HO(u,f,y){return u&&u.length&&f&&f.length?hm(u,f,Ne(y,2)):u}function VO(u,f,y){return u&&u.length&&f&&f.length?hm(u,f,n,y):u}var WO=Ka(function(u,f){var y=u==null?0:u.length,T=im(u,f);return ix(u,Mr(f,function(O){return Ja(O,y)?+O:O}).sort(dx)),T});function XO(u,f){var y=[];if(!(u&&u.length))return y;var T=-1,O=[],Y=u.length;for(f=Ne(f,3);++T<Y;){var nt=u[T];f(nt,T,u)&&(y.push(nt),O.push(T))}return ix(u,O),y}function Lm(u){return u==null?u:nm.call(u)}function YO(u,f,y){var T=u==null?0:u.length;return T?(y&&typeof y!="number"&&xo(u,f,y)?(f=0,y=T):(f=f==null?0:Je(f),y=y===n?T:Je(y)),Ps(u,f,y)):[]}function $O(u,f){return Kh(u,f)}function ZO(u,f,y){return gm(u,f,Ne(y,2))}function KO(u,f){var y=u==null?0:u.length;if(y){var T=Kh(u,f);if(T<y&&Vs(u[T],f))return T}return-1}function JO(u,f){return Kh(u,f,!0)}function jO(u,f,y){return gm(u,f,Ne(y,2),!0)}function QO(u,f){var y=u==null?0:u.length;if(y){var T=Kh(u,f,!0)-1;if(Vs(u[T],f))return T}return-1}function tD(u){return u&&u.length?sx(u):[]}function eD(u,f){return u&&u.length?sx(u,Ne(f,2)):[]}function nD(u){var f=u==null?0:u.length;return f?Ps(u,1,f):[]}function rD(u,f,y){return u&&u.length?(f=y||f===n?1:Je(f),Ps(u,0,f<0?0:f)):[]}function iD(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Je(f),f=T-f,Ps(u,f<0?0:f,T)):[]}function oD(u,f){return u&&u.length?Jh(u,Ne(f,3),!1,!0):[]}function sD(u,f){return u&&u.length?Jh(u,Ne(f,3)):[]}var aD=an(function(u){return Cu(ji(u,1,ri,!0))}),uD=an(function(u){var f=Is(u);return ri(f)&&(f=n),Cu(ji(u,1,ri,!0),Ne(f,2))}),lD=an(function(u){var f=Is(u);return f=typeof f=="function"?f:n,Cu(ji(u,1,ri,!0),n,f)});function cD(u){return u&&u.length?Cu(u):[]}function fD(u,f){return u&&u.length?Cu(u,Ne(f,2)):[]}function hD(u,f){return f=typeof f=="function"?f:n,u&&u.length?Cu(u,n,f):[]}function Nm(u){if(!(u&&u.length))return[];var f=0;return u=Yi(u,function(y){if(ri(y))return f=ni(y.length,f),!0}),di(f,function(y){return Mr(u,Es(y))})}function Xx(u,f){if(!(u&&u.length))return[];var y=Nm(u);return f==null?y:Mr(y,function(T){return ie(f,n,T)})}var pD=an(function(u,f){return ri(u)?If(u,f):[]}),dD=an(function(u){return ym(Yi(u,ri))}),gD=an(function(u){var f=Is(u);return ri(f)&&(f=n),ym(Yi(u,ri),Ne(f,2))}),mD=an(function(u){var f=Is(u);return f=typeof f=="function"?f:n,ym(Yi(u,ri),n,f)}),yD=an(Nm);function vD(u,f){return cx(u||[],f||[],Pf)}function _D(u,f){return cx(u||[],f||[],Nf)}var xD=an(function(u){var f=u.length,y=f>1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,Xx(u,y)});function Yx(u){var f=U(u);return f.__chain__=!0,f}function ED(u,f){return f(u),u}function sp(u,f){return f(u)}var wD=Ka(function(u){var f=u.length,y=f?u[0]:0,T=this.__wrapped__,O=function(Y){return im(Y,u)};return f>1||this.__actions__.length||!(T instanceof i)||!Ja(y)?this.thru(O):(T=T.slice(y,+y+(f?1:0)),T.__actions__.push({func:sp,args:[O],thisArg:n}),new r(T,this.__chain__).thru(function(Y){return f&&!Y.length&&Y.push(n),Y}))});function SD(){return Yx(this)}function MD(){return new r(this.value(),this.__chain__)}function bD(){this.__values__===n&&(this.__values__=aE(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function AD(){return this}function TD(u){for(var f,y=this;y instanceof _a;){var T=Gx(y);T.__index__=0,T.__values__=n,f?O.__wrapped__=T:f=T;var O=T;y=y.__wrapped__}return O.__wrapped__=u,f}function CD(){var u=this.__wrapped__;if(u instanceof i){var f=u;return this.__actions__.length&&(f=new i(this)),f=f.reverse(),f.__actions__.push({func:sp,args:[Lm],thisArg:n}),new r(f,this.__chain__)}return this.thru(Lm)}function PD(){return lx(this.__wrapped__,this.__actions__)}var ID=jh(function(u,f,y){sn.call(u,y)?++u[y]:$a(u,y,1)});function RD(u,f,y){var T=We(u)?po:E2;return y&&xo(u,f,y)&&(f=n),T(u,Ne(f,3))}function LD(u,f){var y=We(u)?Yi:X1;return y(u,Ne(f,3))}var ND=xx(kx),OD=xx(qx);function DD(u,f){return ji(ap(u,f),1)}function FD(u,f){return ji(ap(u,f),At)}function UD(u,f,y){return y=y===n?1:Je(y),ji(ap(u,f),y)}function $x(u,f){var y=We(u)?Pi:Tu;return y(u,Ne(f,3))}function Zx(u,f){var y=We(u)?Ii:W1;return y(u,Ne(f,3))}var BD=jh(function(u,f,y){sn.call(u,y)?u[y].push(f):$a(u,y,[f])});function zD(u,f,y,T){u=Ho(u)?u:sc(u),y=y&&!T?Je(y):0;var O=u.length;return y<0&&(y=ni(O+y,0)),hp(u)?y<=O&&u.indexOf(f,y)>-1:!!O&&xs(u,f,y)>-1}var GD=an(function(u,f,y){var T=-1,O=typeof f=="function",Y=Ho(u)?Ct(u.length):[];return Tu(u,function(nt){Y[++T]=O?ie(f,nt,y):Rf(nt,f,y)}),Y}),kD=jh(function(u,f,y){$a(u,y,f)});function ap(u,f){var y=We(u)?Mr:j1;return y(u,Ne(f,3))}function qD(u,f,y,T){return u==null?[]:(We(f)||(f=f==null?[]:[f]),y=T?n:y,We(y)||(y=y==null?[]:[y]),nx(u,f,y))}var HD=jh(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function VD(u,f,y){var T=We(u)?Oo:Zi,O=arguments.length<3;return T(u,Ne(f,4),y,O,Tu)}function WD(u,f,y){var T=We(u)?yr:Zi,O=arguments.length<3;return T(u,Ne(f,4),y,O,W1)}function XD(u,f){var y=We(u)?Yi:X1;return y(u,cp(Ne(f,3)))}function YD(u){var f=We(u)?k1:z2;return f(u)}function $D(u,f,y){(y?xo(u,f,y):f===n)?f=1:f=Je(f);var T=We(u)?m2:G2;return T(u,f)}function ZD(u){var f=We(u)?y2:q2;return f(u)}function KD(u){if(u==null)return 0;if(Ho(u))return hp(u)?Ha(u):u.length;var f=oo(u);return f==ft||f==Wt?u.size:cm(u).length}function JD(u,f,y){var T=We(u)?ka:H2;return y&&xo(u,f,y)&&(f=n),T(u,Ne(f,3))}var jD=an(function(u,f){if(u==null)return[];var y=f.length;return y>1&&xo(u,f[0],f[1])?f=[]:y>2&&xo(f[0],f[1],f[2])&&(f=[f[0]]),nx(u,ji(f,1),[])}),up=Wa||function(){return Ur.Date.now()};function QD(u,f){if(typeof f!="function")throw new tr(s);return u=Je(u),function(){if(--u<1)return f.apply(this,arguments)}}function Kx(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Za(u,V,n,n,n,n,f)}function Jx(u,f){var y;if(typeof f!="function")throw new tr(s);return u=Je(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var Om=an(function(u,f,y){var T=C;if(y.length){var O=zs(y,ic(Om));T|=A}return Za(u,T,f,y,O)}),jx=an(function(u,f,y){var T=C|R;if(y.length){var O=zs(y,ic(jx));T|=A}return Za(f,T,u,y,O)});function Qx(u,f,y){f=y?n:f;var T=Za(u,E,n,n,n,n,n,f);return T.placeholder=Qx.placeholder,T}function tE(u,f,y){f=y?n:f;var T=Za(u,I,n,n,n,n,n,f);return T.placeholder=tE.placeholder,T}function eE(u,f,y){var T,O,Y,nt,ct,_t,zt=0,kt=!1,Yt=!1,pe=!0;if(typeof u!="function")throw new tr(s);f=Rs(f)||0,Gr(y)&&(kt=!!y.leading,Yt="maxWait"in y,Y=Yt?ni(Rs(y.maxWait)||0,f):Y,pe="trailing"in y?!!y.trailing:pe);function Se(ii){var Ws=T,tu=O;return T=O=n,zt=ii,nt=u.apply(tu,Ws),nt}function De(ii){return zt=ii,ct=Ff(Fn,f),kt?Se(ii):nt}function en(ii){var Ws=ii-_t,tu=ii-zt,xE=f-Ws;return Yt?vr(xE,Y-tu):xE}function Fe(ii){var Ws=ii-_t,tu=ii-zt;return _t===n||Ws>=f||Ws<0||Yt&&tu>=Y}function Fn(){var ii=up();if(Fe(ii))return $n(ii);ct=Ff(Fn,en(ii))}function $n(ii){return ct=n,pe&&T?Se(ii):(T=O=n,nt)}function cs(){ct!==n&&fx(ct),zt=0,T=_t=O=ct=n}function Eo(){return ct===n?nt:$n(up())}function fs(){var ii=up(),Ws=Fe(ii);if(T=arguments,O=this,_t=ii,Ws){if(ct===n)return De(_t);if(Yt)return fx(ct),ct=Ff(Fn,f),Se(_t)}return ct===n&&(ct=Ff(Fn,f)),nt}return fs.cancel=cs,fs.flush=Eo,fs}var t3=an(function(u,f){return V1(u,1,f)}),e3=an(function(u,f,y){return V1(u,Rs(f)||0,y)});function n3(u){return Za(u,q)}function lp(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new tr(s);var y=function(){var T=arguments,O=f?f.apply(this,T):T[0],Y=y.cache;if(Y.has(O))return Y.get(O);var nt=u.apply(this,T);return y.cache=Y.set(O,nt)||Y,nt};return y.cache=new(lp.Cache||Jn),y}lp.Cache=Jn;function cp(u){if(typeof u!="function")throw new tr(s);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function r3(u){return Jx(2,u)}var i3=V2(function(u,f){f=f.length==1&&We(f[0])?Mr(f[0],io(Ne())):Mr(ji(f,1),io(Ne()));var y=f.length;return an(function(T){for(var O=-1,Y=vr(T.length,y);++O<Y;)T[O]=f[O].call(this,T[O]);return ie(u,this,T)})}),Dm=an(function(u,f){var y=zs(f,ic(Dm));return Za(u,A,n,f,y)}),nE=an(function(u,f){var y=zs(f,ic(nE));return Za(u,F,n,f,y)}),o3=Ka(function(u,f){return Za(u,X,n,n,n,f)});function s3(u,f){if(typeof u!="function")throw new tr(s);return f=f===n?f:Je(f),an(u,f)}function a3(u,f){if(typeof u!="function")throw new tr(s);return f=f==null?0:ni(Je(f),0),an(function(y){var T=y[f],O=Iu(y,0,f);return T&&ke(O,T),ie(u,this,O)})}function u3(u,f,y){var T=!0,O=!0;if(typeof u!="function")throw new tr(s);return Gr(y)&&(T="leading"in y?!!y.leading:T,O="trailing"in y?!!y.trailing:O),eE(u,f,{leading:T,maxWait:f,trailing:O})}function l3(u){return Kx(u,1)}function c3(u,f){return Dm(_m(f),u)}function f3(){if(!arguments.length)return[];var u=arguments[0];return We(u)?u:[u]}function h3(u){return Cs(u,w)}function p3(u,f){return f=typeof f=="function"?f:n,Cs(u,w,f)}function d3(u){return Cs(u,m|w)}function g3(u,f){return f=typeof f=="function"?f:n,Cs(u,m|w,f)}function m3(u,f){return f==null||H1(u,f,Fi(f))}function Vs(u,f){return u===f||u!==u&&f!==f}var y3=np(am),v3=np(function(u,f){return u>=f}),xl=Z1(function(){return arguments}())?Z1:function(u){return $r(u)&&sn.call(u,"callee")&&!zo.call(u,"callee")},We=Ct.isArray,_3=_s?io(_s):T2;function Ho(u){return u!=null&&fp(u.length)&&!ja(u)}function ri(u){return $r(u)&&Ho(u)}function x3(u){return u===!0||u===!1||$r(u)&&_o(u)==jt}var Ru=Oi||Xm,E3=Qr?io(Qr):C2;function w3(u){return $r(u)&&u.nodeType===1&&!Uf(u)}function S3(u){if(u==null)return!0;if(Ho(u)&&(We(u)||typeof u=="string"||typeof u.splice=="function"||Ru(u)||oc(u)||xl(u)))return!u.length;var f=oo(u);if(f==ft||f==Wt)return!u.size;if(Df(u))return!cm(u).length;for(var y in u)if(sn.call(u,y))return!1;return!0}function M3(u,f){return Lf(u,f)}function b3(u,f,y){y=typeof y=="function"?y:n;var T=y?y(u,f):n;return T===n?Lf(u,f,n,y):!!T}function Fm(u){if(!$r(u))return!1;var f=_o(u);return f==$t||f==te||typeof u.message=="string"&&typeof u.name=="string"&&!Uf(u)}function A3(u){return typeof u=="number"&&tc(u)}function ja(u){if(!Gr(u))return!1;var f=_o(u);return f==qt||f==xe||f==Ut||f==Te}function rE(u){return typeof u=="number"&&u==Je(u)}function fp(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Mt}function Gr(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function $r(u){return u!=null&&typeof u=="object"}var iE=ua?io(ua):I2;function T3(u,f){return u===f||lm(u,f,Am(f))}function C3(u,f,y){return y=typeof y=="function"?y:n,lm(u,f,Am(f),y)}function P3(u){return oE(u)&&u!=+u}function I3(u){if(pO(u))throw new _e(o);return K1(u)}function R3(u){return u===null}function L3(u){return u==null}function oE(u){return typeof u=="number"||$r(u)&&_o(u)==Xe}function Uf(u){if(!$r(u)||_o(u)!=ge)return!1;var f=bs(u);if(f===null)return!0;var y=sn.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&Ss.call(y)==bf}var Um=No?io(No):R2;function N3(u){return rE(u)&&u>=-Mt&&u<=Mt}var sE=_u?io(_u):L2;function hp(u){return typeof u=="string"||!We(u)&&$r(u)&&_o(u)==Me}function ls(u){return typeof u=="symbol"||$r(u)&&_o(u)==tt}var oc=mr?io(mr):N2;function O3(u){return u===n}function D3(u){return $r(u)&&oo(u)==It}function F3(u){return $r(u)&&_o(u)==Ot}var U3=np(fm),B3=np(function(u,f){return u<=f});function aE(u){if(!u)return[];if(Ho(u))return hp(u)?Fo(u):qo(u);if(Mu&&u[Mu])return ai(u[Mu]());var f=oo(u),y=f==ft?ns:f==Wt?Wr:sc;return y(u)}function Qa(u){if(!u)return u===0?u:0;if(u=Rs(u),u===At||u===-At){var f=u<0?-1:1;return f*Lt}return u===u?u:0}function Je(u){var f=Qa(u),y=f%1;return f===f?y?f-y:f:0}function uE(u){return u?ml(Je(u),0,yt):0}function Rs(u){if(typeof u=="number")return u;if(ls(u))return pt;if(Gr(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=Gr(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=qh(u);var y=oi.test(u);return y||mt.test(u)?ho(u.slice(2),y?2:8):bi.test(u)?pt:+u}function lE(u){return Ea(u,Vo(u))}function z3(u){return u?ml(Je(u),-Mt,Mt):u===0?u:0}function hr(u){return u==null?"":us(u)}var G3=nc(function(u,f){if(Df(f)||Ho(f)){Ea(f,Fi(f),u);return}for(var y in f)sn.call(f,y)&&Pf(u,y,f[y])}),cE=nc(function(u,f){Ea(f,Vo(f),u)}),pp=nc(function(u,f,y,T){Ea(f,Vo(f),u,T)}),k3=nc(function(u,f,y,T){Ea(f,Fi(f),u,T)}),q3=Ka(im);function H3(u,f){var y=Ya(u);return f==null?y:q1(y,f)}var V3=an(function(u,f){u=cr(u);var y=-1,T=f.length,O=T>2?f[2]:n;for(O&&xo(f[0],f[1],O)&&(T=1);++y<T;)for(var Y=f[y],nt=Vo(Y),ct=-1,_t=nt.length;++ct<_t;){var zt=nt[ct],kt=u[zt];(kt===n||Vs(kt,ei[zt])&&!sn.call(u,zt))&&(u[zt]=Y[zt])}return u}),W3=an(function(u){return u.push(n,Tx),ie(fE,n,u)});function X3(u,f){return ca(u,Ne(f,3),xa)}function Y3(u,f){return ca(u,Ne(f,3),sm)}function $3(u,f){return u==null?u:om(u,Ne(f,3),Vo)}function Z3(u,f){return u==null?u:Y1(u,Ne(f,3),Vo)}function K3(u,f){return u&&xa(u,Ne(f,3))}function J3(u,f){return u&&sm(u,Ne(f,3))}function j3(u){return u==null?[]:$h(u,Fi(u))}function Q3(u){return u==null?[]:$h(u,Vo(u))}function Bm(u,f,y){var T=u==null?n:yl(u,f);return T===n?y:T}function tF(u,f){return u!=null&&Ix(u,f,S2)}function zm(u,f){return u!=null&&Ix(u,f,M2)}var eF=wx(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Rr.call(f)),u[f]=y},km(Wo)),nF=wx(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Rr.call(f)),sn.call(u,f)?u[f].push(y):u[f]=[y]},Ne),rF=an(Rf);function Fi(u){return Ho(u)?G1(u):cm(u)}function Vo(u){return Ho(u)?G1(u,!0):O2(u)}function iF(u,f){var y={};return f=Ne(f,3),xa(u,function(T,O,Y){$a(y,f(T,O,Y),T)}),y}function oF(u,f){var y={};return f=Ne(f,3),xa(u,function(T,O,Y){$a(y,O,f(T,O,Y))}),y}var sF=nc(function(u,f,y){Zh(u,f,y)}),fE=nc(function(u,f,y,T){Zh(u,f,y,T)}),aF=Ka(function(u,f){var y={};if(u==null)return y;var T=!1;f=Mr(f,function(Y){return Y=Pu(Y,u),T||(T=Y.length>1),Y}),Ea(u,Mm(u),y),T&&(y=Cs(y,m|_|w,eO));for(var O=f.length;O--;)mm(y,f[O]);return y});function uF(u,f){return hE(u,cp(Ne(f)))}var lF=Ka(function(u,f){return u==null?{}:F2(u,f)});function hE(u,f){if(u==null)return{};var y=Mr(Mm(u),function(T){return[T]});return f=Ne(f),rx(u,y,function(T,O){return f(T,O[0])})}function cF(u,f,y){f=Pu(f,u);var T=-1,O=f.length;for(O||(O=1,u=n);++T<O;){var Y=u==null?n:u[wa(f[T])];Y===n&&(T=O,Y=y),u=ja(Y)?Y.call(u):Y}return u}function fF(u,f,y){return u==null?u:Nf(u,f,y)}function hF(u,f,y,T){return T=typeof T=="function"?T:n,u==null?u:Nf(u,f,y,T)}var pE=bx(Fi),dE=bx(Vo);function pF(u,f,y){var T=We(u),O=T||Ru(u)||oc(u);if(f=Ne(f,4),y==null){var Y=u&&u.constructor;O?y=T?new Y:[]:Gr(u)?y=ja(Y)?Ya(bs(u)):{}:y={}}return(O?Pi:xa)(u,function(nt,ct,_t){return f(y,nt,ct,_t)}),y}function dF(u,f){return u==null?!0:mm(u,f)}function gF(u,f,y){return u==null?u:ux(u,f,_m(y))}function mF(u,f,y,T){return T=typeof T=="function"?T:n,u==null?u:ux(u,f,_m(y),T)}function sc(u){return u==null?[]:ts(u,Fi(u))}function yF(u){return u==null?[]:ts(u,Vo(u))}function vF(u,f,y){return y===n&&(y=f,f=n),y!==n&&(y=Rs(y),y=y===y?y:0),f!==n&&(f=Rs(f),f=f===f?f:0),ml(Rs(u),f,y)}function _F(u,f,y){return f=Qa(f),y===n?(y=f,f=0):y=Qa(y),u=Rs(u),b2(u,f,y)}function xF(u,f,y){if(y&&typeof y!="boolean"&&xo(u,f,y)&&(f=y=n),y===n&&(typeof f=="boolean"?(y=f,f=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&f===n?(u=0,f=1):(u=Qa(u),f===n?(f=u,u=0):f=Qa(f)),u>f){var T=u;u=f,f=T}if(y||u%1||f%1){var O=Wh();return vr(u+O*(f-u+zh("1e-"+((O+"").length-1))),f)}return pm(u,f)}var EF=rc(function(u,f,y){return f=f.toLowerCase(),u+(y?gE(f):f)});function gE(u){return Gm(hr(u).toLowerCase())}function mE(u){return u=hr(u),u&&u.replace(St,es).replace(Yn,"")}function wF(u,f,y){u=hr(u),f=us(f);var T=u.length;y=y===n?T:ml(Je(y),0,T);var O=y;return y-=f.length,y>=0&&u.slice(y,O)==f}function SF(u){return u=hr(u),u&&st.test(u)?u.replace(Et,ha):u}function MF(u){return u=hr(u),u&&Ue.test(u)?u.replace(He,"\\$&"):u}var bF=rc(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),AF=rc(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),TF=_x("toLowerCase");function CF(u,f,y){u=hr(u),f=Je(f);var T=f?Ha(u):0;if(!f||T>=f)return u;var O=(f-T)/2;return ep(zr(O),y)+u+ep(Cr(O),y)}function PF(u,f,y){u=hr(u),f=Je(f);var T=f?Ha(u):0;return f&&T<f?u+ep(f-T,y):u}function IF(u,f,y){u=hr(u),f=Je(f);var T=f?Ha(u):0;return f&&T<f?ep(f-T,y)+u:u}function RF(u,f,y){return y||f==null?f=0:f&&(f=+f),dl(hr(u).replace(Ye,""),f||0)}function LF(u,f,y){return(y?xo(u,f,y):f===n)?f=1:f=Je(f),dm(hr(u),f)}function NF(){var u=arguments,f=hr(u[0]);return u.length<3?f:f.replace(u[1],u[2])}var OF=rc(function(u,f,y){return u+(y?"_":"")+f.toLowerCase()});function DF(u,f,y){return y&&typeof y!="number"&&xo(u,f,y)&&(f=y=n),y=y===n?yt:y>>>0,y?(u=hr(u),u&&(typeof f=="string"||f!=null&&!Um(f))&&(f=us(f),!f&&qa(u))?Iu(Fo(u),0,y):u.split(f,y)):[]}var FF=rc(function(u,f,y){return u+(y?" ":"")+Gm(f)});function UF(u,f,y){return u=hr(u),y=y==null?0:ml(Je(y),0,u.length),f=us(f),u.slice(y,y+f.length)==f}function BF(u,f,y){var T=U.templateSettings;y&&xo(u,f,y)&&(f=n),u=hr(u),f=pp({},f,T,Ax);var O=pp({},f.imports,T.imports,Ax),Y=Fi(O),nt=ts(O,Y),ct,_t,zt=0,kt=f.interpolate||vt,Yt="__p += '",pe=os((f.escape||vt).source+"|"+kt.source+"|"+(kt===Ft?ur:vt).source+"|"+(f.evaluate||vt).source+"|$","g"),Se="//# sourceURL="+(sn.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ci+"]")+`
|
|
9
|
+
`)}function cO(u){return We(u)||xl(u)||!!(Af&&u&&u[Af])}function Ja(u,f){var y=typeof u;return f=f==null?Mt:f,!!f&&(y=="number"||y!="symbol"&&Rt.test(u))&&u>-1&&u%1==0&&u<f}function xo(u,f,y){if(!Gr(y))return!1;var T=typeof f;return(T=="number"?Ho(y)&&Ja(f,y.length):T=="string"&&f in y)?Vs(y[f],u):!1}function Cm(u,f){if(We(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||ls(u)?!0:me.test(u)||!Jt.test(u)||f!=null&&u in cr(f)}function fO(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}function Pm(u){var f=rp(u),y=U[f];if(typeof y!="function"||!(f in i.prototype))return!1;if(u===y)return!0;var T=bm(y);return!!T&&u===T[0]}function hO(u){return!!Ql&&Ql in u}var pO=Su?ja:Xm;function Df(u){var f=u&&u.constructor,y=typeof f=="function"&&f.prototype||ei;return u===y}function Lx(u){return u===u&&!Gr(u)}function Nx(u,f){return function(y){return y==null?!1:y[u]===f&&(f!==n||u in cr(y))}}function dO(u){var f=lp(u,function(T){return y.size===h&&y.clear(),T}),y=f.cache;return f}function gO(u,f){var y=u[1],T=f[1],O=y|T,Y=O<(C|R|V),nt=T==V&&y==E||T==V&&y==X&&u[7].length<=f[8]||T==(V|X)&&f[7].length<=f[8]&&y==E;if(!(Y||nt))return u;T&C&&(u[2]=f[2],O|=y&C?0:x);var ct=f[3];if(ct){var _t=u[3];u[3]=_t?gx(_t,ct,f[4]):ct,u[4]=_t?zs(u[3],g):f[4]}return ct=f[5],ct&&(_t=u[5],u[5]=_t?mx(_t,ct,f[6]):ct,u[6]=_t?zs(u[5],g):f[6]),ct=f[7],ct&&(u[7]=ct),T&V&&(u[8]=u[8]==null?f[8]:vr(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=O,u}function mO(u){var f=[];if(u!=null)for(var y in cr(u))f.push(y);return f}function yO(u){return Rr.call(u)}function Ox(u,f,y){return f=ni(f===n?u.length-1:f,0),function(){for(var T=arguments,O=-1,Y=ni(T.length-f,0),nt=Ct(Y);++O<Y;)nt[O]=T[f+O];O=-1;for(var ct=Ct(f+1);++O<f;)ct[O]=T[O];return ct[f]=y(nt),ie(u,this,ct)}}function Dx(u,f){return f.length<2?u:yl(u,Ps(f,0,-1))}function vO(u,f){for(var y=u.length,T=vr(f.length,y),O=qo(u);T--;){var Y=f[T];u[T]=Ja(Y,y)?O[Y]:n}return u}function Im(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}var Fx=Bx(ox),Ff=Gs||function(u,f){return Ur.setTimeout(u,f)},Rm=Bx(k2);function Ux(u,f,y){var T=f+"";return Rm(u,lO(T,_O(sO(T),y)))}function Bx(u){var f=0,y=0;return function(){var T=Vh(),O=j-(T-y);if(y=T,O>0){if(++f>=B)return arguments[0]}else f=0;return u.apply(n,arguments)}}function op(u,f){var y=-1,T=u.length,O=T-1;for(f=f===n?T:f;++y<f;){var Y=pm(y,O),nt=u[Y];u[Y]=u[y],u[y]=nt}return u.length=f,u}var zx=dO(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(ve,function(y,T,O,Y){f.push(O?Y.replace(pr,"$1"):T||y)}),f});function wa(u){if(typeof u=="string"||ls(u))return u;var f=u+"";return f=="0"&&1/u==-At?"-0":f}function _l(u){if(u!=null){try{return Ss.call(u)}catch(f){}try{return u+""}catch(f){}}return""}function _O(u,f){return Pi(Gt,function(y){var T="_."+y[0];f&y[1]&&!la(u,T)&&u.push(T)}),u.sort()}function Gx(u){if(u instanceof i)return u.clone();var f=new r(u.__wrapped__,u.__chain__);return f.__actions__=qo(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}function xO(u,f,y){(y?xo(u,f,y):f===n)?f=1:f=ni(Ke(f),0);var T=u==null?0:u.length;if(!T||f<1)return[];for(var O=0,Y=0,nt=Ct(Cr(T/f));O<T;)nt[Y++]=Ps(u,O,O+=f);return nt}function EO(u){for(var f=-1,y=u==null?0:u.length,T=0,O=[];++f<y;){var Y=u[f];Y&&(O[T++]=Y)}return O}function wO(){var u=arguments.length;if(!u)return[];for(var f=Ct(u-1),y=arguments[0],T=u;T--;)f[T-1]=arguments[T];return ke(We(y)?qo(y):[y],ji(f,1))}var SO=an(function(u,f){return ri(u)?If(u,ji(f,1,ri,!0)):[]}),MO=an(function(u,f){var y=Is(f);return ri(y)&&(y=n),ri(u)?If(u,ji(f,1,ri,!0),Ne(y,2)):[]}),bO=an(function(u,f){var y=Is(f);return ri(y)&&(y=n),ri(u)?If(u,ji(f,1,ri,!0),n,y):[]});function AO(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Ke(f),Ps(u,f<0?0:f,T)):[]}function TO(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Ke(f),f=T-f,Ps(u,0,f<0?0:f)):[]}function CO(u,f){return u&&u.length?Jh(u,Ne(f,3),!0,!0):[]}function PO(u,f){return u&&u.length?Jh(u,Ne(f,3),!0):[]}function IO(u,f,y,T){var O=u==null?0:u.length;return O?(y&&typeof y!="number"&&xo(u,f,y)&&(y=0,T=O),w2(u,f,y,T)):[]}function kx(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=y==null?0:Ke(y);return O<0&&(O=ni(T+O,0)),Kn(u,Ne(f,3),O)}function qx(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=T-1;return y!==n&&(O=Ke(y),O=y<0?ni(T+O,0):vr(O,T-1)),Kn(u,Ne(f,3),O,!0)}function Hx(u){var f=u==null?0:u.length;return f?ji(u,1):[]}function RO(u){var f=u==null?0:u.length;return f?ji(u,At):[]}function LO(u,f){var y=u==null?0:u.length;return y?(f=f===n?1:Ke(f),ji(u,f)):[]}function NO(u){for(var f=-1,y=u==null?0:u.length,T={};++f<y;){var O=u[f];T[O[0]]=O[1]}return T}function Vx(u){return u&&u.length?u[0]:n}function OO(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=y==null?0:Ke(y);return O<0&&(O=ni(T+O,0)),xs(u,f,O)}function DO(u){var f=u==null?0:u.length;return f?Ps(u,0,-1):[]}var FO=an(function(u){var f=Mr(u,vm);return f.length&&f[0]===u[0]?um(f):[]}),UO=an(function(u){var f=Is(u),y=Mr(u,vm);return f===Is(y)?f=n:y.pop(),y.length&&y[0]===u[0]?um(y,Ne(f,2)):[]}),BO=an(function(u){var f=Is(u),y=Mr(u,vm);return f=typeof f=="function"?f:n,f&&y.pop(),y.length&&y[0]===u[0]?um(y,n,f):[]});function zO(u,f){return u==null?"":ec.call(u,f)}function Is(u){var f=u==null?0:u.length;return f?u[f-1]:n}function GO(u,f,y){var T=u==null?0:u.length;if(!T)return-1;var O=T;return y!==n&&(O=Ke(y),O=O<0?ni(T+O,0):vr(O,T-1)),f===f?Eu(u,f,O):Kn(u,fa,O,!0)}function kO(u,f){return u&&u.length?ex(u,Ke(f)):n}var qO=an(Wx);function Wx(u,f){return u&&u.length&&f&&f.length?hm(u,f):u}function HO(u,f,y){return u&&u.length&&f&&f.length?hm(u,f,Ne(y,2)):u}function VO(u,f,y){return u&&u.length&&f&&f.length?hm(u,f,n,y):u}var WO=Ka(function(u,f){var y=u==null?0:u.length,T=im(u,f);return ix(u,Mr(f,function(O){return Ja(O,y)?+O:O}).sort(dx)),T});function XO(u,f){var y=[];if(!(u&&u.length))return y;var T=-1,O=[],Y=u.length;for(f=Ne(f,3);++T<Y;){var nt=u[T];f(nt,T,u)&&(y.push(nt),O.push(T))}return ix(u,O),y}function Lm(u){return u==null?u:nm.call(u)}function YO(u,f,y){var T=u==null?0:u.length;return T?(y&&typeof y!="number"&&xo(u,f,y)?(f=0,y=T):(f=f==null?0:Ke(f),y=y===n?T:Ke(y)),Ps(u,f,y)):[]}function $O(u,f){return Kh(u,f)}function ZO(u,f,y){return gm(u,f,Ne(y,2))}function KO(u,f){var y=u==null?0:u.length;if(y){var T=Kh(u,f);if(T<y&&Vs(u[T],f))return T}return-1}function JO(u,f){return Kh(u,f,!0)}function jO(u,f,y){return gm(u,f,Ne(y,2),!0)}function QO(u,f){var y=u==null?0:u.length;if(y){var T=Kh(u,f,!0)-1;if(Vs(u[T],f))return T}return-1}function tD(u){return u&&u.length?sx(u):[]}function eD(u,f){return u&&u.length?sx(u,Ne(f,2)):[]}function nD(u){var f=u==null?0:u.length;return f?Ps(u,1,f):[]}function rD(u,f,y){return u&&u.length?(f=y||f===n?1:Ke(f),Ps(u,0,f<0?0:f)):[]}function iD(u,f,y){var T=u==null?0:u.length;return T?(f=y||f===n?1:Ke(f),f=T-f,Ps(u,f<0?0:f,T)):[]}function oD(u,f){return u&&u.length?Jh(u,Ne(f,3),!1,!0):[]}function sD(u,f){return u&&u.length?Jh(u,Ne(f,3)):[]}var aD=an(function(u){return Cu(ji(u,1,ri,!0))}),uD=an(function(u){var f=Is(u);return ri(f)&&(f=n),Cu(ji(u,1,ri,!0),Ne(f,2))}),lD=an(function(u){var f=Is(u);return f=typeof f=="function"?f:n,Cu(ji(u,1,ri,!0),n,f)});function cD(u){return u&&u.length?Cu(u):[]}function fD(u,f){return u&&u.length?Cu(u,Ne(f,2)):[]}function hD(u,f){return f=typeof f=="function"?f:n,u&&u.length?Cu(u,n,f):[]}function Nm(u){if(!(u&&u.length))return[];var f=0;return u=Yi(u,function(y){if(ri(y))return f=ni(y.length,f),!0}),di(f,function(y){return Mr(u,Es(y))})}function Xx(u,f){if(!(u&&u.length))return[];var y=Nm(u);return f==null?y:Mr(y,function(T){return ie(f,n,T)})}var pD=an(function(u,f){return ri(u)?If(u,f):[]}),dD=an(function(u){return ym(Yi(u,ri))}),gD=an(function(u){var f=Is(u);return ri(f)&&(f=n),ym(Yi(u,ri),Ne(f,2))}),mD=an(function(u){var f=Is(u);return f=typeof f=="function"?f:n,ym(Yi(u,ri),n,f)}),yD=an(Nm);function vD(u,f){return cx(u||[],f||[],Pf)}function _D(u,f){return cx(u||[],f||[],Nf)}var xD=an(function(u){var f=u.length,y=f>1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,Xx(u,y)});function Yx(u){var f=U(u);return f.__chain__=!0,f}function ED(u,f){return f(u),u}function sp(u,f){return f(u)}var wD=Ka(function(u){var f=u.length,y=f?u[0]:0,T=this.__wrapped__,O=function(Y){return im(Y,u)};return f>1||this.__actions__.length||!(T instanceof i)||!Ja(y)?this.thru(O):(T=T.slice(y,+y+(f?1:0)),T.__actions__.push({func:sp,args:[O],thisArg:n}),new r(T,this.__chain__).thru(function(Y){return f&&!Y.length&&Y.push(n),Y}))});function SD(){return Yx(this)}function MD(){return new r(this.value(),this.__chain__)}function bD(){this.__values__===n&&(this.__values__=aE(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function AD(){return this}function TD(u){for(var f,y=this;y instanceof _a;){var T=Gx(y);T.__index__=0,T.__values__=n,f?O.__wrapped__=T:f=T;var O=T;y=y.__wrapped__}return O.__wrapped__=u,f}function CD(){var u=this.__wrapped__;if(u instanceof i){var f=u;return this.__actions__.length&&(f=new i(this)),f=f.reverse(),f.__actions__.push({func:sp,args:[Lm],thisArg:n}),new r(f,this.__chain__)}return this.thru(Lm)}function PD(){return lx(this.__wrapped__,this.__actions__)}var ID=jh(function(u,f,y){sn.call(u,y)?++u[y]:$a(u,y,1)});function RD(u,f,y){var T=We(u)?po:E2;return y&&xo(u,f,y)&&(f=n),T(u,Ne(f,3))}function LD(u,f){var y=We(u)?Yi:X1;return y(u,Ne(f,3))}var ND=xx(kx),OD=xx(qx);function DD(u,f){return ji(ap(u,f),1)}function FD(u,f){return ji(ap(u,f),At)}function UD(u,f,y){return y=y===n?1:Ke(y),ji(ap(u,f),y)}function $x(u,f){var y=We(u)?Pi:Tu;return y(u,Ne(f,3))}function Zx(u,f){var y=We(u)?Ii:W1;return y(u,Ne(f,3))}var BD=jh(function(u,f,y){sn.call(u,y)?u[y].push(f):$a(u,y,[f])});function zD(u,f,y,T){u=Ho(u)?u:sc(u),y=y&&!T?Ke(y):0;var O=u.length;return y<0&&(y=ni(O+y,0)),hp(u)?y<=O&&u.indexOf(f,y)>-1:!!O&&xs(u,f,y)>-1}var GD=an(function(u,f,y){var T=-1,O=typeof f=="function",Y=Ho(u)?Ct(u.length):[];return Tu(u,function(nt){Y[++T]=O?ie(f,nt,y):Rf(nt,f,y)}),Y}),kD=jh(function(u,f,y){$a(u,y,f)});function ap(u,f){var y=We(u)?Mr:j1;return y(u,Ne(f,3))}function qD(u,f,y,T){return u==null?[]:(We(f)||(f=f==null?[]:[f]),y=T?n:y,We(y)||(y=y==null?[]:[y]),nx(u,f,y))}var HD=jh(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function VD(u,f,y){var T=We(u)?Oo:Zi,O=arguments.length<3;return T(u,Ne(f,4),y,O,Tu)}function WD(u,f,y){var T=We(u)?yr:Zi,O=arguments.length<3;return T(u,Ne(f,4),y,O,W1)}function XD(u,f){var y=We(u)?Yi:X1;return y(u,cp(Ne(f,3)))}function YD(u){var f=We(u)?k1:z2;return f(u)}function $D(u,f,y){(y?xo(u,f,y):f===n)?f=1:f=Ke(f);var T=We(u)?m2:G2;return T(u,f)}function ZD(u){var f=We(u)?y2:q2;return f(u)}function KD(u){if(u==null)return 0;if(Ho(u))return hp(u)?Ha(u):u.length;var f=oo(u);return f==ft||f==Wt?u.size:cm(u).length}function JD(u,f,y){var T=We(u)?ka:H2;return y&&xo(u,f,y)&&(f=n),T(u,Ne(f,3))}var jD=an(function(u,f){if(u==null)return[];var y=f.length;return y>1&&xo(u,f[0],f[1])?f=[]:y>2&&xo(f[0],f[1],f[2])&&(f=[f[0]]),nx(u,ji(f,1),[])}),up=Wa||function(){return Ur.Date.now()};function QD(u,f){if(typeof f!="function")throw new tr(s);return u=Ke(u),function(){if(--u<1)return f.apply(this,arguments)}}function Kx(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Za(u,V,n,n,n,n,f)}function Jx(u,f){var y;if(typeof f!="function")throw new tr(s);return u=Ke(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var Om=an(function(u,f,y){var T=C;if(y.length){var O=zs(y,ic(Om));T|=A}return Za(u,T,f,y,O)}),jx=an(function(u,f,y){var T=C|R;if(y.length){var O=zs(y,ic(jx));T|=A}return Za(f,T,u,y,O)});function Qx(u,f,y){f=y?n:f;var T=Za(u,E,n,n,n,n,n,f);return T.placeholder=Qx.placeholder,T}function tE(u,f,y){f=y?n:f;var T=Za(u,I,n,n,n,n,n,f);return T.placeholder=tE.placeholder,T}function eE(u,f,y){var T,O,Y,nt,ct,_t,zt=0,kt=!1,Yt=!1,pe=!0;if(typeof u!="function")throw new tr(s);f=Rs(f)||0,Gr(y)&&(kt=!!y.leading,Yt="maxWait"in y,Y=Yt?ni(Rs(y.maxWait)||0,f):Y,pe="trailing"in y?!!y.trailing:pe);function Se(ii){var Ws=T,tu=O;return T=O=n,zt=ii,nt=u.apply(tu,Ws),nt}function De(ii){return zt=ii,ct=Ff(Fn,f),kt?Se(ii):nt}function en(ii){var Ws=ii-_t,tu=ii-zt,xE=f-Ws;return Yt?vr(xE,Y-tu):xE}function Fe(ii){var Ws=ii-_t,tu=ii-zt;return _t===n||Ws>=f||Ws<0||Yt&&tu>=Y}function Fn(){var ii=up();if(Fe(ii))return $n(ii);ct=Ff(Fn,en(ii))}function $n(ii){return ct=n,pe&&T?Se(ii):(T=O=n,nt)}function cs(){ct!==n&&fx(ct),zt=0,T=_t=O=ct=n}function Eo(){return ct===n?nt:$n(up())}function fs(){var ii=up(),Ws=Fe(ii);if(T=arguments,O=this,_t=ii,Ws){if(ct===n)return De(_t);if(Yt)return fx(ct),ct=Ff(Fn,f),Se(_t)}return ct===n&&(ct=Ff(Fn,f)),nt}return fs.cancel=cs,fs.flush=Eo,fs}var t3=an(function(u,f){return V1(u,1,f)}),e3=an(function(u,f,y){return V1(u,Rs(f)||0,y)});function n3(u){return Za(u,q)}function lp(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new tr(s);var y=function(){var T=arguments,O=f?f.apply(this,T):T[0],Y=y.cache;if(Y.has(O))return Y.get(O);var nt=u.apply(this,T);return y.cache=Y.set(O,nt)||Y,nt};return y.cache=new(lp.Cache||Jn),y}lp.Cache=Jn;function cp(u){if(typeof u!="function")throw new tr(s);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function r3(u){return Jx(2,u)}var i3=V2(function(u,f){f=f.length==1&&We(f[0])?Mr(f[0],io(Ne())):Mr(ji(f,1),io(Ne()));var y=f.length;return an(function(T){for(var O=-1,Y=vr(T.length,y);++O<Y;)T[O]=f[O].call(this,T[O]);return ie(u,this,T)})}),Dm=an(function(u,f){var y=zs(f,ic(Dm));return Za(u,A,n,f,y)}),nE=an(function(u,f){var y=zs(f,ic(nE));return Za(u,F,n,f,y)}),o3=Ka(function(u,f){return Za(u,X,n,n,n,f)});function s3(u,f){if(typeof u!="function")throw new tr(s);return f=f===n?f:Ke(f),an(u,f)}function a3(u,f){if(typeof u!="function")throw new tr(s);return f=f==null?0:ni(Ke(f),0),an(function(y){var T=y[f],O=Iu(y,0,f);return T&&ke(O,T),ie(u,this,O)})}function u3(u,f,y){var T=!0,O=!0;if(typeof u!="function")throw new tr(s);return Gr(y)&&(T="leading"in y?!!y.leading:T,O="trailing"in y?!!y.trailing:O),eE(u,f,{leading:T,maxWait:f,trailing:O})}function l3(u){return Kx(u,1)}function c3(u,f){return Dm(_m(f),u)}function f3(){if(!arguments.length)return[];var u=arguments[0];return We(u)?u:[u]}function h3(u){return Cs(u,w)}function p3(u,f){return f=typeof f=="function"?f:n,Cs(u,w,f)}function d3(u){return Cs(u,m|w)}function g3(u,f){return f=typeof f=="function"?f:n,Cs(u,m|w,f)}function m3(u,f){return f==null||H1(u,f,Fi(f))}function Vs(u,f){return u===f||u!==u&&f!==f}var y3=np(am),v3=np(function(u,f){return u>=f}),xl=Z1(function(){return arguments}())?Z1:function(u){return $r(u)&&sn.call(u,"callee")&&!zo.call(u,"callee")},We=Ct.isArray,_3=_s?io(_s):T2;function Ho(u){return u!=null&&fp(u.length)&&!ja(u)}function ri(u){return $r(u)&&Ho(u)}function x3(u){return u===!0||u===!1||$r(u)&&_o(u)==jt}var Ru=Oi||Xm,E3=Qr?io(Qr):C2;function w3(u){return $r(u)&&u.nodeType===1&&!Uf(u)}function S3(u){if(u==null)return!0;if(Ho(u)&&(We(u)||typeof u=="string"||typeof u.splice=="function"||Ru(u)||oc(u)||xl(u)))return!u.length;var f=oo(u);if(f==ft||f==Wt)return!u.size;if(Df(u))return!cm(u).length;for(var y in u)if(sn.call(u,y))return!1;return!0}function M3(u,f){return Lf(u,f)}function b3(u,f,y){y=typeof y=="function"?y:n;var T=y?y(u,f):n;return T===n?Lf(u,f,n,y):!!T}function Fm(u){if(!$r(u))return!1;var f=_o(u);return f==$t||f==te||typeof u.message=="string"&&typeof u.name=="string"&&!Uf(u)}function A3(u){return typeof u=="number"&&tc(u)}function ja(u){if(!Gr(u))return!1;var f=_o(u);return f==qt||f==xe||f==Ut||f==Te}function rE(u){return typeof u=="number"&&u==Ke(u)}function fp(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Mt}function Gr(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function $r(u){return u!=null&&typeof u=="object"}var iE=ua?io(ua):I2;function T3(u,f){return u===f||lm(u,f,Am(f))}function C3(u,f,y){return y=typeof y=="function"?y:n,lm(u,f,Am(f),y)}function P3(u){return oE(u)&&u!=+u}function I3(u){if(pO(u))throw new _e(o);return K1(u)}function R3(u){return u===null}function L3(u){return u==null}function oE(u){return typeof u=="number"||$r(u)&&_o(u)==Xe}function Uf(u){if(!$r(u)||_o(u)!=ge)return!1;var f=bs(u);if(f===null)return!0;var y=sn.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&Ss.call(y)==bf}var Um=No?io(No):R2;function N3(u){return rE(u)&&u>=-Mt&&u<=Mt}var sE=_u?io(_u):L2;function hp(u){return typeof u=="string"||!We(u)&&$r(u)&&_o(u)==Me}function ls(u){return typeof u=="symbol"||$r(u)&&_o(u)==tt}var oc=mr?io(mr):N2;function O3(u){return u===n}function D3(u){return $r(u)&&oo(u)==It}function F3(u){return $r(u)&&_o(u)==Ot}var U3=np(fm),B3=np(function(u,f){return u<=f});function aE(u){if(!u)return[];if(Ho(u))return hp(u)?Fo(u):qo(u);if(Mu&&u[Mu])return ai(u[Mu]());var f=oo(u),y=f==ft?ns:f==Wt?Wr:sc;return y(u)}function Qa(u){if(!u)return u===0?u:0;if(u=Rs(u),u===At||u===-At){var f=u<0?-1:1;return f*Lt}return u===u?u:0}function Ke(u){var f=Qa(u),y=f%1;return f===f?y?f-y:f:0}function uE(u){return u?ml(Ke(u),0,yt):0}function Rs(u){if(typeof u=="number")return u;if(ls(u))return pt;if(Gr(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=Gr(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=qh(u);var y=oi.test(u);return y||mt.test(u)?ho(u.slice(2),y?2:8):bi.test(u)?pt:+u}function lE(u){return Ea(u,Vo(u))}function z3(u){return u?ml(Ke(u),-Mt,Mt):u===0?u:0}function hr(u){return u==null?"":us(u)}var G3=nc(function(u,f){if(Df(f)||Ho(f)){Ea(f,Fi(f),u);return}for(var y in f)sn.call(f,y)&&Pf(u,y,f[y])}),cE=nc(function(u,f){Ea(f,Vo(f),u)}),pp=nc(function(u,f,y,T){Ea(f,Vo(f),u,T)}),k3=nc(function(u,f,y,T){Ea(f,Fi(f),u,T)}),q3=Ka(im);function H3(u,f){var y=Ya(u);return f==null?y:q1(y,f)}var V3=an(function(u,f){u=cr(u);var y=-1,T=f.length,O=T>2?f[2]:n;for(O&&xo(f[0],f[1],O)&&(T=1);++y<T;)for(var Y=f[y],nt=Vo(Y),ct=-1,_t=nt.length;++ct<_t;){var zt=nt[ct],kt=u[zt];(kt===n||Vs(kt,ei[zt])&&!sn.call(u,zt))&&(u[zt]=Y[zt])}return u}),W3=an(function(u){return u.push(n,Tx),ie(fE,n,u)});function X3(u,f){return ca(u,Ne(f,3),xa)}function Y3(u,f){return ca(u,Ne(f,3),sm)}function $3(u,f){return u==null?u:om(u,Ne(f,3),Vo)}function Z3(u,f){return u==null?u:Y1(u,Ne(f,3),Vo)}function K3(u,f){return u&&xa(u,Ne(f,3))}function J3(u,f){return u&&sm(u,Ne(f,3))}function j3(u){return u==null?[]:$h(u,Fi(u))}function Q3(u){return u==null?[]:$h(u,Vo(u))}function Bm(u,f,y){var T=u==null?n:yl(u,f);return T===n?y:T}function tF(u,f){return u!=null&&Ix(u,f,S2)}function zm(u,f){return u!=null&&Ix(u,f,M2)}var eF=wx(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Rr.call(f)),u[f]=y},km(Wo)),nF=wx(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Rr.call(f)),sn.call(u,f)?u[f].push(y):u[f]=[y]},Ne),rF=an(Rf);function Fi(u){return Ho(u)?G1(u):cm(u)}function Vo(u){return Ho(u)?G1(u,!0):O2(u)}function iF(u,f){var y={};return f=Ne(f,3),xa(u,function(T,O,Y){$a(y,f(T,O,Y),T)}),y}function oF(u,f){var y={};return f=Ne(f,3),xa(u,function(T,O,Y){$a(y,O,f(T,O,Y))}),y}var sF=nc(function(u,f,y){Zh(u,f,y)}),fE=nc(function(u,f,y,T){Zh(u,f,y,T)}),aF=Ka(function(u,f){var y={};if(u==null)return y;var T=!1;f=Mr(f,function(Y){return Y=Pu(Y,u),T||(T=Y.length>1),Y}),Ea(u,Mm(u),y),T&&(y=Cs(y,m|_|w,eO));for(var O=f.length;O--;)mm(y,f[O]);return y});function uF(u,f){return hE(u,cp(Ne(f)))}var lF=Ka(function(u,f){return u==null?{}:F2(u,f)});function hE(u,f){if(u==null)return{};var y=Mr(Mm(u),function(T){return[T]});return f=Ne(f),rx(u,y,function(T,O){return f(T,O[0])})}function cF(u,f,y){f=Pu(f,u);var T=-1,O=f.length;for(O||(O=1,u=n);++T<O;){var Y=u==null?n:u[wa(f[T])];Y===n&&(T=O,Y=y),u=ja(Y)?Y.call(u):Y}return u}function fF(u,f,y){return u==null?u:Nf(u,f,y)}function hF(u,f,y,T){return T=typeof T=="function"?T:n,u==null?u:Nf(u,f,y,T)}var pE=bx(Fi),dE=bx(Vo);function pF(u,f,y){var T=We(u),O=T||Ru(u)||oc(u);if(f=Ne(f,4),y==null){var Y=u&&u.constructor;O?y=T?new Y:[]:Gr(u)?y=ja(Y)?Ya(bs(u)):{}:y={}}return(O?Pi:xa)(u,function(nt,ct,_t){return f(y,nt,ct,_t)}),y}function dF(u,f){return u==null?!0:mm(u,f)}function gF(u,f,y){return u==null?u:ux(u,f,_m(y))}function mF(u,f,y,T){return T=typeof T=="function"?T:n,u==null?u:ux(u,f,_m(y),T)}function sc(u){return u==null?[]:ts(u,Fi(u))}function yF(u){return u==null?[]:ts(u,Vo(u))}function vF(u,f,y){return y===n&&(y=f,f=n),y!==n&&(y=Rs(y),y=y===y?y:0),f!==n&&(f=Rs(f),f=f===f?f:0),ml(Rs(u),f,y)}function _F(u,f,y){return f=Qa(f),y===n?(y=f,f=0):y=Qa(y),u=Rs(u),b2(u,f,y)}function xF(u,f,y){if(y&&typeof y!="boolean"&&xo(u,f,y)&&(f=y=n),y===n&&(typeof f=="boolean"?(y=f,f=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&f===n?(u=0,f=1):(u=Qa(u),f===n?(f=u,u=0):f=Qa(f)),u>f){var T=u;u=f,f=T}if(y||u%1||f%1){var O=Wh();return vr(u+O*(f-u+zh("1e-"+((O+"").length-1))),f)}return pm(u,f)}var EF=rc(function(u,f,y){return f=f.toLowerCase(),u+(y?gE(f):f)});function gE(u){return Gm(hr(u).toLowerCase())}function mE(u){return u=hr(u),u&&u.replace(St,es).replace(Yn,"")}function wF(u,f,y){u=hr(u),f=us(f);var T=u.length;y=y===n?T:ml(Ke(y),0,T);var O=y;return y-=f.length,y>=0&&u.slice(y,O)==f}function SF(u){return u=hr(u),u&&st.test(u)?u.replace(Et,ha):u}function MF(u){return u=hr(u),u&&Ue.test(u)?u.replace(He,"\\$&"):u}var bF=rc(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),AF=rc(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),TF=_x("toLowerCase");function CF(u,f,y){u=hr(u),f=Ke(f);var T=f?Ha(u):0;if(!f||T>=f)return u;var O=(f-T)/2;return ep(zr(O),y)+u+ep(Cr(O),y)}function PF(u,f,y){u=hr(u),f=Ke(f);var T=f?Ha(u):0;return f&&T<f?u+ep(f-T,y):u}function IF(u,f,y){u=hr(u),f=Ke(f);var T=f?Ha(u):0;return f&&T<f?ep(f-T,y)+u:u}function RF(u,f,y){return y||f==null?f=0:f&&(f=+f),dl(hr(u).replace(Ye,""),f||0)}function LF(u,f,y){return(y?xo(u,f,y):f===n)?f=1:f=Ke(f),dm(hr(u),f)}function NF(){var u=arguments,f=hr(u[0]);return u.length<3?f:f.replace(u[1],u[2])}var OF=rc(function(u,f,y){return u+(y?"_":"")+f.toLowerCase()});function DF(u,f,y){return y&&typeof y!="number"&&xo(u,f,y)&&(f=y=n),y=y===n?yt:y>>>0,y?(u=hr(u),u&&(typeof f=="string"||f!=null&&!Um(f))&&(f=us(f),!f&&qa(u))?Iu(Fo(u),0,y):u.split(f,y)):[]}var FF=rc(function(u,f,y){return u+(y?" ":"")+Gm(f)});function UF(u,f,y){return u=hr(u),y=y==null?0:ml(Ke(y),0,u.length),f=us(f),u.slice(y,y+f.length)==f}function BF(u,f,y){var T=U.templateSettings;y&&xo(u,f,y)&&(f=n),u=hr(u),f=pp({},f,T,Ax);var O=pp({},f.imports,T.imports,Ax),Y=Fi(O),nt=ts(O,Y),ct,_t,zt=0,kt=f.interpolate||vt,Yt="__p += '",pe=os((f.escape||vt).source+"|"+kt.source+"|"+(kt===Ft?ur:vt).source+"|"+(f.evaluate||vt).source+"|$","g"),Se="//# sourceURL="+(sn.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ci+"]")+`
|
|
10
10
|
`;u.replace(pe,function(Fe,Fn,$n,cs,Eo,fs){return $n||($n=cs),Yt+=u.slice(zt,fs).replace(he,ws),Fn&&(ct=!0,Yt+=`' +
|
|
11
11
|
__e(`+Fn+`) +
|
|
12
12
|
'`),Eo&&(_t=!0,Yt+=`';
|
|
@@ -23,7 +23,7 @@ __p += '`),$n&&(Yt+=`' +
|
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
25
|
`)+Yt+`return __p
|
|
26
|
-
}`;var en=vE(function(){return qe(Y,Se+"return "+Yt).apply(n,nt)});if(en.source=Yt,Fm(en))throw en;return en}function zF(u){return hr(u).toLowerCase()}function GF(u){return hr(u).toUpperCase()}function kF(u,f,y){if(u=hr(u),u&&(y||f===n))return qh(u);if(!u||!(f=us(f)))return u;var T=Fo(u),O=Fo(f),Y=Bs(T,O),nt=Ri(T,O)+1;return Iu(T,Y,nt).join("")}function qF(u,f,y){if(u=hr(u),u&&(y||f===n))return u.slice(0,pa(u)+1);if(!u||!(f=us(f)))return u;var T=Fo(u),O=Ri(T,Fo(f))+1;return Iu(T,0,O).join("")}function HF(u,f,y){if(u=hr(u),u&&(y||f===n))return u.replace(Ye,"");if(!u||!(f=us(f)))return u;var T=Fo(u),O=Bs(T,Fo(f));return Iu(T,O).join("")}function VF(u,f){var y=D,T=xt;if(Gr(f)){var O="separator"in f?f.separator:O;y="length"in f?Je(f.length):y,T="omission"in f?us(f.omission):T}u=hr(u);var Y=u.length;if(qa(u)){var nt=Fo(u);Y=nt.length}if(y>=Y)return u;var ct=y-Ha(T);if(ct<1)return T;var _t=nt?Iu(nt,0,ct).join(""):u.slice(0,ct);if(O===n)return _t+T;if(nt&&(ct+=_t.length-ct),Um(O)){if(u.slice(ct).search(O)){var zt,kt=_t;for(O.global||(O=os(O.source,hr(Qn.exec(O))+"g")),O.lastIndex=0;zt=O.exec(kt);)var Yt=zt.index;_t=_t.slice(0,Yt===n?ct:Yt)}}else if(u.indexOf(us(O),ct)!=ct){var pe=_t.lastIndexOf(O);pe>-1&&(_t=_t.slice(0,pe))}return _t+T}function WF(u){return u=hr(u),u&&G.test(u)?u.replace(wt,rs):u}var XF=rc(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),Gm=_x("toUpperCase");function yE(u,f,y){return u=hr(u),f=y?n:f,f===n?jl(u)?ui(u):Ve(u):u.match(f)||[]}var vE=an(function(u,f){try{return ie(u,n,f)}catch(y){return Fm(y)?y:new _e(y)}}),YF=Ka(function(u,f){return Pi(f,function(y){y=wa(y),$a(u,y,Om(u[y],u))}),u});function $F(u){var f=u==null?0:u.length,y=Ne();return u=f?Mr(u,function(T){if(typeof T[1]!="function")throw new tr(s);return[y(T[0]),T[1]]}):[],an(function(T){for(var O=-1;++O<f;){var Y=u[O];if(ie(Y[0],this,T))return ie(Y[1],this,T)}})}function ZF(u){return x2(Cs(u,m))}function km(u){return function(){return u}}function KF(u,f){return u==null||u!==u?f:u}var JF=Ex(),jF=Ex(!0);function Wo(u){return u}function qm(u){return J1(typeof u=="function"?u:Cs(u,m))}function QF(u){return Q1(Cs(u,m))}function tU(u,f){return tx(u,Cs(f,m))}var eU=an(function(u,f){return function(y){return Rf(y,u,f)}}),nU=an(function(u,f){return function(y){return Rf(u,y,f)}});function Hm(u,f,y){var T=Fi(f),O=$h(f,T);y==null&&!(Gr(f)&&(O.length||!T.length))&&(y=f,f=u,u=this,O=$h(f,Fi(f)));var Y=!(Gr(y)&&"chain"in y)||!!y.chain,nt=ja(u);return Pi(O,function(ct){var _t=f[ct];u[ct]=_t,nt&&(u.prototype[ct]=function(){var zt=this.__chain__;if(Y||zt){var kt=u(this.__wrapped__),Yt=kt.__actions__=qo(this.__actions__);return Yt.push({func:_t,args:arguments,thisArg:u}),kt.__chain__=zt,kt}return _t.apply(u,ke([this.value()],arguments))})}),u}function rU(){return Ur._===this&&(Ur._=Bo),this}function Vm(){}function iU(u){return u=Je(u),an(function(f){return ex(f,u)})}var oU=Em(Mr),sU=Em(po),aU=Em(ka);function _E(u){return Cm(u)?Es(wa(u)):U2(u)}function uU(u){return function(f){return u==null?n:yl(u,f)}}var lU=Sx(),cU=Sx(!0);function Wm(){return[]}function Xm(){return!1}function fU(){return{}}function hU(){return""}function pU(){return!0}function dU(u,f){if(u=Je(u),u<1||u>Mt)return[];var y=yt,T=vr(u,yt);f=Ne(f),u-=yt;for(var O=di(T,f);++y<u;)f(y);return O}function gU(u){return We(u)?Mr(u,wa):ls(u)?[u]:qo(zx(hr(u)))}function mU(u){var f=++Li;return hr(u)+f}var yU=tp(function(u,f){return u+f},0),vU=wm("ceil"),_U=tp(function(u,f){return u/f},1),xU=wm("floor");function EU(u){return u&&u.length?Yh(u,Wo,am):n}function wU(u,f){return u&&u.length?Yh(u,Ne(f,2),am):n}function SU(u){return Mf(u,Wo)}function MU(u,f){return Mf(u,Ne(f,2))}function bU(u){return u&&u.length?Yh(u,Wo,fm):n}function AU(u,f){return u&&u.length?Yh(u,Ne(f,2),fm):n}var TU=tp(function(u,f){return u*f},1),CU=wm("round"),PU=tp(function(u,f){return u-f},0);function IU(u){return u&&u.length?go(u,Wo):0}function RU(u,f){return u&&u.length?go(u,Ne(f,2)):0}return U.after=QD,U.ary=Kx,U.assign=G3,U.assignIn=cE,U.assignInWith=pp,U.assignWith=k3,U.at=q3,U.before=Jx,U.bind=Om,U.bindAll=YF,U.bindKey=jx,U.castArray=f3,U.chain=Yx,U.chunk=xO,U.compact=EO,U.concat=wO,U.cond=$F,U.conforms=ZF,U.constant=km,U.countBy=ID,U.create=H3,U.curry=Qx,U.curryRight=tE,U.debounce=eE,U.defaults=V3,U.defaultsDeep=W3,U.defer=t3,U.delay=e3,U.difference=SO,U.differenceBy=MO,U.differenceWith=bO,U.drop=AO,U.dropRight=TO,U.dropRightWhile=CO,U.dropWhile=PO,U.fill=IO,U.filter=LD,U.flatMap=DD,U.flatMapDeep=FD,U.flatMapDepth=UD,U.flatten=Hx,U.flattenDeep=RO,U.flattenDepth=LO,U.flip=n3,U.flow=JF,U.flowRight=jF,U.fromPairs=NO,U.functions=j3,U.functionsIn=Q3,U.groupBy=BD,U.initial=DO,U.intersection=FO,U.intersectionBy=UO,U.intersectionWith=BO,U.invert=eF,U.invertBy=nF,U.invokeMap=GD,U.iteratee=qm,U.keyBy=kD,U.keys=Fi,U.keysIn=Vo,U.map=ap,U.mapKeys=iF,U.mapValues=oF,U.matches=QF,U.matchesProperty=tU,U.memoize=lp,U.merge=sF,U.mergeWith=fE,U.method=eU,U.methodOf=nU,U.mixin=Hm,U.negate=cp,U.nthArg=iU,U.omit=aF,U.omitBy=uF,U.once=r3,U.orderBy=qD,U.over=oU,U.overArgs=i3,U.overEvery=sU,U.overSome=aU,U.partial=Dm,U.partialRight=nE,U.partition=HD,U.pick=lF,U.pickBy=hE,U.property=_E,U.propertyOf=uU,U.pull=qO,U.pullAll=Wx,U.pullAllBy=HO,U.pullAllWith=VO,U.pullAt=WO,U.range=lU,U.rangeRight=cU,U.rearg=o3,U.reject=XD,U.remove=XO,U.rest=s3,U.reverse=Lm,U.sampleSize=$D,U.set=fF,U.setWith=hF,U.shuffle=ZD,U.slice=YO,U.sortBy=jD,U.sortedUniq=tD,U.sortedUniqBy=eD,U.split=DF,U.spread=a3,U.tail=nD,U.take=rD,U.takeRight=iD,U.takeRightWhile=oD,U.takeWhile=sD,U.tap=ED,U.throttle=u3,U.thru=sp,U.toArray=aE,U.toPairs=pE,U.toPairsIn=dE,U.toPath=gU,U.toPlainObject=lE,U.transform=pF,U.unary=l3,U.union=aD,U.unionBy=uD,U.unionWith=lD,U.uniq=cD,U.uniqBy=fD,U.uniqWith=hD,U.unset=dF,U.unzip=Nm,U.unzipWith=Xx,U.update=gF,U.updateWith=mF,U.values=sc,U.valuesIn=yF,U.without=pD,U.words=yE,U.wrap=c3,U.xor=dD,U.xorBy=gD,U.xorWith=mD,U.zip=yD,U.zipObject=vD,U.zipObjectDeep=_D,U.zipWith=xD,U.entries=pE,U.entriesIn=dE,U.extend=cE,U.extendWith=pp,Hm(U,U),U.add=yU,U.attempt=vE,U.camelCase=EF,U.capitalize=gE,U.ceil=vU,U.clamp=vF,U.clone=h3,U.cloneDeep=d3,U.cloneDeepWith=g3,U.cloneWith=p3,U.conformsTo=m3,U.deburr=mE,U.defaultTo=KF,U.divide=_U,U.endsWith=wF,U.eq=Vs,U.escape=SF,U.escapeRegExp=MF,U.every=RD,U.find=ND,U.findIndex=kx,U.findKey=X3,U.findLast=OD,U.findLastIndex=qx,U.findLastKey=Y3,U.floor=xU,U.forEach=$x,U.forEachRight=Zx,U.forIn=$3,U.forInRight=Z3,U.forOwn=K3,U.forOwnRight=J3,U.get=Bm,U.gt=y3,U.gte=v3,U.has=tF,U.hasIn=zm,U.head=Vx,U.identity=Wo,U.includes=zD,U.indexOf=OO,U.inRange=_F,U.invoke=rF,U.isArguments=xl,U.isArray=We,U.isArrayBuffer=_3,U.isArrayLike=Ho,U.isArrayLikeObject=ri,U.isBoolean=x3,U.isBuffer=Ru,U.isDate=E3,U.isElement=w3,U.isEmpty=S3,U.isEqual=M3,U.isEqualWith=b3,U.isError=Fm,U.isFinite=A3,U.isFunction=ja,U.isInteger=rE,U.isLength=fp,U.isMap=iE,U.isMatch=T3,U.isMatchWith=C3,U.isNaN=P3,U.isNative=I3,U.isNil=L3,U.isNull=R3,U.isNumber=oE,U.isObject=Gr,U.isObjectLike=$r,U.isPlainObject=Uf,U.isRegExp=Um,U.isSafeInteger=N3,U.isSet=sE,U.isString=hp,U.isSymbol=ls,U.isTypedArray=oc,U.isUndefined=O3,U.isWeakMap=D3,U.isWeakSet=F3,U.join=zO,U.kebabCase=bF,U.last=Is,U.lastIndexOf=GO,U.lowerCase=AF,U.lowerFirst=TF,U.lt=U3,U.lte=B3,U.max=EU,U.maxBy=wU,U.mean=SU,U.meanBy=MU,U.min=bU,U.minBy=AU,U.stubArray=Wm,U.stubFalse=Xm,U.stubObject=fU,U.stubString=hU,U.stubTrue=pU,U.multiply=TU,U.nth=kO,U.noConflict=rU,U.noop=Vm,U.now=up,U.pad=CF,U.padEnd=PF,U.padStart=IF,U.parseInt=RF,U.random=xF,U.reduce=VD,U.reduceRight=WD,U.repeat=LF,U.replace=NF,U.result=cF,U.round=CU,U.runInContext=gt,U.sample=YD,U.size=KD,U.snakeCase=OF,U.some=JD,U.sortedIndex=$O,U.sortedIndexBy=ZO,U.sortedIndexOf=KO,U.sortedLastIndex=JO,U.sortedLastIndexBy=jO,U.sortedLastIndexOf=QO,U.startCase=FF,U.startsWith=UF,U.subtract=PU,U.sum=IU,U.sumBy=RU,U.template=BF,U.times=dU,U.toFinite=Qa,U.toInteger=Je,U.toLength=uE,U.toLower=zF,U.toNumber=Rs,U.toSafeInteger=z3,U.toString=hr,U.toUpper=GF,U.trim=kF,U.trimEnd=qF,U.trimStart=HF,U.truncate=VF,U.unescape=WF,U.uniqueId=mU,U.upperCase=XF,U.upperFirst=Gm,U.each=$x,U.eachRight=Zx,U.first=Vx,Hm(U,function(){var u={};return xa(U,function(f,y){sn.call(U.prototype,y)||(u[y]=f)}),u}(),{chain:!1}),U.VERSION=t,Pi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){U[u].placeholder=U}),Pi(["drop","take"],function(u,f){i.prototype[u]=function(y){y=y===n?1:ni(Je(y),0);var T=this.__filtered__&&!f?new i(this):this.clone();return T.__filtered__?T.__takeCount__=vr(y,T.__takeCount__):T.__views__.push({size:vr(y,yt),type:u+(T.__dir__<0?"Right":"")}),T},i.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),Pi(["filter","map","takeWhile"],function(u,f){var y=f+1,T=y==K||y==Q;i.prototype[u]=function(O){var Y=this.clone();return Y.__iteratees__.push({iteratee:Ne(O,3),type:y}),Y.__filtered__=Y.__filtered__||T,Y}}),Pi(["head","last"],function(u,f){var y="take"+(f?"Right":"");i.prototype[u]=function(){return this[y](1).value()[0]}}),Pi(["initial","tail"],function(u,f){var y="drop"+(f?"":"Right");i.prototype[u]=function(){return this.__filtered__?new i(this):this[y](1)}}),i.prototype.compact=function(){return this.filter(Wo)},i.prototype.find=function(u){return this.filter(u).head()},i.prototype.findLast=function(u){return this.reverse().find(u)},i.prototype.invokeMap=an(function(u,f){return typeof u=="function"?new i(this):this.map(function(y){return Rf(y,u,f)})}),i.prototype.reject=function(u){return this.filter(cp(Ne(u)))},i.prototype.slice=function(u,f){u=Je(u);var y=this;return y.__filtered__&&(u>0||f<0)?new i(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=Je(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},i.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},i.prototype.toArray=function(){return this.take(yt)},xa(i.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),T=/^(?:head|last)$/.test(f),O=U[T?"take"+(f=="last"?"Right":""):f],Y=T||/^find/.test(f);O&&(U.prototype[f]=function(){var nt=this.__wrapped__,ct=T?[1]:arguments,_t=nt instanceof i,zt=ct[0],kt=_t||We(nt),Yt=function(Fn){var $n=O.apply(U,ke([Fn],ct));return T&&pe?$n[0]:$n};kt&&y&&typeof zt=="function"&&zt.length!=1&&(_t=kt=!1);var pe=this.__chain__,Se=!!this.__actions__.length,De=Y&&!pe,en=_t&&!Se;if(!Y&&kt){nt=en?nt:new i(this);var Fe=u.apply(nt,ct);return Fe.__actions__.push({func:sp,args:[Yt],thisArg:n}),new r(Fe,pe)}return De&&en?u.apply(this,ct):(Fe=this.thru(Yt),De?T?Fe.value()[0]:Fe.value():Fe)})}),Pi(["pop","push","shift","sort","splice","unshift"],function(u){var f=Nr[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",T=/^(?:pop|shift)$/.test(u);U.prototype[u]=function(){var O=arguments;if(T&&!this.__chain__){var Y=this.value();return f.apply(We(Y)?Y:[],O)}return this[y](function(nt){return f.apply(We(nt)?nt:[],O)})}}),xa(i.prototype,function(u,f){var y=U[f];if(y){var T=y.name+"";sn.call(ss,T)||(ss[T]=[]),ss[T].push({name:f,func:y})}}),ss[Qh(n,R).name]=[{name:"wrapper",func:n}],i.prototype.clone=a,i.prototype.reverse=c,i.prototype.value=d,U.prototype.at=wD,U.prototype.chain=SD,U.prototype.commit=MD,U.prototype.next=bD,U.prototype.plant=TD,U.prototype.reverse=CD,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=PD,U.prototype.first=U.prototype.head,Mu&&(U.prototype[Mu]=AD),U},Ki=is();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ur._=Ki,define(function(){return Ki})):Lo?((Lo.exports=Ki)._=Ki,wf._=Ki):Ur._=Ki}).call(vf)});var CN=ot((rwt,TN)=>{TN.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var RN=ot((iwt,IN)=>{var PN=CN();IN.exports=function(n,t){Array.isArray(t)||(t=[]),n.length>0&&t.push(PN([0,0],n[0]));for(var e=0;e<n.length-1;e++){var o=n[e],s=n[e+1],l=o[0],p=o[1],h=s[0],g=s[1],m=[.75*l+.25*h,.75*p+.25*g],_=[.25*l+.75*h,.25*p+.75*g];t.push(m),t.push(_)}return n.length>1&&t.push(PN([0,0],n[n.length-1])),t}});var UN=ot((lwt,FN)=>{"use strict";var xJ=zf(),DN=Function.prototype,NN=DN.apply,ON=DN.call;FN.exports=typeof Reflect=="object"&&Reflect.apply||(xJ?ON.bind(NN):function(){return ON.apply(NN,arguments)})});var HN=ot((cwt,qN)=>{"use strict";Yp();var BN=Ns(),zN=Wf(),EJ=Xp(),GN=mi(),kN=Ls(),wJ=pc(),SJ=kN("species"),N1=RegExp.prototype;qN.exports=function(n,t,e,o){var s=kN(n),l=!GN(function(){var m={};return m[s]=function(){return 7},""[n](m)!==7}),p=l&&!GN(function(){var m=!1,_=/a/;return n==="split"&&(_={},_.constructor={},_.constructor[SJ]=function(){return _},_.flags="",_[s]=/./[s]),_.exec=function(){return m=!0,null},_[s](""),!m});if(!l||!p||e){var h=/./[s],g=t(s,""[n],function(m,_,w,S,b){var C=_.exec;return C===EJ||C===N1.exec?l&&!b?{done:!0,value:BN(h,_,w,S)}:{done:!0,value:BN(m,w,_,S)}:{done:!1}});zN(String.prototype,n,g[0]),zN(N1,s,g[1])}o&&wJ(N1[s],"sham",!0)}});var YN=ot((fwt,XN)=>{"use strict";var O1=yi(),MJ=El(),bJ=Hp(),AJ=uc(),TJ=O1("".charAt),VN=O1("".charCodeAt),CJ=O1("".slice),WN=function(n){return function(t,e){var o=bJ(AJ(t)),s=MJ(e),l=o.length,p,h;return s<0||s>=l?n?"":void 0:(p=VN(o,s),p<55296||p>56319||s+1===l||(h=VN(o,s+1))<56320||h>57343?n?TJ(o,s):p:n?CJ(o,s,s+2):(p-55296<<10)+(h-56320)+65536)}};XN.exports={codeAt:WN(!1),charAt:WN(!0)}});var ZN=ot((hwt,$N)=>{"use strict";var PJ=YN().charAt;$N.exports=function(n,t,e){return t+(e?PJ(n,t).length:1)}});var JN=ot((pwt,KN)=>{"use strict";var U1=yi(),IJ=cc(),RJ=Math.floor,D1=U1("".charAt),LJ=U1("".replace),F1=U1("".slice),NJ=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,OJ=/\$([$&'`]|\d{1,2})/g;KN.exports=function(n,t,e,o,s,l){var p=e+n.length,h=o.length,g=OJ;return s!==void 0&&(s=IJ(s),g=NJ),LJ(l,g,function(m,_){var w;switch(D1(_,0)){case"$":return"$";case"&":return n;case"`":return F1(t,0,e);case"'":return F1(t,p);case"<":w=s[F1(_,1,-1)];break;default:var S=+_;if(S===0)return m;if(S>h){var b=RJ(S/10);return b===0?m:b<=h?o[b-1]===void 0?D1(_,1):o[b-1]+D1(_,1):m}w=o[S-1]}return w===void 0?"":w})}});var t2=ot((dwt,QN)=>{"use strict";var jN=Ns(),DJ=Ma(),FJ=Ui(),UJ=ac(),BJ=Xp(),zJ=TypeError;QN.exports=function(n,t){var e=n.exec;if(FJ(e)){var o=jN(e,n,t);return o!==null&&DJ(o),o}if(UJ(n)==="RegExp")return jN(BJ,n,t);throw new zJ("RegExp#exec called on incompatible receiver")}});var o2=ot(()=>{"use strict";var GJ=UN(),e2=Ns(),Qg=yi(),kJ=HN(),qJ=mi(),HJ=Ma(),VJ=Ui(),WJ=Xs(),XJ=El(),YJ=y0(),xf=Hp(),$J=uc(),ZJ=ZN(),KJ=Ep(),JJ=JN(),jJ=t2(),QJ=Ls(),z1=QJ("replace"),tj=Math.max,ej=Math.min,nj=Qg([].concat),B1=Qg([].push),n2=Qg("".indexOf),r2=Qg("".slice),rj=function(n){return n===void 0?n:String(n)},ij=function(){return"a".replace(/./,"$0")==="$0"}(),i2=function(){return/./[z1]?/./[z1]("a","$0")==="":!1}(),oj=!qJ(function(){var n=/./;return n.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(n,"$<a>")!=="7"});kJ("replace",function(n,t,e){var o=i2?"$":"$0";return[function(l,p){var h=$J(this),g=WJ(l)?KJ(l,z1):void 0;return g?e2(g,l,h,p):e2(t,xf(h),l,p)},function(s,l){var p=HJ(this),h=xf(s);if(typeof l=="string"&&n2(l,o)===-1&&n2(l,"$<")===-1){var g=e(t,p,h,l);if(g.done)return g.value}var m=VJ(l);m||(l=xf(l));var _=p.global,w;_&&(w=p.unicode,p.lastIndex=0);for(var S=[],b;b=jJ(p,h),!(b===null||(B1(S,b),!_));){var C=xf(b[0]);C===""&&(p.lastIndex=ZJ(h,YJ(p.lastIndex),w))}for(var R="",x=0,E=0;E<S.length;E++){b=S[E];for(var I=xf(b[0]),A=tj(ej(XJ(b.index),h.length),0),F=[],V,X=1;X<b.length;X++)B1(F,rj(b[X]));var q=b.groups;if(m){var D=nj([I],F,A,h);q!==void 0&&B1(D,q),V=xf(GJ(l,void 0,D))}else V=JJ(I,h,A,F,q,l);A>=x&&(R+=r2(h,x,A)+V,x=A+I.length)}return R+r2(h,x)}]},!oj||!ij||i2)});function eu(){return eu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},eu.apply(this,arguments)}var qEt=$e(kp(),1),HEt=$e(Yp(),1),VEt=$e(Zp(),1),WEt=$e(Pb(),1),XEt=$e(Nb(),1),YEt=$e(Bb(),1),$Et=$e(kb(),1),ZEt=$e(Vb(),1),KEt=$e(Yb(),1),JEt=$e(Kb(),1),jEt=$e(yA(),1),QEt=$e(vA(),1),Vi=$e(NA(),1);var UEt=$e(kp(),1);var Lv="162";var mH=0,OA=1,yH=2;var oC=1,vH=2,uu=3,Ku=0,$o=1,cu=2,Xu=0,zc=1,DA=2,FA=3,UA=4,_H=5,Il=100,xH=101,EH=102,BA=103,zA=104,wH=200,SH=201,MH=202,bH=203,Vy=204,Wy=205,AH=206,TH=207,CH=208,PH=209,IH=210,RH=211,LH=212,NH=213,OH=214,DH=0,FH=1,UH=2,Sd=3,BH=4,zH=5,GH=6,kH=7,sC=0,qH=1,HH=2,Yu=0,VH=1,WH=2,XH=3,YH=4,$H=5,ZH=6,KH=7;var aC=300,qc=301,Hc=302,Xy=303,Yy=304,Wd=306,$y=1e3,ta=1001,Zy=1002,Mo=1003,GA=1004;var Jf=1005;var Xo=1006,cy=1007;var Ll=1008;var $u=1009,JH=1010,jH=1011,Nv=1012,uC=1013,Wu=1014,fu=1015,sh=1016,lC=1017,cC=1018,Ol=1020,QH=1021,ea=1023,t6=1024,e6=1025,Dl=1026,Vc=1027,n6=1028,fC=1029,r6=1030,hC=1031,pC=1033,fy=33776,hy=33777,py=33778,dy=33779,kA=35840,qA=35841,HA=35842,VA=35843,dC=36196,WA=37492,XA=37496,YA=37808,$A=37809,ZA=37810,KA=37811,JA=37812,jA=37813,QA=37814,tT=37815,eT=37816,nT=37817,rT=37818,iT=37819,oT=37820,sT=37821,gy=36492,aT=36494,uT=36495,i6=36283,lT=36284,cT=36285,fT=36286;var Md=2300,bd=2301,my=2302,hT=2400,pT=2401,dT=2402;var o6=3200,s6=3201,a6=0,u6=1,Vu="",ba="srgb",tl="srgb-linear",Ov="display-p3",Xd="display-p3-linear",Ad="linear",Lr="srgb",Td="rec709",Cd="p3";var yc=7680;var gT=519,l6=512,c6=513,f6=514,gC=515,h6=516,p6=517,d6=518,g6=519,Ky=35044;var mT="300 es",Jy=1035,hu=2e3,Pd=2001,Ju=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let o=this._listeners;o[t]===void 0&&(o[t]=[]),o[t].indexOf(e)===-1&&o[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let o=this._listeners;return o[t]!==void 0&&o[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let s=this._listeners[t];if(s!==void 0){let l=s.indexOf(e);l!==-1&&s.splice(l,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let o=this._listeners[t.type];if(o!==void 0){t.target=this;let s=o.slice(0);for(let l=0,p=s.length;l<p;l++)s[l].call(this,t);t.target=null}}},ao=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var yy=Math.PI/180,jy=180/Math.PI;function Zu(){let n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(ao[n&255]+ao[n>>8&255]+ao[n>>16&255]+ao[n>>24&255]+"-"+ao[t&255]+ao[t>>8&255]+"-"+ao[t>>16&15|64]+ao[t>>24&255]+"-"+ao[e&63|128]+ao[e>>8&255]+"-"+ao[e>>16&255]+ao[e>>24&255]+ao[o&255]+ao[o>>8&255]+ao[o>>16&255]+ao[o>>24&255]).toLowerCase()}function Yo(n,t,e){return Math.max(t,Math.min(e,n))}function m6(n,t){return(n%t+t)%t}function vy(n,t,e){return(1-e)*n+e*t}function yT(n){return(n&n-1)===0&&n!==0}function Qy(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ta(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function _r(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var ze=class n{constructor(t=0,e=0){n.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,o=this.y,s=t.elements;return this.x=s[0]*e+s[3]*o+s[6],this.y=s[1]*e+s[4]*o+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let o=this.dot(t)/e;return Math.acos(Yo(o,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,o=this.y-t.y;return e*e+o*o}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let o=Math.cos(e),s=Math.sin(e),l=this.x-t.x,p=this.y-t.y;return this.x=l*o-p*s+t.x,this.y=l*s+p*o+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},je=class n{constructor(t,e,o,s,l,p,h,g,m){n.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,o,s,l,p,h,g,m)}set(t,e,o,s,l,p,h,g,m){let _=this.elements;return _[0]=t,_[1]=s,_[2]=h,_[3]=e,_[4]=l,_[5]=g,_[6]=o,_[7]=p,_[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,o=t.elements;return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],e[4]=o[4],e[5]=o[5],e[6]=o[6],e[7]=o[7],e[8]=o[8],this}extractBasis(t,e,o){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),o.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let o=t.elements,s=e.elements,l=this.elements,p=o[0],h=o[3],g=o[6],m=o[1],_=o[4],w=o[7],S=o[2],b=o[5],C=o[8],R=s[0],x=s[3],E=s[6],I=s[1],A=s[4],F=s[7],V=s[2],X=s[5],q=s[8];return l[0]=p*R+h*I+g*V,l[3]=p*x+h*A+g*X,l[6]=p*E+h*F+g*q,l[1]=m*R+_*I+w*V,l[4]=m*x+_*A+w*X,l[7]=m*E+_*F+w*q,l[2]=S*R+b*I+C*V,l[5]=S*x+b*A+C*X,l[8]=S*E+b*F+C*q,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8];return e*p*_-e*h*m-o*l*_+o*h*g+s*l*m-s*p*g}invert(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8],w=_*p-h*m,S=h*g-_*l,b=m*l-p*g,C=e*w+o*S+s*b;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);let R=1/C;return t[0]=w*R,t[1]=(s*m-_*o)*R,t[2]=(h*o-s*p)*R,t[3]=S*R,t[4]=(_*e-s*g)*R,t[5]=(s*l-h*e)*R,t[6]=b*R,t[7]=(o*g-m*e)*R,t[8]=(p*e-o*l)*R,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,o,s,l,p,h){let g=Math.cos(l),m=Math.sin(l);return this.set(o*g,o*m,-o*(g*p+m*h)+p+t,-s*m,s*g,-s*(-m*p+g*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(_y.makeScale(t,e)),this}rotate(t){return this.premultiply(_y.makeRotation(-t)),this}translate(t,e){return this.premultiply(_y.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,-o,0,o,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,o=t.elements;for(let s=0;s<9;s++)if(e[s]!==o[s])return!1;return!0}fromArray(t,e=0){for(let o=0;o<9;o++)this.elements[o]=t[o+e];return this}toArray(t=[],e=0){let o=this.elements;return t[e]=o[0],t[e+1]=o[1],t[e+2]=o[2],t[e+3]=o[3],t[e+4]=o[4],t[e+5]=o[5],t[e+6]=o[6],t[e+7]=o[7],t[e+8]=o[8],t}clone(){return new this.constructor().fromArray(this.elements)}},_y=new je;function mC(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Id(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function y6(){let n=Id("canvas");return n.style.display="block",n}var vT={};function yC(n){n in vT||(vT[n]=!0,console.warn(n))}var _T=new je().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),xT=new je().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),jp={[tl]:{transfer:Ad,primaries:Td,toReference:n=>n,fromReference:n=>n},[ba]:{transfer:Lr,primaries:Td,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Xd]:{transfer:Ad,primaries:Cd,toReference:n=>n.applyMatrix3(xT),fromReference:n=>n.applyMatrix3(_T)},[Ov]:{transfer:Lr,primaries:Cd,toReference:n=>n.convertSRGBToLinear().applyMatrix3(xT),fromReference:n=>n.applyMatrix3(_T).convertLinearToSRGB()}},v6=new Set([tl,Xd]),xr={enabled:!0,_workingColorSpace:tl,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!v6.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;let o=jp[t].toReference,s=jp[e].fromReference;return s(o(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return jp[n].primaries},getTransfer:function(n){return n===Vu?Ad:jp[n].transfer}};function Gc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function xy(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var vc,Rd=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{vc===void 0&&(vc=Id("canvas")),vc.width=t.width,vc.height=t.height;let o=vc.getContext("2d");t instanceof ImageData?o.putImageData(t,0,0):o.drawImage(t,0,0,t.width,t.height),e=vc}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap){let e=Id("canvas");e.width=t.width,e.height=t.height;let o=e.getContext("2d");o.drawImage(t,0,0,t.width,t.height);let s=o.getImageData(0,0,t.width,t.height),l=s.data;for(let p=0;p<l.length;p++)l[p]=Gc(l[p]/255)*255;return o.putImageData(s,0,0),e}else if(t.data){let e=t.data.slice(0);for(let o=0;o<e.length;o++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[o]=Math.floor(Gc(e[o]/255)*255):e[o]=Gc(e[o]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},_6=0,Ld=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:_6++}),this.uuid=Zu(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let o={uuid:this.uuid,url:""},s=this.data;if(s!==null){let l;if(Array.isArray(s)){l=[];for(let p=0,h=s.length;p<h;p++)s[p].isDataTexture?l.push(Ey(s[p].image)):l.push(Ey(s[p]))}else l=Ey(s);o.url=l}return e||(t.images[this.uuid]=o),o}};function Ey(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?Rd.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var x6=0,Fs=class n extends Ju{constructor(t=n.DEFAULT_IMAGE,e=n.DEFAULT_MAPPING,o=ta,s=ta,l=Xo,p=Ll,h=ea,g=$u,m=n.DEFAULT_ANISOTROPY,_=Vu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:x6++}),this.uuid=Zu(),this.name="",this.source=new Ld(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=o,this.wrapT=s,this.magFilter=l,this.minFilter=p,this.anisotropy=m,this.format=h,this.internalFormat=null,this.type=g,this.offset=new ze(0,0),this.repeat=new ze(1,1),this.center=new ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=_,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let o={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(o.userData=this.userData),e||(t.textures[this.uuid]=o),o}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==aC)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case $y:t.x=t.x-Math.floor(t.x);break;case ta:t.x=t.x<0?0:1;break;case Zy:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case $y:t.y=t.y-Math.floor(t.y);break;case ta:t.y=t.y<0?0:1;break;case Zy:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}};Fs.DEFAULT_IMAGE=null;Fs.DEFAULT_MAPPING=aC;Fs.DEFAULT_ANISOTROPY=1;var Qi=class n{constructor(t=0,e=0,o=0,s=1){n.prototype.isVector4=!0,this.x=t,this.y=e,this.z=o,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,o,s){return this.x=t,this.y=e,this.z=o,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,o=this.y,s=this.z,l=this.w,p=t.elements;return this.x=p[0]*e+p[4]*o+p[8]*s+p[12]*l,this.y=p[1]*e+p[5]*o+p[9]*s+p[13]*l,this.z=p[2]*e+p[6]*o+p[10]*s+p[14]*l,this.w=p[3]*e+p[7]*o+p[11]*s+p[15]*l,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,o,s,l,g=t.elements,m=g[0],_=g[4],w=g[8],S=g[1],b=g[5],C=g[9],R=g[2],x=g[6],E=g[10];if(Math.abs(_-S)<.01&&Math.abs(w-R)<.01&&Math.abs(C-x)<.01){if(Math.abs(_+S)<.1&&Math.abs(w+R)<.1&&Math.abs(C+x)<.1&&Math.abs(m+b+E-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let A=(m+1)/2,F=(b+1)/2,V=(E+1)/2,X=(_+S)/4,q=(w+R)/4,D=(C+x)/4;return A>F&&A>V?A<.01?(o=0,s=.707106781,l=.707106781):(o=Math.sqrt(A),s=X/o,l=q/o):F>V?F<.01?(o=.707106781,s=0,l=.707106781):(s=Math.sqrt(F),o=X/s,l=D/s):V<.01?(o=.707106781,s=.707106781,l=0):(l=Math.sqrt(V),o=q/l,s=D/l),this.set(o,s,l,e),this}let I=Math.sqrt((x-C)*(x-C)+(w-R)*(w-R)+(S-_)*(S-_));return Math.abs(I)<.001&&(I=1),this.x=(x-C)/I,this.y=(w-R)/I,this.z=(S-_)/I,this.w=Math.acos((m+b+E-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this.z=t.z+(e.z-t.z)*o,this.w=t.w+(e.w-t.w)*o,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},tv=class extends Ju{constructor(t=1,e=1,o={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qi(0,0,t,e),this.scissorTest=!1,this.viewport=new Qi(0,0,t,e);let s={width:t,height:e,depth:1};o=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Xo,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},o);let l=new Fs(s,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.colorSpace);l.flipY=!1,l.generateMipmaps=o.generateMipmaps,l.internalFormat=o.internalFormat,this.textures=[];let p=o.count;for(let h=0;h<p;h++)this.textures[h]=l.clone(),this.textures[h].isRenderTargetTexture=!0;this.depthBuffer=o.depthBuffer,this.stencilBuffer=o.stencilBuffer,this.depthTexture=o.depthTexture,this.samples=o.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,o=1){if(this.width!==t||this.height!==e||this.depth!==o){this.width=t,this.height=e,this.depth=o;for(let s=0,l=this.textures.length;s<l;s++)this.textures[s].image.width=t,this.textures[s].image.height=e,this.textures[s].image.depth=o;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let o=0,s=t.textures.length;o<s;o++)this.textures[o]=t.textures[o].clone(),this.textures[o].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Ld(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},du=class extends tv{constructor(t=1,e=1,o={}){super(t,e,o),this.isWebGLRenderTarget=!0}},Nd=class extends Fs{constructor(t=null,e=1,o=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:o,depth:s},this.magFilter=Mo,this.minFilter=Mo,this.wrapR=ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var ev=class extends Fs{constructor(t=null,e=1,o=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:o,depth:s},this.magFilter=Mo,this.minFilter=Mo,this.wrapR=ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var ju=class{constructor(t=0,e=0,o=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=o,this._w=s}static slerpFlat(t,e,o,s,l,p,h){let g=o[s+0],m=o[s+1],_=o[s+2],w=o[s+3],S=l[p+0],b=l[p+1],C=l[p+2],R=l[p+3];if(h===0){t[e+0]=g,t[e+1]=m,t[e+2]=_,t[e+3]=w;return}if(h===1){t[e+0]=S,t[e+1]=b,t[e+2]=C,t[e+3]=R;return}if(w!==R||g!==S||m!==b||_!==C){let x=1-h,E=g*S+m*b+_*C+w*R,I=E>=0?1:-1,A=1-E*E;if(A>Number.EPSILON){let V=Math.sqrt(A),X=Math.atan2(V,E*I);x=Math.sin(x*X)/V,h=Math.sin(h*X)/V}let F=h*I;if(g=g*x+S*F,m=m*x+b*F,_=_*x+C*F,w=w*x+R*F,x===1-h){let V=1/Math.sqrt(g*g+m*m+_*_+w*w);g*=V,m*=V,_*=V,w*=V}}t[e]=g,t[e+1]=m,t[e+2]=_,t[e+3]=w}static multiplyQuaternionsFlat(t,e,o,s,l,p){let h=o[s],g=o[s+1],m=o[s+2],_=o[s+3],w=l[p],S=l[p+1],b=l[p+2],C=l[p+3];return t[e]=h*C+_*w+g*b-m*S,t[e+1]=g*C+_*S+m*w-h*b,t[e+2]=m*C+_*b+h*S-g*w,t[e+3]=_*C-h*w-g*S-m*b,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,o,s){return this._x=t,this._y=e,this._z=o,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let o=t._x,s=t._y,l=t._z,p=t._order,h=Math.cos,g=Math.sin,m=h(o/2),_=h(s/2),w=h(l/2),S=g(o/2),b=g(s/2),C=g(l/2);switch(p){case"XYZ":this._x=S*_*w+m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w-S*b*C;break;case"YXZ":this._x=S*_*w+m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w+S*b*C;break;case"ZXY":this._x=S*_*w-m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w-S*b*C;break;case"ZYX":this._x=S*_*w-m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w+S*b*C;break;case"YZX":this._x=S*_*w+m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w-S*b*C;break;case"XZY":this._x=S*_*w-m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w+S*b*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+p)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let o=e/2,s=Math.sin(o);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(o),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,o=e[0],s=e[4],l=e[8],p=e[1],h=e[5],g=e[9],m=e[2],_=e[6],w=e[10],S=o+h+w;if(S>0){let b=.5/Math.sqrt(S+1);this._w=.25/b,this._x=(_-g)*b,this._y=(l-m)*b,this._z=(p-s)*b}else if(o>h&&o>w){let b=2*Math.sqrt(1+o-h-w);this._w=(_-g)/b,this._x=.25*b,this._y=(s+p)/b,this._z=(l+m)/b}else if(h>w){let b=2*Math.sqrt(1+h-o-w);this._w=(l-m)/b,this._x=(s+p)/b,this._y=.25*b,this._z=(g+_)/b}else{let b=2*Math.sqrt(1+w-o-h);this._w=(p-s)/b,this._x=(l+m)/b,this._y=(g+_)/b,this._z=.25*b}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let o=t.dot(e)+1;return o<Number.EPSILON?(o=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=o):(this._x=0,this._y=-t.z,this._z=t.y,this._w=o)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=o),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Yo(this.dot(t),-1,1)))}rotateTowards(t,e){let o=this.angleTo(t);if(o===0)return this;let s=Math.min(1,e/o);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let o=t._x,s=t._y,l=t._z,p=t._w,h=e._x,g=e._y,m=e._z,_=e._w;return this._x=o*_+p*h+s*m-l*g,this._y=s*_+p*g+l*h-o*m,this._z=l*_+p*m+o*g-s*h,this._w=p*_-o*h-s*g-l*m,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let o=this._x,s=this._y,l=this._z,p=this._w,h=p*t._w+o*t._x+s*t._y+l*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=p,this._x=o,this._y=s,this._z=l,this;let g=1-h*h;if(g<=Number.EPSILON){let b=1-e;return this._w=b*p+e*this._w,this._x=b*o+e*this._x,this._y=b*s+e*this._y,this._z=b*l+e*this._z,this.normalize(),this}let m=Math.sqrt(g),_=Math.atan2(m,h),w=Math.sin((1-e)*_)/m,S=Math.sin(e*_)/m;return this._w=p*w+this._w*S,this._x=o*w+this._x*S,this._y=s*w+this._y*S,this._z=l*w+this._z*S,this._onChangeCallback(),this}slerpQuaternions(t,e,o){return this.copy(t).slerp(e,o)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),o=Math.random(),s=Math.sqrt(1-o),l=Math.sqrt(o);return this.set(s*Math.sin(t),s*Math.cos(t),l*Math.sin(e),l*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Pt=class n{constructor(t=0,e=0,o=0){n.prototype.isVector3=!0,this.x=t,this.y=e,this.z=o}set(t,e,o){return o===void 0&&(o=this.z),this.x=t,this.y=e,this.z=o,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ET.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ET.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,o=this.y,s=this.z,l=t.elements;return this.x=l[0]*e+l[3]*o+l[6]*s,this.y=l[1]*e+l[4]*o+l[7]*s,this.z=l[2]*e+l[5]*o+l[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,o=this.y,s=this.z,l=t.elements,p=1/(l[3]*e+l[7]*o+l[11]*s+l[15]);return this.x=(l[0]*e+l[4]*o+l[8]*s+l[12])*p,this.y=(l[1]*e+l[5]*o+l[9]*s+l[13])*p,this.z=(l[2]*e+l[6]*o+l[10]*s+l[14])*p,this}applyQuaternion(t){let e=this.x,o=this.y,s=this.z,l=t.x,p=t.y,h=t.z,g=t.w,m=2*(p*s-h*o),_=2*(h*e-l*s),w=2*(l*o-p*e);return this.x=e+g*m+p*w-h*_,this.y=o+g*_+h*m-l*w,this.z=s+g*w+l*_-p*m,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,o=this.y,s=this.z,l=t.elements;return this.x=l[0]*e+l[4]*o+l[8]*s,this.y=l[1]*e+l[5]*o+l[9]*s,this.z=l[2]*e+l[6]*o+l[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this.z=t.z+(e.z-t.z)*o,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let o=t.x,s=t.y,l=t.z,p=e.x,h=e.y,g=e.z;return this.x=s*g-l*h,this.y=l*p-o*g,this.z=o*h-s*p,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let o=t.dot(this)/e;return this.copy(t).multiplyScalar(o)}projectOnPlane(t){return wy.copy(this).projectOnVector(t),this.sub(wy)}reflect(t){return this.sub(wy.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let o=this.dot(t)/e;return Math.acos(Yo(o,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,o=this.y-t.y,s=this.z-t.z;return e*e+o*o+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,o){let s=Math.sin(e)*t;return this.x=s*Math.sin(o),this.y=Math.cos(e)*t,this.z=s*Math.cos(o),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,o){return this.x=t*Math.sin(e),this.y=o,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),o=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=o,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,o=Math.sqrt(1-e*e);return this.x=o*Math.cos(t),this.y=e,this.z=o*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},wy=new Pt,ET=new ju,Fl=class{constructor(t=new Pt(1/0,1/0,1/0),e=new Pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,o=t.length;e<o;e+=3)this.expandByPoint(Js.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,o=t.count;e<o;e++)this.expandByPoint(Js.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,o=t.length;e<o;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let o=Js.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(o),this.max.copy(t).add(o),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let o=t.geometry;if(o!==void 0){let l=o.getAttribute("position");if(e===!0&&l!==void 0&&t.isInstancedMesh!==!0)for(let p=0,h=l.count;p<h;p++)t.isMesh===!0?t.getVertexPosition(p,Js):Js.fromBufferAttribute(l,p),Js.applyMatrix4(t.matrixWorld),this.expandByPoint(Js);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Qp.copy(t.boundingBox)):(o.boundingBox===null&&o.computeBoundingBox(),Qp.copy(o.boundingBox)),Qp.applyMatrix4(t.matrixWorld),this.union(Qp)}let s=t.children;for(let l=0,p=s.length;l<p;l++)this.expandByObject(s[l],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Js),Js.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,o;return t.normal.x>0?(e=t.normal.x*this.min.x,o=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,o=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,o+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,o+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,o+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,o+=t.normal.z*this.min.z),e<=-t.constant&&o>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(jf),td.subVectors(this.max,jf),_c.subVectors(t.a,jf),xc.subVectors(t.b,jf),Ec.subVectors(t.c,jf),Uu.subVectors(xc,_c),Bu.subVectors(Ec,xc),Sl.subVectors(_c,Ec);let e=[0,-Uu.z,Uu.y,0,-Bu.z,Bu.y,0,-Sl.z,Sl.y,Uu.z,0,-Uu.x,Bu.z,0,-Bu.x,Sl.z,0,-Sl.x,-Uu.y,Uu.x,0,-Bu.y,Bu.x,0,-Sl.y,Sl.x,0];return!Sy(e,_c,xc,Ec,td)||(e=[1,0,0,0,1,0,0,0,1],!Sy(e,_c,xc,Ec,td))?!1:(ed.crossVectors(Uu,Bu),e=[ed.x,ed.y,ed.z],Sy(e,_c,xc,Ec,td))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Js).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Js).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(ru[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ru[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ru[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ru[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ru[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ru[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ru[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ru[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ru),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},ru=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Js=new Pt,Qp=new Fl,_c=new Pt,xc=new Pt,Ec=new Pt,Uu=new Pt,Bu=new Pt,Sl=new Pt,jf=new Pt,td=new Pt,ed=new Pt,Ml=new Pt;function Sy(n,t,e,o,s){for(let l=0,p=n.length-3;l<=p;l+=3){Ml.fromArray(n,l);let h=s.x*Math.abs(Ml.x)+s.y*Math.abs(Ml.y)+s.z*Math.abs(Ml.z),g=t.dot(Ml),m=e.dot(Ml),_=o.dot(Ml);if(Math.max(-Math.max(g,m,_),Math.min(g,m,_))>h)return!1}return!0}var E6=new Fl,Qf=new Pt,My=new Pt,ah=class{constructor(t=new Pt,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let o=this.center;e!==void 0?o.copy(e):E6.setFromPoints(t).getCenter(o);let s=0;for(let l=0,p=t.length;l<p;l++)s=Math.max(s,o.distanceToSquared(t[l]));return this.radius=Math.sqrt(s),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let o=this.center.distanceToSquared(t);return e.copy(t),o>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qf.subVectors(t,this.center);let e=Qf.lengthSq();if(e>this.radius*this.radius){let o=Math.sqrt(e),s=(o-this.radius)*.5;this.center.addScaledVector(Qf,s/o),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(My.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qf.copy(t.center).add(My)),this.expandByPoint(Qf.copy(t.center).sub(My))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},iu=new Pt,by=new Pt,nd=new Pt,zu=new Pt,Ay=new Pt,rd=new Pt,Ty=new Pt,nv=class{constructor(t=new Pt,e=new Pt(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,iu)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let o=e.dot(this.direction);return o<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,o)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=iu.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(iu.copy(this.origin).addScaledVector(this.direction,e),iu.distanceToSquared(t))}distanceSqToSegment(t,e,o,s){by.copy(t).add(e).multiplyScalar(.5),nd.copy(e).sub(t).normalize(),zu.copy(this.origin).sub(by);let l=t.distanceTo(e)*.5,p=-this.direction.dot(nd),h=zu.dot(this.direction),g=-zu.dot(nd),m=zu.lengthSq(),_=Math.abs(1-p*p),w,S,b,C;if(_>0)if(w=p*g-h,S=p*h-g,C=l*_,w>=0)if(S>=-C)if(S<=C){let R=1/_;w*=R,S*=R,b=w*(w+p*S+2*h)+S*(p*w+S+2*g)+m}else S=l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;else S=-l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;else S<=-C?(w=Math.max(0,-(-p*l+h)),S=w>0?-l:Math.min(Math.max(-l,-g),l),b=-w*w+S*(S+2*g)+m):S<=C?(w=0,S=Math.min(Math.max(-l,-g),l),b=S*(S+2*g)+m):(w=Math.max(0,-(p*l+h)),S=w>0?l:Math.min(Math.max(-l,-g),l),b=-w*w+S*(S+2*g)+m);else S=p>0?-l:l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;return o&&o.copy(this.origin).addScaledVector(this.direction,w),s&&s.copy(by).addScaledVector(nd,S),b}intersectSphere(t,e){iu.subVectors(t.center,this.origin);let o=iu.dot(this.direction),s=iu.dot(iu)-o*o,l=t.radius*t.radius;if(s>l)return null;let p=Math.sqrt(l-s),h=o-p,g=o+p;return g<0?null:h<0?this.at(g,e):this.at(h,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let o=-(this.origin.dot(t.normal)+t.constant)/e;return o>=0?o:null}intersectPlane(t,e){let o=this.distanceToPlane(t);return o===null?null:this.at(o,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let o,s,l,p,h,g,m=1/this.direction.x,_=1/this.direction.y,w=1/this.direction.z,S=this.origin;return m>=0?(o=(t.min.x-S.x)*m,s=(t.max.x-S.x)*m):(o=(t.max.x-S.x)*m,s=(t.min.x-S.x)*m),_>=0?(l=(t.min.y-S.y)*_,p=(t.max.y-S.y)*_):(l=(t.max.y-S.y)*_,p=(t.min.y-S.y)*_),o>p||l>s||((l>o||isNaN(o))&&(o=l),(p<s||isNaN(s))&&(s=p),w>=0?(h=(t.min.z-S.z)*w,g=(t.max.z-S.z)*w):(h=(t.max.z-S.z)*w,g=(t.min.z-S.z)*w),o>g||h>s)||((h>o||o!==o)&&(o=h),(g<s||s!==s)&&(s=g),s<0)?null:this.at(o>=0?o:s,e)}intersectsBox(t){return this.intersectBox(t,iu)!==null}intersectTriangle(t,e,o,s,l){Ay.subVectors(e,t),rd.subVectors(o,t),Ty.crossVectors(Ay,rd);let p=this.direction.dot(Ty),h;if(p>0){if(s)return null;h=1}else if(p<0)h=-1,p=-p;else return null;zu.subVectors(this.origin,t);let g=h*this.direction.dot(rd.crossVectors(zu,rd));if(g<0)return null;let m=h*this.direction.dot(Ay.cross(zu));if(m<0||g+m>p)return null;let _=-h*zu.dot(Ty);return _<0?null:this.at(_/p,l)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},vi=class n{constructor(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x){n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x)}set(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x){let E=this.elements;return E[0]=t,E[4]=e,E[8]=o,E[12]=s,E[1]=l,E[5]=p,E[9]=h,E[13]=g,E[2]=m,E[6]=_,E[10]=w,E[14]=S,E[3]=b,E[7]=C,E[11]=R,E[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new n().fromArray(this.elements)}copy(t){let e=this.elements,o=t.elements;return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],e[4]=o[4],e[5]=o[5],e[6]=o[6],e[7]=o[7],e[8]=o[8],e[9]=o[9],e[10]=o[10],e[11]=o[11],e[12]=o[12],e[13]=o[13],e[14]=o[14],e[15]=o[15],this}copyPosition(t){let e=this.elements,o=t.elements;return e[12]=o[12],e[13]=o[13],e[14]=o[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,o){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),o.setFromMatrixColumn(this,2),this}makeBasis(t,e,o){return this.set(t.x,e.x,o.x,0,t.y,e.y,o.y,0,t.z,e.z,o.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,o=t.elements,s=1/wc.setFromMatrixColumn(t,0).length(),l=1/wc.setFromMatrixColumn(t,1).length(),p=1/wc.setFromMatrixColumn(t,2).length();return e[0]=o[0]*s,e[1]=o[1]*s,e[2]=o[2]*s,e[3]=0,e[4]=o[4]*l,e[5]=o[5]*l,e[6]=o[6]*l,e[7]=0,e[8]=o[8]*p,e[9]=o[9]*p,e[10]=o[10]*p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,o=t.x,s=t.y,l=t.z,p=Math.cos(o),h=Math.sin(o),g=Math.cos(s),m=Math.sin(s),_=Math.cos(l),w=Math.sin(l);if(t.order==="XYZ"){let S=p*_,b=p*w,C=h*_,R=h*w;e[0]=g*_,e[4]=-g*w,e[8]=m,e[1]=b+C*m,e[5]=S-R*m,e[9]=-h*g,e[2]=R-S*m,e[6]=C+b*m,e[10]=p*g}else if(t.order==="YXZ"){let S=g*_,b=g*w,C=m*_,R=m*w;e[0]=S+R*h,e[4]=C*h-b,e[8]=p*m,e[1]=p*w,e[5]=p*_,e[9]=-h,e[2]=b*h-C,e[6]=R+S*h,e[10]=p*g}else if(t.order==="ZXY"){let S=g*_,b=g*w,C=m*_,R=m*w;e[0]=S-R*h,e[4]=-p*w,e[8]=C+b*h,e[1]=b+C*h,e[5]=p*_,e[9]=R-S*h,e[2]=-p*m,e[6]=h,e[10]=p*g}else if(t.order==="ZYX"){let S=p*_,b=p*w,C=h*_,R=h*w;e[0]=g*_,e[4]=C*m-b,e[8]=S*m+R,e[1]=g*w,e[5]=R*m+S,e[9]=b*m-C,e[2]=-m,e[6]=h*g,e[10]=p*g}else if(t.order==="YZX"){let S=p*g,b=p*m,C=h*g,R=h*m;e[0]=g*_,e[4]=R-S*w,e[8]=C*w+b,e[1]=w,e[5]=p*_,e[9]=-h*_,e[2]=-m*_,e[6]=b*w+C,e[10]=S-R*w}else if(t.order==="XZY"){let S=p*g,b=p*m,C=h*g,R=h*m;e[0]=g*_,e[4]=-w,e[8]=m*_,e[1]=S*w+R,e[5]=p*_,e[9]=b*w-C,e[2]=C*w-b,e[6]=h*_,e[10]=R*w+S}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(w6,t,S6)}lookAt(t,e,o){let s=this.elements;return hs.subVectors(t,e),hs.lengthSq()===0&&(hs.z=1),hs.normalize(),Gu.crossVectors(o,hs),Gu.lengthSq()===0&&(Math.abs(o.z)===1?hs.x+=1e-4:hs.z+=1e-4,hs.normalize(),Gu.crossVectors(o,hs)),Gu.normalize(),id.crossVectors(hs,Gu),s[0]=Gu.x,s[4]=id.x,s[8]=hs.x,s[1]=Gu.y,s[5]=id.y,s[9]=hs.y,s[2]=Gu.z,s[6]=id.z,s[10]=hs.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let o=t.elements,s=e.elements,l=this.elements,p=o[0],h=o[4],g=o[8],m=o[12],_=o[1],w=o[5],S=o[9],b=o[13],C=o[2],R=o[6],x=o[10],E=o[14],I=o[3],A=o[7],F=o[11],V=o[15],X=s[0],q=s[4],D=s[8],xt=s[12],B=s[1],j=s[5],K=s[9],Dt=s[13],Q=s[2],At=s[6],Mt=s[10],Lt=s[14],pt=s[3],yt=s[7],J=s[11],Bt=s[15];return l[0]=p*X+h*B+g*Q+m*pt,l[4]=p*q+h*j+g*At+m*yt,l[8]=p*D+h*K+g*Mt+m*J,l[12]=p*xt+h*Dt+g*Lt+m*Bt,l[1]=_*X+w*B+S*Q+b*pt,l[5]=_*q+w*j+S*At+b*yt,l[9]=_*D+w*K+S*Mt+b*J,l[13]=_*xt+w*Dt+S*Lt+b*Bt,l[2]=C*X+R*B+x*Q+E*pt,l[6]=C*q+R*j+x*At+E*yt,l[10]=C*D+R*K+x*Mt+E*J,l[14]=C*xt+R*Dt+x*Lt+E*Bt,l[3]=I*X+A*B+F*Q+V*pt,l[7]=I*q+A*j+F*At+V*yt,l[11]=I*D+A*K+F*Mt+V*J,l[15]=I*xt+A*Dt+F*Lt+V*Bt,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],o=t[4],s=t[8],l=t[12],p=t[1],h=t[5],g=t[9],m=t[13],_=t[2],w=t[6],S=t[10],b=t[14],C=t[3],R=t[7],x=t[11],E=t[15];return C*(+l*g*w-s*m*w-l*h*S+o*m*S+s*h*b-o*g*b)+R*(+e*g*b-e*m*S+l*p*S-s*p*b+s*m*_-l*g*_)+x*(+e*m*w-e*h*b-l*p*w+o*p*b+l*h*_-o*m*_)+E*(-s*h*_-e*g*w+e*h*S+s*p*w-o*p*S+o*g*_)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,o){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=o),this}invert(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8],w=t[9],S=t[10],b=t[11],C=t[12],R=t[13],x=t[14],E=t[15],I=w*x*m-R*S*m+R*g*b-h*x*b-w*g*E+h*S*E,A=C*S*m-_*x*m-C*g*b+p*x*b+_*g*E-p*S*E,F=_*R*m-C*w*m+C*h*b-p*R*b-_*h*E+p*w*E,V=C*w*g-_*R*g-C*h*S+p*R*S+_*h*x-p*w*x,X=e*I+o*A+s*F+l*V;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let q=1/X;return t[0]=I*q,t[1]=(R*S*l-w*x*l-R*s*b+o*x*b+w*s*E-o*S*E)*q,t[2]=(h*x*l-R*g*l+R*s*m-o*x*m-h*s*E+o*g*E)*q,t[3]=(w*g*l-h*S*l-w*s*m+o*S*m+h*s*b-o*g*b)*q,t[4]=A*q,t[5]=(_*x*l-C*S*l+C*s*b-e*x*b-_*s*E+e*S*E)*q,t[6]=(C*g*l-p*x*l-C*s*m+e*x*m+p*s*E-e*g*E)*q,t[7]=(p*S*l-_*g*l+_*s*m-e*S*m-p*s*b+e*g*b)*q,t[8]=F*q,t[9]=(C*w*l-_*R*l-C*o*b+e*R*b+_*o*E-e*w*E)*q,t[10]=(p*R*l-C*h*l+C*o*m-e*R*m-p*o*E+e*h*E)*q,t[11]=(_*h*l-p*w*l-_*o*m+e*w*m+p*o*b-e*h*b)*q,t[12]=V*q,t[13]=(_*R*s-C*w*s+C*o*S-e*R*S-_*o*x+e*w*x)*q,t[14]=(C*h*s-p*R*s-C*o*g+e*R*g+p*o*x-e*h*x)*q,t[15]=(p*w*s-_*h*s+_*o*g-e*w*g-p*o*S+e*h*S)*q,this}scale(t){let e=this.elements,o=t.x,s=t.y,l=t.z;return e[0]*=o,e[4]*=s,e[8]*=l,e[1]*=o,e[5]*=s,e[9]*=l,e[2]*=o,e[6]*=s,e[10]*=l,e[3]*=o,e[7]*=s,e[11]*=l,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],o=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,o,s))}makeTranslation(t,e,o){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,o,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),o=Math.sin(t);return this.set(1,0,0,0,0,e,-o,0,0,o,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,0,o,0,0,1,0,0,-o,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,-o,0,0,o,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let o=Math.cos(e),s=Math.sin(e),l=1-o,p=t.x,h=t.y,g=t.z,m=l*p,_=l*h;return this.set(m*p+o,m*h-s*g,m*g+s*h,0,m*h+s*g,_*h+o,_*g-s*p,0,m*g-s*h,_*g+s*p,l*g*g+o,0,0,0,0,1),this}makeScale(t,e,o){return this.set(t,0,0,0,0,e,0,0,0,0,o,0,0,0,0,1),this}makeShear(t,e,o,s,l,p){return this.set(1,o,l,0,t,1,p,0,e,s,1,0,0,0,0,1),this}compose(t,e,o){let s=this.elements,l=e._x,p=e._y,h=e._z,g=e._w,m=l+l,_=p+p,w=h+h,S=l*m,b=l*_,C=l*w,R=p*_,x=p*w,E=h*w,I=g*m,A=g*_,F=g*w,V=o.x,X=o.y,q=o.z;return s[0]=(1-(R+E))*V,s[1]=(b+F)*V,s[2]=(C-A)*V,s[3]=0,s[4]=(b-F)*X,s[5]=(1-(S+E))*X,s[6]=(x+I)*X,s[7]=0,s[8]=(C+A)*q,s[9]=(x-I)*q,s[10]=(1-(S+R))*q,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,o){let s=this.elements,l=wc.set(s[0],s[1],s[2]).length(),p=wc.set(s[4],s[5],s[6]).length(),h=wc.set(s[8],s[9],s[10]).length();this.determinant()<0&&(l=-l),t.x=s[12],t.y=s[13],t.z=s[14],js.copy(this);let m=1/l,_=1/p,w=1/h;return js.elements[0]*=m,js.elements[1]*=m,js.elements[2]*=m,js.elements[4]*=_,js.elements[5]*=_,js.elements[6]*=_,js.elements[8]*=w,js.elements[9]*=w,js.elements[10]*=w,e.setFromRotationMatrix(js),o.x=l,o.y=p,o.z=h,this}makePerspective(t,e,o,s,l,p,h=hu){let g=this.elements,m=2*l/(e-t),_=2*l/(o-s),w=(e+t)/(e-t),S=(o+s)/(o-s),b,C;if(h===hu)b=-(p+l)/(p-l),C=-2*p*l/(p-l);else if(h===Pd)b=-p/(p-l),C=-p*l/(p-l);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return g[0]=m,g[4]=0,g[8]=w,g[12]=0,g[1]=0,g[5]=_,g[9]=S,g[13]=0,g[2]=0,g[6]=0,g[10]=b,g[14]=C,g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this}makeOrthographic(t,e,o,s,l,p,h=hu){let g=this.elements,m=1/(e-t),_=1/(o-s),w=1/(p-l),S=(e+t)*m,b=(o+s)*_,C,R;if(h===hu)C=(p+l)*w,R=-2*w;else if(h===Pd)C=l*w,R=-1*w;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return g[0]=2*m,g[4]=0,g[8]=0,g[12]=-S,g[1]=0,g[5]=2*_,g[9]=0,g[13]=-b,g[2]=0,g[6]=0,g[10]=R,g[14]=-C,g[3]=0,g[7]=0,g[11]=0,g[15]=1,this}equals(t){let e=this.elements,o=t.elements;for(let s=0;s<16;s++)if(e[s]!==o[s])return!1;return!0}fromArray(t,e=0){for(let o=0;o<16;o++)this.elements[o]=t[o+e];return this}toArray(t=[],e=0){let o=this.elements;return t[e]=o[0],t[e+1]=o[1],t[e+2]=o[2],t[e+3]=o[3],t[e+4]=o[4],t[e+5]=o[5],t[e+6]=o[6],t[e+7]=o[7],t[e+8]=o[8],t[e+9]=o[9],t[e+10]=o[10],t[e+11]=o[11],t[e+12]=o[12],t[e+13]=o[13],t[e+14]=o[14],t[e+15]=o[15],t}},wc=new Pt,js=new vi,w6=new Pt(0,0,0),S6=new Pt(1,1,1),Gu=new Pt,id=new Pt,hs=new Pt,wT=new vi,ST=new ju,Ul=class n{constructor(t=0,e=0,o=0,s=n.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=o,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,o,s=this._order){return this._x=t,this._y=e,this._z=o,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,o=!0){let s=t.elements,l=s[0],p=s[4],h=s[8],g=s[1],m=s[5],_=s[9],w=s[2],S=s[6],b=s[10];switch(e){case"XYZ":this._y=Math.asin(Yo(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-_,b),this._z=Math.atan2(-p,l)):(this._x=Math.atan2(S,m),this._z=0);break;case"YXZ":this._x=Math.asin(-Yo(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(h,b),this._z=Math.atan2(g,m)):(this._y=Math.atan2(-w,l),this._z=0);break;case"ZXY":this._x=Math.asin(Yo(S,-1,1)),Math.abs(S)<.9999999?(this._y=Math.atan2(-w,b),this._z=Math.atan2(-p,m)):(this._y=0,this._z=Math.atan2(g,l));break;case"ZYX":this._y=Math.asin(-Yo(w,-1,1)),Math.abs(w)<.9999999?(this._x=Math.atan2(S,b),this._z=Math.atan2(g,l)):(this._x=0,this._z=Math.atan2(-p,m));break;case"YZX":this._z=Math.asin(Yo(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(-_,m),this._y=Math.atan2(-w,l)):(this._x=0,this._y=Math.atan2(h,b));break;case"XZY":this._z=Math.asin(-Yo(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(S,m),this._y=Math.atan2(h,l)):(this._x=Math.atan2(-_,b),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,o===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,o){return wT.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wT,e,o)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ST.setFromEuler(this),this.setFromQuaternion(ST,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ul.DEFAULT_ORDER="XYZ";var Od=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},M6=0,MT=new Pt,Sc=new ju,ou=new vi,od=new Pt,th=new Pt,b6=new Pt,A6=new ju,bT=new Pt(1,0,0),AT=new Pt(0,1,0),TT=new Pt(0,0,1),T6={type:"added"},C6={type:"removed"},Cy={type:"childadded",child:null},Py={type:"childremoved",child:null},ra=class n extends Ju{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:M6++}),this.uuid=Zu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.DEFAULT_UP.clone();let t=new Pt,e=new Ul,o=new ju,s=new Pt(1,1,1);function l(){o.setFromEuler(e,!1)}function p(){e.setFromQuaternion(o,void 0,!1)}e._onChange(l),o._onChange(p),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:o},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new vi},normalMatrix:{value:new je}}),this.matrix=new vi,this.matrixWorld=new vi,this.matrixAutoUpdate=n.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=n.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Od,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Sc.setFromAxisAngle(t,e),this.quaternion.multiply(Sc),this}rotateOnWorldAxis(t,e){return Sc.setFromAxisAngle(t,e),this.quaternion.premultiply(Sc),this}rotateX(t){return this.rotateOnAxis(bT,t)}rotateY(t){return this.rotateOnAxis(AT,t)}rotateZ(t){return this.rotateOnAxis(TT,t)}translateOnAxis(t,e){return MT.copy(t).applyQuaternion(this.quaternion),this.position.add(MT.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bT,t)}translateY(t){return this.translateOnAxis(AT,t)}translateZ(t){return this.translateOnAxis(TT,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ou.copy(this.matrixWorld).invert())}lookAt(t,e,o){t.isVector3?od.copy(t):od.set(t,e,o);let s=this.parent;this.updateWorldMatrix(!0,!1),th.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ou.lookAt(th,od,this.up):ou.lookAt(od,th,this.up),this.quaternion.setFromRotationMatrix(ou),s&&(ou.extractRotation(s.matrixWorld),Sc.setFromRotationMatrix(ou),this.quaternion.premultiply(Sc.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(T6),Cy.child=t,this.dispatchEvent(Cy),Cy.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let o=0;o<arguments.length;o++)this.remove(arguments[o]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(C6),Py.child=t,this.dispatchEvent(Py),Py.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),ou.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ou.multiply(t.parent.matrixWorld)),t.applyMatrix4(ou),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let o=0,s=this.children.length;o<s;o++){let p=this.children[o].getObjectByProperty(t,e);if(p!==void 0)return p}}getObjectsByProperty(t,e,o=[]){this[t]===e&&o.push(this);let s=this.children;for(let l=0,p=s.length;l<p;l++)s[l].getObjectsByProperty(t,e,o);return o}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(th,t,b6),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(th,A6,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let o=0,s=e.length;o<s;o++)e[o].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let o=0,s=e.length;o<s;o++)e[o].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let o=0,s=e.length;o<s;o++){let l=e[o];(l.matrixWorldAutoUpdate===!0||t===!0)&&l.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let o=this.parent;if(t===!0&&o!==null&&o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let s=this.children;for(let l=0,p=s.length;l<p;l++){let h=s[l];h.matrixWorldAutoUpdate===!0&&h.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",o={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},o.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(h=>({boxInitialized:h.boxInitialized,boxMin:h.box.min.toArray(),boxMax:h.box.max.toArray(),sphereInitialized:h.sphereInitialized,sphereRadius:h.sphere.radius,sphereCenter:h.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function l(h,g){return h[g.uuid]===void 0&&(h[g.uuid]=g.toJSON(t)),g.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=l(t.geometries,this.geometry);let h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){let g=h.shapes;if(Array.isArray(g))for(let m=0,_=g.length;m<_;m++){let w=g[m];l(t.shapes,w)}else l(t.shapes,g)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(l(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let h=[];for(let g=0,m=this.material.length;g<m;g++)h.push(l(t.materials,this.material[g]));s.material=h}else s.material=l(t.materials,this.material);if(this.children.length>0){s.children=[];for(let h=0;h<this.children.length;h++)s.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let h=0;h<this.animations.length;h++){let g=this.animations[h];s.animations.push(l(t.animations,g))}}if(e){let h=p(t.geometries),g=p(t.materials),m=p(t.textures),_=p(t.images),w=p(t.shapes),S=p(t.skeletons),b=p(t.animations),C=p(t.nodes);h.length>0&&(o.geometries=h),g.length>0&&(o.materials=g),m.length>0&&(o.textures=m),_.length>0&&(o.images=_),w.length>0&&(o.shapes=w),S.length>0&&(o.skeletons=S),b.length>0&&(o.animations=b),C.length>0&&(o.nodes=C)}return o.object=s,o;function p(h){let g=[];for(let m in h){let _=h[m];delete _.metadata,g.push(_)}return g}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let o=0;o<t.children.length;o++){let s=t.children[o];this.add(s.clone())}return this}};ra.DEFAULT_UP=new Pt(0,1,0);ra.DEFAULT_MATRIX_AUTO_UPDATE=!0;ra.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Qs=new Pt,su=new Pt,Iy=new Pt,au=new Pt,Mc=new Pt,bc=new Pt,CT=new Pt,Ry=new Pt,Ly=new Pt,Ny=new Pt,Nl=class n{constructor(t=new Pt,e=new Pt,o=new Pt){this.a=t,this.b=e,this.c=o}static getNormal(t,e,o,s){s.subVectors(o,e),Qs.subVectors(t,e),s.cross(Qs);let l=s.lengthSq();return l>0?s.multiplyScalar(1/Math.sqrt(l)):s.set(0,0,0)}static getBarycoord(t,e,o,s,l){Qs.subVectors(s,e),su.subVectors(o,e),Iy.subVectors(t,e);let p=Qs.dot(Qs),h=Qs.dot(su),g=Qs.dot(Iy),m=su.dot(su),_=su.dot(Iy),w=p*m-h*h;if(w===0)return l.set(0,0,0),null;let S=1/w,b=(m*g-h*_)*S,C=(p*_-h*g)*S;return l.set(1-b-C,C,b)}static containsPoint(t,e,o,s){return this.getBarycoord(t,e,o,s,au)===null?!1:au.x>=0&&au.y>=0&&au.x+au.y<=1}static getInterpolation(t,e,o,s,l,p,h,g){return this.getBarycoord(t,e,o,s,au)===null?(g.x=0,g.y=0,"z"in g&&(g.z=0),"w"in g&&(g.w=0),null):(g.setScalar(0),g.addScaledVector(l,au.x),g.addScaledVector(p,au.y),g.addScaledVector(h,au.z),g)}static isFrontFacing(t,e,o,s){return Qs.subVectors(o,e),su.subVectors(t,e),Qs.cross(su).dot(s)<0}set(t,e,o){return this.a.copy(t),this.b.copy(e),this.c.copy(o),this}setFromPointsAndIndices(t,e,o,s){return this.a.copy(t[e]),this.b.copy(t[o]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,o,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,o),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Qs.subVectors(this.c,this.b),su.subVectors(this.a,this.b),Qs.cross(su).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return n.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return n.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,o,s,l){return n.getInterpolation(t,this.a,this.b,this.c,e,o,s,l)}containsPoint(t){return n.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return n.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let o=this.a,s=this.b,l=this.c,p,h;Mc.subVectors(s,o),bc.subVectors(l,o),Ry.subVectors(t,o);let g=Mc.dot(Ry),m=bc.dot(Ry);if(g<=0&&m<=0)return e.copy(o);Ly.subVectors(t,s);let _=Mc.dot(Ly),w=bc.dot(Ly);if(_>=0&&w<=_)return e.copy(s);let S=g*w-_*m;if(S<=0&&g>=0&&_<=0)return p=g/(g-_),e.copy(o).addScaledVector(Mc,p);Ny.subVectors(t,l);let b=Mc.dot(Ny),C=bc.dot(Ny);if(C>=0&&b<=C)return e.copy(l);let R=b*m-g*C;if(R<=0&&m>=0&&C<=0)return h=m/(m-C),e.copy(o).addScaledVector(bc,h);let x=_*C-b*w;if(x<=0&&w-_>=0&&b-C>=0)return CT.subVectors(l,s),h=(w-_)/(w-_+(b-C)),e.copy(s).addScaledVector(CT,h);let E=1/(x+R+S);return p=R*E,h=S*E,e.copy(o).addScaledVector(Mc,p).addScaledVector(bc,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},vC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ku={h:0,s:0,l:0},sd={h:0,s:0,l:0};function Oy(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}var ar=class{constructor(t,e,o){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,o)}set(t,e,o){if(e===void 0&&o===void 0){let s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,o);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ba){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,xr.toWorkingColorSpace(this,e),this}setRGB(t,e,o,s=xr.workingColorSpace){return this.r=t,this.g=e,this.b=o,xr.toWorkingColorSpace(this,s),this}setHSL(t,e,o,s=xr.workingColorSpace){if(t=m6(t,1),e=Yo(e,0,1),o=Yo(o,0,1),e===0)this.r=this.g=this.b=o;else{let l=o<=.5?o*(1+e):o+e-o*e,p=2*o-l;this.r=Oy(p,l,t+1/3),this.g=Oy(p,l,t),this.b=Oy(p,l,t-1/3)}return xr.toWorkingColorSpace(this,s),this}setStyle(t,e=ba){function o(l){l!==void 0&&parseFloat(l)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let l,p=s[1],h=s[2];switch(p){case"rgb":case"rgba":if(l=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setRGB(Math.min(255,parseInt(l[1],10))/255,Math.min(255,parseInt(l[2],10))/255,Math.min(255,parseInt(l[3],10))/255,e);if(l=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setRGB(Math.min(100,parseInt(l[1],10))/100,Math.min(100,parseInt(l[2],10))/100,Math.min(100,parseInt(l[3],10))/100,e);break;case"hsl":case"hsla":if(l=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setHSL(parseFloat(l[1])/360,parseFloat(l[2])/100,parseFloat(l[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let l=s[1],p=l.length;if(p===3)return this.setRGB(parseInt(l.charAt(0),16)/15,parseInt(l.charAt(1),16)/15,parseInt(l.charAt(2),16)/15,e);if(p===6)return this.setHex(parseInt(l,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=ba){let o=vC[t.toLowerCase()];return o!==void 0?this.setHex(o,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Gc(t.r),this.g=Gc(t.g),this.b=Gc(t.b),this}copyLinearToSRGB(t){return this.r=xy(t.r),this.g=xy(t.g),this.b=xy(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ba){return xr.fromWorkingColorSpace(uo.copy(this),t),Math.round(Yo(uo.r*255,0,255))*65536+Math.round(Yo(uo.g*255,0,255))*256+Math.round(Yo(uo.b*255,0,255))}getHexString(t=ba){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=xr.workingColorSpace){xr.fromWorkingColorSpace(uo.copy(this),e);let o=uo.r,s=uo.g,l=uo.b,p=Math.max(o,s,l),h=Math.min(o,s,l),g,m,_=(h+p)/2;if(h===p)g=0,m=0;else{let w=p-h;switch(m=_<=.5?w/(p+h):w/(2-p-h),p){case o:g=(s-l)/w+(s<l?6:0);break;case s:g=(l-o)/w+2;break;case l:g=(o-s)/w+4;break}g/=6}return t.h=g,t.s=m,t.l=_,t}getRGB(t,e=xr.workingColorSpace){return xr.fromWorkingColorSpace(uo.copy(this),e),t.r=uo.r,t.g=uo.g,t.b=uo.b,t}getStyle(t=ba){xr.fromWorkingColorSpace(uo.copy(this),t);let e=uo.r,o=uo.g,s=uo.b;return t!==ba?`color(${t} ${e.toFixed(3)} ${o.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(o*255)},${Math.round(s*255)})`}offsetHSL(t,e,o){return this.getHSL(ku),this.setHSL(ku.h+t,ku.s+e,ku.l+o)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,o){return this.r=t.r+(e.r-t.r)*o,this.g=t.g+(e.g-t.g)*o,this.b=t.b+(e.b-t.b)*o,this}lerpHSL(t,e){this.getHSL(ku),t.getHSL(sd);let o=vy(ku.h,sd.h,e),s=vy(ku.s,sd.s,e),l=vy(ku.l,sd.l,e);return this.setHSL(o,s,l),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,o=this.g,s=this.b,l=t.elements;return this.r=l[0]*e+l[3]*o+l[6]*s,this.g=l[1]*e+l[4]*o+l[7]*s,this.b=l[2]*e+l[5]*o+l[8]*s,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},uo=new ar;ar.NAMES=vC;var P6=0,Bl=class extends Ju{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:P6++}),this.uuid=Zu(),this.name="",this.type="Material",this.blending=zc,this.side=Ku,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vy,this.blendDst=Wy,this.blendEquation=Il,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ar(0,0,0),this.blendAlpha=0,this.depthFunc=Sd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=gT,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yc,this.stencilZFail=yc,this.stencilZPass=yc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let o=t[e];if(o===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(o):s&&s.isVector3&&o&&o.isVector3?s.copy(o):this[e]=o}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let o={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.color&&this.color.isColor&&(o.color=this.color.getHex()),this.roughness!==void 0&&(o.roughness=this.roughness),this.metalness!==void 0&&(o.metalness=this.metalness),this.sheen!==void 0&&(o.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(o.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(o.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(o.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(o.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(o.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(o.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(o.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(o.shininess=this.shininess),this.clearcoat!==void 0&&(o.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(o.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(o.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(o.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(o.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,o.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(o.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(o.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(o.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(o.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(o.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(o.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(o.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(o.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(o.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(o.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(o.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(o.lightMap=this.lightMap.toJSON(t).uuid,o.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(o.aoMap=this.aoMap.toJSON(t).uuid,o.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(o.bumpMap=this.bumpMap.toJSON(t).uuid,o.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(o.normalMap=this.normalMap.toJSON(t).uuid,o.normalMapType=this.normalMapType,o.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(o.displacementMap=this.displacementMap.toJSON(t).uuid,o.displacementScale=this.displacementScale,o.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(o.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(o.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(o.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(o.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(o.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(o.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(o.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(o.combine=this.combine)),this.envMapRotation!==void 0&&(o.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(o.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(o.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(o.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(o.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(o.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(o.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(o.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(o.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(o.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(o.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(o.size=this.size),this.shadowSide!==null&&(o.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(o.sizeAttenuation=this.sizeAttenuation),this.blending!==zc&&(o.blending=this.blending),this.side!==Ku&&(o.side=this.side),this.vertexColors===!0&&(o.vertexColors=!0),this.opacity<1&&(o.opacity=this.opacity),this.transparent===!0&&(o.transparent=!0),this.blendSrc!==Vy&&(o.blendSrc=this.blendSrc),this.blendDst!==Wy&&(o.blendDst=this.blendDst),this.blendEquation!==Il&&(o.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(o.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(o.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(o.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(o.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(o.blendAlpha=this.blendAlpha),this.depthFunc!==Sd&&(o.depthFunc=this.depthFunc),this.depthTest===!1&&(o.depthTest=this.depthTest),this.depthWrite===!1&&(o.depthWrite=this.depthWrite),this.colorWrite===!1&&(o.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(o.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==gT&&(o.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(o.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(o.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yc&&(o.stencilFail=this.stencilFail),this.stencilZFail!==yc&&(o.stencilZFail=this.stencilZFail),this.stencilZPass!==yc&&(o.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(o.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(o.rotation=this.rotation),this.polygonOffset===!0&&(o.polygonOffset=!0),this.polygonOffsetFactor!==0&&(o.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(o.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(o.linewidth=this.linewidth),this.dashSize!==void 0&&(o.dashSize=this.dashSize),this.gapSize!==void 0&&(o.gapSize=this.gapSize),this.scale!==void 0&&(o.scale=this.scale),this.dithering===!0&&(o.dithering=!0),this.alphaTest>0&&(o.alphaTest=this.alphaTest),this.alphaHash===!0&&(o.alphaHash=!0),this.alphaToCoverage===!0&&(o.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(o.premultipliedAlpha=!0),this.forceSinglePass===!0&&(o.forceSinglePass=!0),this.wireframe===!0&&(o.wireframe=!0),this.wireframeLinewidth>1&&(o.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(o.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(o.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(o.flatShading=!0),this.visible===!1&&(o.visible=!1),this.toneMapped===!1&&(o.toneMapped=!1),this.fog===!1&&(o.fog=!1),Object.keys(this.userData).length>0&&(o.userData=this.userData);function s(l){let p=[];for(let h in l){let g=l[h];delete g.metadata,p.push(g)}return p}if(e){let l=s(t.textures),p=s(t.images);l.length>0&&(o.textures=l),p.length>0&&(o.images=p)}return o}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,o=null;if(e!==null){let s=e.length;o=new Array(s);for(let l=0;l!==s;++l)o[l]=e[l].clone()}return this.clippingPlanes=o,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Dd=class extends Bl{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ar(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ul,this.combine=sC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var hi=new Pt,ad=new ze,gs=class{constructor(t,e,o=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=o,this.usage=Ky,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=fu,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,o){t*=this.itemSize,o*=e.itemSize;for(let s=0,l=this.itemSize;s<l;s++)this.array[t+s]=e.array[o+s];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,o=this.count;e<o;e++)ad.fromBufferAttribute(this,e),ad.applyMatrix3(t),this.setXY(e,ad.x,ad.y);else if(this.itemSize===3)for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyMatrix3(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}applyMatrix4(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyMatrix4(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyNormalMatrix(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.transformDirection(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let o=this.array[t*this.itemSize+e];return this.normalized&&(o=Ta(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.array[t*this.itemSize+e]=o,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ta(e,this.array)),e}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ta(e,this.array)),e}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ta(e,this.array)),e}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ta(e,this.array)),e}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,o){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.array[t+0]=e,this.array[t+1]=o,this}setXYZ(t,e,o,s){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.array[t+0]=e,this.array[t+1]=o,this.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.array[t+0]=e,this.array[t+1]=o,this.array[t+2]=s,this.array[t+3]=l,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Ky&&(t.usage=this.usage),t}};var Fd=class extends gs{constructor(t,e,o){super(new Uint16Array(t),e,o)}};var Ud=class extends gs{constructor(t,e,o){super(new Uint32Array(t),e,o)}};var pu=class extends gs{constructor(t,e,o){super(new Float32Array(t),e,o)}},I6=0,Ds=new vi,Dy=new ra,Ac=new Pt,ps=new Fl,eh=new Fl,Bi=new Pt,Qu=class n extends Ju{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:I6++}),this.uuid=Zu(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(mC(t)?Ud:Fd)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,o=0){this.groups.push({start:t,count:e,materialIndex:o})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let o=this.attributes.normal;if(o!==void 0){let l=new je().getNormalMatrix(t);o.applyNormalMatrix(l),o.needsUpdate=!0}let s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(t),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ds.makeRotationFromQuaternion(t),this.applyMatrix4(Ds),this}rotateX(t){return Ds.makeRotationX(t),this.applyMatrix4(Ds),this}rotateY(t){return Ds.makeRotationY(t),this.applyMatrix4(Ds),this}rotateZ(t){return Ds.makeRotationZ(t),this.applyMatrix4(Ds),this}translate(t,e,o){return Ds.makeTranslation(t,e,o),this.applyMatrix4(Ds),this}scale(t,e,o){return Ds.makeScale(t,e,o),this.applyMatrix4(Ds),this}lookAt(t){return Dy.lookAt(t),Dy.updateMatrix(),this.applyMatrix4(Dy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ac).negate(),this.translate(Ac.x,Ac.y,Ac.z),this}setFromPoints(t){let e=[];for(let o=0,s=t.length;o<s;o++){let l=t[o];e.push(l.x,l.y,l.z||0)}return this.setAttribute("position",new pu(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fl);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Pt(-1/0,-1/0,-1/0),new Pt(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){let l=e[o];ps.setFromBufferAttribute(l),this.morphTargetsRelative?(Bi.addVectors(this.boundingBox.min,ps.min),this.boundingBox.expandByPoint(Bi),Bi.addVectors(this.boundingBox.max,ps.max),this.boundingBox.expandByPoint(Bi)):(this.boundingBox.expandByPoint(ps.min),this.boundingBox.expandByPoint(ps.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ah);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Pt,1/0);return}if(t){let o=this.boundingSphere.center;if(ps.setFromBufferAttribute(t),e)for(let l=0,p=e.length;l<p;l++){let h=e[l];eh.setFromBufferAttribute(h),this.morphTargetsRelative?(Bi.addVectors(ps.min,eh.min),ps.expandByPoint(Bi),Bi.addVectors(ps.max,eh.max),ps.expandByPoint(Bi)):(ps.expandByPoint(eh.min),ps.expandByPoint(eh.max))}ps.getCenter(o);let s=0;for(let l=0,p=t.count;l<p;l++)Bi.fromBufferAttribute(t,l),s=Math.max(s,o.distanceToSquared(Bi));if(e)for(let l=0,p=e.length;l<p;l++){let h=e[l],g=this.morphTargetsRelative;for(let m=0,_=h.count;m<_;m++)Bi.fromBufferAttribute(h,m),g&&(Ac.fromBufferAttribute(t,m),Bi.add(Ac)),s=Math.max(s,o.distanceToSquared(Bi))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let o=e.position,s=e.normal,l=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new gs(new Float32Array(4*o.count),4));let p=this.getAttribute("tangent"),h=[],g=[];for(let D=0;D<o.count;D++)h[D]=new Pt,g[D]=new Pt;let m=new Pt,_=new Pt,w=new Pt,S=new ze,b=new ze,C=new ze,R=new Pt,x=new Pt;function E(D,xt,B){m.fromBufferAttribute(o,D),_.fromBufferAttribute(o,xt),w.fromBufferAttribute(o,B),S.fromBufferAttribute(l,D),b.fromBufferAttribute(l,xt),C.fromBufferAttribute(l,B),_.sub(m),w.sub(m),b.sub(S),C.sub(S);let j=1/(b.x*C.y-C.x*b.y);isFinite(j)&&(R.copy(_).multiplyScalar(C.y).addScaledVector(w,-b.y).multiplyScalar(j),x.copy(w).multiplyScalar(b.x).addScaledVector(_,-C.x).multiplyScalar(j),h[D].add(R),h[xt].add(R),h[B].add(R),g[D].add(x),g[xt].add(x),g[B].add(x))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let D=0,xt=I.length;D<xt;++D){let B=I[D],j=B.start,K=B.count;for(let Dt=j,Q=j+K;Dt<Q;Dt+=3)E(t.getX(Dt+0),t.getX(Dt+1),t.getX(Dt+2))}let A=new Pt,F=new Pt,V=new Pt,X=new Pt;function q(D){V.fromBufferAttribute(s,D),X.copy(V);let xt=h[D];A.copy(xt),A.sub(V.multiplyScalar(V.dot(xt))).normalize(),F.crossVectors(X,xt);let j=F.dot(g[D])<0?-1:1;p.setXYZW(D,A.x,A.y,A.z,j)}for(let D=0,xt=I.length;D<xt;++D){let B=I[D],j=B.start,K=B.count;for(let Dt=j,Q=j+K;Dt<Q;Dt+=3)q(t.getX(Dt+0)),q(t.getX(Dt+1)),q(t.getX(Dt+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let o=this.getAttribute("normal");if(o===void 0)o=new gs(new Float32Array(e.count*3),3),this.setAttribute("normal",o);else for(let S=0,b=o.count;S<b;S++)o.setXYZ(S,0,0,0);let s=new Pt,l=new Pt,p=new Pt,h=new Pt,g=new Pt,m=new Pt,_=new Pt,w=new Pt;if(t)for(let S=0,b=t.count;S<b;S+=3){let C=t.getX(S+0),R=t.getX(S+1),x=t.getX(S+2);s.fromBufferAttribute(e,C),l.fromBufferAttribute(e,R),p.fromBufferAttribute(e,x),_.subVectors(p,l),w.subVectors(s,l),_.cross(w),h.fromBufferAttribute(o,C),g.fromBufferAttribute(o,R),m.fromBufferAttribute(o,x),h.add(_),g.add(_),m.add(_),o.setXYZ(C,h.x,h.y,h.z),o.setXYZ(R,g.x,g.y,g.z),o.setXYZ(x,m.x,m.y,m.z)}else for(let S=0,b=e.count;S<b;S+=3)s.fromBufferAttribute(e,S+0),l.fromBufferAttribute(e,S+1),p.fromBufferAttribute(e,S+2),_.subVectors(p,l),w.subVectors(s,l),_.cross(w),o.setXYZ(S+0,_.x,_.y,_.z),o.setXYZ(S+1,_.x,_.y,_.z),o.setXYZ(S+2,_.x,_.y,_.z);this.normalizeNormals(),o.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,o=t.count;e<o;e++)Bi.fromBufferAttribute(t,e),Bi.normalize(),t.setXYZ(e,Bi.x,Bi.y,Bi.z)}toNonIndexed(){function t(h,g){let m=h.array,_=h.itemSize,w=h.normalized,S=new m.constructor(g.length*_),b=0,C=0;for(let R=0,x=g.length;R<x;R++){h.isInterleavedBufferAttribute?b=g[R]*h.data.stride+h.offset:b=g[R]*_;for(let E=0;E<_;E++)S[C++]=m[b++]}return new gs(S,_,w)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new n,o=this.index.array,s=this.attributes;for(let h in s){let g=s[h],m=t(g,o);e.setAttribute(h,m)}let l=this.morphAttributes;for(let h in l){let g=[],m=l[h];for(let _=0,w=m.length;_<w;_++){let S=m[_],b=t(S,o);g.push(b)}e.morphAttributes[h]=g}e.morphTargetsRelative=this.morphTargetsRelative;let p=this.groups;for(let h=0,g=p.length;h<g;h++){let m=p[h];e.addGroup(m.start,m.count,m.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let g=this.parameters;for(let m in g)g[m]!==void 0&&(t[m]=g[m]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let o=this.attributes;for(let g in o){let m=o[g];t.data.attributes[g]=m.toJSON(t.data)}let s={},l=!1;for(let g in this.morphAttributes){let m=this.morphAttributes[g],_=[];for(let w=0,S=m.length;w<S;w++){let b=m[w];_.push(b.toJSON(t.data))}_.length>0&&(s[g]=_,l=!0)}l&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let p=this.groups;p.length>0&&(t.data.groups=JSON.parse(JSON.stringify(p)));let h=this.boundingSphere;return h!==null&&(t.data.boundingSphere={center:h.center.toArray(),radius:h.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let o=t.index;o!==null&&this.setIndex(o.clone(e));let s=t.attributes;for(let m in s){let _=s[m];this.setAttribute(m,_.clone(e))}let l=t.morphAttributes;for(let m in l){let _=[],w=l[m];for(let S=0,b=w.length;S<b;S++)_.push(w[S].clone(e));this.morphAttributes[m]=_}this.morphTargetsRelative=t.morphTargetsRelative;let p=t.groups;for(let m=0,_=p.length;m<_;m++){let w=p[m];this.addGroup(w.start,w.count,w.materialIndex)}let h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());let g=t.boundingSphere;return g!==null&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},PT=new vi,bl=new nv,ud=new ah,IT=new Pt,Tc=new Pt,Cc=new Pt,Pc=new Pt,Fy=new Pt,ld=new Pt,cd=new ze,fd=new ze,hd=new ze,RT=new Pt,LT=new Pt,NT=new Pt,pd=new Pt,dd=new Pt,na=class extends ra{constructor(t=new Qu,e=new Dd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,o=Object.keys(e);if(o.length>0){let s=e[o[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,p=s.length;l<p;l++){let h=s[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=l}}}}getVertexPosition(t,e){let o=this.geometry,s=o.attributes.position,l=o.morphAttributes.position,p=o.morphTargetsRelative;e.fromBufferAttribute(s,t);let h=this.morphTargetInfluences;if(l&&h){ld.set(0,0,0);for(let g=0,m=l.length;g<m;g++){let _=h[g],w=l[g];_!==0&&(Fy.fromBufferAttribute(w,t),p?ld.addScaledVector(Fy,_):ld.addScaledVector(Fy.sub(e),_))}e.add(ld)}return e}raycast(t,e){let o=this.geometry,s=this.material,l=this.matrixWorld;s!==void 0&&(o.boundingSphere===null&&o.computeBoundingSphere(),ud.copy(o.boundingSphere),ud.applyMatrix4(l),bl.copy(t.ray).recast(t.near),!(ud.containsPoint(bl.origin)===!1&&(bl.intersectSphere(ud,IT)===null||bl.origin.distanceToSquared(IT)>(t.far-t.near)**2))&&(PT.copy(l).invert(),bl.copy(t.ray).applyMatrix4(PT),!(o.boundingBox!==null&&bl.intersectsBox(o.boundingBox)===!1)&&this._computeIntersections(t,e,bl)))}_computeIntersections(t,e,o){let s,l=this.geometry,p=this.material,h=l.index,g=l.attributes.position,m=l.attributes.uv,_=l.attributes.uv1,w=l.attributes.normal,S=l.groups,b=l.drawRange;if(h!==null)if(Array.isArray(p))for(let C=0,R=S.length;C<R;C++){let x=S[C],E=p[x.materialIndex],I=Math.max(x.start,b.start),A=Math.min(h.count,Math.min(x.start+x.count,b.start+b.count));for(let F=I,V=A;F<V;F+=3){let X=h.getX(F),q=h.getX(F+1),D=h.getX(F+2);s=gd(this,E,t,o,m,_,w,X,q,D),s&&(s.faceIndex=Math.floor(F/3),s.face.materialIndex=x.materialIndex,e.push(s))}}else{let C=Math.max(0,b.start),R=Math.min(h.count,b.start+b.count);for(let x=C,E=R;x<E;x+=3){let I=h.getX(x),A=h.getX(x+1),F=h.getX(x+2);s=gd(this,p,t,o,m,_,w,I,A,F),s&&(s.faceIndex=Math.floor(x/3),e.push(s))}}else if(g!==void 0)if(Array.isArray(p))for(let C=0,R=S.length;C<R;C++){let x=S[C],E=p[x.materialIndex],I=Math.max(x.start,b.start),A=Math.min(g.count,Math.min(x.start+x.count,b.start+b.count));for(let F=I,V=A;F<V;F+=3){let X=F,q=F+1,D=F+2;s=gd(this,E,t,o,m,_,w,X,q,D),s&&(s.faceIndex=Math.floor(F/3),s.face.materialIndex=x.materialIndex,e.push(s))}}else{let C=Math.max(0,b.start),R=Math.min(g.count,b.start+b.count);for(let x=C,E=R;x<E;x+=3){let I=x,A=x+1,F=x+2;s=gd(this,p,t,o,m,_,w,I,A,F),s&&(s.faceIndex=Math.floor(x/3),e.push(s))}}}};function R6(n,t,e,o,s,l,p,h){let g;if(t.side===$o?g=o.intersectTriangle(p,l,s,!0,h):g=o.intersectTriangle(s,l,p,t.side===Ku,h),g===null)return null;dd.copy(h),dd.applyMatrix4(n.matrixWorld);let m=e.ray.origin.distanceTo(dd);return m<e.near||m>e.far?null:{distance:m,point:dd.clone(),object:n}}function gd(n,t,e,o,s,l,p,h,g,m){n.getVertexPosition(h,Tc),n.getVertexPosition(g,Cc),n.getVertexPosition(m,Pc);let _=R6(n,t,e,o,Tc,Cc,Pc,pd);if(_){s&&(cd.fromBufferAttribute(s,h),fd.fromBufferAttribute(s,g),hd.fromBufferAttribute(s,m),_.uv=Nl.getInterpolation(pd,Tc,Cc,Pc,cd,fd,hd,new ze)),l&&(cd.fromBufferAttribute(l,h),fd.fromBufferAttribute(l,g),hd.fromBufferAttribute(l,m),_.uv1=Nl.getInterpolation(pd,Tc,Cc,Pc,cd,fd,hd,new ze)),p&&(RT.fromBufferAttribute(p,h),LT.fromBufferAttribute(p,g),NT.fromBufferAttribute(p,m),_.normal=Nl.getInterpolation(pd,Tc,Cc,Pc,RT,LT,NT,new Pt),_.normal.dot(o.direction)>0&&_.normal.multiplyScalar(-1));let w={a:h,b:g,c:m,normal:new Pt,materialIndex:0};Nl.getNormal(Tc,Cc,Pc,w.normal),_.face=w}return _}var uh=class n extends Qu{constructor(t=1,e=1,o=1,s=1,l=1,p=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:o,widthSegments:s,heightSegments:l,depthSegments:p};let h=this;s=Math.floor(s),l=Math.floor(l),p=Math.floor(p);let g=[],m=[],_=[],w=[],S=0,b=0;C("z","y","x",-1,-1,o,e,t,p,l,0),C("z","y","x",1,-1,o,e,-t,p,l,1),C("x","z","y",1,1,t,o,e,s,p,2),C("x","z","y",1,-1,t,o,-e,s,p,3),C("x","y","z",1,-1,t,e,o,s,l,4),C("x","y","z",-1,-1,t,e,-o,s,l,5),this.setIndex(g),this.setAttribute("position",new pu(m,3)),this.setAttribute("normal",new pu(_,3)),this.setAttribute("uv",new pu(w,2));function C(R,x,E,I,A,F,V,X,q,D,xt){let B=F/q,j=V/D,K=F/2,Dt=V/2,Q=X/2,At=q+1,Mt=D+1,Lt=0,pt=0,yt=new Pt;for(let J=0;J<Mt;J++){let Bt=J*j-Dt;for(let Gt=0;Gt<At;Gt++){let ae=Gt*B-K;yt[R]=ae*I,yt[x]=Bt*A,yt[E]=Q,m.push(yt.x,yt.y,yt.z),yt[R]=0,yt[x]=0,yt[E]=X>0?1:-1,_.push(yt.x,yt.y,yt.z),w.push(Gt/q),w.push(1-J/D),Lt+=1}}for(let J=0;J<D;J++)for(let Bt=0;Bt<q;Bt++){let Gt=S+Bt+At*J,ae=S+Bt+At*(J+1),ut=S+(Bt+1)+At*(J+1),Ut=S+(Bt+1)+At*J;g.push(Gt,ae,Ut),g.push(ae,ut,Ut),pt+=6}h.addGroup(b,pt,xt),b+=pt,S+=Lt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new n(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Wc(n){let t={};for(let e in n){t[e]={};for(let o in n[e]){let s=n[e][o];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][o]=null):t[e][o]=s.clone():Array.isArray(s)?t[e][o]=s.slice():t[e][o]=s}}return t}function So(n){let t={};for(let e=0;e<n.length;e++){let o=Wc(n[e]);for(let s in o)t[s]=o[s]}return t}function L6(n){let t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function _C(n){return n.getRenderTarget()===null?n.outputColorSpace:xr.workingColorSpace}var N6={clone:Wc,merge:So},O6=`void main() {
|
|
26
|
+
}`;var en=vE(function(){return qe(Y,Se+"return "+Yt).apply(n,nt)});if(en.source=Yt,Fm(en))throw en;return en}function zF(u){return hr(u).toLowerCase()}function GF(u){return hr(u).toUpperCase()}function kF(u,f,y){if(u=hr(u),u&&(y||f===n))return qh(u);if(!u||!(f=us(f)))return u;var T=Fo(u),O=Fo(f),Y=Bs(T,O),nt=Ri(T,O)+1;return Iu(T,Y,nt).join("")}function qF(u,f,y){if(u=hr(u),u&&(y||f===n))return u.slice(0,pa(u)+1);if(!u||!(f=us(f)))return u;var T=Fo(u),O=Ri(T,Fo(f))+1;return Iu(T,0,O).join("")}function HF(u,f,y){if(u=hr(u),u&&(y||f===n))return u.replace(Ye,"");if(!u||!(f=us(f)))return u;var T=Fo(u),O=Bs(T,Fo(f));return Iu(T,O).join("")}function VF(u,f){var y=D,T=xt;if(Gr(f)){var O="separator"in f?f.separator:O;y="length"in f?Ke(f.length):y,T="omission"in f?us(f.omission):T}u=hr(u);var Y=u.length;if(qa(u)){var nt=Fo(u);Y=nt.length}if(y>=Y)return u;var ct=y-Ha(T);if(ct<1)return T;var _t=nt?Iu(nt,0,ct).join(""):u.slice(0,ct);if(O===n)return _t+T;if(nt&&(ct+=_t.length-ct),Um(O)){if(u.slice(ct).search(O)){var zt,kt=_t;for(O.global||(O=os(O.source,hr(Qn.exec(O))+"g")),O.lastIndex=0;zt=O.exec(kt);)var Yt=zt.index;_t=_t.slice(0,Yt===n?ct:Yt)}}else if(u.indexOf(us(O),ct)!=ct){var pe=_t.lastIndexOf(O);pe>-1&&(_t=_t.slice(0,pe))}return _t+T}function WF(u){return u=hr(u),u&&G.test(u)?u.replace(wt,rs):u}var XF=rc(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),Gm=_x("toUpperCase");function yE(u,f,y){return u=hr(u),f=y?n:f,f===n?jl(u)?ui(u):Ve(u):u.match(f)||[]}var vE=an(function(u,f){try{return ie(u,n,f)}catch(y){return Fm(y)?y:new _e(y)}}),YF=Ka(function(u,f){return Pi(f,function(y){y=wa(y),$a(u,y,Om(u[y],u))}),u});function $F(u){var f=u==null?0:u.length,y=Ne();return u=f?Mr(u,function(T){if(typeof T[1]!="function")throw new tr(s);return[y(T[0]),T[1]]}):[],an(function(T){for(var O=-1;++O<f;){var Y=u[O];if(ie(Y[0],this,T))return ie(Y[1],this,T)}})}function ZF(u){return x2(Cs(u,m))}function km(u){return function(){return u}}function KF(u,f){return u==null||u!==u?f:u}var JF=Ex(),jF=Ex(!0);function Wo(u){return u}function qm(u){return J1(typeof u=="function"?u:Cs(u,m))}function QF(u){return Q1(Cs(u,m))}function tU(u,f){return tx(u,Cs(f,m))}var eU=an(function(u,f){return function(y){return Rf(y,u,f)}}),nU=an(function(u,f){return function(y){return Rf(u,y,f)}});function Hm(u,f,y){var T=Fi(f),O=$h(f,T);y==null&&!(Gr(f)&&(O.length||!T.length))&&(y=f,f=u,u=this,O=$h(f,Fi(f)));var Y=!(Gr(y)&&"chain"in y)||!!y.chain,nt=ja(u);return Pi(O,function(ct){var _t=f[ct];u[ct]=_t,nt&&(u.prototype[ct]=function(){var zt=this.__chain__;if(Y||zt){var kt=u(this.__wrapped__),Yt=kt.__actions__=qo(this.__actions__);return Yt.push({func:_t,args:arguments,thisArg:u}),kt.__chain__=zt,kt}return _t.apply(u,ke([this.value()],arguments))})}),u}function rU(){return Ur._===this&&(Ur._=Bo),this}function Vm(){}function iU(u){return u=Ke(u),an(function(f){return ex(f,u)})}var oU=Em(Mr),sU=Em(po),aU=Em(ka);function _E(u){return Cm(u)?Es(wa(u)):U2(u)}function uU(u){return function(f){return u==null?n:yl(u,f)}}var lU=Sx(),cU=Sx(!0);function Wm(){return[]}function Xm(){return!1}function fU(){return{}}function hU(){return""}function pU(){return!0}function dU(u,f){if(u=Ke(u),u<1||u>Mt)return[];var y=yt,T=vr(u,yt);f=Ne(f),u-=yt;for(var O=di(T,f);++y<u;)f(y);return O}function gU(u){return We(u)?Mr(u,wa):ls(u)?[u]:qo(zx(hr(u)))}function mU(u){var f=++Li;return hr(u)+f}var yU=tp(function(u,f){return u+f},0),vU=wm("ceil"),_U=tp(function(u,f){return u/f},1),xU=wm("floor");function EU(u){return u&&u.length?Yh(u,Wo,am):n}function wU(u,f){return u&&u.length?Yh(u,Ne(f,2),am):n}function SU(u){return Mf(u,Wo)}function MU(u,f){return Mf(u,Ne(f,2))}function bU(u){return u&&u.length?Yh(u,Wo,fm):n}function AU(u,f){return u&&u.length?Yh(u,Ne(f,2),fm):n}var TU=tp(function(u,f){return u*f},1),CU=wm("round"),PU=tp(function(u,f){return u-f},0);function IU(u){return u&&u.length?go(u,Wo):0}function RU(u,f){return u&&u.length?go(u,Ne(f,2)):0}return U.after=QD,U.ary=Kx,U.assign=G3,U.assignIn=cE,U.assignInWith=pp,U.assignWith=k3,U.at=q3,U.before=Jx,U.bind=Om,U.bindAll=YF,U.bindKey=jx,U.castArray=f3,U.chain=Yx,U.chunk=xO,U.compact=EO,U.concat=wO,U.cond=$F,U.conforms=ZF,U.constant=km,U.countBy=ID,U.create=H3,U.curry=Qx,U.curryRight=tE,U.debounce=eE,U.defaults=V3,U.defaultsDeep=W3,U.defer=t3,U.delay=e3,U.difference=SO,U.differenceBy=MO,U.differenceWith=bO,U.drop=AO,U.dropRight=TO,U.dropRightWhile=CO,U.dropWhile=PO,U.fill=IO,U.filter=LD,U.flatMap=DD,U.flatMapDeep=FD,U.flatMapDepth=UD,U.flatten=Hx,U.flattenDeep=RO,U.flattenDepth=LO,U.flip=n3,U.flow=JF,U.flowRight=jF,U.fromPairs=NO,U.functions=j3,U.functionsIn=Q3,U.groupBy=BD,U.initial=DO,U.intersection=FO,U.intersectionBy=UO,U.intersectionWith=BO,U.invert=eF,U.invertBy=nF,U.invokeMap=GD,U.iteratee=qm,U.keyBy=kD,U.keys=Fi,U.keysIn=Vo,U.map=ap,U.mapKeys=iF,U.mapValues=oF,U.matches=QF,U.matchesProperty=tU,U.memoize=lp,U.merge=sF,U.mergeWith=fE,U.method=eU,U.methodOf=nU,U.mixin=Hm,U.negate=cp,U.nthArg=iU,U.omit=aF,U.omitBy=uF,U.once=r3,U.orderBy=qD,U.over=oU,U.overArgs=i3,U.overEvery=sU,U.overSome=aU,U.partial=Dm,U.partialRight=nE,U.partition=HD,U.pick=lF,U.pickBy=hE,U.property=_E,U.propertyOf=uU,U.pull=qO,U.pullAll=Wx,U.pullAllBy=HO,U.pullAllWith=VO,U.pullAt=WO,U.range=lU,U.rangeRight=cU,U.rearg=o3,U.reject=XD,U.remove=XO,U.rest=s3,U.reverse=Lm,U.sampleSize=$D,U.set=fF,U.setWith=hF,U.shuffle=ZD,U.slice=YO,U.sortBy=jD,U.sortedUniq=tD,U.sortedUniqBy=eD,U.split=DF,U.spread=a3,U.tail=nD,U.take=rD,U.takeRight=iD,U.takeRightWhile=oD,U.takeWhile=sD,U.tap=ED,U.throttle=u3,U.thru=sp,U.toArray=aE,U.toPairs=pE,U.toPairsIn=dE,U.toPath=gU,U.toPlainObject=lE,U.transform=pF,U.unary=l3,U.union=aD,U.unionBy=uD,U.unionWith=lD,U.uniq=cD,U.uniqBy=fD,U.uniqWith=hD,U.unset=dF,U.unzip=Nm,U.unzipWith=Xx,U.update=gF,U.updateWith=mF,U.values=sc,U.valuesIn=yF,U.without=pD,U.words=yE,U.wrap=c3,U.xor=dD,U.xorBy=gD,U.xorWith=mD,U.zip=yD,U.zipObject=vD,U.zipObjectDeep=_D,U.zipWith=xD,U.entries=pE,U.entriesIn=dE,U.extend=cE,U.extendWith=pp,Hm(U,U),U.add=yU,U.attempt=vE,U.camelCase=EF,U.capitalize=gE,U.ceil=vU,U.clamp=vF,U.clone=h3,U.cloneDeep=d3,U.cloneDeepWith=g3,U.cloneWith=p3,U.conformsTo=m3,U.deburr=mE,U.defaultTo=KF,U.divide=_U,U.endsWith=wF,U.eq=Vs,U.escape=SF,U.escapeRegExp=MF,U.every=RD,U.find=ND,U.findIndex=kx,U.findKey=X3,U.findLast=OD,U.findLastIndex=qx,U.findLastKey=Y3,U.floor=xU,U.forEach=$x,U.forEachRight=Zx,U.forIn=$3,U.forInRight=Z3,U.forOwn=K3,U.forOwnRight=J3,U.get=Bm,U.gt=y3,U.gte=v3,U.has=tF,U.hasIn=zm,U.head=Vx,U.identity=Wo,U.includes=zD,U.indexOf=OO,U.inRange=_F,U.invoke=rF,U.isArguments=xl,U.isArray=We,U.isArrayBuffer=_3,U.isArrayLike=Ho,U.isArrayLikeObject=ri,U.isBoolean=x3,U.isBuffer=Ru,U.isDate=E3,U.isElement=w3,U.isEmpty=S3,U.isEqual=M3,U.isEqualWith=b3,U.isError=Fm,U.isFinite=A3,U.isFunction=ja,U.isInteger=rE,U.isLength=fp,U.isMap=iE,U.isMatch=T3,U.isMatchWith=C3,U.isNaN=P3,U.isNative=I3,U.isNil=L3,U.isNull=R3,U.isNumber=oE,U.isObject=Gr,U.isObjectLike=$r,U.isPlainObject=Uf,U.isRegExp=Um,U.isSafeInteger=N3,U.isSet=sE,U.isString=hp,U.isSymbol=ls,U.isTypedArray=oc,U.isUndefined=O3,U.isWeakMap=D3,U.isWeakSet=F3,U.join=zO,U.kebabCase=bF,U.last=Is,U.lastIndexOf=GO,U.lowerCase=AF,U.lowerFirst=TF,U.lt=U3,U.lte=B3,U.max=EU,U.maxBy=wU,U.mean=SU,U.meanBy=MU,U.min=bU,U.minBy=AU,U.stubArray=Wm,U.stubFalse=Xm,U.stubObject=fU,U.stubString=hU,U.stubTrue=pU,U.multiply=TU,U.nth=kO,U.noConflict=rU,U.noop=Vm,U.now=up,U.pad=CF,U.padEnd=PF,U.padStart=IF,U.parseInt=RF,U.random=xF,U.reduce=VD,U.reduceRight=WD,U.repeat=LF,U.replace=NF,U.result=cF,U.round=CU,U.runInContext=gt,U.sample=YD,U.size=KD,U.snakeCase=OF,U.some=JD,U.sortedIndex=$O,U.sortedIndexBy=ZO,U.sortedIndexOf=KO,U.sortedLastIndex=JO,U.sortedLastIndexBy=jO,U.sortedLastIndexOf=QO,U.startCase=FF,U.startsWith=UF,U.subtract=PU,U.sum=IU,U.sumBy=RU,U.template=BF,U.times=dU,U.toFinite=Qa,U.toInteger=Ke,U.toLength=uE,U.toLower=zF,U.toNumber=Rs,U.toSafeInteger=z3,U.toString=hr,U.toUpper=GF,U.trim=kF,U.trimEnd=qF,U.trimStart=HF,U.truncate=VF,U.unescape=WF,U.uniqueId=mU,U.upperCase=XF,U.upperFirst=Gm,U.each=$x,U.eachRight=Zx,U.first=Vx,Hm(U,function(){var u={};return xa(U,function(f,y){sn.call(U.prototype,y)||(u[y]=f)}),u}(),{chain:!1}),U.VERSION=t,Pi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){U[u].placeholder=U}),Pi(["drop","take"],function(u,f){i.prototype[u]=function(y){y=y===n?1:ni(Ke(y),0);var T=this.__filtered__&&!f?new i(this):this.clone();return T.__filtered__?T.__takeCount__=vr(y,T.__takeCount__):T.__views__.push({size:vr(y,yt),type:u+(T.__dir__<0?"Right":"")}),T},i.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),Pi(["filter","map","takeWhile"],function(u,f){var y=f+1,T=y==K||y==Q;i.prototype[u]=function(O){var Y=this.clone();return Y.__iteratees__.push({iteratee:Ne(O,3),type:y}),Y.__filtered__=Y.__filtered__||T,Y}}),Pi(["head","last"],function(u,f){var y="take"+(f?"Right":"");i.prototype[u]=function(){return this[y](1).value()[0]}}),Pi(["initial","tail"],function(u,f){var y="drop"+(f?"":"Right");i.prototype[u]=function(){return this.__filtered__?new i(this):this[y](1)}}),i.prototype.compact=function(){return this.filter(Wo)},i.prototype.find=function(u){return this.filter(u).head()},i.prototype.findLast=function(u){return this.reverse().find(u)},i.prototype.invokeMap=an(function(u,f){return typeof u=="function"?new i(this):this.map(function(y){return Rf(y,u,f)})}),i.prototype.reject=function(u){return this.filter(cp(Ne(u)))},i.prototype.slice=function(u,f){u=Ke(u);var y=this;return y.__filtered__&&(u>0||f<0)?new i(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=Ke(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},i.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},i.prototype.toArray=function(){return this.take(yt)},xa(i.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),T=/^(?:head|last)$/.test(f),O=U[T?"take"+(f=="last"?"Right":""):f],Y=T||/^find/.test(f);O&&(U.prototype[f]=function(){var nt=this.__wrapped__,ct=T?[1]:arguments,_t=nt instanceof i,zt=ct[0],kt=_t||We(nt),Yt=function(Fn){var $n=O.apply(U,ke([Fn],ct));return T&&pe?$n[0]:$n};kt&&y&&typeof zt=="function"&&zt.length!=1&&(_t=kt=!1);var pe=this.__chain__,Se=!!this.__actions__.length,De=Y&&!pe,en=_t&&!Se;if(!Y&&kt){nt=en?nt:new i(this);var Fe=u.apply(nt,ct);return Fe.__actions__.push({func:sp,args:[Yt],thisArg:n}),new r(Fe,pe)}return De&&en?u.apply(this,ct):(Fe=this.thru(Yt),De?T?Fe.value()[0]:Fe.value():Fe)})}),Pi(["pop","push","shift","sort","splice","unshift"],function(u){var f=Nr[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",T=/^(?:pop|shift)$/.test(u);U.prototype[u]=function(){var O=arguments;if(T&&!this.__chain__){var Y=this.value();return f.apply(We(Y)?Y:[],O)}return this[y](function(nt){return f.apply(We(nt)?nt:[],O)})}}),xa(i.prototype,function(u,f){var y=U[f];if(y){var T=y.name+"";sn.call(ss,T)||(ss[T]=[]),ss[T].push({name:f,func:y})}}),ss[Qh(n,R).name]=[{name:"wrapper",func:n}],i.prototype.clone=a,i.prototype.reverse=c,i.prototype.value=d,U.prototype.at=wD,U.prototype.chain=SD,U.prototype.commit=MD,U.prototype.next=bD,U.prototype.plant=TD,U.prototype.reverse=CD,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=PD,U.prototype.first=U.prototype.head,Mu&&(U.prototype[Mu]=AD),U},Ki=is();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ur._=Ki,define(function(){return Ki})):Lo?((Lo.exports=Ki)._=Ki,wf._=Ki):Ur._=Ki}).call(vf)});var CN=ot((rwt,TN)=>{TN.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var RN=ot((iwt,IN)=>{var PN=CN();IN.exports=function(n,t){Array.isArray(t)||(t=[]),n.length>0&&t.push(PN([0,0],n[0]));for(var e=0;e<n.length-1;e++){var o=n[e],s=n[e+1],l=o[0],p=o[1],h=s[0],g=s[1],m=[.75*l+.25*h,.75*p+.25*g],_=[.25*l+.75*h,.25*p+.75*g];t.push(m),t.push(_)}return n.length>1&&t.push(PN([0,0],n[n.length-1])),t}});var UN=ot((lwt,FN)=>{"use strict";var xJ=zf(),DN=Function.prototype,NN=DN.apply,ON=DN.call;FN.exports=typeof Reflect=="object"&&Reflect.apply||(xJ?ON.bind(NN):function(){return ON.apply(NN,arguments)})});var HN=ot((cwt,qN)=>{"use strict";Yp();var BN=Ns(),zN=Wf(),EJ=Xp(),GN=mi(),kN=Ls(),wJ=pc(),SJ=kN("species"),N1=RegExp.prototype;qN.exports=function(n,t,e,o){var s=kN(n),l=!GN(function(){var m={};return m[s]=function(){return 7},""[n](m)!==7}),p=l&&!GN(function(){var m=!1,_=/a/;return n==="split"&&(_={},_.constructor={},_.constructor[SJ]=function(){return _},_.flags="",_[s]=/./[s]),_.exec=function(){return m=!0,null},_[s](""),!m});if(!l||!p||e){var h=/./[s],g=t(s,""[n],function(m,_,w,S,b){var C=_.exec;return C===EJ||C===N1.exec?l&&!b?{done:!0,value:BN(h,_,w,S)}:{done:!0,value:BN(m,w,_,S)}:{done:!1}});zN(String.prototype,n,g[0]),zN(N1,s,g[1])}o&&wJ(N1[s],"sham",!0)}});var YN=ot((fwt,XN)=>{"use strict";var O1=yi(),MJ=El(),bJ=Hp(),AJ=uc(),TJ=O1("".charAt),VN=O1("".charCodeAt),CJ=O1("".slice),WN=function(n){return function(t,e){var o=bJ(AJ(t)),s=MJ(e),l=o.length,p,h;return s<0||s>=l?n?"":void 0:(p=VN(o,s),p<55296||p>56319||s+1===l||(h=VN(o,s+1))<56320||h>57343?n?TJ(o,s):p:n?CJ(o,s,s+2):(p-55296<<10)+(h-56320)+65536)}};XN.exports={codeAt:WN(!1),charAt:WN(!0)}});var ZN=ot((hwt,$N)=>{"use strict";var PJ=YN().charAt;$N.exports=function(n,t,e){return t+(e?PJ(n,t).length:1)}});var JN=ot((pwt,KN)=>{"use strict";var U1=yi(),IJ=cc(),RJ=Math.floor,D1=U1("".charAt),LJ=U1("".replace),F1=U1("".slice),NJ=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,OJ=/\$([$&'`]|\d{1,2})/g;KN.exports=function(n,t,e,o,s,l){var p=e+n.length,h=o.length,g=OJ;return s!==void 0&&(s=IJ(s),g=NJ),LJ(l,g,function(m,_){var w;switch(D1(_,0)){case"$":return"$";case"&":return n;case"`":return F1(t,0,e);case"'":return F1(t,p);case"<":w=s[F1(_,1,-1)];break;default:var S=+_;if(S===0)return m;if(S>h){var b=RJ(S/10);return b===0?m:b<=h?o[b-1]===void 0?D1(_,1):o[b-1]+D1(_,1):m}w=o[S-1]}return w===void 0?"":w})}});var t2=ot((dwt,QN)=>{"use strict";var jN=Ns(),DJ=Ma(),FJ=Ui(),UJ=ac(),BJ=Xp(),zJ=TypeError;QN.exports=function(n,t){var e=n.exec;if(FJ(e)){var o=jN(e,n,t);return o!==null&&DJ(o),o}if(UJ(n)==="RegExp")return jN(BJ,n,t);throw new zJ("RegExp#exec called on incompatible receiver")}});var o2=ot(()=>{"use strict";var GJ=UN(),e2=Ns(),Qg=yi(),kJ=HN(),qJ=mi(),HJ=Ma(),VJ=Ui(),WJ=Xs(),XJ=El(),YJ=y0(),xf=Hp(),$J=uc(),ZJ=ZN(),KJ=Ep(),JJ=JN(),jJ=t2(),QJ=Ls(),z1=QJ("replace"),tj=Math.max,ej=Math.min,nj=Qg([].concat),B1=Qg([].push),n2=Qg("".indexOf),r2=Qg("".slice),rj=function(n){return n===void 0?n:String(n)},ij=function(){return"a".replace(/./,"$0")==="$0"}(),i2=function(){return/./[z1]?/./[z1]("a","$0")==="":!1}(),oj=!qJ(function(){var n=/./;return n.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(n,"$<a>")!=="7"});kJ("replace",function(n,t,e){var o=i2?"$":"$0";return[function(l,p){var h=$J(this),g=WJ(l)?KJ(l,z1):void 0;return g?e2(g,l,h,p):e2(t,xf(h),l,p)},function(s,l){var p=HJ(this),h=xf(s);if(typeof l=="string"&&n2(l,o)===-1&&n2(l,"$<")===-1){var g=e(t,p,h,l);if(g.done)return g.value}var m=VJ(l);m||(l=xf(l));var _=p.global,w;_&&(w=p.unicode,p.lastIndex=0);for(var S=[],b;b=jJ(p,h),!(b===null||(B1(S,b),!_));){var C=xf(b[0]);C===""&&(p.lastIndex=ZJ(h,YJ(p.lastIndex),w))}for(var R="",x=0,E=0;E<S.length;E++){b=S[E];for(var I=xf(b[0]),A=tj(ej(XJ(b.index),h.length),0),F=[],V,X=1;X<b.length;X++)B1(F,rj(b[X]));var q=b.groups;if(m){var D=nj([I],F,A,h);q!==void 0&&B1(D,q),V=xf(GJ(l,void 0,D))}else V=JJ(I,h,A,F,q,l);A>=x&&(R+=r2(h,x,A)+V,x=A+I.length)}return R+r2(h,x)}]},!oj||!ij||i2)});function eu(){return eu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},eu.apply(this,arguments)}var qEt=$e(kp(),1),HEt=$e(Yp(),1),VEt=$e(Zp(),1),WEt=$e(Pb(),1),XEt=$e(Nb(),1),YEt=$e(Bb(),1),$Et=$e(kb(),1),ZEt=$e(Vb(),1),KEt=$e(Yb(),1),JEt=$e(Kb(),1),jEt=$e(yA(),1),QEt=$e(vA(),1),Vi=$e(NA(),1);var UEt=$e(kp(),1);var Lv="162";var mH=0,OA=1,yH=2;var oC=1,vH=2,uu=3,Ku=0,$o=1,cu=2,Xu=0,zc=1,DA=2,FA=3,UA=4,_H=5,Il=100,xH=101,EH=102,BA=103,zA=104,wH=200,SH=201,MH=202,bH=203,Vy=204,Wy=205,AH=206,TH=207,CH=208,PH=209,IH=210,RH=211,LH=212,NH=213,OH=214,DH=0,FH=1,UH=2,Sd=3,BH=4,zH=5,GH=6,kH=7,sC=0,qH=1,HH=2,Yu=0,VH=1,WH=2,XH=3,YH=4,$H=5,ZH=6,KH=7;var aC=300,qc=301,Hc=302,Xy=303,Yy=304,Wd=306,$y=1e3,ta=1001,Zy=1002,Mo=1003,GA=1004;var Jf=1005;var Xo=1006,cy=1007;var Ll=1008;var $u=1009,JH=1010,jH=1011,Nv=1012,uC=1013,Wu=1014,fu=1015,sh=1016,lC=1017,cC=1018,Ol=1020,QH=1021,ea=1023,t6=1024,e6=1025,Dl=1026,Vc=1027,n6=1028,fC=1029,r6=1030,hC=1031,pC=1033,fy=33776,hy=33777,py=33778,dy=33779,kA=35840,qA=35841,HA=35842,VA=35843,dC=36196,WA=37492,XA=37496,YA=37808,$A=37809,ZA=37810,KA=37811,JA=37812,jA=37813,QA=37814,tT=37815,eT=37816,nT=37817,rT=37818,iT=37819,oT=37820,sT=37821,gy=36492,aT=36494,uT=36495,i6=36283,lT=36284,cT=36285,fT=36286;var Md=2300,bd=2301,my=2302,hT=2400,pT=2401,dT=2402;var o6=3200,s6=3201,a6=0,u6=1,Vu="",ba="srgb",tl="srgb-linear",Ov="display-p3",Xd="display-p3-linear",Ad="linear",Lr="srgb",Td="rec709",Cd="p3";var yc=7680;var gT=519,l6=512,c6=513,f6=514,gC=515,h6=516,p6=517,d6=518,g6=519,Ky=35044;var mT="300 es",Jy=1035,hu=2e3,Pd=2001,Ju=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let o=this._listeners;o[t]===void 0&&(o[t]=[]),o[t].indexOf(e)===-1&&o[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let o=this._listeners;return o[t]!==void 0&&o[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let s=this._listeners[t];if(s!==void 0){let l=s.indexOf(e);l!==-1&&s.splice(l,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let o=this._listeners[t.type];if(o!==void 0){t.target=this;let s=o.slice(0);for(let l=0,p=s.length;l<p;l++)s[l].call(this,t);t.target=null}}},ao=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var yy=Math.PI/180,jy=180/Math.PI;function Zu(){let n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(ao[n&255]+ao[n>>8&255]+ao[n>>16&255]+ao[n>>24&255]+"-"+ao[t&255]+ao[t>>8&255]+"-"+ao[t>>16&15|64]+ao[t>>24&255]+"-"+ao[e&63|128]+ao[e>>8&255]+"-"+ao[e>>16&255]+ao[e>>24&255]+ao[o&255]+ao[o>>8&255]+ao[o>>16&255]+ao[o>>24&255]).toLowerCase()}function Yo(n,t,e){return Math.max(t,Math.min(e,n))}function m6(n,t){return(n%t+t)%t}function vy(n,t,e){return(1-e)*n+e*t}function yT(n){return(n&n-1)===0&&n!==0}function Qy(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ta(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function _r(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var ze=class n{constructor(t=0,e=0){n.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,o=this.y,s=t.elements;return this.x=s[0]*e+s[3]*o+s[6],this.y=s[1]*e+s[4]*o+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let o=this.dot(t)/e;return Math.acos(Yo(o,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,o=this.y-t.y;return e*e+o*o}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let o=Math.cos(e),s=Math.sin(e),l=this.x-t.x,p=this.y-t.y;return this.x=l*o-p*s+t.x,this.y=l*s+p*o+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Je=class n{constructor(t,e,o,s,l,p,h,g,m){n.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,o,s,l,p,h,g,m)}set(t,e,o,s,l,p,h,g,m){let _=this.elements;return _[0]=t,_[1]=s,_[2]=h,_[3]=e,_[4]=l,_[5]=g,_[6]=o,_[7]=p,_[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,o=t.elements;return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],e[4]=o[4],e[5]=o[5],e[6]=o[6],e[7]=o[7],e[8]=o[8],this}extractBasis(t,e,o){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),o.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let o=t.elements,s=e.elements,l=this.elements,p=o[0],h=o[3],g=o[6],m=o[1],_=o[4],w=o[7],S=o[2],b=o[5],C=o[8],R=s[0],x=s[3],E=s[6],I=s[1],A=s[4],F=s[7],V=s[2],X=s[5],q=s[8];return l[0]=p*R+h*I+g*V,l[3]=p*x+h*A+g*X,l[6]=p*E+h*F+g*q,l[1]=m*R+_*I+w*V,l[4]=m*x+_*A+w*X,l[7]=m*E+_*F+w*q,l[2]=S*R+b*I+C*V,l[5]=S*x+b*A+C*X,l[8]=S*E+b*F+C*q,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8];return e*p*_-e*h*m-o*l*_+o*h*g+s*l*m-s*p*g}invert(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8],w=_*p-h*m,S=h*g-_*l,b=m*l-p*g,C=e*w+o*S+s*b;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);let R=1/C;return t[0]=w*R,t[1]=(s*m-_*o)*R,t[2]=(h*o-s*p)*R,t[3]=S*R,t[4]=(_*e-s*g)*R,t[5]=(s*l-h*e)*R,t[6]=b*R,t[7]=(o*g-m*e)*R,t[8]=(p*e-o*l)*R,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,o,s,l,p,h){let g=Math.cos(l),m=Math.sin(l);return this.set(o*g,o*m,-o*(g*p+m*h)+p+t,-s*m,s*g,-s*(-m*p+g*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(_y.makeScale(t,e)),this}rotate(t){return this.premultiply(_y.makeRotation(-t)),this}translate(t,e){return this.premultiply(_y.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,-o,0,o,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,o=t.elements;for(let s=0;s<9;s++)if(e[s]!==o[s])return!1;return!0}fromArray(t,e=0){for(let o=0;o<9;o++)this.elements[o]=t[o+e];return this}toArray(t=[],e=0){let o=this.elements;return t[e]=o[0],t[e+1]=o[1],t[e+2]=o[2],t[e+3]=o[3],t[e+4]=o[4],t[e+5]=o[5],t[e+6]=o[6],t[e+7]=o[7],t[e+8]=o[8],t}clone(){return new this.constructor().fromArray(this.elements)}},_y=new Je;function mC(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Id(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function y6(){let n=Id("canvas");return n.style.display="block",n}var vT={};function yC(n){n in vT||(vT[n]=!0,console.warn(n))}var _T=new Je().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),xT=new Je().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),jp={[tl]:{transfer:Ad,primaries:Td,toReference:n=>n,fromReference:n=>n},[ba]:{transfer:Lr,primaries:Td,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Xd]:{transfer:Ad,primaries:Cd,toReference:n=>n.applyMatrix3(xT),fromReference:n=>n.applyMatrix3(_T)},[Ov]:{transfer:Lr,primaries:Cd,toReference:n=>n.convertSRGBToLinear().applyMatrix3(xT),fromReference:n=>n.applyMatrix3(_T).convertLinearToSRGB()}},v6=new Set([tl,Xd]),xr={enabled:!0,_workingColorSpace:tl,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!v6.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;let o=jp[t].toReference,s=jp[e].fromReference;return s(o(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return jp[n].primaries},getTransfer:function(n){return n===Vu?Ad:jp[n].transfer}};function Gc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function xy(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var vc,Rd=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement=="undefined")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{vc===void 0&&(vc=Id("canvas")),vc.width=t.width,vc.height=t.height;let o=vc.getContext("2d");t instanceof ImageData?o.putImageData(t,0,0):o.drawImage(t,0,0,t.width,t.height),e=vc}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement!="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&t instanceof ImageBitmap){let e=Id("canvas");e.width=t.width,e.height=t.height;let o=e.getContext("2d");o.drawImage(t,0,0,t.width,t.height);let s=o.getImageData(0,0,t.width,t.height),l=s.data;for(let p=0;p<l.length;p++)l[p]=Gc(l[p]/255)*255;return o.putImageData(s,0,0),e}else if(t.data){let e=t.data.slice(0);for(let o=0;o<e.length;o++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[o]=Math.floor(Gc(e[o]/255)*255):e[o]=Gc(e[o]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},_6=0,Ld=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:_6++}),this.uuid=Zu(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let o={uuid:this.uuid,url:""},s=this.data;if(s!==null){let l;if(Array.isArray(s)){l=[];for(let p=0,h=s.length;p<h;p++)s[p].isDataTexture?l.push(Ey(s[p].image)):l.push(Ey(s[p]))}else l=Ey(s);o.url=l}return e||(t.images[this.uuid]=o),o}};function Ey(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?Rd.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var x6=0,Fs=class n extends Ju{constructor(t=n.DEFAULT_IMAGE,e=n.DEFAULT_MAPPING,o=ta,s=ta,l=Xo,p=Ll,h=ea,g=$u,m=n.DEFAULT_ANISOTROPY,_=Vu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:x6++}),this.uuid=Zu(),this.name="",this.source=new Ld(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=o,this.wrapT=s,this.magFilter=l,this.minFilter=p,this.anisotropy=m,this.format=h,this.internalFormat=null,this.type=g,this.offset=new ze(0,0),this.repeat=new ze(1,1),this.center=new ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=_,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let o={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(o.userData=this.userData),e||(t.textures[this.uuid]=o),o}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==aC)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case $y:t.x=t.x-Math.floor(t.x);break;case ta:t.x=t.x<0?0:1;break;case Zy:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case $y:t.y=t.y-Math.floor(t.y);break;case ta:t.y=t.y<0?0:1;break;case Zy:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}};Fs.DEFAULT_IMAGE=null;Fs.DEFAULT_MAPPING=aC;Fs.DEFAULT_ANISOTROPY=1;var Qi=class n{constructor(t=0,e=0,o=0,s=1){n.prototype.isVector4=!0,this.x=t,this.y=e,this.z=o,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,o,s){return this.x=t,this.y=e,this.z=o,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,o=this.y,s=this.z,l=this.w,p=t.elements;return this.x=p[0]*e+p[4]*o+p[8]*s+p[12]*l,this.y=p[1]*e+p[5]*o+p[9]*s+p[13]*l,this.z=p[2]*e+p[6]*o+p[10]*s+p[14]*l,this.w=p[3]*e+p[7]*o+p[11]*s+p[15]*l,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,o,s,l,g=t.elements,m=g[0],_=g[4],w=g[8],S=g[1],b=g[5],C=g[9],R=g[2],x=g[6],E=g[10];if(Math.abs(_-S)<.01&&Math.abs(w-R)<.01&&Math.abs(C-x)<.01){if(Math.abs(_+S)<.1&&Math.abs(w+R)<.1&&Math.abs(C+x)<.1&&Math.abs(m+b+E-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let A=(m+1)/2,F=(b+1)/2,V=(E+1)/2,X=(_+S)/4,q=(w+R)/4,D=(C+x)/4;return A>F&&A>V?A<.01?(o=0,s=.707106781,l=.707106781):(o=Math.sqrt(A),s=X/o,l=q/o):F>V?F<.01?(o=.707106781,s=0,l=.707106781):(s=Math.sqrt(F),o=X/s,l=D/s):V<.01?(o=.707106781,s=.707106781,l=0):(l=Math.sqrt(V),o=q/l,s=D/l),this.set(o,s,l,e),this}let I=Math.sqrt((x-C)*(x-C)+(w-R)*(w-R)+(S-_)*(S-_));return Math.abs(I)<.001&&(I=1),this.x=(x-C)/I,this.y=(w-R)/I,this.z=(S-_)/I,this.w=Math.acos((m+b+E-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this.z=t.z+(e.z-t.z)*o,this.w=t.w+(e.w-t.w)*o,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},tv=class extends Ju{constructor(t=1,e=1,o={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qi(0,0,t,e),this.scissorTest=!1,this.viewport=new Qi(0,0,t,e);let s={width:t,height:e,depth:1};o=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Xo,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},o);let l=new Fs(s,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.colorSpace);l.flipY=!1,l.generateMipmaps=o.generateMipmaps,l.internalFormat=o.internalFormat,this.textures=[];let p=o.count;for(let h=0;h<p;h++)this.textures[h]=l.clone(),this.textures[h].isRenderTargetTexture=!0;this.depthBuffer=o.depthBuffer,this.stencilBuffer=o.stencilBuffer,this.depthTexture=o.depthTexture,this.samples=o.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,o=1){if(this.width!==t||this.height!==e||this.depth!==o){this.width=t,this.height=e,this.depth=o;for(let s=0,l=this.textures.length;s<l;s++)this.textures[s].image.width=t,this.textures[s].image.height=e,this.textures[s].image.depth=o;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let o=0,s=t.textures.length;o<s;o++)this.textures[o]=t.textures[o].clone(),this.textures[o].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Ld(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},du=class extends tv{constructor(t=1,e=1,o={}){super(t,e,o),this.isWebGLRenderTarget=!0}},Nd=class extends Fs{constructor(t=null,e=1,o=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:o,depth:s},this.magFilter=Mo,this.minFilter=Mo,this.wrapR=ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var ev=class extends Fs{constructor(t=null,e=1,o=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:o,depth:s},this.magFilter=Mo,this.minFilter=Mo,this.wrapR=ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var ju=class{constructor(t=0,e=0,o=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=o,this._w=s}static slerpFlat(t,e,o,s,l,p,h){let g=o[s+0],m=o[s+1],_=o[s+2],w=o[s+3],S=l[p+0],b=l[p+1],C=l[p+2],R=l[p+3];if(h===0){t[e+0]=g,t[e+1]=m,t[e+2]=_,t[e+3]=w;return}if(h===1){t[e+0]=S,t[e+1]=b,t[e+2]=C,t[e+3]=R;return}if(w!==R||g!==S||m!==b||_!==C){let x=1-h,E=g*S+m*b+_*C+w*R,I=E>=0?1:-1,A=1-E*E;if(A>Number.EPSILON){let V=Math.sqrt(A),X=Math.atan2(V,E*I);x=Math.sin(x*X)/V,h=Math.sin(h*X)/V}let F=h*I;if(g=g*x+S*F,m=m*x+b*F,_=_*x+C*F,w=w*x+R*F,x===1-h){let V=1/Math.sqrt(g*g+m*m+_*_+w*w);g*=V,m*=V,_*=V,w*=V}}t[e]=g,t[e+1]=m,t[e+2]=_,t[e+3]=w}static multiplyQuaternionsFlat(t,e,o,s,l,p){let h=o[s],g=o[s+1],m=o[s+2],_=o[s+3],w=l[p],S=l[p+1],b=l[p+2],C=l[p+3];return t[e]=h*C+_*w+g*b-m*S,t[e+1]=g*C+_*S+m*w-h*b,t[e+2]=m*C+_*b+h*S-g*w,t[e+3]=_*C-h*w-g*S-m*b,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,o,s){return this._x=t,this._y=e,this._z=o,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let o=t._x,s=t._y,l=t._z,p=t._order,h=Math.cos,g=Math.sin,m=h(o/2),_=h(s/2),w=h(l/2),S=g(o/2),b=g(s/2),C=g(l/2);switch(p){case"XYZ":this._x=S*_*w+m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w-S*b*C;break;case"YXZ":this._x=S*_*w+m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w+S*b*C;break;case"ZXY":this._x=S*_*w-m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w-S*b*C;break;case"ZYX":this._x=S*_*w-m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w+S*b*C;break;case"YZX":this._x=S*_*w+m*b*C,this._y=m*b*w+S*_*C,this._z=m*_*C-S*b*w,this._w=m*_*w-S*b*C;break;case"XZY":this._x=S*_*w-m*b*C,this._y=m*b*w-S*_*C,this._z=m*_*C+S*b*w,this._w=m*_*w+S*b*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+p)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let o=e/2,s=Math.sin(o);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(o),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,o=e[0],s=e[4],l=e[8],p=e[1],h=e[5],g=e[9],m=e[2],_=e[6],w=e[10],S=o+h+w;if(S>0){let b=.5/Math.sqrt(S+1);this._w=.25/b,this._x=(_-g)*b,this._y=(l-m)*b,this._z=(p-s)*b}else if(o>h&&o>w){let b=2*Math.sqrt(1+o-h-w);this._w=(_-g)/b,this._x=.25*b,this._y=(s+p)/b,this._z=(l+m)/b}else if(h>w){let b=2*Math.sqrt(1+h-o-w);this._w=(l-m)/b,this._x=(s+p)/b,this._y=.25*b,this._z=(g+_)/b}else{let b=2*Math.sqrt(1+w-o-h);this._w=(p-s)/b,this._x=(l+m)/b,this._y=(g+_)/b,this._z=.25*b}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let o=t.dot(e)+1;return o<Number.EPSILON?(o=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=o):(this._x=0,this._y=-t.z,this._z=t.y,this._w=o)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=o),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Yo(this.dot(t),-1,1)))}rotateTowards(t,e){let o=this.angleTo(t);if(o===0)return this;let s=Math.min(1,e/o);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let o=t._x,s=t._y,l=t._z,p=t._w,h=e._x,g=e._y,m=e._z,_=e._w;return this._x=o*_+p*h+s*m-l*g,this._y=s*_+p*g+l*h-o*m,this._z=l*_+p*m+o*g-s*h,this._w=p*_-o*h-s*g-l*m,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let o=this._x,s=this._y,l=this._z,p=this._w,h=p*t._w+o*t._x+s*t._y+l*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=p,this._x=o,this._y=s,this._z=l,this;let g=1-h*h;if(g<=Number.EPSILON){let b=1-e;return this._w=b*p+e*this._w,this._x=b*o+e*this._x,this._y=b*s+e*this._y,this._z=b*l+e*this._z,this.normalize(),this}let m=Math.sqrt(g),_=Math.atan2(m,h),w=Math.sin((1-e)*_)/m,S=Math.sin(e*_)/m;return this._w=p*w+this._w*S,this._x=o*w+this._x*S,this._y=s*w+this._y*S,this._z=l*w+this._z*S,this._onChangeCallback(),this}slerpQuaternions(t,e,o){return this.copy(t).slerp(e,o)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),o=Math.random(),s=Math.sqrt(1-o),l=Math.sqrt(o);return this.set(s*Math.sin(t),s*Math.cos(t),l*Math.sin(e),l*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Pt=class n{constructor(t=0,e=0,o=0){n.prototype.isVector3=!0,this.x=t,this.y=e,this.z=o}set(t,e,o){return o===void 0&&(o=this.z),this.x=t,this.y=e,this.z=o,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ET.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ET.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,o=this.y,s=this.z,l=t.elements;return this.x=l[0]*e+l[3]*o+l[6]*s,this.y=l[1]*e+l[4]*o+l[7]*s,this.z=l[2]*e+l[5]*o+l[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,o=this.y,s=this.z,l=t.elements,p=1/(l[3]*e+l[7]*o+l[11]*s+l[15]);return this.x=(l[0]*e+l[4]*o+l[8]*s+l[12])*p,this.y=(l[1]*e+l[5]*o+l[9]*s+l[13])*p,this.z=(l[2]*e+l[6]*o+l[10]*s+l[14])*p,this}applyQuaternion(t){let e=this.x,o=this.y,s=this.z,l=t.x,p=t.y,h=t.z,g=t.w,m=2*(p*s-h*o),_=2*(h*e-l*s),w=2*(l*o-p*e);return this.x=e+g*m+p*w-h*_,this.y=o+g*_+h*m-l*w,this.z=s+g*w+l*_-p*m,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,o=this.y,s=this.z,l=t.elements;return this.x=l[0]*e+l[4]*o+l[8]*s,this.y=l[1]*e+l[5]*o+l[9]*s,this.z=l[2]*e+l[6]*o+l[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(t,Math.min(e,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,o){return this.x=t.x+(e.x-t.x)*o,this.y=t.y+(e.y-t.y)*o,this.z=t.z+(e.z-t.z)*o,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let o=t.x,s=t.y,l=t.z,p=e.x,h=e.y,g=e.z;return this.x=s*g-l*h,this.y=l*p-o*g,this.z=o*h-s*p,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let o=t.dot(this)/e;return this.copy(t).multiplyScalar(o)}projectOnPlane(t){return wy.copy(this).projectOnVector(t),this.sub(wy)}reflect(t){return this.sub(wy.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let o=this.dot(t)/e;return Math.acos(Yo(o,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,o=this.y-t.y,s=this.z-t.z;return e*e+o*o+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,o){let s=Math.sin(e)*t;return this.x=s*Math.sin(o),this.y=Math.cos(e)*t,this.z=s*Math.cos(o),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,o){return this.x=t*Math.sin(e),this.y=o,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),o=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=o,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,o=Math.sqrt(1-e*e);return this.x=o*Math.cos(t),this.y=e,this.z=o*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},wy=new Pt,ET=new ju,Fl=class{constructor(t=new Pt(1/0,1/0,1/0),e=new Pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,o=t.length;e<o;e+=3)this.expandByPoint(Js.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,o=t.count;e<o;e++)this.expandByPoint(Js.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,o=t.length;e<o;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let o=Js.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(o),this.max.copy(t).add(o),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let o=t.geometry;if(o!==void 0){let l=o.getAttribute("position");if(e===!0&&l!==void 0&&t.isInstancedMesh!==!0)for(let p=0,h=l.count;p<h;p++)t.isMesh===!0?t.getVertexPosition(p,Js):Js.fromBufferAttribute(l,p),Js.applyMatrix4(t.matrixWorld),this.expandByPoint(Js);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Qp.copy(t.boundingBox)):(o.boundingBox===null&&o.computeBoundingBox(),Qp.copy(o.boundingBox)),Qp.applyMatrix4(t.matrixWorld),this.union(Qp)}let s=t.children;for(let l=0,p=s.length;l<p;l++)this.expandByObject(s[l],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Js),Js.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,o;return t.normal.x>0?(e=t.normal.x*this.min.x,o=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,o=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,o+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,o+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,o+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,o+=t.normal.z*this.min.z),e<=-t.constant&&o>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(jf),td.subVectors(this.max,jf),_c.subVectors(t.a,jf),xc.subVectors(t.b,jf),Ec.subVectors(t.c,jf),Uu.subVectors(xc,_c),Bu.subVectors(Ec,xc),Sl.subVectors(_c,Ec);let e=[0,-Uu.z,Uu.y,0,-Bu.z,Bu.y,0,-Sl.z,Sl.y,Uu.z,0,-Uu.x,Bu.z,0,-Bu.x,Sl.z,0,-Sl.x,-Uu.y,Uu.x,0,-Bu.y,Bu.x,0,-Sl.y,Sl.x,0];return!Sy(e,_c,xc,Ec,td)||(e=[1,0,0,0,1,0,0,0,1],!Sy(e,_c,xc,Ec,td))?!1:(ed.crossVectors(Uu,Bu),e=[ed.x,ed.y,ed.z],Sy(e,_c,xc,Ec,td))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Js).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Js).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(ru[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ru[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ru[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ru[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ru[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ru[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ru[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ru[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ru),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},ru=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Js=new Pt,Qp=new Fl,_c=new Pt,xc=new Pt,Ec=new Pt,Uu=new Pt,Bu=new Pt,Sl=new Pt,jf=new Pt,td=new Pt,ed=new Pt,Ml=new Pt;function Sy(n,t,e,o,s){for(let l=0,p=n.length-3;l<=p;l+=3){Ml.fromArray(n,l);let h=s.x*Math.abs(Ml.x)+s.y*Math.abs(Ml.y)+s.z*Math.abs(Ml.z),g=t.dot(Ml),m=e.dot(Ml),_=o.dot(Ml);if(Math.max(-Math.max(g,m,_),Math.min(g,m,_))>h)return!1}return!0}var E6=new Fl,Qf=new Pt,My=new Pt,ah=class{constructor(t=new Pt,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let o=this.center;e!==void 0?o.copy(e):E6.setFromPoints(t).getCenter(o);let s=0;for(let l=0,p=t.length;l<p;l++)s=Math.max(s,o.distanceToSquared(t[l]));return this.radius=Math.sqrt(s),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let o=this.center.distanceToSquared(t);return e.copy(t),o>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qf.subVectors(t,this.center);let e=Qf.lengthSq();if(e>this.radius*this.radius){let o=Math.sqrt(e),s=(o-this.radius)*.5;this.center.addScaledVector(Qf,s/o),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(My.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qf.copy(t.center).add(My)),this.expandByPoint(Qf.copy(t.center).sub(My))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},iu=new Pt,by=new Pt,nd=new Pt,zu=new Pt,Ay=new Pt,rd=new Pt,Ty=new Pt,nv=class{constructor(t=new Pt,e=new Pt(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,iu)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let o=e.dot(this.direction);return o<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,o)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=iu.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(iu.copy(this.origin).addScaledVector(this.direction,e),iu.distanceToSquared(t))}distanceSqToSegment(t,e,o,s){by.copy(t).add(e).multiplyScalar(.5),nd.copy(e).sub(t).normalize(),zu.copy(this.origin).sub(by);let l=t.distanceTo(e)*.5,p=-this.direction.dot(nd),h=zu.dot(this.direction),g=-zu.dot(nd),m=zu.lengthSq(),_=Math.abs(1-p*p),w,S,b,C;if(_>0)if(w=p*g-h,S=p*h-g,C=l*_,w>=0)if(S>=-C)if(S<=C){let R=1/_;w*=R,S*=R,b=w*(w+p*S+2*h)+S*(p*w+S+2*g)+m}else S=l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;else S=-l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;else S<=-C?(w=Math.max(0,-(-p*l+h)),S=w>0?-l:Math.min(Math.max(-l,-g),l),b=-w*w+S*(S+2*g)+m):S<=C?(w=0,S=Math.min(Math.max(-l,-g),l),b=S*(S+2*g)+m):(w=Math.max(0,-(p*l+h)),S=w>0?l:Math.min(Math.max(-l,-g),l),b=-w*w+S*(S+2*g)+m);else S=p>0?-l:l,w=Math.max(0,-(p*S+h)),b=-w*w+S*(S+2*g)+m;return o&&o.copy(this.origin).addScaledVector(this.direction,w),s&&s.copy(by).addScaledVector(nd,S),b}intersectSphere(t,e){iu.subVectors(t.center,this.origin);let o=iu.dot(this.direction),s=iu.dot(iu)-o*o,l=t.radius*t.radius;if(s>l)return null;let p=Math.sqrt(l-s),h=o-p,g=o+p;return g<0?null:h<0?this.at(g,e):this.at(h,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let o=-(this.origin.dot(t.normal)+t.constant)/e;return o>=0?o:null}intersectPlane(t,e){let o=this.distanceToPlane(t);return o===null?null:this.at(o,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let o,s,l,p,h,g,m=1/this.direction.x,_=1/this.direction.y,w=1/this.direction.z,S=this.origin;return m>=0?(o=(t.min.x-S.x)*m,s=(t.max.x-S.x)*m):(o=(t.max.x-S.x)*m,s=(t.min.x-S.x)*m),_>=0?(l=(t.min.y-S.y)*_,p=(t.max.y-S.y)*_):(l=(t.max.y-S.y)*_,p=(t.min.y-S.y)*_),o>p||l>s||((l>o||isNaN(o))&&(o=l),(p<s||isNaN(s))&&(s=p),w>=0?(h=(t.min.z-S.z)*w,g=(t.max.z-S.z)*w):(h=(t.max.z-S.z)*w,g=(t.min.z-S.z)*w),o>g||h>s)||((h>o||o!==o)&&(o=h),(g<s||s!==s)&&(s=g),s<0)?null:this.at(o>=0?o:s,e)}intersectsBox(t){return this.intersectBox(t,iu)!==null}intersectTriangle(t,e,o,s,l){Ay.subVectors(e,t),rd.subVectors(o,t),Ty.crossVectors(Ay,rd);let p=this.direction.dot(Ty),h;if(p>0){if(s)return null;h=1}else if(p<0)h=-1,p=-p;else return null;zu.subVectors(this.origin,t);let g=h*this.direction.dot(rd.crossVectors(zu,rd));if(g<0)return null;let m=h*this.direction.dot(Ay.cross(zu));if(m<0||g+m>p)return null;let _=-h*zu.dot(Ty);return _<0?null:this.at(_/p,l)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},vi=class n{constructor(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x){n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x)}set(t,e,o,s,l,p,h,g,m,_,w,S,b,C,R,x){let E=this.elements;return E[0]=t,E[4]=e,E[8]=o,E[12]=s,E[1]=l,E[5]=p,E[9]=h,E[13]=g,E[2]=m,E[6]=_,E[10]=w,E[14]=S,E[3]=b,E[7]=C,E[11]=R,E[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new n().fromArray(this.elements)}copy(t){let e=this.elements,o=t.elements;return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],e[4]=o[4],e[5]=o[5],e[6]=o[6],e[7]=o[7],e[8]=o[8],e[9]=o[9],e[10]=o[10],e[11]=o[11],e[12]=o[12],e[13]=o[13],e[14]=o[14],e[15]=o[15],this}copyPosition(t){let e=this.elements,o=t.elements;return e[12]=o[12],e[13]=o[13],e[14]=o[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,o){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),o.setFromMatrixColumn(this,2),this}makeBasis(t,e,o){return this.set(t.x,e.x,o.x,0,t.y,e.y,o.y,0,t.z,e.z,o.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,o=t.elements,s=1/wc.setFromMatrixColumn(t,0).length(),l=1/wc.setFromMatrixColumn(t,1).length(),p=1/wc.setFromMatrixColumn(t,2).length();return e[0]=o[0]*s,e[1]=o[1]*s,e[2]=o[2]*s,e[3]=0,e[4]=o[4]*l,e[5]=o[5]*l,e[6]=o[6]*l,e[7]=0,e[8]=o[8]*p,e[9]=o[9]*p,e[10]=o[10]*p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,o=t.x,s=t.y,l=t.z,p=Math.cos(o),h=Math.sin(o),g=Math.cos(s),m=Math.sin(s),_=Math.cos(l),w=Math.sin(l);if(t.order==="XYZ"){let S=p*_,b=p*w,C=h*_,R=h*w;e[0]=g*_,e[4]=-g*w,e[8]=m,e[1]=b+C*m,e[5]=S-R*m,e[9]=-h*g,e[2]=R-S*m,e[6]=C+b*m,e[10]=p*g}else if(t.order==="YXZ"){let S=g*_,b=g*w,C=m*_,R=m*w;e[0]=S+R*h,e[4]=C*h-b,e[8]=p*m,e[1]=p*w,e[5]=p*_,e[9]=-h,e[2]=b*h-C,e[6]=R+S*h,e[10]=p*g}else if(t.order==="ZXY"){let S=g*_,b=g*w,C=m*_,R=m*w;e[0]=S-R*h,e[4]=-p*w,e[8]=C+b*h,e[1]=b+C*h,e[5]=p*_,e[9]=R-S*h,e[2]=-p*m,e[6]=h,e[10]=p*g}else if(t.order==="ZYX"){let S=p*_,b=p*w,C=h*_,R=h*w;e[0]=g*_,e[4]=C*m-b,e[8]=S*m+R,e[1]=g*w,e[5]=R*m+S,e[9]=b*m-C,e[2]=-m,e[6]=h*g,e[10]=p*g}else if(t.order==="YZX"){let S=p*g,b=p*m,C=h*g,R=h*m;e[0]=g*_,e[4]=R-S*w,e[8]=C*w+b,e[1]=w,e[5]=p*_,e[9]=-h*_,e[2]=-m*_,e[6]=b*w+C,e[10]=S-R*w}else if(t.order==="XZY"){let S=p*g,b=p*m,C=h*g,R=h*m;e[0]=g*_,e[4]=-w,e[8]=m*_,e[1]=S*w+R,e[5]=p*_,e[9]=b*w-C,e[2]=C*w-b,e[6]=h*_,e[10]=R*w+S}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(w6,t,S6)}lookAt(t,e,o){let s=this.elements;return hs.subVectors(t,e),hs.lengthSq()===0&&(hs.z=1),hs.normalize(),Gu.crossVectors(o,hs),Gu.lengthSq()===0&&(Math.abs(o.z)===1?hs.x+=1e-4:hs.z+=1e-4,hs.normalize(),Gu.crossVectors(o,hs)),Gu.normalize(),id.crossVectors(hs,Gu),s[0]=Gu.x,s[4]=id.x,s[8]=hs.x,s[1]=Gu.y,s[5]=id.y,s[9]=hs.y,s[2]=Gu.z,s[6]=id.z,s[10]=hs.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let o=t.elements,s=e.elements,l=this.elements,p=o[0],h=o[4],g=o[8],m=o[12],_=o[1],w=o[5],S=o[9],b=o[13],C=o[2],R=o[6],x=o[10],E=o[14],I=o[3],A=o[7],F=o[11],V=o[15],X=s[0],q=s[4],D=s[8],xt=s[12],B=s[1],j=s[5],K=s[9],Dt=s[13],Q=s[2],At=s[6],Mt=s[10],Lt=s[14],pt=s[3],yt=s[7],J=s[11],Bt=s[15];return l[0]=p*X+h*B+g*Q+m*pt,l[4]=p*q+h*j+g*At+m*yt,l[8]=p*D+h*K+g*Mt+m*J,l[12]=p*xt+h*Dt+g*Lt+m*Bt,l[1]=_*X+w*B+S*Q+b*pt,l[5]=_*q+w*j+S*At+b*yt,l[9]=_*D+w*K+S*Mt+b*J,l[13]=_*xt+w*Dt+S*Lt+b*Bt,l[2]=C*X+R*B+x*Q+E*pt,l[6]=C*q+R*j+x*At+E*yt,l[10]=C*D+R*K+x*Mt+E*J,l[14]=C*xt+R*Dt+x*Lt+E*Bt,l[3]=I*X+A*B+F*Q+V*pt,l[7]=I*q+A*j+F*At+V*yt,l[11]=I*D+A*K+F*Mt+V*J,l[15]=I*xt+A*Dt+F*Lt+V*Bt,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],o=t[4],s=t[8],l=t[12],p=t[1],h=t[5],g=t[9],m=t[13],_=t[2],w=t[6],S=t[10],b=t[14],C=t[3],R=t[7],x=t[11],E=t[15];return C*(+l*g*w-s*m*w-l*h*S+o*m*S+s*h*b-o*g*b)+R*(+e*g*b-e*m*S+l*p*S-s*p*b+s*m*_-l*g*_)+x*(+e*m*w-e*h*b-l*p*w+o*p*b+l*h*_-o*m*_)+E*(-s*h*_-e*g*w+e*h*S+s*p*w-o*p*S+o*g*_)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,o){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=o),this}invert(){let t=this.elements,e=t[0],o=t[1],s=t[2],l=t[3],p=t[4],h=t[5],g=t[6],m=t[7],_=t[8],w=t[9],S=t[10],b=t[11],C=t[12],R=t[13],x=t[14],E=t[15],I=w*x*m-R*S*m+R*g*b-h*x*b-w*g*E+h*S*E,A=C*S*m-_*x*m-C*g*b+p*x*b+_*g*E-p*S*E,F=_*R*m-C*w*m+C*h*b-p*R*b-_*h*E+p*w*E,V=C*w*g-_*R*g-C*h*S+p*R*S+_*h*x-p*w*x,X=e*I+o*A+s*F+l*V;if(X===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let q=1/X;return t[0]=I*q,t[1]=(R*S*l-w*x*l-R*s*b+o*x*b+w*s*E-o*S*E)*q,t[2]=(h*x*l-R*g*l+R*s*m-o*x*m-h*s*E+o*g*E)*q,t[3]=(w*g*l-h*S*l-w*s*m+o*S*m+h*s*b-o*g*b)*q,t[4]=A*q,t[5]=(_*x*l-C*S*l+C*s*b-e*x*b-_*s*E+e*S*E)*q,t[6]=(C*g*l-p*x*l-C*s*m+e*x*m+p*s*E-e*g*E)*q,t[7]=(p*S*l-_*g*l+_*s*m-e*S*m-p*s*b+e*g*b)*q,t[8]=F*q,t[9]=(C*w*l-_*R*l-C*o*b+e*R*b+_*o*E-e*w*E)*q,t[10]=(p*R*l-C*h*l+C*o*m-e*R*m-p*o*E+e*h*E)*q,t[11]=(_*h*l-p*w*l-_*o*m+e*w*m+p*o*b-e*h*b)*q,t[12]=V*q,t[13]=(_*R*s-C*w*s+C*o*S-e*R*S-_*o*x+e*w*x)*q,t[14]=(C*h*s-p*R*s-C*o*g+e*R*g+p*o*x-e*h*x)*q,t[15]=(p*w*s-_*h*s+_*o*g-e*w*g-p*o*S+e*h*S)*q,this}scale(t){let e=this.elements,o=t.x,s=t.y,l=t.z;return e[0]*=o,e[4]*=s,e[8]*=l,e[1]*=o,e[5]*=s,e[9]*=l,e[2]*=o,e[6]*=s,e[10]*=l,e[3]*=o,e[7]*=s,e[11]*=l,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],o=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,o,s))}makeTranslation(t,e,o){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,o,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),o=Math.sin(t);return this.set(1,0,0,0,0,e,-o,0,0,o,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,0,o,0,0,1,0,0,-o,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),o=Math.sin(t);return this.set(e,-o,0,0,o,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let o=Math.cos(e),s=Math.sin(e),l=1-o,p=t.x,h=t.y,g=t.z,m=l*p,_=l*h;return this.set(m*p+o,m*h-s*g,m*g+s*h,0,m*h+s*g,_*h+o,_*g-s*p,0,m*g-s*h,_*g+s*p,l*g*g+o,0,0,0,0,1),this}makeScale(t,e,o){return this.set(t,0,0,0,0,e,0,0,0,0,o,0,0,0,0,1),this}makeShear(t,e,o,s,l,p){return this.set(1,o,l,0,t,1,p,0,e,s,1,0,0,0,0,1),this}compose(t,e,o){let s=this.elements,l=e._x,p=e._y,h=e._z,g=e._w,m=l+l,_=p+p,w=h+h,S=l*m,b=l*_,C=l*w,R=p*_,x=p*w,E=h*w,I=g*m,A=g*_,F=g*w,V=o.x,X=o.y,q=o.z;return s[0]=(1-(R+E))*V,s[1]=(b+F)*V,s[2]=(C-A)*V,s[3]=0,s[4]=(b-F)*X,s[5]=(1-(S+E))*X,s[6]=(x+I)*X,s[7]=0,s[8]=(C+A)*q,s[9]=(x-I)*q,s[10]=(1-(S+R))*q,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,o){let s=this.elements,l=wc.set(s[0],s[1],s[2]).length(),p=wc.set(s[4],s[5],s[6]).length(),h=wc.set(s[8],s[9],s[10]).length();this.determinant()<0&&(l=-l),t.x=s[12],t.y=s[13],t.z=s[14],js.copy(this);let m=1/l,_=1/p,w=1/h;return js.elements[0]*=m,js.elements[1]*=m,js.elements[2]*=m,js.elements[4]*=_,js.elements[5]*=_,js.elements[6]*=_,js.elements[8]*=w,js.elements[9]*=w,js.elements[10]*=w,e.setFromRotationMatrix(js),o.x=l,o.y=p,o.z=h,this}makePerspective(t,e,o,s,l,p,h=hu){let g=this.elements,m=2*l/(e-t),_=2*l/(o-s),w=(e+t)/(e-t),S=(o+s)/(o-s),b,C;if(h===hu)b=-(p+l)/(p-l),C=-2*p*l/(p-l);else if(h===Pd)b=-p/(p-l),C=-p*l/(p-l);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return g[0]=m,g[4]=0,g[8]=w,g[12]=0,g[1]=0,g[5]=_,g[9]=S,g[13]=0,g[2]=0,g[6]=0,g[10]=b,g[14]=C,g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this}makeOrthographic(t,e,o,s,l,p,h=hu){let g=this.elements,m=1/(e-t),_=1/(o-s),w=1/(p-l),S=(e+t)*m,b=(o+s)*_,C,R;if(h===hu)C=(p+l)*w,R=-2*w;else if(h===Pd)C=l*w,R=-1*w;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return g[0]=2*m,g[4]=0,g[8]=0,g[12]=-S,g[1]=0,g[5]=2*_,g[9]=0,g[13]=-b,g[2]=0,g[6]=0,g[10]=R,g[14]=-C,g[3]=0,g[7]=0,g[11]=0,g[15]=1,this}equals(t){let e=this.elements,o=t.elements;for(let s=0;s<16;s++)if(e[s]!==o[s])return!1;return!0}fromArray(t,e=0){for(let o=0;o<16;o++)this.elements[o]=t[o+e];return this}toArray(t=[],e=0){let o=this.elements;return t[e]=o[0],t[e+1]=o[1],t[e+2]=o[2],t[e+3]=o[3],t[e+4]=o[4],t[e+5]=o[5],t[e+6]=o[6],t[e+7]=o[7],t[e+8]=o[8],t[e+9]=o[9],t[e+10]=o[10],t[e+11]=o[11],t[e+12]=o[12],t[e+13]=o[13],t[e+14]=o[14],t[e+15]=o[15],t}},wc=new Pt,js=new vi,w6=new Pt(0,0,0),S6=new Pt(1,1,1),Gu=new Pt,id=new Pt,hs=new Pt,wT=new vi,ST=new ju,Ul=class n{constructor(t=0,e=0,o=0,s=n.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=o,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,o,s=this._order){return this._x=t,this._y=e,this._z=o,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,o=!0){let s=t.elements,l=s[0],p=s[4],h=s[8],g=s[1],m=s[5],_=s[9],w=s[2],S=s[6],b=s[10];switch(e){case"XYZ":this._y=Math.asin(Yo(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-_,b),this._z=Math.atan2(-p,l)):(this._x=Math.atan2(S,m),this._z=0);break;case"YXZ":this._x=Math.asin(-Yo(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(h,b),this._z=Math.atan2(g,m)):(this._y=Math.atan2(-w,l),this._z=0);break;case"ZXY":this._x=Math.asin(Yo(S,-1,1)),Math.abs(S)<.9999999?(this._y=Math.atan2(-w,b),this._z=Math.atan2(-p,m)):(this._y=0,this._z=Math.atan2(g,l));break;case"ZYX":this._y=Math.asin(-Yo(w,-1,1)),Math.abs(w)<.9999999?(this._x=Math.atan2(S,b),this._z=Math.atan2(g,l)):(this._x=0,this._z=Math.atan2(-p,m));break;case"YZX":this._z=Math.asin(Yo(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(-_,m),this._y=Math.atan2(-w,l)):(this._x=0,this._y=Math.atan2(h,b));break;case"XZY":this._z=Math.asin(-Yo(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(S,m),this._y=Math.atan2(h,l)):(this._x=Math.atan2(-_,b),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,o===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,o){return wT.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wT,e,o)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ST.setFromEuler(this),this.setFromQuaternion(ST,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ul.DEFAULT_ORDER="XYZ";var Od=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},M6=0,MT=new Pt,Sc=new ju,ou=new vi,od=new Pt,th=new Pt,b6=new Pt,A6=new ju,bT=new Pt(1,0,0),AT=new Pt(0,1,0),TT=new Pt(0,0,1),T6={type:"added"},C6={type:"removed"},Cy={type:"childadded",child:null},Py={type:"childremoved",child:null},ra=class n extends Ju{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:M6++}),this.uuid=Zu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.DEFAULT_UP.clone();let t=new Pt,e=new Ul,o=new ju,s=new Pt(1,1,1);function l(){o.setFromEuler(e,!1)}function p(){e.setFromQuaternion(o,void 0,!1)}e._onChange(l),o._onChange(p),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:o},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new vi},normalMatrix:{value:new Je}}),this.matrix=new vi,this.matrixWorld=new vi,this.matrixAutoUpdate=n.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=n.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Od,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Sc.setFromAxisAngle(t,e),this.quaternion.multiply(Sc),this}rotateOnWorldAxis(t,e){return Sc.setFromAxisAngle(t,e),this.quaternion.premultiply(Sc),this}rotateX(t){return this.rotateOnAxis(bT,t)}rotateY(t){return this.rotateOnAxis(AT,t)}rotateZ(t){return this.rotateOnAxis(TT,t)}translateOnAxis(t,e){return MT.copy(t).applyQuaternion(this.quaternion),this.position.add(MT.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bT,t)}translateY(t){return this.translateOnAxis(AT,t)}translateZ(t){return this.translateOnAxis(TT,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ou.copy(this.matrixWorld).invert())}lookAt(t,e,o){t.isVector3?od.copy(t):od.set(t,e,o);let s=this.parent;this.updateWorldMatrix(!0,!1),th.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ou.lookAt(th,od,this.up):ou.lookAt(od,th,this.up),this.quaternion.setFromRotationMatrix(ou),s&&(ou.extractRotation(s.matrixWorld),Sc.setFromRotationMatrix(ou),this.quaternion.premultiply(Sc.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(T6),Cy.child=t,this.dispatchEvent(Cy),Cy.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let o=0;o<arguments.length;o++)this.remove(arguments[o]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(C6),Py.child=t,this.dispatchEvent(Py),Py.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),ou.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ou.multiply(t.parent.matrixWorld)),t.applyMatrix4(ou),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let o=0,s=this.children.length;o<s;o++){let p=this.children[o].getObjectByProperty(t,e);if(p!==void 0)return p}}getObjectsByProperty(t,e,o=[]){this[t]===e&&o.push(this);let s=this.children;for(let l=0,p=s.length;l<p;l++)s[l].getObjectsByProperty(t,e,o);return o}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(th,t,b6),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(th,A6,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let o=0,s=e.length;o<s;o++)e[o].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let o=0,s=e.length;o<s;o++)e[o].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let o=0,s=e.length;o<s;o++){let l=e[o];(l.matrixWorldAutoUpdate===!0||t===!0)&&l.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let o=this.parent;if(t===!0&&o!==null&&o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let s=this.children;for(let l=0,p=s.length;l<p;l++){let h=s[l];h.matrixWorldAutoUpdate===!0&&h.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",o={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},o.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(h=>({boxInitialized:h.boxInitialized,boxMin:h.box.min.toArray(),boxMax:h.box.max.toArray(),sphereInitialized:h.sphereInitialized,sphereRadius:h.sphere.radius,sphereCenter:h.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function l(h,g){return h[g.uuid]===void 0&&(h[g.uuid]=g.toJSON(t)),g.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=l(t.geometries,this.geometry);let h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){let g=h.shapes;if(Array.isArray(g))for(let m=0,_=g.length;m<_;m++){let w=g[m];l(t.shapes,w)}else l(t.shapes,g)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(l(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let h=[];for(let g=0,m=this.material.length;g<m;g++)h.push(l(t.materials,this.material[g]));s.material=h}else s.material=l(t.materials,this.material);if(this.children.length>0){s.children=[];for(let h=0;h<this.children.length;h++)s.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let h=0;h<this.animations.length;h++){let g=this.animations[h];s.animations.push(l(t.animations,g))}}if(e){let h=p(t.geometries),g=p(t.materials),m=p(t.textures),_=p(t.images),w=p(t.shapes),S=p(t.skeletons),b=p(t.animations),C=p(t.nodes);h.length>0&&(o.geometries=h),g.length>0&&(o.materials=g),m.length>0&&(o.textures=m),_.length>0&&(o.images=_),w.length>0&&(o.shapes=w),S.length>0&&(o.skeletons=S),b.length>0&&(o.animations=b),C.length>0&&(o.nodes=C)}return o.object=s,o;function p(h){let g=[];for(let m in h){let _=h[m];delete _.metadata,g.push(_)}return g}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let o=0;o<t.children.length;o++){let s=t.children[o];this.add(s.clone())}return this}};ra.DEFAULT_UP=new Pt(0,1,0);ra.DEFAULT_MATRIX_AUTO_UPDATE=!0;ra.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Qs=new Pt,su=new Pt,Iy=new Pt,au=new Pt,Mc=new Pt,bc=new Pt,CT=new Pt,Ry=new Pt,Ly=new Pt,Ny=new Pt,Nl=class n{constructor(t=new Pt,e=new Pt,o=new Pt){this.a=t,this.b=e,this.c=o}static getNormal(t,e,o,s){s.subVectors(o,e),Qs.subVectors(t,e),s.cross(Qs);let l=s.lengthSq();return l>0?s.multiplyScalar(1/Math.sqrt(l)):s.set(0,0,0)}static getBarycoord(t,e,o,s,l){Qs.subVectors(s,e),su.subVectors(o,e),Iy.subVectors(t,e);let p=Qs.dot(Qs),h=Qs.dot(su),g=Qs.dot(Iy),m=su.dot(su),_=su.dot(Iy),w=p*m-h*h;if(w===0)return l.set(0,0,0),null;let S=1/w,b=(m*g-h*_)*S,C=(p*_-h*g)*S;return l.set(1-b-C,C,b)}static containsPoint(t,e,o,s){return this.getBarycoord(t,e,o,s,au)===null?!1:au.x>=0&&au.y>=0&&au.x+au.y<=1}static getInterpolation(t,e,o,s,l,p,h,g){return this.getBarycoord(t,e,o,s,au)===null?(g.x=0,g.y=0,"z"in g&&(g.z=0),"w"in g&&(g.w=0),null):(g.setScalar(0),g.addScaledVector(l,au.x),g.addScaledVector(p,au.y),g.addScaledVector(h,au.z),g)}static isFrontFacing(t,e,o,s){return Qs.subVectors(o,e),su.subVectors(t,e),Qs.cross(su).dot(s)<0}set(t,e,o){return this.a.copy(t),this.b.copy(e),this.c.copy(o),this}setFromPointsAndIndices(t,e,o,s){return this.a.copy(t[e]),this.b.copy(t[o]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,o,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,o),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Qs.subVectors(this.c,this.b),su.subVectors(this.a,this.b),Qs.cross(su).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return n.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return n.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,o,s,l){return n.getInterpolation(t,this.a,this.b,this.c,e,o,s,l)}containsPoint(t){return n.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return n.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let o=this.a,s=this.b,l=this.c,p,h;Mc.subVectors(s,o),bc.subVectors(l,o),Ry.subVectors(t,o);let g=Mc.dot(Ry),m=bc.dot(Ry);if(g<=0&&m<=0)return e.copy(o);Ly.subVectors(t,s);let _=Mc.dot(Ly),w=bc.dot(Ly);if(_>=0&&w<=_)return e.copy(s);let S=g*w-_*m;if(S<=0&&g>=0&&_<=0)return p=g/(g-_),e.copy(o).addScaledVector(Mc,p);Ny.subVectors(t,l);let b=Mc.dot(Ny),C=bc.dot(Ny);if(C>=0&&b<=C)return e.copy(l);let R=b*m-g*C;if(R<=0&&m>=0&&C<=0)return h=m/(m-C),e.copy(o).addScaledVector(bc,h);let x=_*C-b*w;if(x<=0&&w-_>=0&&b-C>=0)return CT.subVectors(l,s),h=(w-_)/(w-_+(b-C)),e.copy(s).addScaledVector(CT,h);let E=1/(x+R+S);return p=R*E,h=S*E,e.copy(o).addScaledVector(Mc,p).addScaledVector(bc,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},vC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ku={h:0,s:0,l:0},sd={h:0,s:0,l:0};function Oy(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}var ar=class{constructor(t,e,o){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,o)}set(t,e,o){if(e===void 0&&o===void 0){let s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,o);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ba){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,xr.toWorkingColorSpace(this,e),this}setRGB(t,e,o,s=xr.workingColorSpace){return this.r=t,this.g=e,this.b=o,xr.toWorkingColorSpace(this,s),this}setHSL(t,e,o,s=xr.workingColorSpace){if(t=m6(t,1),e=Yo(e,0,1),o=Yo(o,0,1),e===0)this.r=this.g=this.b=o;else{let l=o<=.5?o*(1+e):o+e-o*e,p=2*o-l;this.r=Oy(p,l,t+1/3),this.g=Oy(p,l,t),this.b=Oy(p,l,t-1/3)}return xr.toWorkingColorSpace(this,s),this}setStyle(t,e=ba){function o(l){l!==void 0&&parseFloat(l)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let l,p=s[1],h=s[2];switch(p){case"rgb":case"rgba":if(l=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setRGB(Math.min(255,parseInt(l[1],10))/255,Math.min(255,parseInt(l[2],10))/255,Math.min(255,parseInt(l[3],10))/255,e);if(l=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setRGB(Math.min(100,parseInt(l[1],10))/100,Math.min(100,parseInt(l[2],10))/100,Math.min(100,parseInt(l[3],10))/100,e);break;case"hsl":case"hsla":if(l=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return o(l[4]),this.setHSL(parseFloat(l[1])/360,parseFloat(l[2])/100,parseFloat(l[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let l=s[1],p=l.length;if(p===3)return this.setRGB(parseInt(l.charAt(0),16)/15,parseInt(l.charAt(1),16)/15,parseInt(l.charAt(2),16)/15,e);if(p===6)return this.setHex(parseInt(l,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=ba){let o=vC[t.toLowerCase()];return o!==void 0?this.setHex(o,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Gc(t.r),this.g=Gc(t.g),this.b=Gc(t.b),this}copyLinearToSRGB(t){return this.r=xy(t.r),this.g=xy(t.g),this.b=xy(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ba){return xr.fromWorkingColorSpace(uo.copy(this),t),Math.round(Yo(uo.r*255,0,255))*65536+Math.round(Yo(uo.g*255,0,255))*256+Math.round(Yo(uo.b*255,0,255))}getHexString(t=ba){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=xr.workingColorSpace){xr.fromWorkingColorSpace(uo.copy(this),e);let o=uo.r,s=uo.g,l=uo.b,p=Math.max(o,s,l),h=Math.min(o,s,l),g,m,_=(h+p)/2;if(h===p)g=0,m=0;else{let w=p-h;switch(m=_<=.5?w/(p+h):w/(2-p-h),p){case o:g=(s-l)/w+(s<l?6:0);break;case s:g=(l-o)/w+2;break;case l:g=(o-s)/w+4;break}g/=6}return t.h=g,t.s=m,t.l=_,t}getRGB(t,e=xr.workingColorSpace){return xr.fromWorkingColorSpace(uo.copy(this),e),t.r=uo.r,t.g=uo.g,t.b=uo.b,t}getStyle(t=ba){xr.fromWorkingColorSpace(uo.copy(this),t);let e=uo.r,o=uo.g,s=uo.b;return t!==ba?`color(${t} ${e.toFixed(3)} ${o.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(o*255)},${Math.round(s*255)})`}offsetHSL(t,e,o){return this.getHSL(ku),this.setHSL(ku.h+t,ku.s+e,ku.l+o)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,o){return this.r=t.r+(e.r-t.r)*o,this.g=t.g+(e.g-t.g)*o,this.b=t.b+(e.b-t.b)*o,this}lerpHSL(t,e){this.getHSL(ku),t.getHSL(sd);let o=vy(ku.h,sd.h,e),s=vy(ku.s,sd.s,e),l=vy(ku.l,sd.l,e);return this.setHSL(o,s,l),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,o=this.g,s=this.b,l=t.elements;return this.r=l[0]*e+l[3]*o+l[6]*s,this.g=l[1]*e+l[4]*o+l[7]*s,this.b=l[2]*e+l[5]*o+l[8]*s,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},uo=new ar;ar.NAMES=vC;var P6=0,Bl=class extends Ju{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:P6++}),this.uuid=Zu(),this.name="",this.type="Material",this.blending=zc,this.side=Ku,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vy,this.blendDst=Wy,this.blendEquation=Il,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ar(0,0,0),this.blendAlpha=0,this.depthFunc=Sd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=gT,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yc,this.stencilZFail=yc,this.stencilZPass=yc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let o=t[e];if(o===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(o):s&&s.isVector3&&o&&o.isVector3?s.copy(o):this[e]=o}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let o={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.color&&this.color.isColor&&(o.color=this.color.getHex()),this.roughness!==void 0&&(o.roughness=this.roughness),this.metalness!==void 0&&(o.metalness=this.metalness),this.sheen!==void 0&&(o.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(o.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(o.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(o.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(o.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(o.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(o.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(o.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(o.shininess=this.shininess),this.clearcoat!==void 0&&(o.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(o.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(o.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(o.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(o.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,o.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(o.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(o.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(o.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(o.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(o.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(o.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(o.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(o.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(o.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(o.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(o.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(o.lightMap=this.lightMap.toJSON(t).uuid,o.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(o.aoMap=this.aoMap.toJSON(t).uuid,o.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(o.bumpMap=this.bumpMap.toJSON(t).uuid,o.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(o.normalMap=this.normalMap.toJSON(t).uuid,o.normalMapType=this.normalMapType,o.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(o.displacementMap=this.displacementMap.toJSON(t).uuid,o.displacementScale=this.displacementScale,o.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(o.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(o.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(o.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(o.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(o.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(o.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(o.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(o.combine=this.combine)),this.envMapRotation!==void 0&&(o.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(o.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(o.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(o.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(o.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(o.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(o.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(o.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(o.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(o.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(o.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(o.size=this.size),this.shadowSide!==null&&(o.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(o.sizeAttenuation=this.sizeAttenuation),this.blending!==zc&&(o.blending=this.blending),this.side!==Ku&&(o.side=this.side),this.vertexColors===!0&&(o.vertexColors=!0),this.opacity<1&&(o.opacity=this.opacity),this.transparent===!0&&(o.transparent=!0),this.blendSrc!==Vy&&(o.blendSrc=this.blendSrc),this.blendDst!==Wy&&(o.blendDst=this.blendDst),this.blendEquation!==Il&&(o.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(o.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(o.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(o.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(o.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(o.blendAlpha=this.blendAlpha),this.depthFunc!==Sd&&(o.depthFunc=this.depthFunc),this.depthTest===!1&&(o.depthTest=this.depthTest),this.depthWrite===!1&&(o.depthWrite=this.depthWrite),this.colorWrite===!1&&(o.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(o.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==gT&&(o.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(o.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(o.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yc&&(o.stencilFail=this.stencilFail),this.stencilZFail!==yc&&(o.stencilZFail=this.stencilZFail),this.stencilZPass!==yc&&(o.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(o.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(o.rotation=this.rotation),this.polygonOffset===!0&&(o.polygonOffset=!0),this.polygonOffsetFactor!==0&&(o.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(o.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(o.linewidth=this.linewidth),this.dashSize!==void 0&&(o.dashSize=this.dashSize),this.gapSize!==void 0&&(o.gapSize=this.gapSize),this.scale!==void 0&&(o.scale=this.scale),this.dithering===!0&&(o.dithering=!0),this.alphaTest>0&&(o.alphaTest=this.alphaTest),this.alphaHash===!0&&(o.alphaHash=!0),this.alphaToCoverage===!0&&(o.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(o.premultipliedAlpha=!0),this.forceSinglePass===!0&&(o.forceSinglePass=!0),this.wireframe===!0&&(o.wireframe=!0),this.wireframeLinewidth>1&&(o.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(o.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(o.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(o.flatShading=!0),this.visible===!1&&(o.visible=!1),this.toneMapped===!1&&(o.toneMapped=!1),this.fog===!1&&(o.fog=!1),Object.keys(this.userData).length>0&&(o.userData=this.userData);function s(l){let p=[];for(let h in l){let g=l[h];delete g.metadata,p.push(g)}return p}if(e){let l=s(t.textures),p=s(t.images);l.length>0&&(o.textures=l),p.length>0&&(o.images=p)}return o}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,o=null;if(e!==null){let s=e.length;o=new Array(s);for(let l=0;l!==s;++l)o[l]=e[l].clone()}return this.clippingPlanes=o,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Dd=class extends Bl{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ar(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ul,this.combine=sC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var hi=new Pt,ad=new ze,gs=class{constructor(t,e,o=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=o,this.usage=Ky,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=fu,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,o){t*=this.itemSize,o*=e.itemSize;for(let s=0,l=this.itemSize;s<l;s++)this.array[t+s]=e.array[o+s];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,o=this.count;e<o;e++)ad.fromBufferAttribute(this,e),ad.applyMatrix3(t),this.setXY(e,ad.x,ad.y);else if(this.itemSize===3)for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyMatrix3(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}applyMatrix4(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyMatrix4(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.applyNormalMatrix(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)hi.fromBufferAttribute(this,e),hi.transformDirection(t),this.setXYZ(e,hi.x,hi.y,hi.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let o=this.array[t*this.itemSize+e];return this.normalized&&(o=Ta(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.array[t*this.itemSize+e]=o,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ta(e,this.array)),e}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ta(e,this.array)),e}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ta(e,this.array)),e}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ta(e,this.array)),e}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,o){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.array[t+0]=e,this.array[t+1]=o,this}setXYZ(t,e,o,s){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.array[t+0]=e,this.array[t+1]=o,this.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t*=this.itemSize,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.array[t+0]=e,this.array[t+1]=o,this.array[t+2]=s,this.array[t+3]=l,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Ky&&(t.usage=this.usage),t}};var Fd=class extends gs{constructor(t,e,o){super(new Uint16Array(t),e,o)}};var Ud=class extends gs{constructor(t,e,o){super(new Uint32Array(t),e,o)}};var pu=class extends gs{constructor(t,e,o){super(new Float32Array(t),e,o)}},I6=0,Ds=new vi,Dy=new ra,Ac=new Pt,ps=new Fl,eh=new Fl,Bi=new Pt,Qu=class n extends Ju{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:I6++}),this.uuid=Zu(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(mC(t)?Ud:Fd)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,o=0){this.groups.push({start:t,count:e,materialIndex:o})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let o=this.attributes.normal;if(o!==void 0){let l=new Je().getNormalMatrix(t);o.applyNormalMatrix(l),o.needsUpdate=!0}let s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(t),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ds.makeRotationFromQuaternion(t),this.applyMatrix4(Ds),this}rotateX(t){return Ds.makeRotationX(t),this.applyMatrix4(Ds),this}rotateY(t){return Ds.makeRotationY(t),this.applyMatrix4(Ds),this}rotateZ(t){return Ds.makeRotationZ(t),this.applyMatrix4(Ds),this}translate(t,e,o){return Ds.makeTranslation(t,e,o),this.applyMatrix4(Ds),this}scale(t,e,o){return Ds.makeScale(t,e,o),this.applyMatrix4(Ds),this}lookAt(t){return Dy.lookAt(t),Dy.updateMatrix(),this.applyMatrix4(Dy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ac).negate(),this.translate(Ac.x,Ac.y,Ac.z),this}setFromPoints(t){let e=[];for(let o=0,s=t.length;o<s;o++){let l=t[o];e.push(l.x,l.y,l.z||0)}return this.setAttribute("position",new pu(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fl);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Pt(-1/0,-1/0,-1/0),new Pt(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let o=0,s=e.length;o<s;o++){let l=e[o];ps.setFromBufferAttribute(l),this.morphTargetsRelative?(Bi.addVectors(this.boundingBox.min,ps.min),this.boundingBox.expandByPoint(Bi),Bi.addVectors(this.boundingBox.max,ps.max),this.boundingBox.expandByPoint(Bi)):(this.boundingBox.expandByPoint(ps.min),this.boundingBox.expandByPoint(ps.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ah);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Pt,1/0);return}if(t){let o=this.boundingSphere.center;if(ps.setFromBufferAttribute(t),e)for(let l=0,p=e.length;l<p;l++){let h=e[l];eh.setFromBufferAttribute(h),this.morphTargetsRelative?(Bi.addVectors(ps.min,eh.min),ps.expandByPoint(Bi),Bi.addVectors(ps.max,eh.max),ps.expandByPoint(Bi)):(ps.expandByPoint(eh.min),ps.expandByPoint(eh.max))}ps.getCenter(o);let s=0;for(let l=0,p=t.count;l<p;l++)Bi.fromBufferAttribute(t,l),s=Math.max(s,o.distanceToSquared(Bi));if(e)for(let l=0,p=e.length;l<p;l++){let h=e[l],g=this.morphTargetsRelative;for(let m=0,_=h.count;m<_;m++)Bi.fromBufferAttribute(h,m),g&&(Ac.fromBufferAttribute(t,m),Bi.add(Ac)),s=Math.max(s,o.distanceToSquared(Bi))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let o=e.position,s=e.normal,l=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new gs(new Float32Array(4*o.count),4));let p=this.getAttribute("tangent"),h=[],g=[];for(let D=0;D<o.count;D++)h[D]=new Pt,g[D]=new Pt;let m=new Pt,_=new Pt,w=new Pt,S=new ze,b=new ze,C=new ze,R=new Pt,x=new Pt;function E(D,xt,B){m.fromBufferAttribute(o,D),_.fromBufferAttribute(o,xt),w.fromBufferAttribute(o,B),S.fromBufferAttribute(l,D),b.fromBufferAttribute(l,xt),C.fromBufferAttribute(l,B),_.sub(m),w.sub(m),b.sub(S),C.sub(S);let j=1/(b.x*C.y-C.x*b.y);isFinite(j)&&(R.copy(_).multiplyScalar(C.y).addScaledVector(w,-b.y).multiplyScalar(j),x.copy(w).multiplyScalar(b.x).addScaledVector(_,-C.x).multiplyScalar(j),h[D].add(R),h[xt].add(R),h[B].add(R),g[D].add(x),g[xt].add(x),g[B].add(x))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let D=0,xt=I.length;D<xt;++D){let B=I[D],j=B.start,K=B.count;for(let Dt=j,Q=j+K;Dt<Q;Dt+=3)E(t.getX(Dt+0),t.getX(Dt+1),t.getX(Dt+2))}let A=new Pt,F=new Pt,V=new Pt,X=new Pt;function q(D){V.fromBufferAttribute(s,D),X.copy(V);let xt=h[D];A.copy(xt),A.sub(V.multiplyScalar(V.dot(xt))).normalize(),F.crossVectors(X,xt);let j=F.dot(g[D])<0?-1:1;p.setXYZW(D,A.x,A.y,A.z,j)}for(let D=0,xt=I.length;D<xt;++D){let B=I[D],j=B.start,K=B.count;for(let Dt=j,Q=j+K;Dt<Q;Dt+=3)q(t.getX(Dt+0)),q(t.getX(Dt+1)),q(t.getX(Dt+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let o=this.getAttribute("normal");if(o===void 0)o=new gs(new Float32Array(e.count*3),3),this.setAttribute("normal",o);else for(let S=0,b=o.count;S<b;S++)o.setXYZ(S,0,0,0);let s=new Pt,l=new Pt,p=new Pt,h=new Pt,g=new Pt,m=new Pt,_=new Pt,w=new Pt;if(t)for(let S=0,b=t.count;S<b;S+=3){let C=t.getX(S+0),R=t.getX(S+1),x=t.getX(S+2);s.fromBufferAttribute(e,C),l.fromBufferAttribute(e,R),p.fromBufferAttribute(e,x),_.subVectors(p,l),w.subVectors(s,l),_.cross(w),h.fromBufferAttribute(o,C),g.fromBufferAttribute(o,R),m.fromBufferAttribute(o,x),h.add(_),g.add(_),m.add(_),o.setXYZ(C,h.x,h.y,h.z),o.setXYZ(R,g.x,g.y,g.z),o.setXYZ(x,m.x,m.y,m.z)}else for(let S=0,b=e.count;S<b;S+=3)s.fromBufferAttribute(e,S+0),l.fromBufferAttribute(e,S+1),p.fromBufferAttribute(e,S+2),_.subVectors(p,l),w.subVectors(s,l),_.cross(w),o.setXYZ(S+0,_.x,_.y,_.z),o.setXYZ(S+1,_.x,_.y,_.z),o.setXYZ(S+2,_.x,_.y,_.z);this.normalizeNormals(),o.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,o=t.count;e<o;e++)Bi.fromBufferAttribute(t,e),Bi.normalize(),t.setXYZ(e,Bi.x,Bi.y,Bi.z)}toNonIndexed(){function t(h,g){let m=h.array,_=h.itemSize,w=h.normalized,S=new m.constructor(g.length*_),b=0,C=0;for(let R=0,x=g.length;R<x;R++){h.isInterleavedBufferAttribute?b=g[R]*h.data.stride+h.offset:b=g[R]*_;for(let E=0;E<_;E++)S[C++]=m[b++]}return new gs(S,_,w)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new n,o=this.index.array,s=this.attributes;for(let h in s){let g=s[h],m=t(g,o);e.setAttribute(h,m)}let l=this.morphAttributes;for(let h in l){let g=[],m=l[h];for(let _=0,w=m.length;_<w;_++){let S=m[_],b=t(S,o);g.push(b)}e.morphAttributes[h]=g}e.morphTargetsRelative=this.morphTargetsRelative;let p=this.groups;for(let h=0,g=p.length;h<g;h++){let m=p[h];e.addGroup(m.start,m.count,m.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let g=this.parameters;for(let m in g)g[m]!==void 0&&(t[m]=g[m]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let o=this.attributes;for(let g in o){let m=o[g];t.data.attributes[g]=m.toJSON(t.data)}let s={},l=!1;for(let g in this.morphAttributes){let m=this.morphAttributes[g],_=[];for(let w=0,S=m.length;w<S;w++){let b=m[w];_.push(b.toJSON(t.data))}_.length>0&&(s[g]=_,l=!0)}l&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let p=this.groups;p.length>0&&(t.data.groups=JSON.parse(JSON.stringify(p)));let h=this.boundingSphere;return h!==null&&(t.data.boundingSphere={center:h.center.toArray(),radius:h.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let o=t.index;o!==null&&this.setIndex(o.clone(e));let s=t.attributes;for(let m in s){let _=s[m];this.setAttribute(m,_.clone(e))}let l=t.morphAttributes;for(let m in l){let _=[],w=l[m];for(let S=0,b=w.length;S<b;S++)_.push(w[S].clone(e));this.morphAttributes[m]=_}this.morphTargetsRelative=t.morphTargetsRelative;let p=t.groups;for(let m=0,_=p.length;m<_;m++){let w=p[m];this.addGroup(w.start,w.count,w.materialIndex)}let h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());let g=t.boundingSphere;return g!==null&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},PT=new vi,bl=new nv,ud=new ah,IT=new Pt,Tc=new Pt,Cc=new Pt,Pc=new Pt,Fy=new Pt,ld=new Pt,cd=new ze,fd=new ze,hd=new ze,RT=new Pt,LT=new Pt,NT=new Pt,pd=new Pt,dd=new Pt,na=class extends ra{constructor(t=new Qu,e=new Dd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,o=Object.keys(e);if(o.length>0){let s=e[o[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,p=s.length;l<p;l++){let h=s[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=l}}}}getVertexPosition(t,e){let o=this.geometry,s=o.attributes.position,l=o.morphAttributes.position,p=o.morphTargetsRelative;e.fromBufferAttribute(s,t);let h=this.morphTargetInfluences;if(l&&h){ld.set(0,0,0);for(let g=0,m=l.length;g<m;g++){let _=h[g],w=l[g];_!==0&&(Fy.fromBufferAttribute(w,t),p?ld.addScaledVector(Fy,_):ld.addScaledVector(Fy.sub(e),_))}e.add(ld)}return e}raycast(t,e){let o=this.geometry,s=this.material,l=this.matrixWorld;s!==void 0&&(o.boundingSphere===null&&o.computeBoundingSphere(),ud.copy(o.boundingSphere),ud.applyMatrix4(l),bl.copy(t.ray).recast(t.near),!(ud.containsPoint(bl.origin)===!1&&(bl.intersectSphere(ud,IT)===null||bl.origin.distanceToSquared(IT)>(t.far-t.near)**2))&&(PT.copy(l).invert(),bl.copy(t.ray).applyMatrix4(PT),!(o.boundingBox!==null&&bl.intersectsBox(o.boundingBox)===!1)&&this._computeIntersections(t,e,bl)))}_computeIntersections(t,e,o){let s,l=this.geometry,p=this.material,h=l.index,g=l.attributes.position,m=l.attributes.uv,_=l.attributes.uv1,w=l.attributes.normal,S=l.groups,b=l.drawRange;if(h!==null)if(Array.isArray(p))for(let C=0,R=S.length;C<R;C++){let x=S[C],E=p[x.materialIndex],I=Math.max(x.start,b.start),A=Math.min(h.count,Math.min(x.start+x.count,b.start+b.count));for(let F=I,V=A;F<V;F+=3){let X=h.getX(F),q=h.getX(F+1),D=h.getX(F+2);s=gd(this,E,t,o,m,_,w,X,q,D),s&&(s.faceIndex=Math.floor(F/3),s.face.materialIndex=x.materialIndex,e.push(s))}}else{let C=Math.max(0,b.start),R=Math.min(h.count,b.start+b.count);for(let x=C,E=R;x<E;x+=3){let I=h.getX(x),A=h.getX(x+1),F=h.getX(x+2);s=gd(this,p,t,o,m,_,w,I,A,F),s&&(s.faceIndex=Math.floor(x/3),e.push(s))}}else if(g!==void 0)if(Array.isArray(p))for(let C=0,R=S.length;C<R;C++){let x=S[C],E=p[x.materialIndex],I=Math.max(x.start,b.start),A=Math.min(g.count,Math.min(x.start+x.count,b.start+b.count));for(let F=I,V=A;F<V;F+=3){let X=F,q=F+1,D=F+2;s=gd(this,E,t,o,m,_,w,X,q,D),s&&(s.faceIndex=Math.floor(F/3),s.face.materialIndex=x.materialIndex,e.push(s))}}else{let C=Math.max(0,b.start),R=Math.min(g.count,b.start+b.count);for(let x=C,E=R;x<E;x+=3){let I=x,A=x+1,F=x+2;s=gd(this,p,t,o,m,_,w,I,A,F),s&&(s.faceIndex=Math.floor(x/3),e.push(s))}}}};function R6(n,t,e,o,s,l,p,h){let g;if(t.side===$o?g=o.intersectTriangle(p,l,s,!0,h):g=o.intersectTriangle(s,l,p,t.side===Ku,h),g===null)return null;dd.copy(h),dd.applyMatrix4(n.matrixWorld);let m=e.ray.origin.distanceTo(dd);return m<e.near||m>e.far?null:{distance:m,point:dd.clone(),object:n}}function gd(n,t,e,o,s,l,p,h,g,m){n.getVertexPosition(h,Tc),n.getVertexPosition(g,Cc),n.getVertexPosition(m,Pc);let _=R6(n,t,e,o,Tc,Cc,Pc,pd);if(_){s&&(cd.fromBufferAttribute(s,h),fd.fromBufferAttribute(s,g),hd.fromBufferAttribute(s,m),_.uv=Nl.getInterpolation(pd,Tc,Cc,Pc,cd,fd,hd,new ze)),l&&(cd.fromBufferAttribute(l,h),fd.fromBufferAttribute(l,g),hd.fromBufferAttribute(l,m),_.uv1=Nl.getInterpolation(pd,Tc,Cc,Pc,cd,fd,hd,new ze)),p&&(RT.fromBufferAttribute(p,h),LT.fromBufferAttribute(p,g),NT.fromBufferAttribute(p,m),_.normal=Nl.getInterpolation(pd,Tc,Cc,Pc,RT,LT,NT,new Pt),_.normal.dot(o.direction)>0&&_.normal.multiplyScalar(-1));let w={a:h,b:g,c:m,normal:new Pt,materialIndex:0};Nl.getNormal(Tc,Cc,Pc,w.normal),_.face=w}return _}var uh=class n extends Qu{constructor(t=1,e=1,o=1,s=1,l=1,p=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:o,widthSegments:s,heightSegments:l,depthSegments:p};let h=this;s=Math.floor(s),l=Math.floor(l),p=Math.floor(p);let g=[],m=[],_=[],w=[],S=0,b=0;C("z","y","x",-1,-1,o,e,t,p,l,0),C("z","y","x",1,-1,o,e,-t,p,l,1),C("x","z","y",1,1,t,o,e,s,p,2),C("x","z","y",1,-1,t,o,-e,s,p,3),C("x","y","z",1,-1,t,e,o,s,l,4),C("x","y","z",-1,-1,t,e,-o,s,l,5),this.setIndex(g),this.setAttribute("position",new pu(m,3)),this.setAttribute("normal",new pu(_,3)),this.setAttribute("uv",new pu(w,2));function C(R,x,E,I,A,F,V,X,q,D,xt){let B=F/q,j=V/D,K=F/2,Dt=V/2,Q=X/2,At=q+1,Mt=D+1,Lt=0,pt=0,yt=new Pt;for(let J=0;J<Mt;J++){let Bt=J*j-Dt;for(let Gt=0;Gt<At;Gt++){let ae=Gt*B-K;yt[R]=ae*I,yt[x]=Bt*A,yt[E]=Q,m.push(yt.x,yt.y,yt.z),yt[R]=0,yt[x]=0,yt[E]=X>0?1:-1,_.push(yt.x,yt.y,yt.z),w.push(Gt/q),w.push(1-J/D),Lt+=1}}for(let J=0;J<D;J++)for(let Bt=0;Bt<q;Bt++){let Gt=S+Bt+At*J,ae=S+Bt+At*(J+1),ut=S+(Bt+1)+At*(J+1),Ut=S+(Bt+1)+At*J;g.push(Gt,ae,Ut),g.push(ae,ut,Ut),pt+=6}h.addGroup(b,pt,xt),b+=pt,S+=Lt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new n(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Wc(n){let t={};for(let e in n){t[e]={};for(let o in n[e]){let s=n[e][o];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][o]=null):t[e][o]=s.clone():Array.isArray(s)?t[e][o]=s.slice():t[e][o]=s}}return t}function So(n){let t={};for(let e=0;e<n.length;e++){let o=Wc(n[e]);for(let s in o)t[s]=o[s]}return t}function L6(n){let t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function _C(n){return n.getRenderTarget()===null?n.outputColorSpace:xr.workingColorSpace}var N6={clone:Wc,merge:So},O6=`void main() {
|
|
27
27
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
28
28
|
}`,D6=`void main() {
|
|
29
29
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -62,7 +62,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
62
62
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
63
63
|
|
|
64
64
|
}
|
|
65
|
-
`},s=new uh(5,5,5),l=new Ca({name:"CubemapFromEquirect",uniforms:Wc(o.uniforms),vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,side:$o,blending:Xu});l.uniforms.tEquirect.value=e;let p=new na(s,l),h=e.minFilter;return e.minFilter===Ll&&(e.minFilter=Xo),new rv(1,10,this).update(t,p),e.minFilter=h,p.geometry.dispose(),p.material.dispose(),this}clear(t,e,o,s){let l=t.getRenderTarget();for(let p=0;p<6;p++)t.setRenderTarget(this,p),t.clear(e,o,s);t.setRenderTarget(l)}},Uy=new Pt,F6=new Pt,U6=new
|
|
65
|
+
`},s=new uh(5,5,5),l=new Ca({name:"CubemapFromEquirect",uniforms:Wc(o.uniforms),vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,side:$o,blending:Xu});l.uniforms.tEquirect.value=e;let p=new na(s,l),h=e.minFilter;return e.minFilter===Ll&&(e.minFilter=Xo),new rv(1,10,this).update(t,p),e.minFilter=h,p.geometry.dispose(),p.material.dispose(),this}clear(t,e,o,s){let l=t.getRenderTarget();for(let p=0;p<6;p++)t.setRenderTarget(this,p),t.clear(e,o,s);t.setRenderTarget(l)}},Uy=new Pt,F6=new Pt,U6=new Je,lu=class{constructor(t=new Pt(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,o,s){return this.normal.set(t,e,o),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,o){let s=Uy.subVectors(o,e).cross(F6.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let o=t.delta(Uy),s=this.normal.dot(o);if(s===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let l=-(t.start.dot(this.normal)+this.constant)/s;return l<0||l>1?null:e.copy(t.start).addScaledVector(o,l)}intersectsLine(t){let e=this.distanceToPoint(t.start),o=this.distanceToPoint(t.end);return e<0&&o>0||o<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let o=e||U6.getNormalMatrix(t),s=this.coplanarPoint(Uy).applyMatrix4(t),l=this.normal.applyMatrix3(o).normalize();return this.constant=-s.dot(l),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Al=new ah,md=new Pt,Gd=class{constructor(t=new lu,e=new lu,o=new lu,s=new lu,l=new lu,p=new lu){this.planes=[t,e,o,s,l,p]}set(t,e,o,s,l,p){let h=this.planes;return h[0].copy(t),h[1].copy(e),h[2].copy(o),h[3].copy(s),h[4].copy(l),h[5].copy(p),this}copy(t){let e=this.planes;for(let o=0;o<6;o++)e[o].copy(t.planes[o]);return this}setFromProjectionMatrix(t,e=hu){let o=this.planes,s=t.elements,l=s[0],p=s[1],h=s[2],g=s[3],m=s[4],_=s[5],w=s[6],S=s[7],b=s[8],C=s[9],R=s[10],x=s[11],E=s[12],I=s[13],A=s[14],F=s[15];if(o[0].setComponents(g-l,S-m,x-b,F-E).normalize(),o[1].setComponents(g+l,S+m,x+b,F+E).normalize(),o[2].setComponents(g+p,S+_,x+C,F+I).normalize(),o[3].setComponents(g-p,S-_,x-C,F-I).normalize(),o[4].setComponents(g-h,S-w,x-R,F-A).normalize(),e===hu)o[5].setComponents(g+h,S+w,x+R,F+A).normalize();else if(e===Pd)o[5].setComponents(h,w,R,A).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Al.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Al.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Al)}intersectsSprite(t){return Al.center.set(0,0,0),Al.radius=.7071067811865476,Al.applyMatrix4(t.matrixWorld),this.intersectsSphere(Al)}intersectsSphere(t){let e=this.planes,o=t.center,s=-t.radius;for(let l=0;l<6;l++)if(e[l].distanceToPoint(o)<s)return!1;return!0}intersectsBox(t){let e=this.planes;for(let o=0;o<6;o++){let s=e[o];if(md.x=s.normal.x>0?t.max.x:t.min.x,md.y=s.normal.y>0?t.max.y:t.min.y,md.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(md)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let o=0;o<6;o++)if(e[o].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function xC(){let n=null,t=!1,e=null,o=null;function s(l,p){e(l,p),o=n.requestAnimationFrame(s)}return{start:function(){t!==!0&&e!==null&&(o=n.requestAnimationFrame(s),t=!0)},stop:function(){n.cancelAnimationFrame(o),t=!1},setAnimationLoop:function(l){e=l},setContext:function(l){n=l}}}function B6(n,t){let e=t.isWebGL2,o=new WeakMap;function s(m,_){let w=m.array,S=m.usage,b=w.byteLength,C=n.createBuffer();n.bindBuffer(_,C),n.bufferData(_,w,S),m.onUploadCallback();let R;if(w instanceof Float32Array)R=n.FLOAT;else if(w instanceof Uint16Array)if(m.isFloat16BufferAttribute)if(e)R=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else R=n.UNSIGNED_SHORT;else if(w instanceof Int16Array)R=n.SHORT;else if(w instanceof Uint32Array)R=n.UNSIGNED_INT;else if(w instanceof Int32Array)R=n.INT;else if(w instanceof Int8Array)R=n.BYTE;else if(w instanceof Uint8Array)R=n.UNSIGNED_BYTE;else if(w instanceof Uint8ClampedArray)R=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+w);return{buffer:C,type:R,bytesPerElement:w.BYTES_PER_ELEMENT,version:m.version,size:b}}function l(m,_,w){let S=_.array,b=_._updateRange,C=_.updateRanges;if(n.bindBuffer(w,m),b.count===-1&&C.length===0&&n.bufferSubData(w,0,S),C.length!==0){for(let R=0,x=C.length;R<x;R++){let E=C[R];e?n.bufferSubData(w,E.start*S.BYTES_PER_ELEMENT,S,E.start,E.count):n.bufferSubData(w,E.start*S.BYTES_PER_ELEMENT,S.subarray(E.start,E.start+E.count))}_.clearUpdateRanges()}b.count!==-1&&(e?n.bufferSubData(w,b.offset*S.BYTES_PER_ELEMENT,S,b.offset,b.count):n.bufferSubData(w,b.offset*S.BYTES_PER_ELEMENT,S.subarray(b.offset,b.offset+b.count)),b.count=-1),_.onUploadCallback()}function p(m){return m.isInterleavedBufferAttribute&&(m=m.data),o.get(m)}function h(m){m.isInterleavedBufferAttribute&&(m=m.data);let _=o.get(m);_&&(n.deleteBuffer(_.buffer),o.delete(m))}function g(m,_){if(m.isGLBufferAttribute){let S=o.get(m);(!S||S.version<m.version)&&o.set(m,{buffer:m.buffer,type:m.type,bytesPerElement:m.elementSize,version:m.version});return}m.isInterleavedBufferAttribute&&(m=m.data);let w=o.get(m);if(w===void 0)o.set(m,s(m,_));else if(w.version<m.version){if(w.size!==m.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");l(w.buffer,m,_),w.version=m.version}}return{get:p,remove:h,update:g}}var kd=class n extends Qu{constructor(t=1,e=1,o=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:o,heightSegments:s};let l=t/2,p=e/2,h=Math.floor(o),g=Math.floor(s),m=h+1,_=g+1,w=t/h,S=e/g,b=[],C=[],R=[],x=[];for(let E=0;E<_;E++){let I=E*S-p;for(let A=0;A<m;A++){let F=A*w-l;C.push(F,-I,0),R.push(0,0,1),x.push(A/h),x.push(1-E/g)}}for(let E=0;E<g;E++)for(let I=0;I<h;I++){let A=I+m*E,F=I+m*(E+1),V=I+1+m*(E+1),X=I+1+m*E;b.push(A,F,X),b.push(F,V,X)}this.setIndex(b),this.setAttribute("position",new pu(C,3)),this.setAttribute("normal",new pu(R,3)),this.setAttribute("uv",new pu(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new n(t.width,t.height,t.widthSegments,t.heightSegments)}},z6=`#ifdef USE_ALPHAHASH
|
|
66
66
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
67
67
|
#endif`,G6=`#ifdef USE_ALPHAHASH
|
|
68
68
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3569,7 +3569,7 @@ void main() {
|
|
|
3569
3569
|
#include <tonemapping_fragment>
|
|
3570
3570
|
#include <colorspace_fragment>
|
|
3571
3571
|
#include <fog_fragment>
|
|
3572
|
-
}`,nn={alphahash_fragment:z6,alphahash_pars_fragment:G6,alphamap_fragment:k6,alphamap_pars_fragment:q6,alphatest_fragment:H6,alphatest_pars_fragment:V6,aomap_fragment:W6,aomap_pars_fragment:X6,batching_pars_vertex:Y6,batching_vertex:$6,begin_vertex:Z6,beginnormal_vertex:K6,bsdfs:J6,iridescence_fragment:j6,bumpmap_pars_fragment:Q6,clipping_planes_fragment:tV,clipping_planes_pars_fragment:eV,clipping_planes_pars_vertex:nV,clipping_planes_vertex:rV,color_fragment:iV,color_pars_fragment:oV,color_pars_vertex:sV,color_vertex:aV,common:uV,cube_uv_reflection_fragment:lV,defaultnormal_vertex:cV,displacementmap_pars_vertex:fV,displacementmap_vertex:hV,emissivemap_fragment:pV,emissivemap_pars_fragment:dV,colorspace_fragment:gV,colorspace_pars_fragment:mV,envmap_fragment:yV,envmap_common_pars_fragment:vV,envmap_pars_fragment:_V,envmap_pars_vertex:xV,envmap_physical_pars_fragment:LV,envmap_vertex:EV,fog_vertex:wV,fog_pars_vertex:SV,fog_fragment:MV,fog_pars_fragment:bV,gradientmap_pars_fragment:AV,lightmap_fragment:TV,lightmap_pars_fragment:CV,lights_lambert_fragment:PV,lights_lambert_pars_fragment:IV,lights_pars_begin:RV,lights_toon_fragment:NV,lights_toon_pars_fragment:OV,lights_phong_fragment:DV,lights_phong_pars_fragment:FV,lights_physical_fragment:UV,lights_physical_pars_fragment:BV,lights_fragment_begin:zV,lights_fragment_maps:GV,lights_fragment_end:kV,logdepthbuf_fragment:qV,logdepthbuf_pars_fragment:HV,logdepthbuf_pars_vertex:VV,logdepthbuf_vertex:WV,map_fragment:XV,map_pars_fragment:YV,map_particle_fragment:$V,map_particle_pars_fragment:ZV,metalnessmap_fragment:KV,metalnessmap_pars_fragment:JV,morphinstance_vertex:jV,morphcolor_vertex:QV,morphnormal_vertex:t8,morphtarget_pars_vertex:e8,morphtarget_vertex:n8,normal_fragment_begin:r8,normal_fragment_maps:i8,normal_pars_fragment:o8,normal_pars_vertex:s8,normal_vertex:a8,normalmap_pars_fragment:u8,clearcoat_normal_fragment_begin:l8,clearcoat_normal_fragment_maps:c8,clearcoat_pars_fragment:f8,iridescence_pars_fragment:h8,opaque_fragment:p8,packing:d8,premultiplied_alpha_fragment:g8,project_vertex:m8,dithering_fragment:y8,dithering_pars_fragment:v8,roughnessmap_fragment:_8,roughnessmap_pars_fragment:x8,shadowmap_pars_fragment:E8,shadowmap_pars_vertex:w8,shadowmap_vertex:S8,shadowmask_pars_fragment:M8,skinbase_vertex:b8,skinning_pars_vertex:A8,skinning_vertex:T8,skinnormal_vertex:C8,specularmap_fragment:P8,specularmap_pars_fragment:I8,tonemapping_fragment:R8,tonemapping_pars_fragment:L8,transmission_fragment:N8,transmission_pars_fragment:O8,uv_pars_fragment:D8,uv_pars_vertex:F8,uv_vertex:U8,worldpos_vertex:B8,background_vert:z8,background_frag:G8,backgroundCube_vert:k8,backgroundCube_frag:q8,cube_vert:H8,cube_frag:V8,depth_vert:W8,depth_frag:X8,distanceRGBA_vert:Y8,distanceRGBA_frag:$8,equirect_vert:Z8,equirect_frag:K8,linedashed_vert:J8,linedashed_frag:j8,meshbasic_vert:Q8,meshbasic_frag:tW,meshlambert_vert:eW,meshlambert_frag:nW,meshmatcap_vert:rW,meshmatcap_frag:iW,meshnormal_vert:oW,meshnormal_frag:sW,meshphong_vert:aW,meshphong_frag:uW,meshphysical_vert:lW,meshphysical_frag:cW,meshtoon_vert:fW,meshtoon_frag:hW,points_vert:pW,points_frag:dW,shadow_vert:gW,shadow_frag:mW,sprite_vert:yW,sprite_frag:vW},oe={common:{diffuse:{value:new ar(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new je}},envmap:{envMap:{value:null},envMapRotation:{value:new je},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new je},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ar(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ar(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0},uvTransform:{value:new je}},sprite:{diffuse:{value:new ar(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}}},Aa={basic:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.fog]),vertexShader:nn.meshbasic_vert,fragmentShader:nn.meshbasic_frag},lambert:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,oe.lights,{emissive:{value:new ar(0)}}]),vertexShader:nn.meshlambert_vert,fragmentShader:nn.meshlambert_frag},phong:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,oe.lights,{emissive:{value:new ar(0)},specular:{value:new ar(1118481)},shininess:{value:30}}]),vertexShader:nn.meshphong_vert,fragmentShader:nn.meshphong_frag},standard:{uniforms:So([oe.common,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.roughnessmap,oe.metalnessmap,oe.fog,oe.lights,{emissive:{value:new ar(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:nn.meshphysical_vert,fragmentShader:nn.meshphysical_frag},toon:{uniforms:So([oe.common,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.gradientmap,oe.fog,oe.lights,{emissive:{value:new ar(0)}}]),vertexShader:nn.meshtoon_vert,fragmentShader:nn.meshtoon_frag},matcap:{uniforms:So([oe.common,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,{matcap:{value:null}}]),vertexShader:nn.meshmatcap_vert,fragmentShader:nn.meshmatcap_frag},points:{uniforms:So([oe.points,oe.fog]),vertexShader:nn.points_vert,fragmentShader:nn.points_frag},dashed:{uniforms:So([oe.common,oe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:nn.linedashed_vert,fragmentShader:nn.linedashed_frag},depth:{uniforms:So([oe.common,oe.displacementmap]),vertexShader:nn.depth_vert,fragmentShader:nn.depth_frag},normal:{uniforms:So([oe.common,oe.bumpmap,oe.normalmap,oe.displacementmap,{opacity:{value:1}}]),vertexShader:nn.meshnormal_vert,fragmentShader:nn.meshnormal_frag},sprite:{uniforms:So([oe.sprite,oe.fog]),vertexShader:nn.sprite_vert,fragmentShader:nn.sprite_frag},background:{uniforms:{uvTransform:{value:new je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:nn.background_vert,fragmentShader:nn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new je}},vertexShader:nn.backgroundCube_vert,fragmentShader:nn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:nn.cube_vert,fragmentShader:nn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:nn.equirect_vert,fragmentShader:nn.equirect_frag},distanceRGBA:{uniforms:So([oe.common,oe.displacementmap,{referencePosition:{value:new Pt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:nn.distanceRGBA_vert,fragmentShader:nn.distanceRGBA_frag},shadow:{uniforms:So([oe.lights,oe.fog,{color:{value:new ar(0)},opacity:{value:1}}]),vertexShader:nn.shadow_vert,fragmentShader:nn.shadow_frag}};Aa.physical={uniforms:So([Aa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new je},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new je},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new je},sheen:{value:0},sheenColor:{value:new ar(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new je},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new je},attenuationDistance:{value:0},attenuationColor:{value:new ar(0)},specularColor:{value:new ar(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new je},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new je}}]),vertexShader:nn.meshphysical_vert,fragmentShader:nn.meshphysical_frag};var yd={r:0,b:0,g:0},Tl=new Ul,_W=new vi;function xW(n,t,e,o,s,l,p){let h=new ar(0),g=l===!0?0:1,m,_,w=null,S=0,b=null;function C(x,E){let I=!1,A=E.isScene===!0?E.background:null;A&&A.isTexture&&(A=(E.backgroundBlurriness>0?e:t).get(A)),A===null?R(h,g):A&&A.isColor&&(R(A,1),I=!0);let F=n.xr.getEnvironmentBlendMode();F==="additive"?o.buffers.color.setClear(0,0,0,1,p):F==="alpha-blend"&&o.buffers.color.setClear(0,0,0,0,p),(n.autoClear||I)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),A&&(A.isCubeTexture||A.mapping===Wd)?(_===void 0&&(_=new na(new uh(1,1,1),new Ca({name:"BackgroundCubeMaterial",uniforms:Wc(Aa.backgroundCube.uniforms),vertexShader:Aa.backgroundCube.vertexShader,fragmentShader:Aa.backgroundCube.fragmentShader,side:$o,depthTest:!1,depthWrite:!1,fog:!1})),_.geometry.deleteAttribute("normal"),_.geometry.deleteAttribute("uv"),_.onBeforeRender=function(V,X,q){this.matrixWorld.copyPosition(q.matrixWorld)},Object.defineProperty(_.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(_)),Tl.copy(E.backgroundRotation),Tl.x*=-1,Tl.y*=-1,Tl.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Tl.y*=-1,Tl.z*=-1),_.material.uniforms.envMap.value=A,_.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,_.material.uniforms.backgroundBlurriness.value=E.backgroundBlurriness,_.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,_.material.uniforms.backgroundRotation.value.setFromMatrix4(_W.makeRotationFromEuler(Tl)),_.material.toneMapped=xr.getTransfer(A.colorSpace)!==Lr,(w!==A||S!==A.version||b!==n.toneMapping)&&(_.material.needsUpdate=!0,w=A,S=A.version,b=n.toneMapping),_.layers.enableAll(),x.unshift(_,_.geometry,_.material,0,0,null)):A&&A.isTexture&&(m===void 0&&(m=new na(new kd(2,2),new Ca({name:"BackgroundMaterial",uniforms:Wc(Aa.background.uniforms),vertexShader:Aa.background.vertexShader,fragmentShader:Aa.background.fragmentShader,side:Ku,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=A,m.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,m.material.toneMapped=xr.getTransfer(A.colorSpace)!==Lr,A.matrixAutoUpdate===!0&&A.updateMatrix(),m.material.uniforms.uvTransform.value.copy(A.matrix),(w!==A||S!==A.version||b!==n.toneMapping)&&(m.material.needsUpdate=!0,w=A,S=A.version,b=n.toneMapping),m.layers.enableAll(),x.unshift(m,m.geometry,m.material,0,0,null))}function R(x,E){x.getRGB(yd,_C(n)),o.buffers.color.setClear(yd.r,yd.g,yd.b,E,p)}return{getClearColor:function(){return h},setClearColor:function(x,E=1){h.set(x),g=E,R(h,g)},getClearAlpha:function(){return g},setClearAlpha:function(x){g=x,R(h,g)},render:C}}function EW(n,t,e,o){let s=n.getParameter(n.MAX_VERTEX_ATTRIBS),l=o.isWebGL2?null:t.get("OES_vertex_array_object"),p=o.isWebGL2||l!==null,h={},g=x(null),m=g,_=!1;function w(Q,At,Mt,Lt,pt){let yt=!1;if(p){let J=R(Lt,Mt,At);m!==J&&(m=J,b(m.object)),yt=E(Q,Lt,Mt,pt),yt&&I(Q,Lt,Mt,pt)}else{let J=At.wireframe===!0;(m.geometry!==Lt.id||m.program!==Mt.id||m.wireframe!==J)&&(m.geometry=Lt.id,m.program=Mt.id,m.wireframe=J,yt=!0)}pt!==null&&e.update(pt,n.ELEMENT_ARRAY_BUFFER),(yt||_)&&(_=!1,D(Q,At,Mt,Lt),pt!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(pt).buffer))}function S(){return o.isWebGL2?n.createVertexArray():l.createVertexArrayOES()}function b(Q){return o.isWebGL2?n.bindVertexArray(Q):l.bindVertexArrayOES(Q)}function C(Q){return o.isWebGL2?n.deleteVertexArray(Q):l.deleteVertexArrayOES(Q)}function R(Q,At,Mt){let Lt=Mt.wireframe===!0,pt=h[Q.id];pt===void 0&&(pt={},h[Q.id]=pt);let yt=pt[At.id];yt===void 0&&(yt={},pt[At.id]=yt);let J=yt[Lt];return J===void 0&&(J=x(S()),yt[Lt]=J),J}function x(Q){let At=[],Mt=[],Lt=[];for(let pt=0;pt<s;pt++)At[pt]=0,Mt[pt]=0,Lt[pt]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:At,enabledAttributes:Mt,attributeDivisors:Lt,object:Q,attributes:{},index:null}}function E(Q,At,Mt,Lt){let pt=m.attributes,yt=At.attributes,J=0,Bt=Mt.getAttributes();for(let Gt in Bt)if(Bt[Gt].location>=0){let ut=pt[Gt],Ut=yt[Gt];if(Ut===void 0&&(Gt==="instanceMatrix"&&Q.instanceMatrix&&(Ut=Q.instanceMatrix),Gt==="instanceColor"&&Q.instanceColor&&(Ut=Q.instanceColor)),ut===void 0||ut.attribute!==Ut||Ut&&ut.data!==Ut.data)return!0;J++}return m.attributesNum!==J||m.index!==Lt}function I(Q,At,Mt,Lt){let pt={},yt=At.attributes,J=0,Bt=Mt.getAttributes();for(let Gt in Bt)if(Bt[Gt].location>=0){let ut=yt[Gt];ut===void 0&&(Gt==="instanceMatrix"&&Q.instanceMatrix&&(ut=Q.instanceMatrix),Gt==="instanceColor"&&Q.instanceColor&&(ut=Q.instanceColor));let Ut={};Ut.attribute=ut,ut&&ut.data&&(Ut.data=ut.data),pt[Gt]=Ut,J++}m.attributes=pt,m.attributesNum=J,m.index=Lt}function A(){let Q=m.newAttributes;for(let At=0,Mt=Q.length;At<Mt;At++)Q[At]=0}function F(Q){V(Q,0)}function V(Q,At){let Mt=m.newAttributes,Lt=m.enabledAttributes,pt=m.attributeDivisors;Mt[Q]=1,Lt[Q]===0&&(n.enableVertexAttribArray(Q),Lt[Q]=1),pt[Q]!==At&&((o.isWebGL2?n:t.get("ANGLE_instanced_arrays"))[o.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](Q,At),pt[Q]=At)}function X(){let Q=m.newAttributes,At=m.enabledAttributes;for(let Mt=0,Lt=At.length;Mt<Lt;Mt++)At[Mt]!==Q[Mt]&&(n.disableVertexAttribArray(Mt),At[Mt]=0)}function q(Q,At,Mt,Lt,pt,yt,J){J===!0?n.vertexAttribIPointer(Q,At,Mt,pt,yt):n.vertexAttribPointer(Q,At,Mt,Lt,pt,yt)}function D(Q,At,Mt,Lt){if(o.isWebGL2===!1&&(Q.isInstancedMesh||Lt.isInstancedBufferGeometry)&&t.get("ANGLE_instanced_arrays")===null)return;A();let pt=Lt.attributes,yt=Mt.getAttributes(),J=At.defaultAttributeValues;for(let Bt in yt){let Gt=yt[Bt];if(Gt.location>=0){let ae=pt[Bt];if(ae===void 0&&(Bt==="instanceMatrix"&&Q.instanceMatrix&&(ae=Q.instanceMatrix),Bt==="instanceColor"&&Q.instanceColor&&(ae=Q.instanceColor)),ae!==void 0){let ut=ae.normalized,Ut=ae.itemSize,jt=e.get(ae);if(jt===void 0)continue;let ce=jt.buffer,te=jt.type,$t=jt.bytesPerElement,qt=o.isWebGL2===!0&&(te===n.INT||te===n.UNSIGNED_INT||ae.gpuType===uC);if(ae.isInterleavedBufferAttribute){let xe=ae.data,ft=xe.stride,Xe=ae.offset;if(xe.isInstancedInterleavedBuffer){for(let ee=0;ee<Gt.locationSize;ee++)V(Gt.location+ee,xe.meshPerAttribute);Q.isInstancedMesh!==!0&&Lt._maxInstanceCount===void 0&&(Lt._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let ee=0;ee<Gt.locationSize;ee++)F(Gt.location+ee);n.bindBuffer(n.ARRAY_BUFFER,ce);for(let ee=0;ee<Gt.locationSize;ee++)q(Gt.location+ee,Ut/Gt.locationSize,te,ut,ft*$t,(Xe+Ut/Gt.locationSize*ee)*$t,qt)}else{if(ae.isInstancedBufferAttribute){for(let xe=0;xe<Gt.locationSize;xe++)V(Gt.location+xe,ae.meshPerAttribute);Q.isInstancedMesh!==!0&&Lt._maxInstanceCount===void 0&&(Lt._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let xe=0;xe<Gt.locationSize;xe++)F(Gt.location+xe);n.bindBuffer(n.ARRAY_BUFFER,ce);for(let xe=0;xe<Gt.locationSize;xe++)q(Gt.location+xe,Ut/Gt.locationSize,te,ut,Ut*$t,Ut/Gt.locationSize*xe*$t,qt)}}else if(J!==void 0){let ut=J[Bt];if(ut!==void 0)switch(ut.length){case 2:n.vertexAttrib2fv(Gt.location,ut);break;case 3:n.vertexAttrib3fv(Gt.location,ut);break;case 4:n.vertexAttrib4fv(Gt.location,ut);break;default:n.vertexAttrib1fv(Gt.location,ut)}}}}X()}function xt(){K();for(let Q in h){let At=h[Q];for(let Mt in At){let Lt=At[Mt];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete At[Mt]}delete h[Q]}}function B(Q){if(h[Q.id]===void 0)return;let At=h[Q.id];for(let Mt in At){let Lt=At[Mt];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete At[Mt]}delete h[Q.id]}function j(Q){for(let At in h){let Mt=h[At];if(Mt[Q.id]===void 0)continue;let Lt=Mt[Q.id];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete Mt[Q.id]}}function K(){Dt(),_=!0,m!==g&&(m=g,b(m.object))}function Dt(){g.geometry=null,g.program=null,g.wireframe=!1}return{setup:w,reset:K,resetDefaultState:Dt,dispose:xt,releaseStatesOfGeometry:B,releaseStatesOfProgram:j,initAttributes:A,enableAttribute:F,disableUnusedAttributes:X}}function wW(n,t,e,o){let s=o.isWebGL2,l;function p(_){l=_}function h(_,w){n.drawArrays(l,_,w),e.update(w,l,1)}function g(_,w,S){if(S===0)return;let b,C;if(s)b=n,C="drawArraysInstanced";else if(b=t.get("ANGLE_instanced_arrays"),C="drawArraysInstancedANGLE",b===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}b[C](l,_,w,S),e.update(w,l,S)}function m(_,w,S){if(S===0)return;let b=t.get("WEBGL_multi_draw");if(b===null)for(let C=0;C<S;C++)this.render(_[C],w[C]);else{b.multiDrawArraysWEBGL(l,_,0,w,0,S);let C=0;for(let R=0;R<S;R++)C+=w[R];e.update(C,l,1)}}this.setMode=p,this.render=h,this.renderInstances=g,this.renderMultiDraw=m}function SW(n,t,e){let o;function s(){if(o!==void 0)return o;if(t.has("EXT_texture_filter_anisotropic")===!0){let q=t.get("EXT_texture_filter_anisotropic");o=n.getParameter(q.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else o=0;return o}function l(q){if(q==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";q="mediump"}return q==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=typeof WebGL2RenderingContext!="undefined"&&n.constructor.name==="WebGL2RenderingContext",h=e.precision!==void 0?e.precision:"highp",g=l(h);g!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",g,"instead."),h=g);let m=p||t.has("WEBGL_draw_buffers"),_=e.logarithmicDepthBuffer===!0,w=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=n.getParameter(n.MAX_TEXTURE_SIZE),C=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),R=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),E=n.getParameter(n.MAX_VARYING_VECTORS),I=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=S>0,F=p||t.has("OES_texture_float"),V=A&&F,X=p?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:p,drawBuffers:m,getMaxAnisotropy:s,getMaxPrecision:l,precision:h,logarithmicDepthBuffer:_,maxTextures:w,maxVertexTextures:S,maxTextureSize:b,maxCubemapSize:C,maxAttributes:R,maxVertexUniforms:x,maxVaryings:E,maxFragmentUniforms:I,vertexTextures:A,floatFragmentTextures:F,floatVertexTextures:V,maxSamples:X}}function MW(n){let t=this,e=null,o=0,s=!1,l=!1,p=new lu,h=new je,g={value:null,needsUpdate:!1};this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(w,S){let b=w.length!==0||S||o!==0||s;return s=S,o=w.length,b},this.beginShadows=function(){l=!0,_(null)},this.endShadows=function(){l=!1},this.setGlobalState=function(w,S){e=_(w,S,0)},this.setState=function(w,S,b){let C=w.clippingPlanes,R=w.clipIntersection,x=w.clipShadows,E=n.get(w);if(!s||C===null||C.length===0||l&&!x)l?_(null):m();else{let I=l?0:o,A=I*4,F=E.clippingState||null;g.value=F,F=_(C,S,A,b);for(let V=0;V!==A;++V)F[V]=e[V];E.clippingState=F,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=I}};function m(){g.value!==e&&(g.value=e,g.needsUpdate=o>0),t.numPlanes=o,t.numIntersection=0}function _(w,S,b,C){let R=w!==null?w.length:0,x=null;if(R!==0){if(x=g.value,C!==!0||x===null){let E=b+R*4,I=S.matrixWorldInverse;h.getNormalMatrix(I),(x===null||x.length<E)&&(x=new Float32Array(E));for(let A=0,F=b;A!==R;++A,F+=4)p.copy(w[A]).applyMatrix4(I,h),p.normal.toArray(x,F),x[F+3]=p.constant}g.value=x,g.needsUpdate=!0}return t.numPlanes=R,t.numIntersection=0,x}}function bW(n){let t=new WeakMap;function e(p,h){return h===Xy?p.mapping=qc:h===Yy&&(p.mapping=Hc),p}function o(p){if(p&&p.isTexture){let h=p.mapping;if(h===Xy||h===Yy)if(t.has(p)){let g=t.get(p).texture;return e(g,p.mapping)}else{let g=p.image;if(g&&g.height>0){let m=new iv(g.height);return m.fromEquirectangularTexture(n,p),t.set(p,m),p.addEventListener("dispose",s),e(m.texture,p.mapping)}else return null}}return p}function s(p){let h=p.target;h.removeEventListener("dispose",s);let g=t.get(h);g!==void 0&&(t.delete(h),g.dispose())}function l(){t=new WeakMap}return{get:o,dispose:l}}var ov=class extends Bd{constructor(t=-1,e=1,o=1,s=-1,l=.1,p=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=o,this.bottom=s,this.near=l,this.far=p,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,o,s,l,p){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=o,this.view.offsetY=s,this.view.width=l,this.view.height=p,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),o=(this.right+this.left)/2,s=(this.top+this.bottom)/2,l=o-t,p=o+t,h=s+e,g=s-e;if(this.view!==null&&this.view.enabled){let m=(this.right-this.left)/this.view.fullWidth/this.zoom,_=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l+=m*this.view.offsetX,p=l+m*this.view.width,h-=_*this.view.offsetY,g=h-_*this.view.height}this.projectionMatrix.makeOrthographic(l,p,h,g,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Fc=4,FT=[.125,.215,.35,.446,.526,.582],Rl=20,By=new ov,UT=new ar,zy=null,Gy=0,ky=0,Pl=(1+Math.sqrt(5))/2,Lc=1/Pl,BT=[new Pt(1,1,1),new Pt(-1,1,1),new Pt(1,1,-1),new Pt(-1,1,-1),new Pt(0,Pl,Lc),new Pt(0,Pl,-Lc),new Pt(Lc,0,Pl),new Pt(-Lc,0,Pl),new Pt(Pl,Lc,0),new Pt(-Pl,Lc,0)],qd=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,o=.1,s=100){zy=this._renderer.getRenderTarget(),Gy=this._renderer.getActiveCubeFace(),ky=this._renderer.getActiveMipmapLevel(),this._setSize(256);let l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,o,s,l),e>0&&this._blur(l,0,0,e),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=kT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=GT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(zy,Gy,ky),t.scissorTest=!1,vd(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===qc||t.mapping===Hc?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),zy=this._renderer.getRenderTarget(),Gy=this._renderer.getActiveCubeFace(),ky=this._renderer.getActiveMipmapLevel();let o=e||this._allocateTargets();return this._textureToCubeUV(t,o),this._applyPMREM(o),this._cleanup(o),o}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,o={magFilter:Xo,minFilter:Xo,generateMipmaps:!1,type:sh,format:ea,colorSpace:tl,depthBuffer:!1},s=zT(t,e,o);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=zT(t,e,o);let{_lodMax:l}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=AW(l)),this._blurMaterial=TW(l,t,e)}return s}_compileMaterial(t){let e=new na(this._lodPlanes[0],t);this._renderer.compile(e,By)}_sceneToCubeUV(t,e,o,s){let h=new ds(90,1,e,o),g=[1,-1,1,1,1,1],m=[1,1,1,-1,-1,-1],_=this._renderer,w=_.autoClear,S=_.toneMapping;_.getClearColor(UT),_.toneMapping=Yu,_.autoClear=!1;let b=new Dd({name:"PMREM.Background",side:$o,depthWrite:!1,depthTest:!1}),C=new na(new uh,b),R=!1,x=t.background;x?x.isColor&&(b.color.copy(x),t.background=null,R=!0):(b.color.copy(UT),R=!0);for(let E=0;E<6;E++){let I=E%3;I===0?(h.up.set(0,g[E],0),h.lookAt(m[E],0,0)):I===1?(h.up.set(0,0,g[E]),h.lookAt(0,m[E],0)):(h.up.set(0,g[E],0),h.lookAt(0,0,m[E]));let A=this._cubeSize;vd(s,I*A,E>2?A:0,A,A),_.setRenderTarget(s),R&&_.render(C,h),_.render(t,h)}C.geometry.dispose(),C.material.dispose(),_.toneMapping=S,_.autoClear=w,t.background=x}_textureToCubeUV(t,e){let o=this._renderer,s=t.mapping===qc||t.mapping===Hc;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=kT()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=GT());let l=s?this._cubemapMaterial:this._equirectMaterial,p=new na(this._lodPlanes[0],l),h=l.uniforms;h.envMap.value=t;let g=this._cubeSize;vd(e,0,0,3*g,2*g),o.setRenderTarget(e),o.render(p,By)}_applyPMREM(t){let e=this._renderer,o=e.autoClear;e.autoClear=!1;for(let s=1;s<this._lodPlanes.length;s++){let l=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),p=BT[(s-1)%BT.length];this._blur(t,s-1,s,l,p)}e.autoClear=o}_blur(t,e,o,s,l){let p=this._pingPongRenderTarget;this._halfBlur(t,p,e,o,s,"latitudinal",l),this._halfBlur(p,t,o,o,s,"longitudinal",l)}_halfBlur(t,e,o,s,l,p,h){let g=this._renderer,m=this._blurMaterial;p!=="latitudinal"&&p!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let _=3,w=new na(this._lodPlanes[s],m),S=m.uniforms,b=this._sizeLods[o]-1,C=isFinite(l)?Math.PI/(2*b):2*Math.PI/(2*Rl-1),R=l/C,x=isFinite(l)?1+Math.floor(_*R):Rl;x>Rl&&console.warn(`sigmaRadians, ${l}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Rl}`);let E=[],I=0;for(let q=0;q<Rl;++q){let D=q/R,xt=Math.exp(-D*D/2);E.push(xt),q===0?I+=xt:q<x&&(I+=2*xt)}for(let q=0;q<E.length;q++)E[q]=E[q]/I;S.envMap.value=t.texture,S.samples.value=x,S.weights.value=E,S.latitudinal.value=p==="latitudinal",h&&(S.poleAxis.value=h);let{_lodMax:A}=this;S.dTheta.value=C,S.mipInt.value=A-o;let F=this._sizeLods[s],V=3*F*(s>A-Fc?s-A+Fc:0),X=4*(this._cubeSize-F);vd(e,V,X,3*F,2*F),g.setRenderTarget(e),g.render(w,By)}};function AW(n){let t=[],e=[],o=[],s=n,l=n-Fc+1+FT.length;for(let p=0;p<l;p++){let h=Math.pow(2,s);e.push(h);let g=1/h;p>n-Fc?g=FT[p-n+Fc-1]:p===0&&(g=0),o.push(g);let m=1/(h-2),_=-m,w=1+m,S=[_,_,w,_,w,w,_,_,w,w,_,w],b=6,C=6,R=3,x=2,E=1,I=new Float32Array(R*C*b),A=new Float32Array(x*C*b),F=new Float32Array(E*C*b);for(let X=0;X<b;X++){let q=X%3*2/3-1,D=X>2?0:-1,xt=[q,D,0,q+2/3,D,0,q+2/3,D+1,0,q,D,0,q+2/3,D+1,0,q,D+1,0];I.set(xt,R*C*X),A.set(S,x*C*X);let B=[X,X,X,X,X,X];F.set(B,E*C*X)}let V=new Qu;V.setAttribute("position",new gs(I,R)),V.setAttribute("uv",new gs(A,x)),V.setAttribute("faceIndex",new gs(F,E)),t.push(V),s>Fc&&s--}return{lodPlanes:t,sizeLods:e,sigmas:o}}function zT(n,t,e){let o=new du(n,t,e);return o.texture.mapping=Wd,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function vd(n,t,e,o,s){n.viewport.set(t,e,o,s),n.scissor.set(t,e,o,s)}function TW(n,t,e){let o=new Float32Array(Rl),s=new Pt(0,1,0);return new Ca({name:"SphericalGaussianBlur",defines:{n:Rl,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Dv(),fragmentShader:`
|
|
3572
|
+
}`,nn={alphahash_fragment:z6,alphahash_pars_fragment:G6,alphamap_fragment:k6,alphamap_pars_fragment:q6,alphatest_fragment:H6,alphatest_pars_fragment:V6,aomap_fragment:W6,aomap_pars_fragment:X6,batching_pars_vertex:Y6,batching_vertex:$6,begin_vertex:Z6,beginnormal_vertex:K6,bsdfs:J6,iridescence_fragment:j6,bumpmap_pars_fragment:Q6,clipping_planes_fragment:tV,clipping_planes_pars_fragment:eV,clipping_planes_pars_vertex:nV,clipping_planes_vertex:rV,color_fragment:iV,color_pars_fragment:oV,color_pars_vertex:sV,color_vertex:aV,common:uV,cube_uv_reflection_fragment:lV,defaultnormal_vertex:cV,displacementmap_pars_vertex:fV,displacementmap_vertex:hV,emissivemap_fragment:pV,emissivemap_pars_fragment:dV,colorspace_fragment:gV,colorspace_pars_fragment:mV,envmap_fragment:yV,envmap_common_pars_fragment:vV,envmap_pars_fragment:_V,envmap_pars_vertex:xV,envmap_physical_pars_fragment:LV,envmap_vertex:EV,fog_vertex:wV,fog_pars_vertex:SV,fog_fragment:MV,fog_pars_fragment:bV,gradientmap_pars_fragment:AV,lightmap_fragment:TV,lightmap_pars_fragment:CV,lights_lambert_fragment:PV,lights_lambert_pars_fragment:IV,lights_pars_begin:RV,lights_toon_fragment:NV,lights_toon_pars_fragment:OV,lights_phong_fragment:DV,lights_phong_pars_fragment:FV,lights_physical_fragment:UV,lights_physical_pars_fragment:BV,lights_fragment_begin:zV,lights_fragment_maps:GV,lights_fragment_end:kV,logdepthbuf_fragment:qV,logdepthbuf_pars_fragment:HV,logdepthbuf_pars_vertex:VV,logdepthbuf_vertex:WV,map_fragment:XV,map_pars_fragment:YV,map_particle_fragment:$V,map_particle_pars_fragment:ZV,metalnessmap_fragment:KV,metalnessmap_pars_fragment:JV,morphinstance_vertex:jV,morphcolor_vertex:QV,morphnormal_vertex:t8,morphtarget_pars_vertex:e8,morphtarget_vertex:n8,normal_fragment_begin:r8,normal_fragment_maps:i8,normal_pars_fragment:o8,normal_pars_vertex:s8,normal_vertex:a8,normalmap_pars_fragment:u8,clearcoat_normal_fragment_begin:l8,clearcoat_normal_fragment_maps:c8,clearcoat_pars_fragment:f8,iridescence_pars_fragment:h8,opaque_fragment:p8,packing:d8,premultiplied_alpha_fragment:g8,project_vertex:m8,dithering_fragment:y8,dithering_pars_fragment:v8,roughnessmap_fragment:_8,roughnessmap_pars_fragment:x8,shadowmap_pars_fragment:E8,shadowmap_pars_vertex:w8,shadowmap_vertex:S8,shadowmask_pars_fragment:M8,skinbase_vertex:b8,skinning_pars_vertex:A8,skinning_vertex:T8,skinnormal_vertex:C8,specularmap_fragment:P8,specularmap_pars_fragment:I8,tonemapping_fragment:R8,tonemapping_pars_fragment:L8,transmission_fragment:N8,transmission_pars_fragment:O8,uv_pars_fragment:D8,uv_pars_vertex:F8,uv_vertex:U8,worldpos_vertex:B8,background_vert:z8,background_frag:G8,backgroundCube_vert:k8,backgroundCube_frag:q8,cube_vert:H8,cube_frag:V8,depth_vert:W8,depth_frag:X8,distanceRGBA_vert:Y8,distanceRGBA_frag:$8,equirect_vert:Z8,equirect_frag:K8,linedashed_vert:J8,linedashed_frag:j8,meshbasic_vert:Q8,meshbasic_frag:tW,meshlambert_vert:eW,meshlambert_frag:nW,meshmatcap_vert:rW,meshmatcap_frag:iW,meshnormal_vert:oW,meshnormal_frag:sW,meshphong_vert:aW,meshphong_frag:uW,meshphysical_vert:lW,meshphysical_frag:cW,meshtoon_vert:fW,meshtoon_frag:hW,points_vert:pW,points_frag:dW,shadow_vert:gW,shadow_frag:mW,sprite_vert:yW,sprite_frag:vW},oe={common:{diffuse:{value:new ar(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Je},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Je}},envmap:{envMap:{value:null},envMapRotation:{value:new Je},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Je},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ar(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ar(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0},uvTransform:{value:new Je}},sprite:{diffuse:{value:new ar(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Je},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0}}},Aa={basic:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.fog]),vertexShader:nn.meshbasic_vert,fragmentShader:nn.meshbasic_frag},lambert:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,oe.lights,{emissive:{value:new ar(0)}}]),vertexShader:nn.meshlambert_vert,fragmentShader:nn.meshlambert_frag},phong:{uniforms:So([oe.common,oe.specularmap,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,oe.lights,{emissive:{value:new ar(0)},specular:{value:new ar(1118481)},shininess:{value:30}}]),vertexShader:nn.meshphong_vert,fragmentShader:nn.meshphong_frag},standard:{uniforms:So([oe.common,oe.envmap,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.roughnessmap,oe.metalnessmap,oe.fog,oe.lights,{emissive:{value:new ar(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:nn.meshphysical_vert,fragmentShader:nn.meshphysical_frag},toon:{uniforms:So([oe.common,oe.aomap,oe.lightmap,oe.emissivemap,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.gradientmap,oe.fog,oe.lights,{emissive:{value:new ar(0)}}]),vertexShader:nn.meshtoon_vert,fragmentShader:nn.meshtoon_frag},matcap:{uniforms:So([oe.common,oe.bumpmap,oe.normalmap,oe.displacementmap,oe.fog,{matcap:{value:null}}]),vertexShader:nn.meshmatcap_vert,fragmentShader:nn.meshmatcap_frag},points:{uniforms:So([oe.points,oe.fog]),vertexShader:nn.points_vert,fragmentShader:nn.points_frag},dashed:{uniforms:So([oe.common,oe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:nn.linedashed_vert,fragmentShader:nn.linedashed_frag},depth:{uniforms:So([oe.common,oe.displacementmap]),vertexShader:nn.depth_vert,fragmentShader:nn.depth_frag},normal:{uniforms:So([oe.common,oe.bumpmap,oe.normalmap,oe.displacementmap,{opacity:{value:1}}]),vertexShader:nn.meshnormal_vert,fragmentShader:nn.meshnormal_frag},sprite:{uniforms:So([oe.sprite,oe.fog]),vertexShader:nn.sprite_vert,fragmentShader:nn.sprite_frag},background:{uniforms:{uvTransform:{value:new Je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:nn.background_vert,fragmentShader:nn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Je}},vertexShader:nn.backgroundCube_vert,fragmentShader:nn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:nn.cube_vert,fragmentShader:nn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:nn.equirect_vert,fragmentShader:nn.equirect_frag},distanceRGBA:{uniforms:So([oe.common,oe.displacementmap,{referencePosition:{value:new Pt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:nn.distanceRGBA_vert,fragmentShader:nn.distanceRGBA_frag},shadow:{uniforms:So([oe.lights,oe.fog,{color:{value:new ar(0)},opacity:{value:1}}]),vertexShader:nn.shadow_vert,fragmentShader:nn.shadow_frag}};Aa.physical={uniforms:So([Aa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Je},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Je},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Je},sheen:{value:0},sheenColor:{value:new ar(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Je},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Je},attenuationDistance:{value:0},attenuationColor:{value:new ar(0)},specularColor:{value:new ar(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Je},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Je}}]),vertexShader:nn.meshphysical_vert,fragmentShader:nn.meshphysical_frag};var yd={r:0,b:0,g:0},Tl=new Ul,_W=new vi;function xW(n,t,e,o,s,l,p){let h=new ar(0),g=l===!0?0:1,m,_,w=null,S=0,b=null;function C(x,E){let I=!1,A=E.isScene===!0?E.background:null;A&&A.isTexture&&(A=(E.backgroundBlurriness>0?e:t).get(A)),A===null?R(h,g):A&&A.isColor&&(R(A,1),I=!0);let F=n.xr.getEnvironmentBlendMode();F==="additive"?o.buffers.color.setClear(0,0,0,1,p):F==="alpha-blend"&&o.buffers.color.setClear(0,0,0,0,p),(n.autoClear||I)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),A&&(A.isCubeTexture||A.mapping===Wd)?(_===void 0&&(_=new na(new uh(1,1,1),new Ca({name:"BackgroundCubeMaterial",uniforms:Wc(Aa.backgroundCube.uniforms),vertexShader:Aa.backgroundCube.vertexShader,fragmentShader:Aa.backgroundCube.fragmentShader,side:$o,depthTest:!1,depthWrite:!1,fog:!1})),_.geometry.deleteAttribute("normal"),_.geometry.deleteAttribute("uv"),_.onBeforeRender=function(V,X,q){this.matrixWorld.copyPosition(q.matrixWorld)},Object.defineProperty(_.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(_)),Tl.copy(E.backgroundRotation),Tl.x*=-1,Tl.y*=-1,Tl.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Tl.y*=-1,Tl.z*=-1),_.material.uniforms.envMap.value=A,_.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,_.material.uniforms.backgroundBlurriness.value=E.backgroundBlurriness,_.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,_.material.uniforms.backgroundRotation.value.setFromMatrix4(_W.makeRotationFromEuler(Tl)),_.material.toneMapped=xr.getTransfer(A.colorSpace)!==Lr,(w!==A||S!==A.version||b!==n.toneMapping)&&(_.material.needsUpdate=!0,w=A,S=A.version,b=n.toneMapping),_.layers.enableAll(),x.unshift(_,_.geometry,_.material,0,0,null)):A&&A.isTexture&&(m===void 0&&(m=new na(new kd(2,2),new Ca({name:"BackgroundMaterial",uniforms:Wc(Aa.background.uniforms),vertexShader:Aa.background.vertexShader,fragmentShader:Aa.background.fragmentShader,side:Ku,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=A,m.material.uniforms.backgroundIntensity.value=E.backgroundIntensity,m.material.toneMapped=xr.getTransfer(A.colorSpace)!==Lr,A.matrixAutoUpdate===!0&&A.updateMatrix(),m.material.uniforms.uvTransform.value.copy(A.matrix),(w!==A||S!==A.version||b!==n.toneMapping)&&(m.material.needsUpdate=!0,w=A,S=A.version,b=n.toneMapping),m.layers.enableAll(),x.unshift(m,m.geometry,m.material,0,0,null))}function R(x,E){x.getRGB(yd,_C(n)),o.buffers.color.setClear(yd.r,yd.g,yd.b,E,p)}return{getClearColor:function(){return h},setClearColor:function(x,E=1){h.set(x),g=E,R(h,g)},getClearAlpha:function(){return g},setClearAlpha:function(x){g=x,R(h,g)},render:C}}function EW(n,t,e,o){let s=n.getParameter(n.MAX_VERTEX_ATTRIBS),l=o.isWebGL2?null:t.get("OES_vertex_array_object"),p=o.isWebGL2||l!==null,h={},g=x(null),m=g,_=!1;function w(Q,At,Mt,Lt,pt){let yt=!1;if(p){let J=R(Lt,Mt,At);m!==J&&(m=J,b(m.object)),yt=E(Q,Lt,Mt,pt),yt&&I(Q,Lt,Mt,pt)}else{let J=At.wireframe===!0;(m.geometry!==Lt.id||m.program!==Mt.id||m.wireframe!==J)&&(m.geometry=Lt.id,m.program=Mt.id,m.wireframe=J,yt=!0)}pt!==null&&e.update(pt,n.ELEMENT_ARRAY_BUFFER),(yt||_)&&(_=!1,D(Q,At,Mt,Lt),pt!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(pt).buffer))}function S(){return o.isWebGL2?n.createVertexArray():l.createVertexArrayOES()}function b(Q){return o.isWebGL2?n.bindVertexArray(Q):l.bindVertexArrayOES(Q)}function C(Q){return o.isWebGL2?n.deleteVertexArray(Q):l.deleteVertexArrayOES(Q)}function R(Q,At,Mt){let Lt=Mt.wireframe===!0,pt=h[Q.id];pt===void 0&&(pt={},h[Q.id]=pt);let yt=pt[At.id];yt===void 0&&(yt={},pt[At.id]=yt);let J=yt[Lt];return J===void 0&&(J=x(S()),yt[Lt]=J),J}function x(Q){let At=[],Mt=[],Lt=[];for(let pt=0;pt<s;pt++)At[pt]=0,Mt[pt]=0,Lt[pt]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:At,enabledAttributes:Mt,attributeDivisors:Lt,object:Q,attributes:{},index:null}}function E(Q,At,Mt,Lt){let pt=m.attributes,yt=At.attributes,J=0,Bt=Mt.getAttributes();for(let Gt in Bt)if(Bt[Gt].location>=0){let ut=pt[Gt],Ut=yt[Gt];if(Ut===void 0&&(Gt==="instanceMatrix"&&Q.instanceMatrix&&(Ut=Q.instanceMatrix),Gt==="instanceColor"&&Q.instanceColor&&(Ut=Q.instanceColor)),ut===void 0||ut.attribute!==Ut||Ut&&ut.data!==Ut.data)return!0;J++}return m.attributesNum!==J||m.index!==Lt}function I(Q,At,Mt,Lt){let pt={},yt=At.attributes,J=0,Bt=Mt.getAttributes();for(let Gt in Bt)if(Bt[Gt].location>=0){let ut=yt[Gt];ut===void 0&&(Gt==="instanceMatrix"&&Q.instanceMatrix&&(ut=Q.instanceMatrix),Gt==="instanceColor"&&Q.instanceColor&&(ut=Q.instanceColor));let Ut={};Ut.attribute=ut,ut&&ut.data&&(Ut.data=ut.data),pt[Gt]=Ut,J++}m.attributes=pt,m.attributesNum=J,m.index=Lt}function A(){let Q=m.newAttributes;for(let At=0,Mt=Q.length;At<Mt;At++)Q[At]=0}function F(Q){V(Q,0)}function V(Q,At){let Mt=m.newAttributes,Lt=m.enabledAttributes,pt=m.attributeDivisors;Mt[Q]=1,Lt[Q]===0&&(n.enableVertexAttribArray(Q),Lt[Q]=1),pt[Q]!==At&&((o.isWebGL2?n:t.get("ANGLE_instanced_arrays"))[o.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](Q,At),pt[Q]=At)}function X(){let Q=m.newAttributes,At=m.enabledAttributes;for(let Mt=0,Lt=At.length;Mt<Lt;Mt++)At[Mt]!==Q[Mt]&&(n.disableVertexAttribArray(Mt),At[Mt]=0)}function q(Q,At,Mt,Lt,pt,yt,J){J===!0?n.vertexAttribIPointer(Q,At,Mt,pt,yt):n.vertexAttribPointer(Q,At,Mt,Lt,pt,yt)}function D(Q,At,Mt,Lt){if(o.isWebGL2===!1&&(Q.isInstancedMesh||Lt.isInstancedBufferGeometry)&&t.get("ANGLE_instanced_arrays")===null)return;A();let pt=Lt.attributes,yt=Mt.getAttributes(),J=At.defaultAttributeValues;for(let Bt in yt){let Gt=yt[Bt];if(Gt.location>=0){let ae=pt[Bt];if(ae===void 0&&(Bt==="instanceMatrix"&&Q.instanceMatrix&&(ae=Q.instanceMatrix),Bt==="instanceColor"&&Q.instanceColor&&(ae=Q.instanceColor)),ae!==void 0){let ut=ae.normalized,Ut=ae.itemSize,jt=e.get(ae);if(jt===void 0)continue;let ce=jt.buffer,te=jt.type,$t=jt.bytesPerElement,qt=o.isWebGL2===!0&&(te===n.INT||te===n.UNSIGNED_INT||ae.gpuType===uC);if(ae.isInterleavedBufferAttribute){let xe=ae.data,ft=xe.stride,Xe=ae.offset;if(xe.isInstancedInterleavedBuffer){for(let ee=0;ee<Gt.locationSize;ee++)V(Gt.location+ee,xe.meshPerAttribute);Q.isInstancedMesh!==!0&&Lt._maxInstanceCount===void 0&&(Lt._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let ee=0;ee<Gt.locationSize;ee++)F(Gt.location+ee);n.bindBuffer(n.ARRAY_BUFFER,ce);for(let ee=0;ee<Gt.locationSize;ee++)q(Gt.location+ee,Ut/Gt.locationSize,te,ut,ft*$t,(Xe+Ut/Gt.locationSize*ee)*$t,qt)}else{if(ae.isInstancedBufferAttribute){for(let xe=0;xe<Gt.locationSize;xe++)V(Gt.location+xe,ae.meshPerAttribute);Q.isInstancedMesh!==!0&&Lt._maxInstanceCount===void 0&&(Lt._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let xe=0;xe<Gt.locationSize;xe++)F(Gt.location+xe);n.bindBuffer(n.ARRAY_BUFFER,ce);for(let xe=0;xe<Gt.locationSize;xe++)q(Gt.location+xe,Ut/Gt.locationSize,te,ut,Ut*$t,Ut/Gt.locationSize*xe*$t,qt)}}else if(J!==void 0){let ut=J[Bt];if(ut!==void 0)switch(ut.length){case 2:n.vertexAttrib2fv(Gt.location,ut);break;case 3:n.vertexAttrib3fv(Gt.location,ut);break;case 4:n.vertexAttrib4fv(Gt.location,ut);break;default:n.vertexAttrib1fv(Gt.location,ut)}}}}X()}function xt(){K();for(let Q in h){let At=h[Q];for(let Mt in At){let Lt=At[Mt];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete At[Mt]}delete h[Q]}}function B(Q){if(h[Q.id]===void 0)return;let At=h[Q.id];for(let Mt in At){let Lt=At[Mt];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete At[Mt]}delete h[Q.id]}function j(Q){for(let At in h){let Mt=h[At];if(Mt[Q.id]===void 0)continue;let Lt=Mt[Q.id];for(let pt in Lt)C(Lt[pt].object),delete Lt[pt];delete Mt[Q.id]}}function K(){Dt(),_=!0,m!==g&&(m=g,b(m.object))}function Dt(){g.geometry=null,g.program=null,g.wireframe=!1}return{setup:w,reset:K,resetDefaultState:Dt,dispose:xt,releaseStatesOfGeometry:B,releaseStatesOfProgram:j,initAttributes:A,enableAttribute:F,disableUnusedAttributes:X}}function wW(n,t,e,o){let s=o.isWebGL2,l;function p(_){l=_}function h(_,w){n.drawArrays(l,_,w),e.update(w,l,1)}function g(_,w,S){if(S===0)return;let b,C;if(s)b=n,C="drawArraysInstanced";else if(b=t.get("ANGLE_instanced_arrays"),C="drawArraysInstancedANGLE",b===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}b[C](l,_,w,S),e.update(w,l,S)}function m(_,w,S){if(S===0)return;let b=t.get("WEBGL_multi_draw");if(b===null)for(let C=0;C<S;C++)this.render(_[C],w[C]);else{b.multiDrawArraysWEBGL(l,_,0,w,0,S);let C=0;for(let R=0;R<S;R++)C+=w[R];e.update(C,l,1)}}this.setMode=p,this.render=h,this.renderInstances=g,this.renderMultiDraw=m}function SW(n,t,e){let o;function s(){if(o!==void 0)return o;if(t.has("EXT_texture_filter_anisotropic")===!0){let q=t.get("EXT_texture_filter_anisotropic");o=n.getParameter(q.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else o=0;return o}function l(q){if(q==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";q="mediump"}return q==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=typeof WebGL2RenderingContext!="undefined"&&n.constructor.name==="WebGL2RenderingContext",h=e.precision!==void 0?e.precision:"highp",g=l(h);g!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",g,"instead."),h=g);let m=p||t.has("WEBGL_draw_buffers"),_=e.logarithmicDepthBuffer===!0,w=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=n.getParameter(n.MAX_TEXTURE_SIZE),C=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),R=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),E=n.getParameter(n.MAX_VARYING_VECTORS),I=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=S>0,F=p||t.has("OES_texture_float"),V=A&&F,X=p?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:p,drawBuffers:m,getMaxAnisotropy:s,getMaxPrecision:l,precision:h,logarithmicDepthBuffer:_,maxTextures:w,maxVertexTextures:S,maxTextureSize:b,maxCubemapSize:C,maxAttributes:R,maxVertexUniforms:x,maxVaryings:E,maxFragmentUniforms:I,vertexTextures:A,floatFragmentTextures:F,floatVertexTextures:V,maxSamples:X}}function MW(n){let t=this,e=null,o=0,s=!1,l=!1,p=new lu,h=new Je,g={value:null,needsUpdate:!1};this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(w,S){let b=w.length!==0||S||o!==0||s;return s=S,o=w.length,b},this.beginShadows=function(){l=!0,_(null)},this.endShadows=function(){l=!1},this.setGlobalState=function(w,S){e=_(w,S,0)},this.setState=function(w,S,b){let C=w.clippingPlanes,R=w.clipIntersection,x=w.clipShadows,E=n.get(w);if(!s||C===null||C.length===0||l&&!x)l?_(null):m();else{let I=l?0:o,A=I*4,F=E.clippingState||null;g.value=F,F=_(C,S,A,b);for(let V=0;V!==A;++V)F[V]=e[V];E.clippingState=F,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=I}};function m(){g.value!==e&&(g.value=e,g.needsUpdate=o>0),t.numPlanes=o,t.numIntersection=0}function _(w,S,b,C){let R=w!==null?w.length:0,x=null;if(R!==0){if(x=g.value,C!==!0||x===null){let E=b+R*4,I=S.matrixWorldInverse;h.getNormalMatrix(I),(x===null||x.length<E)&&(x=new Float32Array(E));for(let A=0,F=b;A!==R;++A,F+=4)p.copy(w[A]).applyMatrix4(I,h),p.normal.toArray(x,F),x[F+3]=p.constant}g.value=x,g.needsUpdate=!0}return t.numPlanes=R,t.numIntersection=0,x}}function bW(n){let t=new WeakMap;function e(p,h){return h===Xy?p.mapping=qc:h===Yy&&(p.mapping=Hc),p}function o(p){if(p&&p.isTexture){let h=p.mapping;if(h===Xy||h===Yy)if(t.has(p)){let g=t.get(p).texture;return e(g,p.mapping)}else{let g=p.image;if(g&&g.height>0){let m=new iv(g.height);return m.fromEquirectangularTexture(n,p),t.set(p,m),p.addEventListener("dispose",s),e(m.texture,p.mapping)}else return null}}return p}function s(p){let h=p.target;h.removeEventListener("dispose",s);let g=t.get(h);g!==void 0&&(t.delete(h),g.dispose())}function l(){t=new WeakMap}return{get:o,dispose:l}}var ov=class extends Bd{constructor(t=-1,e=1,o=1,s=-1,l=.1,p=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=o,this.bottom=s,this.near=l,this.far=p,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,o,s,l,p){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=o,this.view.offsetY=s,this.view.width=l,this.view.height=p,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),o=(this.right+this.left)/2,s=(this.top+this.bottom)/2,l=o-t,p=o+t,h=s+e,g=s-e;if(this.view!==null&&this.view.enabled){let m=(this.right-this.left)/this.view.fullWidth/this.zoom,_=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l+=m*this.view.offsetX,p=l+m*this.view.width,h-=_*this.view.offsetY,g=h-_*this.view.height}this.projectionMatrix.makeOrthographic(l,p,h,g,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Fc=4,FT=[.125,.215,.35,.446,.526,.582],Rl=20,By=new ov,UT=new ar,zy=null,Gy=0,ky=0,Pl=(1+Math.sqrt(5))/2,Lc=1/Pl,BT=[new Pt(1,1,1),new Pt(-1,1,1),new Pt(1,1,-1),new Pt(-1,1,-1),new Pt(0,Pl,Lc),new Pt(0,Pl,-Lc),new Pt(Lc,0,Pl),new Pt(-Lc,0,Pl),new Pt(Pl,Lc,0),new Pt(-Pl,Lc,0)],qd=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,o=.1,s=100){zy=this._renderer.getRenderTarget(),Gy=this._renderer.getActiveCubeFace(),ky=this._renderer.getActiveMipmapLevel(),this._setSize(256);let l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,o,s,l),e>0&&this._blur(l,0,0,e),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=kT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=GT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(zy,Gy,ky),t.scissorTest=!1,vd(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===qc||t.mapping===Hc?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),zy=this._renderer.getRenderTarget(),Gy=this._renderer.getActiveCubeFace(),ky=this._renderer.getActiveMipmapLevel();let o=e||this._allocateTargets();return this._textureToCubeUV(t,o),this._applyPMREM(o),this._cleanup(o),o}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,o={magFilter:Xo,minFilter:Xo,generateMipmaps:!1,type:sh,format:ea,colorSpace:tl,depthBuffer:!1},s=zT(t,e,o);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=zT(t,e,o);let{_lodMax:l}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=AW(l)),this._blurMaterial=TW(l,t,e)}return s}_compileMaterial(t){let e=new na(this._lodPlanes[0],t);this._renderer.compile(e,By)}_sceneToCubeUV(t,e,o,s){let h=new ds(90,1,e,o),g=[1,-1,1,1,1,1],m=[1,1,1,-1,-1,-1],_=this._renderer,w=_.autoClear,S=_.toneMapping;_.getClearColor(UT),_.toneMapping=Yu,_.autoClear=!1;let b=new Dd({name:"PMREM.Background",side:$o,depthWrite:!1,depthTest:!1}),C=new na(new uh,b),R=!1,x=t.background;x?x.isColor&&(b.color.copy(x),t.background=null,R=!0):(b.color.copy(UT),R=!0);for(let E=0;E<6;E++){let I=E%3;I===0?(h.up.set(0,g[E],0),h.lookAt(m[E],0,0)):I===1?(h.up.set(0,0,g[E]),h.lookAt(0,m[E],0)):(h.up.set(0,g[E],0),h.lookAt(0,0,m[E]));let A=this._cubeSize;vd(s,I*A,E>2?A:0,A,A),_.setRenderTarget(s),R&&_.render(C,h),_.render(t,h)}C.geometry.dispose(),C.material.dispose(),_.toneMapping=S,_.autoClear=w,t.background=x}_textureToCubeUV(t,e){let o=this._renderer,s=t.mapping===qc||t.mapping===Hc;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=kT()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=GT());let l=s?this._cubemapMaterial:this._equirectMaterial,p=new na(this._lodPlanes[0],l),h=l.uniforms;h.envMap.value=t;let g=this._cubeSize;vd(e,0,0,3*g,2*g),o.setRenderTarget(e),o.render(p,By)}_applyPMREM(t){let e=this._renderer,o=e.autoClear;e.autoClear=!1;for(let s=1;s<this._lodPlanes.length;s++){let l=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),p=BT[(s-1)%BT.length];this._blur(t,s-1,s,l,p)}e.autoClear=o}_blur(t,e,o,s,l){let p=this._pingPongRenderTarget;this._halfBlur(t,p,e,o,s,"latitudinal",l),this._halfBlur(p,t,o,o,s,"longitudinal",l)}_halfBlur(t,e,o,s,l,p,h){let g=this._renderer,m=this._blurMaterial;p!=="latitudinal"&&p!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let _=3,w=new na(this._lodPlanes[s],m),S=m.uniforms,b=this._sizeLods[o]-1,C=isFinite(l)?Math.PI/(2*b):2*Math.PI/(2*Rl-1),R=l/C,x=isFinite(l)?1+Math.floor(_*R):Rl;x>Rl&&console.warn(`sigmaRadians, ${l}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Rl}`);let E=[],I=0;for(let q=0;q<Rl;++q){let D=q/R,xt=Math.exp(-D*D/2);E.push(xt),q===0?I+=xt:q<x&&(I+=2*xt)}for(let q=0;q<E.length;q++)E[q]=E[q]/I;S.envMap.value=t.texture,S.samples.value=x,S.weights.value=E,S.latitudinal.value=p==="latitudinal",h&&(S.poleAxis.value=h);let{_lodMax:A}=this;S.dTheta.value=C,S.mipInt.value=A-o;let F=this._sizeLods[s],V=3*F*(s>A-Fc?s-A+Fc:0),X=4*(this._cubeSize-F);vd(e,V,X,3*F,2*F),g.setRenderTarget(e),g.render(w,By)}};function AW(n){let t=[],e=[],o=[],s=n,l=n-Fc+1+FT.length;for(let p=0;p<l;p++){let h=Math.pow(2,s);e.push(h);let g=1/h;p>n-Fc?g=FT[p-n+Fc-1]:p===0&&(g=0),o.push(g);let m=1/(h-2),_=-m,w=1+m,S=[_,_,w,_,w,w,_,_,w,w,_,w],b=6,C=6,R=3,x=2,E=1,I=new Float32Array(R*C*b),A=new Float32Array(x*C*b),F=new Float32Array(E*C*b);for(let X=0;X<b;X++){let q=X%3*2/3-1,D=X>2?0:-1,xt=[q,D,0,q+2/3,D,0,q+2/3,D+1,0,q,D,0,q+2/3,D+1,0,q,D+1,0];I.set(xt,R*C*X),A.set(S,x*C*X);let B=[X,X,X,X,X,X];F.set(B,E*C*X)}let V=new Qu;V.setAttribute("position",new gs(I,R)),V.setAttribute("uv",new gs(A,x)),V.setAttribute("faceIndex",new gs(F,E)),t.push(V),s>Fc&&s--}return{lodPlanes:t,sizeLods:e,sigmas:o}}function zT(n,t,e){let o=new du(n,t,e);return o.texture.mapping=Wd,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function vd(n,t,e,o,s){n.viewport.set(t,e,o,s),n.scissor.set(t,e,o,s)}function TW(n,t,e){let o=new Float32Array(Rl),s=new Pt(0,1,0);return new Ca({name:"SphericalGaussianBlur",defines:{n:Rl,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Dv(),fragmentShader:`
|
|
3573
3573
|
|
|
3574
3574
|
precision mediump float;
|
|
3575
3575
|
precision mediump int;
|
|
@@ -3822,4 +3822,4 @@ void main() {
|
|
|
3822
3822
|
}
|
|
3823
3823
|
|
|
3824
3824
|
}`,gv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Fs,l=t.properties.get(s);l.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Ca({extensions:{fragDepth:!0},vertexShader:lX,fragmentShader:cX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new na(new kd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},mv=class extends Ju{constructor(t,e){super();let o=this,s=null,l=1,p=null,h="local-floor",g=1,m=null,_=null,w=null,S=null,b=null,C=null,R=new gv,x=e.getContextAttributes(),E=null,I=null,A=[],F=[],V=new ze,X=null,q=new ds;q.layers.enable(1),q.viewport=new Qi;let D=new ds;D.layers.enable(2),D.viewport=new Qi;let xt=[q,D],B=new dv;B.layers.enable(1),B.layers.enable(2);let j=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=A[ut];return Ut===void 0&&(Ut=new oh,A[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=A[ut];return Ut===void 0&&(Ut=new oh,A[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=A[ut];return Ut===void 0&&(Ut=new oh,A[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=A[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<A.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,A[ut].disconnect(Ut))}j=null,K=null,R.reset(),t.setRenderTarget(E),b=null,S=null,w=null,s=null,I=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(V.width,V.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){l=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return S!==null?S:b},this.getBinding=function(){return w},this.getFrame=function(){return C},this.getSession=function(){return s},this.setSession=function(ut){return dp(this,null,function*(){if(s=ut,s!==null){if(E=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),x.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(V),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:l};b=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:b}),t.setPixelRatio(1),t.setSize(b.framebufferWidth,b.framebufferHeight,!1),I=new du(b.framebufferWidth,b.framebufferHeight,{format:ea,type:$u,colorSpace:t.outputColorSpace,stencilBuffer:x.stencil})}else{let Ut=null,jt=null,ce=null;x.depth&&(ce=x.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=x.stencil?Vc:Dl,jt=x.stencil?Ol:Wu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:l};w=new XRWebGLBinding(s,e),S=w.createProjectionLayer(te),s.updateRenderState({layers:[S]}),t.setPixelRatio(1),t.setSize(S.textureWidth,S.textureHeight,!1),I=new du(S.textureWidth,S.textureHeight,{format:ea,type:$u,depthTexture:new Hd(S.textureWidth,S.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:x.stencil,colorSpace:t.outputColorSpace,samples:x.antialias?4:0});let $t=t.properties.get(I);$t.__ignoreDepthValues=S.ignoreDepthValues}I.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,A[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<A.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=A[ce];te&&te.connect(jt)}}let Mt=new Pt,Lt=new Pt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],Xe=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,It=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=Xe*xe/tt*Me;ut.projectionMatrix.makePerspective(z,It,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;R.texture!==null&&(ut.near=R.depthNear,ut.far=R.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||K!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,K=B.far,q.near=j,q.far=K,D.near=j,D.far=K,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),J(ut,B,Ut)};function J(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=jy*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(S===null&&b===null))return g},this.setFoveation=function(ut){g=ut,S!==null&&(S.fixedFoveation=ut),b!==null&&b.fixedFoveation!==void 0&&(b.fixedFoveation=ut)},this.hasDepthSensing=function(){return R.texture!==null};let Bt=null;function Gt(ut,Ut){if(_=Ut.getViewerPose(m||p),C=Ut,_!==null){let jt=_.views;b!==null&&(t.setRenderTargetFramebuffer(I,b.framebuffer),t.setRenderTarget(I));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(b!==null)xe=b.getViewport(qt);else{let Xe=w.getViewSubImage(S,qt);xe=Xe.viewport,$t===0&&(t.setRenderTargetTextures(I,Xe.colorTexture,S.ignoreDepthValues?void 0:Xe.depthStencilTexture),t.setRenderTarget(I))}let ft=xt[$t];ft===void 0&&(ft=new ds,ft.layers.enable($t),ft.viewport=new Qi,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=w.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&R.init(t,$t,s.renderState)}}for(let jt=0;jt<A.length;jt++){let ce=F[jt],te=A[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}R.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),C=null}let ae=new xC;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,fX=new vi;function hX(n,t){function e(x,E){x.matrixAutoUpdate===!0&&x.updateMatrix(),E.value.copy(x.matrix)}function o(x,E){E.color.getRGB(x.fogColor.value,_C(n)),E.isFog?(x.fogNear.value=E.near,x.fogFar.value=E.far):E.isFogExp2&&(x.fogDensity.value=E.density)}function s(x,E,I,A,F){E.isMeshBasicMaterial||E.isMeshLambertMaterial?l(x,E):E.isMeshToonMaterial?(l(x,E),w(x,E)):E.isMeshPhongMaterial?(l(x,E),_(x,E)):E.isMeshStandardMaterial?(l(x,E),S(x,E),E.isMeshPhysicalMaterial&&b(x,E,F)):E.isMeshMatcapMaterial?(l(x,E),C(x,E)):E.isMeshDepthMaterial?l(x,E):E.isMeshDistanceMaterial?(l(x,E),R(x,E)):E.isMeshNormalMaterial?l(x,E):E.isLineBasicMaterial?(p(x,E),E.isLineDashedMaterial&&h(x,E)):E.isPointsMaterial?g(x,E,I,A):E.isSpriteMaterial?m(x,E):E.isShadowMaterial?(x.color.value.copy(E.color),x.opacity.value=E.opacity):E.isShaderMaterial&&(E.uniformsNeedUpdate=!1)}function l(x,E){x.opacity.value=E.opacity,E.color&&x.diffuse.value.copy(E.color),E.emissive&&x.emissive.value.copy(E.emissive).multiplyScalar(E.emissiveIntensity),E.map&&(x.map.value=E.map,e(E.map,x.mapTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.bumpMap&&(x.bumpMap.value=E.bumpMap,e(E.bumpMap,x.bumpMapTransform),x.bumpScale.value=E.bumpScale,E.side===$o&&(x.bumpScale.value*=-1)),E.normalMap&&(x.normalMap.value=E.normalMap,e(E.normalMap,x.normalMapTransform),x.normalScale.value.copy(E.normalScale),E.side===$o&&x.normalScale.value.negate()),E.displacementMap&&(x.displacementMap.value=E.displacementMap,e(E.displacementMap,x.displacementMapTransform),x.displacementScale.value=E.displacementScale,x.displacementBias.value=E.displacementBias),E.emissiveMap&&(x.emissiveMap.value=E.emissiveMap,e(E.emissiveMap,x.emissiveMapTransform)),E.specularMap&&(x.specularMap.value=E.specularMap,e(E.specularMap,x.specularMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest);let I=t.get(E),A=I.envMap,F=I.envMapRotation;if(A&&(x.envMap.value=A,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),x.envMapRotation.value.setFromMatrix4(fX.makeRotationFromEuler(Cl)),x.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=E.reflectivity,x.ior.value=E.ior,x.refractionRatio.value=E.refractionRatio),E.lightMap){x.lightMap.value=E.lightMap;let V=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=E.lightMapIntensity*V,e(E.lightMap,x.lightMapTransform)}E.aoMap&&(x.aoMap.value=E.aoMap,x.aoMapIntensity.value=E.aoMapIntensity,e(E.aoMap,x.aoMapTransform))}function p(x,E){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,E.map&&(x.map.value=E.map,e(E.map,x.mapTransform))}function h(x,E){x.dashSize.value=E.dashSize,x.totalSize.value=E.dashSize+E.gapSize,x.scale.value=E.scale}function g(x,E,I,A){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,x.size.value=E.size*I,x.scale.value=A*.5,E.map&&(x.map.value=E.map,e(E.map,x.uvTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest)}function m(x,E){x.diffuse.value.copy(E.color),x.opacity.value=E.opacity,x.rotation.value=E.rotation,E.map&&(x.map.value=E.map,e(E.map,x.mapTransform)),E.alphaMap&&(x.alphaMap.value=E.alphaMap,e(E.alphaMap,x.alphaMapTransform)),E.alphaTest>0&&(x.alphaTest.value=E.alphaTest)}function _(x,E){x.specular.value.copy(E.specular),x.shininess.value=Math.max(E.shininess,1e-4)}function w(x,E){E.gradientMap&&(x.gradientMap.value=E.gradientMap)}function S(x,E){x.metalness.value=E.metalness,E.metalnessMap&&(x.metalnessMap.value=E.metalnessMap,e(E.metalnessMap,x.metalnessMapTransform)),x.roughness.value=E.roughness,E.roughnessMap&&(x.roughnessMap.value=E.roughnessMap,e(E.roughnessMap,x.roughnessMapTransform)),t.get(E).envMap&&(x.envMapIntensity.value=E.envMapIntensity)}function b(x,E,I){x.ior.value=E.ior,E.sheen>0&&(x.sheenColor.value.copy(E.sheenColor).multiplyScalar(E.sheen),x.sheenRoughness.value=E.sheenRoughness,E.sheenColorMap&&(x.sheenColorMap.value=E.sheenColorMap,e(E.sheenColorMap,x.sheenColorMapTransform)),E.sheenRoughnessMap&&(x.sheenRoughnessMap.value=E.sheenRoughnessMap,e(E.sheenRoughnessMap,x.sheenRoughnessMapTransform))),E.clearcoat>0&&(x.clearcoat.value=E.clearcoat,x.clearcoatRoughness.value=E.clearcoatRoughness,E.clearcoatMap&&(x.clearcoatMap.value=E.clearcoatMap,e(E.clearcoatMap,x.clearcoatMapTransform)),E.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=E.clearcoatRoughnessMap,e(E.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),E.clearcoatNormalMap&&(x.clearcoatNormalMap.value=E.clearcoatNormalMap,e(E.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(E.clearcoatNormalScale),E.side===$o&&x.clearcoatNormalScale.value.negate())),E.iridescence>0&&(x.iridescence.value=E.iridescence,x.iridescenceIOR.value=E.iridescenceIOR,x.iridescenceThicknessMinimum.value=E.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=E.iridescenceThicknessRange[1],E.iridescenceMap&&(x.iridescenceMap.value=E.iridescenceMap,e(E.iridescenceMap,x.iridescenceMapTransform)),E.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=E.iridescenceThicknessMap,e(E.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),E.transmission>0&&(x.transmission.value=E.transmission,x.transmissionSamplerMap.value=I.texture,x.transmissionSamplerSize.value.set(I.width,I.height),E.transmissionMap&&(x.transmissionMap.value=E.transmissionMap,e(E.transmissionMap,x.transmissionMapTransform)),x.thickness.value=E.thickness,E.thicknessMap&&(x.thicknessMap.value=E.thicknessMap,e(E.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=E.attenuationDistance,x.attenuationColor.value.copy(E.attenuationColor)),E.anisotropy>0&&(x.anisotropyVector.value.set(E.anisotropy*Math.cos(E.anisotropyRotation),E.anisotropy*Math.sin(E.anisotropyRotation)),E.anisotropyMap&&(x.anisotropyMap.value=E.anisotropyMap,e(E.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=E.specularIntensity,x.specularColor.value.copy(E.specularColor),E.specularColorMap&&(x.specularColorMap.value=E.specularColorMap,e(E.specularColorMap,x.specularColorMapTransform)),E.specularIntensityMap&&(x.specularIntensityMap.value=E.specularIntensityMap,e(E.specularIntensityMap,x.specularIntensityMapTransform))}function C(x,E){E.matcap&&(x.matcap.value=E.matcap)}function R(x,E){let I=t.get(E).light;x.referencePosition.value.setFromMatrixPosition(I.matrixWorld),x.nearDistance.value=I.shadow.camera.near,x.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function pX(n,t,e,o){let s={},l={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(I,A){let F=A.program;o.uniformBlockBinding(I,F)}function m(I,A){let F=s[I.id];F===void 0&&(C(I),F=_(I),s[I.id]=F,I.addEventListener("dispose",x));let V=A.program;o.updateUBOMapping(I,V);let X=t.render.frame;l[I.id]!==X&&(S(I),l[I.id]=X)}function _(I){let A=w();I.__bindingPointIndex=A;let F=n.createBuffer(),V=I.__size,X=I.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,V,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,A,F),F}function w(){for(let I=0;I<h;I++)if(p.indexOf(I)===-1)return p.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function S(I){let A=s[I.id],F=I.uniforms,V=I.__cache;n.bindBuffer(n.UNIFORM_BUFFER,A);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(b(j,X,xt,V)===!0){let K=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=R(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,K+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,K,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function b(I,A,F,V){let X=I.value,q=A+"_"+F;if(V[q]===void 0)return typeof X=="number"||typeof X=="boolean"?V[q]=X:V[q]=X.clone(),!0;{let D=V[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return V[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function C(I){let A=I.uniforms,F=0,V=16;for(let q=0,D=A.length;q<D;q++){let xt=Array.isArray(A[q])?A[q]:[A[q]];for(let B=0,j=xt.length;B<j;B++){let K=xt[B],Dt=Array.isArray(K.value)?K.value:[K.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=R(Mt),pt=F%V;pt!==0&&V-pt<Lt.boundary&&(F+=V-pt),K.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),K.__offset=F,F+=Lt.storage}}}let X=F%V;return X>0&&(F+=V-X),I.__size=F,I.__cache={},this}function R(I){let A={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(A.boundary=4,A.storage=4):I.isVector2?(A.boundary=8,A.storage=8):I.isVector3||I.isColor?(A.boundary=16,A.storage=12):I.isVector4?(A.boundary=16,A.storage=16):I.isMatrix3?(A.boundary=48,A.storage=48):I.isMatrix4?(A.boundary=64,A.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),A}function x(I){let A=I.target;A.removeEventListener("dispose",x);let F=p.indexOf(A.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[A.id]),delete s[A.id],delete l[A.id]}function E(){for(let I in s)n.deleteBuffer(s[I]);p=[],s={},l={}}return{bind:g,update:m,dispose:E}}var yv=class{constructor(t={}){let{canvas:e=y6(),context:o=null,depth:s=!0,stencil:l=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:w=!1}=t;this.isWebGLRenderer=!0;let S;o!==null?S=o.getContextAttributes().alpha:S=p;let b=new Uint32Array(4),C=new Int32Array(4),R=null,x=null,E=[],I=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ba,this._useLegacyLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let A=this,F=!1,V=0,X=0,q=null,D=-1,xt=null,B=new Qi,j=new Qi,K=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,J=new Qi(0,0,At,Mt),Bt=new Qi(0,0,At,Mt),Gt=!1,ae=new Gd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new ze,$t=new Pt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function Xe(Z,mt){for(let Rt=0;Rt<Z.length;Rt++){let St=Z[Rt],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:l,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:_,failIfMajorPerformanceCaveat:w};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Lv}`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",st,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(A.isWebGL1Renderer===!0&&mt.shift(),ft=Xe(mt,Z),ft===null)throw Xe(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,It,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,W,ht;function at(){ee=new PW(ft),ge=new SW(ft,ee,t),ee.init(ge),$=new aX(ft,ee,ge),fe=new oX(ft,ee,ge),Te=new LW(ft),be=new Y9,Wt=new sX(ft,ee,fe,be,ge,$,Te),Me=new bW(A),tt=new CW(A),z=new B6(ft,ge),W=new EW(ft,ee,z,ge),It=new IW(ft,z,Te,W),Ot=new FW(ft,It,z,Te),P=new DW(ft,ge,Wt),Zt=new MW(be),dt=new X9(A,Me,tt,ee,ge,W,Zt),Ht=new hX(A,be),Ce=new Z9,Vt=new eX(ee,ge),rt=new xW(A,Me,tt,fe,Ot,S,g),ne=new iX(A,Ot,ge),ht=new pX(ft,Te,ge,fe),N=new wW(ft,ee,Te,ge),k=new RW(ft,ee,Te,ge),Te.programs=dt.programs,A.capabilities=ge,A.extensions=ee,A.properties=be,A.renderLists=Ce,A.shadowMap=ne,A.state=fe,A.info=Te}at();let wt=new mv(A,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,Rt=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),Rt===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,Rt){At=Z,Mt=mt,Lt=Rt,e.width=Math.floor(Z*Rt),e.height=Math.floor(mt*Rt),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(J)},this.setViewport=function(Z,mt,Rt,St){Z.isVector4?J.set(Z.x,Z.y,Z.z,Z.w):J.set(Z,mt,Rt,St),fe.viewport(B.copy(J).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,Rt,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,Rt,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,Rt=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===pC||he===hC||he===fC}if(vt){let he=q.texture.type,ue=he===$u||he===Wu||he===Nv||he===Ol||he===lC||he===cC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(b[0]=Be,b[1]=Ae,b[2]=Pe,b[3]=de,ft.clearBufferuiv(ft.COLOR,0,b)):(C[0]=Be,C[1]=Ae,C[2]=Pe,C[3]=de,ft.clearBufferiv(ft.COLOR,0,C))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),Rt&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",st,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),W.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",He),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Ye.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,Rt=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=Rt,ne.needsUpdate=St,ne.type=vt}function st(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(Rt){dt.releaseProgram(Rt)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,Rt,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,Rt,St,vt);fe.setMaterial(St,ue);let de=Rt.index,Be=1;if(St.wireframe===!0){if(de=It.getWireframeAttribute(Rt),de===void 0)return;Be=2}let Ae=Rt.drawRange,Pe=Rt.attributes.position,rn=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(rn=Math.max(rn,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(rn=Math.max(rn,0),si=Math.min(si,de.count)):Pe!=null&&(rn=Math.max(rn,0),si=Math.min(si,Pe.count));let br=si-rn;if(br<0||br===1/0)return;W.setup(vt,St,we,Rt,de);let Wi,sr=N;if(de!==null&&(Wi=z.get(de),sr=k,sr.setIndex(Wi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(rn,br,vt.count);else if(Rt.isInstancedBufferGeometry){let ye=Rt._maxInstanceCount!==void 0?Rt._maxInstanceCount:1/0,Fa=Math.min(Rt.instanceCount,ye);sr.renderInstances(rn,br,Fa)}else sr.render(rn,br)};function Jt(Z,mt,Rt){Z.transparent===!0&&Z.side===cu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=Ku,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=cu):rr(Z,mt,Rt)}this.compile=function(Z,mt,Rt=null){Rt===null&&(Rt=Z),x=Vt.get(Rt),x.init(),I.push(x),Rt.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(x.pushLight(vt),vt.castShadow&&x.pushShadow(vt))}),Z!==Rt&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(x.pushLight(vt),vt.castShadow&&x.pushShadow(vt))}),x.setupLights(A._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Jt(we,Rt,vt),St.add(we)}else Jt(he,Rt,vt),St.add(he)}),I.pop(),x=null,St},this.compileAsync=function(Z,mt,Rt=null){let St=this.compile(Z,mt,Rt);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function He(){Ye.stop()}function Ue(){Ye.start()}let Ye=new xC;Ye.setAnimationLoop(ve),typeof self!="undefined"&&Ye.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Ye.stop():Ye.start()},wt.addEventListener("sessionstart",He),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(A,Z,mt,q),x=Vt.get(Z,I.length),x.init(),I.push(x),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),R=Ce.get(Z,E.length),R.init(),E.push(R),Qe(Z,mt,0,A.sortObjects),R.finish(),A.sortObjects===!0&&R.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let Rt=x.state.shadowsArray;if(ne.render(Rt,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(R,Z),x.setupLights(A._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(R,Z,ue,ue.viewport)}}else wr(R,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(A,Z,mt),W.resetDefaultState(),D=-1,xt=null,I.pop(),I.length>0?x=I[I.length-1]:x=null,E.pop(),E.length>0?R=E[E.length-1]:R=null};function Qe(Z,mt,Rt,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)Rt=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)x.pushLight(Z),Z.castShadow&&x.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&R.push(Z,ue,we,Rt,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],rn=we[Pe.materialIndex];rn&&rn.visible&&R.push(Z,ue,rn,Rt,$t.z,Pe)}}else we.visible&&R.push(Z,ue,we,Rt,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)Qe(he[ue],mt,Rt,St)}function wr(Z,mt,Rt,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;x.setupLightsView(Rt),ut===!0&&Zt.setGlobalState(A.clippingPlanes,Rt),he.length>0&&Kr(vt,he,mt,Rt),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,Rt),he.length>0&&nr(he,mt,Rt),ue.length>0&&nr(ue,mt,Rt),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Kr(Z,mt,Rt,St){if((Rt.isScene===!0?Rt.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new du(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?sh:$u,minFilter:Ll,samples:he?4:0})),A.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(Qy(te.x),Qy(te.y));let ue=A.getRenderTarget();A.setRenderTarget(jt),A.getClearColor(Dt),Q=A.getClearAlpha(),Q<1&&A.setClearColor(16777215,.5),A.clear();let we=A.toneMapping;A.toneMapping=Yu,nr(Z,Rt,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],rn=Pe.object,si=Pe.geometry,br=Pe.material,Wi=Pe.group;if(br.side===cu&&rn.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(rn,Rt,St,si,br,Wi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),A.setRenderTarget(ue),A.setClearColor(Dt,Q),A.toneMapping=we}function nr(Z,mt,Rt){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(Rt.layers)&&Ie(we,mt,Rt,de,Be,Ae)}}function Ie(Z,mt,Rt,St,vt,he){Z.onBeforeRender(A,mt,Rt,St,vt,he),Z.modelViewMatrix.multiplyMatrices(Rt.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(A,mt,Rt,St,Z,he),vt.transparent===!0&&vt.side===cu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,A.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=Ku,vt.needsUpdate=!0,A.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=cu):A.renderBufferDirect(Rt,mt,St,vt,Z,he),Z.onAfterRender(A,mt,Rt,St,vt,he)}function rr(Z,mt,Rt){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=x.state.lights,he=x.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,Rt),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(Rt,we,A),Z.onBeforeCompile(we,A),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=kc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let Rt=be.get(Z);Rt.outputColorSpace=mt.outputColorSpace,Rt.batching=mt.batching,Rt.instancing=mt.instancing,Rt.instancingColor=mt.instancingColor,Rt.instancingMorph=mt.instancingMorph,Rt.skinning=mt.skinning,Rt.morphTargets=mt.morphTargets,Rt.morphNormals=mt.morphNormals,Rt.morphColors=mt.morphColors,Rt.morphTargetsCount=mt.morphTargetsCount,Rt.numClippingPlanes=mt.numClippingPlanes,Rt.numIntersection=mt.numClipIntersection,Rt.vertexAlphas=mt.vertexAlphas,Rt.vertexTangents=mt.vertexTangents,Rt.toneMapping=mt.toneMapping}function Qn(Z,mt,Rt,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?A.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:tl,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!Rt.attributes.color&&Rt.attributes.color.itemSize===4,Ae=!!Rt.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!Rt.morphAttributes.position,rn=!!Rt.morphAttributes.normal,si=!!Rt.morphAttributes.color,br=Yu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=A.toneMapping);let Wi=Rt.morphAttributes.position||Rt.morphAttributes.normal||Rt.morphAttributes.color,sr=Wi!==void 0?Wi.length:0,ye=be.get(St),Fa=x.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let on=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Fa.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==rn||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(on=!0):(on=!0,ye.__version=St.version);let fo=ye.currentProgram;on===!0&&(fo=rr(St,mt,vt));let ul=!1,Ge=!1,ys=!1,ir=fo.getUniforms(),jo=ye.uniforms;if(fe.useProgram(fo.program)&&(ul=!0,Ge=!0,ys=!0),St.id!==D&&(D=St.id,Ge=!0),ul||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,Ge=!0,ys=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=Rt.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,Rt,fo),(Ge||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(jo.envMap.value=de,jo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),Ge&&(ir.setValue(ft,"toneMappingExposure",A.toneMappingExposure),ye.needsLights&&bi(jo,ys),he&&St.fog===!0&&Ht.refreshFogUniforms(jo,he),Ht.refreshMaterialUniforms(jo,St,Lt,Mt,jt),kc.upload(ft,pr(ye),jo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(kc.upload(ft,pr(ye),jo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ua=0,yu=Ai.length;Ua<yu;Ua++)if(ge.isWebGL2){let Ti=Ai[Ua];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return V},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,Rt){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=Rt;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=Rt===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let Rt=be.get(Z);Rt.__webglFramebuffer=mt,Rt.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,Rt=0){q=Z,V=mt,X=Rt;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][Rt]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[Rt]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),K=Z.scissorTest}else B.copy(J).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),K=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(K),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,Rt)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,Rt||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,Rt,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==ea&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===sh&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==$u&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===fu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&Rt>=0&&Rt<=Z.height-vt&&ft.readPixels(mt,Rt,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,Rt=0){let St=Math.pow(2,-Rt),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,Rt,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,Rt,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(Rt.format),we=$.convert(Rt.type);Wt.setTexture2D(Rt,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,Rt.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Rt.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,Rt.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&Rt.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,Rt,St,vt=0){if(A.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),rn=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Wi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=Rt.isCompressedTexture?Rt.mipmaps[vt]:Rt.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),Rt.isDataTexture||Rt.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,rn),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Wi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){V=0,X=0,q=null,fe.reset(),W.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Ov?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Xd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},vv=class extends yv{};vv.prototype.isWebGL1Renderer=!0;var _v=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Ky,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Zu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,l=this.stride;s<l;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wo=new Pt,Vd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Ta(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ta(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ta(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ta(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ta(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=l,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return new gs(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},xv=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Hu,nh=new Pt,Nc=new Pt,Oc=new Pt,Dc=new ze,rh=new ze,AC=new vi,_d=new Pt,ih=new Pt,xd=new Pt,rC=new ze,Hy=new ze,iC=new ze,Ev=class extends ra{constructor(t=new xv){if(super(),this.isSprite=!0,this.type="Sprite",Hu===void 0){Hu=new Qu;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new _v(e,5);Hu.setIndex([0,1,2,0,2,3]),Hu.setAttribute("position",new Vd(o,3,0,!1)),Hu.setAttribute("uv",new Vd(o,2,3,!1))}this.geometry=Hu,this.material=t,this.center=new ze(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Nc.setFromMatrixScale(this.matrixWorld),AC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Oc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Nc.multiplyScalar(-Oc.z);let o=this.material.rotation,s,l;o!==0&&(l=Math.cos(o),s=Math.sin(o));let p=this.center;Ed(_d.set(-.5,-.5,0),Oc,p,Nc,s,l),Ed(ih.set(.5,-.5,0),Oc,p,Nc,s,l),Ed(xd.set(.5,.5,0),Oc,p,Nc,s,l),rC.set(0,0),Hy.set(1,0),iC.set(1,1);let h=t.ray.intersectTriangle(_d,ih,xd,!1,nh);if(h===null&&(Ed(ih.set(-.5,.5,0),Oc,p,Nc,s,l),Hy.set(0,1),h=t.ray.intersectTriangle(_d,xd,ih,!1,nh),h===null))return;let g=t.ray.origin.distanceTo(nh);g<t.near||g>t.far||e.push({distance:g,point:nh.clone(),uv:Nl.getInterpolation(nh,_d,ih,xd,rC,Hy,iC,new ze),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};Ev.Dispose=function(){Hu.dispose(),Hu=void 0};function Ed(n,t,e,o,s,l){Dc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(rh.x=l*Dc.x-s*Dc.y,rh.y=s*Dc.x+l*Dc.y):rh.copy(Dc),n.copy(t),n.x+=rh.x,n.y+=rh.y,n.applyMatrix4(AC)}function wd(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function dX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Xc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],l=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<l)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(l=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=l)){let h=e[1];t<h&&(o=2,l=h);for(let g=o-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=l,l=e[--o-1],t>=l)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],l=e[o-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,l,s)}return this.interpolate_(o,l,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=t*s;for(let p=0;p!==s;++p)e[p]=o[l+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},wv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hT,endingEnd:hT}}intervalChanged_(t,e,o){let s=this.parameterPositions,l=t-2,p=t+1,h=s[l],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case pT:l=t,h=2*e-o;break;case dT:l=s.length-2,h=e+s[l]-s[l+1];break;default:l=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case pT:p=t,g=2*o-e;break;case dT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,_=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=l*_,this._offsetNext=p*_}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=this._offsetPrev,w=this._offsetNext,S=this._weightPrev,b=this._weightNext,C=(o-e)/(s-e),R=C*C,x=R*C,E=-S*x+2*S*R-S*C,I=(1+S)*x+(-1.5-2*S)*R+(-.5+S)*C+1,A=(-1-b)*x+(1.5+b)*R+.5*C,F=b*x-b*R;for(let V=0;V!==h;++V)l[V]=E*p[_+V]+I*p[m+V]+A*p[g+V]+F*p[w+V];return l}},Sv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=(o-e)/(s-e),w=1-_;for(let S=0;S!==h;++S)l[S]=p[m+S]*w+p[g+S]*_;return l}},Mv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},ia=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=wd(e,this.TimeBufferType),this.values=wd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:wd(t.times,Array),values:wd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Mv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Sv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new wv(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Md:e=this.InterpolantFactoryMethodDiscrete;break;case bd:e=this.InterpolantFactoryMethodLinear;break;case my:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Md;case this.InterpolantFactoryMethodLinear:return bd;case this.InterpolantFactoryMethodSmooth:return my}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,l=0,p=s-1;for(;l!==s&&o[l]<t;)++l;for(;p!==-1&&o[p]>e;)--p;if(++p,l!==0||p!==s){l>=p&&(p=Math.max(p,1),l=p-1);let h=this.getValueSize();this.times=o.slice(l,p),this.values=this.values.slice(l*h,p*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,l=o.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==l;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&dX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===my,l=t.length-1,p=1;for(let h=1;h<l;++h){let g=!1,m=t[h],_=t[h+1];if(m!==_&&(h!==1||m!==t[0]))if(s)g=!0;else{let w=h*o,S=w-o,b=w+o;for(let C=0;C!==o;++C){let R=e[w+C];if(R!==e[S+C]||R!==e[b+C]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let w=h*o,S=p*o;for(let b=0;b!==o;++b)e[S+b]=e[w+b]}++p}}if(l>0){t[p]=t[l];for(let h=l*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};ia.prototype.TimeBufferType=Float32Array;ia.prototype.ValueBufferType=Float32Array;ia.prototype.DefaultInterpolation=bd;var zl=class extends ia{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=Md;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var bv=class extends ia{};bv.prototype.ValueTypeName="color";var Av=class extends ia{};Av.prototype.ValueTypeName="number";var Tv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let _=m+h;m!==_;m+=4)ju.slerpFlat(l,0,p,m-h,p,m,g);return l}},lh=class extends ia{InterpolantFactoryMethodLinear(t){return new Tv(this.times,this.values,this.getValueSize(),t)}};lh.prototype.ValueTypeName="quaternion";lh.prototype.DefaultInterpolation=bd;lh.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends ia{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=Md;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Cv=class extends ia{};Cv.prototype.ValueTypeName="vector";var Pv=class{constructor(t,e,o){let s=this,l=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(_){h++,l===!1&&s.onStart!==void 0&&s.onStart(_,p,h),l=!0},this.itemEnd=function(_){p++,s.onProgress!==void 0&&s.onProgress(_,p,h),p===h&&(l=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(_){s.onError!==void 0&&s.onError(_)},this.resolveURL=function(_){return g?g(_):_},this.setURLModifier=function(_){return g=_,this},this.addHandler=function(_,w){return m.push(_,w),this},this.removeHandler=function(_){let w=m.indexOf(_);return w!==-1&&m.splice(w,2),this},this.getHandler=function(_){for(let w=0,S=m.length;w<S;w+=2){let b=m[w],C=m[w+1];if(b.global&&(b.lastIndex=0),b.test(_))return C}return null}}},gX=new Pv,Iv=class{constructor(t){this.manager=t!==void 0?t:gX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,l){o.load(t,s,e,l)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Iv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Fv="\\[\\]\\.:\\/",mX=new RegExp("["+Fv+"]","g"),Uv="[^"+Fv+"]",yX="[^"+Fv.replace("\\.","")+"]",vX=/((?:WC+[\/:])*)/.source.replace("WC",Uv),_X=/(WCOD+)?/.source.replace("WCOD",yX),xX=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Uv),EX=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Uv),wX=new RegExp("^"+vX+_X+xX+EX+"$"),SX=["material","materials","bones","map"],Rv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,l=o.length;s!==l;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(mX,"")}static parseTrackName(t){let e=wX.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let l=o.nodeName.substring(s+1);SX.indexOf(l)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=l)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(l){for(let p=0;p<l.length;p++){let h=l[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,l=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let m=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let _=0;_<t.length;_++)if(t[_].name===m){m=_;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(l!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[l]!==void 0&&(l=t.morphTargetDictionary[l])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=l}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Rv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Ztt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Lv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Lv);var zi=63710088e-1,jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},Qtt={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/zi,yards:1.0936133};function bo(n,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=n,o}function Pr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pa(n[0])||!Pa(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return bo(o,t,e)}function Bv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Pa(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,_=0,w=0,S,b=n.type,C=b==="FeatureCollection",R=b==="Feature",x=C?n.features.length:1,E=0;E<x;E++){m=C?n.features[E].geometry:R?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var I=0;I<h;I++){var A=0,F=0;if(p=S?m.geometries[I]:m,p!==null){g=p.coordinates;var V=p.type;switch(_=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,w,E,A,F)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,F)===!1)return!1;w++,V==="MultiPoint"&&A++}V==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],w,E,A,F)===!1)return!1;w++}V==="MultiLineString"&&A++,V==="Polygon"&&F++}V==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-_;l++){if(t(g[o][s][l],w,E,A,F)===!1)return!1;w++}F++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TC(n,t,e,o){var s=e;return Ei(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function el(n,t){var e,o,s,l,p,h,g,m,_,w,S=0,b=n.type==="FeatureCollection",C=n.type==="Feature",R=b?n.features.length:1;for(e=0;e<R;e++){for(h=b?n.features[e].geometry:C?n.geometry:n,m=b?n.features[e].properties:C?n.properties:{},_=b?n.features[e].bbox:C?n.bbox:void 0,w=b?n.features[e].id:C?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,S,m,_,w)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,S,m,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],S,m,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function ms(n,t){el(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],w={type:g,coordinates:_};if(t(bo(w,s),o,m)===!1)return!1}})}function zv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}zv.default=zv;var Ao=zv;function to(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Gv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function eo(n){return n.type==="Feature"?n.geometry:n}var RX=$e($d(),1);var kX=$e(WC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=to(n),s=eo(t),l=s.type,p=t.bbox,h=s.coordinates;if(p&&qX(o,p)===!1)return!1;l==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(XC(o,h[m][0],e.ignoreBoundary)){for(var _=!1,w=1;w<h[m].length&&!_;)XC(o,h[m][w],!e.ignoreBoundary)&&(_=!0),w++;_||(g=!0)}return g}function XC(n,t,e){var o=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,l=t.length-1;s<t.length;l=s++){var p=t[s][0],h=t[s][1],g=t[l][0],m=t[l][1],_=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(_)return!e;var w=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;w&&(o=!o)}return o}function qX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZC=new ArrayBuffer(16),Int=new Float64Array(ZC),Rnt=new Uint32Array(ZC);var r7=$e(n_(),1);var rit=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var l=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var l=this.pos(s),p=Math.sqrt((l.x-o.x)*(l.x-o.x)+(l.y-o.y)*(l.y-o.y)+(l.z-o.z)*(l.z-o.z));p>t&&(e.push(s),o=l)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),l=(this.length-1)*o-s;return i7(l,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function i7(n,t,e,o,s){var l=o7(n),p={x:s.x*l[0]+o.x*l[1]+e.x*l[2]+t.x*l[3],y:s.y*l[0]+o.y*l[1]+e.y*l[2]+t.y*l[3],z:s.z*l[0]+o.z*l[1]+e.z*l[2]+t.z*l[3]};return p}function o7(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function ph(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),l=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,l],g=[s,l],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function s7(n){return ph(Ao(n))}var r_=s7;var S7=$e(sP(),1);var K7=$e(fg(),1);var j7=$e($d(),1);var eY=$e(n_(),1);var MP=Math.PI/180,bP=180/Math.PI,xh=function(n,t){this.lon=n,this.lat=t,this.x=MP*n,this.y=MP*t};xh.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};xh.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new xh(t,n)};var AP=function(){this.coords=[],this.length=0};AP.prototype.move_to=function(n){this.length++,this.coords.push(n)};var S_=function(n){this.properties=n||{},this.geometries=[]};S_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};S_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(l){t+=l[0]+" "+l[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TP=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new xh(n.x,n.y),this.end=new xh(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,l=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(l)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};TP.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),l=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=bP*Math.atan2(l,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=bP*Math.atan2(s,o);return[h,p]};TP.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(n-1),s=0;s<n;++s){var l=o*s,p=this.interpolate(l);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,_=180-m,w=-180+m,S=360-m,b=1;b<e.length;++b){var C=e[b-1][0],R=e[b][0],x=Math.abs(R-C);x>S&&(R>_&&C<w||C>_&&R<w)?h=!0:x>g&&(g=x)}var E=[];if(h&&g<m){var I=[];E.push(I);for(var A=0;A<e.length;++A){var F=parseFloat(e[A][0]);if(A>0&&Math.abs(F-e[A-1][0])>S){var V=parseFloat(e[A-1][0]),X=parseFloat(e[A-1][1]),q=parseFloat(e[A][0]),D=parseFloat(e[A][1]);if(V>-180&&V<w&&q===180&&A+1<e.length&&e[A-1][0]>-180&&e[A-1][0]<w){I.push([-180,e[A][1]]),A++,I.push([e[A][0],e[A][1]]);continue}else if(V>_&&V<180&&q===-180&&A+1<e.length&&e[A-1][0]>_&&e[A-1][0]<180){I.push([180,e[A][1]]),A++,I.push([e[A][0],e[A][1]]);continue}if(V<w&&q>_){var xt=V;V=q,q=xt;var B=X;X=D,D=B}if(V>_&&q<w&&(q+=360),V<=180&&q>=180&&V<q){var j=(180-V)/(q-V),K=j*D+(1-j)*X;I.push([e[A-1][0]>_?180:-180,K]),I=[],I.push([e[A-1][0]>_?-180:180,K]),E.push(I)}else I=[],E.push(I);I.push([F,e[A][1]])}else I.push([e[A][0],e[A][1]])}}else{var Dt=[];E.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new S_(this.properties),Mt=0;Mt<E.length;++Mt){var Lt=new AP;At.geometries.push(Lt);for(var pt=E[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var iY=$e(fg(),1);var rZ=$e(fg(),1);var iZ=$e(J_(),1);var aZ=$e($d(),1);var cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[],Nn=[];mn[85]=_n[85]=-1;yn[85]=xn[85]=0;vn[85]=En[85]=1;Cn[85]=Rn[85]=1;Pn[85]=Ln[85]=0;In[85]=Nn[85]=1;cn[85]=pn[85]=0;fn[85]=dn[85]=-1;hn[85]=Mn[85]=0;bn[85]=wn[85]=0;An[85]=Sn[85]=1;gn[85]=Tn[85]=1;Rn[1]=Rn[169]=0;Ln[1]=Ln[169]=-1;Nn[1]=Nn[169]=0;wn[1]=wn[169]=-1;Sn[1]=Sn[169]=0;Mn[1]=Mn[169]=0;_n[4]=_n[166]=0;xn[4]=xn[166]=-1;En[4]=En[166]=1;bn[4]=bn[166]=1;An[4]=An[166]=0;Tn[4]=Tn[166]=0;mn[16]=mn[154]=0;yn[16]=yn[154]=1;vn[16]=vn[154]=1;pn[16]=pn[154]=1;dn[16]=dn[154]=0;gn[16]=gn[154]=1;Cn[64]=Cn[106]=0;Pn[64]=Pn[106]=1;In[64]=In[106]=0;cn[64]=cn[106]=-1;fn[64]=fn[106]=0;hn[64]=hn[106]=1;Cn[2]=Cn[168]=0;Pn[2]=Pn[168]=-1;In[2]=In[168]=1;Rn[2]=Rn[168]=0;Ln[2]=Ln[168]=-1;Nn[2]=Nn[168]=0;wn[2]=wn[168]=-1;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=0;bn[2]=bn[168]=-1;An[2]=An[168]=0;Tn[2]=Tn[168]=1;mn[8]=mn[162]=0;yn[8]=yn[162]=-1;vn[8]=vn[162]=0;_n[8]=_n[162]=0;xn[8]=xn[162]=-1;En[8]=En[162]=1;wn[8]=wn[162]=1;Sn[8]=Sn[162]=0;Mn[8]=Mn[162]=1;bn[8]=bn[162]=1;An[8]=An[162]=0;Tn[8]=Tn[162]=0;mn[32]=mn[138]=0;yn[32]=yn[138]=1;vn[32]=vn[138]=1;_n[32]=_n[138]=0;xn[32]=xn[138]=1;En[32]=En[138]=0;cn[32]=cn[138]=1;fn[32]=fn[138]=0;hn[32]=hn[138]=0;pn[32]=pn[138]=1;dn[32]=dn[138]=0;gn[32]=gn[138]=1;Rn[128]=Rn[42]=0;Ln[128]=Ln[42]=1;Nn[128]=Nn[42]=1;Cn[128]=Cn[42]=0;Pn[128]=Pn[42]=1;In[128]=In[42]=0;cn[128]=cn[42]=-1;fn[128]=fn[42]=0;hn[128]=hn[42]=1;pn[128]=pn[42]=-1;dn[128]=dn[42]=0;gn[128]=gn[42]=0;_n[5]=_n[165]=-1;xn[5]=xn[165]=0;En[5]=En[165]=0;Rn[5]=Rn[165]=1;Ln[5]=Ln[165]=0;Nn[5]=Nn[165]=0;bn[20]=bn[150]=0;An[20]=An[150]=1;Tn[20]=Tn[150]=1;pn[20]=pn[150]=0;dn[20]=dn[150]=-1;gn[20]=gn[150]=1;mn[80]=mn[90]=-1;yn[80]=yn[90]=0;vn[80]=vn[90]=1;Cn[80]=Cn[90]=1;Pn[80]=Pn[90]=0;In[80]=In[90]=1;wn[65]=wn[105]=0;Sn[65]=Sn[105]=1;Mn[65]=Mn[105]=0;cn[65]=cn[105]=0;fn[65]=fn[105]=-1;hn[65]=hn[105]=0;mn[160]=mn[10]=-1;yn[160]=yn[10]=0;vn[160]=vn[10]=1;_n[160]=_n[10]=-1;xn[160]=xn[10]=0;En[160]=En[10]=0;Rn[160]=Rn[10]=1;Ln[160]=Ln[10]=0;Nn[160]=Nn[10]=0;Cn[160]=Cn[10]=1;Pn[160]=Pn[10]=0;In[160]=In[10]=1;bn[130]=bn[40]=0;An[130]=An[40]=1;Tn[130]=Tn[40]=1;wn[130]=wn[40]=0;Sn[130]=Sn[40]=1;Mn[130]=Mn[40]=0;cn[130]=cn[40]=0;fn[130]=fn[40]=-1;hn[130]=hn[40]=0;pn[130]=pn[40]=0;dn[130]=dn[40]=-1;gn[130]=gn[40]=1;_n[37]=_n[133]=0;xn[37]=xn[133]=1;En[37]=En[133]=1;Rn[37]=Rn[133]=0;Ln[37]=Ln[133]=1;Nn[37]=Nn[133]=0;cn[37]=cn[133]=-1;fn[37]=fn[133]=0;hn[37]=hn[133]=0;pn[37]=pn[133]=1;dn[37]=dn[133]=0;gn[37]=gn[133]=0;bn[148]=bn[22]=-1;An[148]=An[22]=0;Tn[148]=Tn[22]=0;Rn[148]=Rn[22]=0;Ln[148]=Ln[22]=-1;Nn[148]=Nn[22]=1;Cn[148]=Cn[22]=0;Pn[148]=Pn[22]=1;In[148]=In[22]=1;pn[148]=pn[22]=-1;dn[148]=dn[22]=0;gn[148]=gn[22]=1;mn[82]=mn[88]=0;yn[82]=yn[88]=-1;vn[82]=vn[88]=1;bn[82]=bn[88]=1;An[82]=An[88]=0;Tn[82]=Tn[88]=1;wn[82]=wn[88]=-1;Sn[82]=Sn[88]=0;Mn[82]=Mn[88]=1;Cn[82]=Cn[88]=0;Pn[82]=Pn[88]=-1;In[82]=In[88]=0;mn[73]=mn[97]=0;yn[73]=yn[97]=1;vn[73]=vn[97]=0;_n[73]=_n[97]=0;xn[73]=xn[97]=-1;En[73]=En[97]=0;wn[73]=wn[97]=1;Sn[73]=Sn[97]=0;Mn[73]=Mn[97]=0;cn[73]=cn[97]=1;fn[73]=fn[97]=0;hn[73]=hn[97]=1;mn[145]=mn[25]=0;yn[145]=yn[25]=-1;vn[145]=vn[25]=0;wn[145]=wn[25]=1;Sn[145]=Sn[25]=0;Mn[145]=Mn[25]=1;Rn[145]=Rn[25]=0;Ln[145]=Ln[25]=1;Nn[145]=Nn[25]=1;pn[145]=pn[25]=-1;dn[145]=dn[25]=0;gn[145]=gn[25]=0;_n[70]=_n[100]=0;xn[70]=xn[100]=1;En[70]=En[100]=0;bn[70]=bn[100]=-1;An[70]=An[100]=0;Tn[70]=Tn[100]=1;Cn[70]=Cn[100]=0;Pn[70]=Pn[100]=-1;In[70]=In[100]=1;cn[70]=cn[100]=1;fn[70]=fn[100]=0;hn[70]=hn[100]=0;_n[101]=_n[69]=0;xn[101]=xn[69]=1;En[101]=En[69]=0;cn[101]=cn[69]=1;fn[101]=fn[69]=0;hn[101]=hn[69]=0;Rn[149]=Rn[21]=0;Ln[149]=Ln[21]=1;Nn[149]=Nn[21]=1;pn[149]=pn[21]=-1;dn[149]=dn[21]=0;gn[149]=gn[21]=0;bn[86]=bn[84]=-1;An[86]=An[84]=0;Tn[86]=Tn[84]=1;Cn[86]=Cn[84]=0;Pn[86]=Pn[84]=-1;In[86]=In[84]=1;mn[89]=mn[81]=0;yn[89]=yn[81]=-1;vn[89]=vn[81]=0;wn[89]=wn[81]=1;Sn[89]=Sn[81]=0;Mn[89]=Mn[81]=1;mn[96]=mn[74]=0;yn[96]=yn[74]=1;vn[96]=vn[74]=0;_n[96]=_n[74]=-1;xn[96]=xn[74]=0;En[96]=En[74]=1;Cn[96]=Cn[74]=1;Pn[96]=Pn[74]=0;In[96]=In[74]=0;cn[96]=cn[74]=1;fn[96]=fn[74]=0;hn[96]=hn[74]=1;mn[24]=mn[146]=0;yn[24]=yn[146]=-1;vn[24]=vn[146]=1;bn[24]=bn[146]=1;An[24]=An[146]=0;Tn[24]=Tn[146]=1;wn[24]=wn[146]=0;Sn[24]=Sn[146]=1;Mn[24]=Mn[146]=1;pn[24]=pn[146]=0;dn[24]=dn[146]=-1;gn[24]=gn[146]=0;_n[6]=_n[164]=-1;xn[6]=xn[164]=0;En[6]=En[164]=1;bn[6]=bn[164]=-1;An[6]=An[164]=0;Tn[6]=Tn[164]=0;Rn[6]=Rn[164]=0;Ln[6]=Ln[164]=-1;Nn[6]=Nn[164]=1;Cn[6]=Cn[164]=1;Pn[6]=Pn[164]=0;In[6]=In[164]=0;wn[129]=wn[41]=0;Sn[129]=Sn[41]=1;Mn[129]=Mn[41]=1;Rn[129]=Rn[41]=0;Ln[129]=Ln[41]=1;Nn[129]=Nn[41]=0;cn[129]=cn[41]=-1;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=0;dn[129]=dn[41]=-1;gn[129]=gn[41]=0;bn[66]=bn[104]=0;An[66]=An[104]=1;Tn[66]=Tn[104]=0;wn[66]=wn[104]=-1;Sn[66]=Sn[104]=0;Mn[66]=Mn[104]=1;Cn[66]=Cn[104]=0;Pn[66]=Pn[104]=-1;In[66]=In[104]=0;cn[66]=cn[104]=0;fn[66]=fn[104]=-1;hn[66]=hn[104]=1;mn[144]=mn[26]=-1;yn[144]=yn[26]=0;vn[144]=vn[26]=0;Rn[144]=Rn[26]=1;Ln[144]=Ln[26]=0;Nn[144]=Nn[26]=1;Cn[144]=Cn[26]=0;Pn[144]=Pn[26]=1;In[144]=In[26]=1;pn[144]=pn[26]=-1;dn[144]=dn[26]=0;gn[144]=gn[26]=1;_n[36]=_n[134]=0;xn[36]=xn[134]=1;En[36]=En[134]=1;bn[36]=bn[134]=0;An[36]=An[134]=1;Tn[36]=Tn[134]=0;cn[36]=cn[134]=0;fn[36]=fn[134]=-1;hn[36]=hn[134]=1;pn[36]=pn[134]=1;dn[36]=dn[134]=0;gn[36]=gn[134]=0;mn[9]=mn[161]=-1;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=0;xn[9]=xn[161]=-1;En[9]=En[161]=0;wn[9]=wn[161]=1;Sn[9]=Sn[161]=0;Mn[9]=Mn[161]=0;Rn[9]=Rn[161]=1;Ln[9]=Ln[161]=0;Nn[9]=Nn[161]=1;mn[136]=0;yn[136]=1;vn[136]=1;_n[136]=0;xn[136]=1;En[136]=0;bn[136]=-1;An[136]=0;Tn[136]=1;wn[136]=-1;Sn[136]=0;Mn[136]=0;Rn[136]=0;Ln[136]=-1;Nn[136]=0;Cn[136]=0;Pn[136]=-1;In[136]=1;cn[136]=1;fn[136]=0;hn[136]=0;pn[136]=1;dn[136]=0;gn[136]=1;mn[34]=0;yn[34]=-1;vn[34]=0;_n[34]=0;xn[34]=-1;En[34]=1;bn[34]=1;An[34]=0;Tn[34]=0;wn[34]=1;Sn[34]=0;Mn[34]=1;Rn[34]=0;Ln[34]=1;Nn[34]=1;Cn[34]=0;Pn[34]=1;In[34]=0;cn[34]=-1;fn[34]=0;hn[34]=1;pn[34]=-1;dn[34]=0;gn[34]=0;mn[35]=0;yn[35]=1;vn[35]=1;_n[35]=0;xn[35]=-1;En[35]=1;bn[35]=1;An[35]=0;Tn[35]=0;wn[35]=-1;Sn[35]=0;Mn[35]=0;Rn[35]=0;Ln[35]=-1;Nn[35]=0;Cn[35]=0;Pn[35]=1;In[35]=0;cn[35]=-1;fn[35]=0;hn[35]=1;pn[35]=1;dn[35]=0;gn[35]=1;mn[153]=0;yn[153]=1;vn[153]=1;wn[153]=-1;Sn[153]=0;Mn[153]=0;Rn[153]=0;Ln[153]=-1;Nn[153]=0;pn[153]=1;dn[153]=0;gn[153]=1;_n[102]=0;xn[102]=-1;En[102]=1;bn[102]=1;An[102]=0;Tn[102]=0;Cn[102]=0;Pn[102]=1;In[102]=0;cn[102]=-1;fn[102]=0;hn[102]=1;mn[155]=0;yn[155]=-1;vn[155]=0;wn[155]=1;Sn[155]=0;Mn[155]=1;Rn[155]=0;Ln[155]=1;Nn[155]=1;pn[155]=-1;dn[155]=0;gn[155]=0;_n[103]=0;xn[103]=1;En[103]=0;bn[103]=-1;An[103]=0;Tn[103]=1;Cn[103]=0;Pn[103]=-1;In[103]=1;cn[103]=1;fn[103]=0;hn[103]=0;mn[152]=0;yn[152]=1;vn[152]=1;bn[152]=-1;An[152]=0;Tn[152]=1;wn[152]=-1;Sn[152]=0;Mn[152]=0;Rn[152]=0;Ln[152]=-1;Nn[152]=0;Cn[152]=0;Pn[152]=-1;In[152]=1;pn[152]=1;dn[152]=0;gn[152]=1;mn[156]=0;yn[156]=-1;vn[156]=1;bn[156]=1;An[156]=0;Tn[156]=1;wn[156]=-1;Sn[156]=0;Mn[156]=0;Rn[156]=0;Ln[156]=-1;Nn[156]=0;Cn[156]=0;Pn[156]=1;In[156]=1;pn[156]=-1;dn[156]=0;gn[156]=1;mn[137]=0;yn[137]=1;vn[137]=1;_n[137]=0;xn[137]=1;En[137]=0;wn[137]=-1;Sn[137]=0;Mn[137]=0;Rn[137]=0;Ln[137]=-1;Nn[137]=0;cn[137]=1;fn[137]=0;hn[137]=0;pn[137]=1;dn[137]=0;gn[137]=1;mn[139]=0;yn[139]=1;vn[139]=1;_n[139]=0;xn[139]=-1;En[139]=0;wn[139]=1;Sn[139]=0;Mn[139]=0;Rn[139]=0;Ln[139]=1;Nn[139]=0;cn[139]=-1;fn[139]=0;hn[139]=0;pn[139]=1;dn[139]=0;gn[139]=1;mn[98]=0;yn[98]=-1;vn[98]=0;_n[98]=0;xn[98]=-1;En[98]=1;bn[98]=1;An[98]=0;Tn[98]=0;wn[98]=1;Sn[98]=0;Mn[98]=1;Cn[98]=0;Pn[98]=1;In[98]=0;cn[98]=-1;fn[98]=0;hn[98]=1;mn[99]=0;yn[99]=1;vn[99]=0;_n[99]=0;xn[99]=-1;En[99]=1;bn[99]=1;An[99]=0;Tn[99]=0;wn[99]=-1;Sn[99]=0;Mn[99]=1;Cn[99]=0;Pn[99]=-1;In[99]=0;cn[99]=1;fn[99]=0;hn[99]=1;_n[38]=0;xn[38]=-1;En[38]=1;bn[38]=1;An[38]=0;Tn[38]=0;Rn[38]=0;Ln[38]=1;Nn[38]=1;Cn[38]=0;Pn[38]=1;In[38]=0;cn[38]=-1;fn[38]=0;hn[38]=1;pn[38]=-1;dn[38]=0;gn[38]=0;_n[39]=0;xn[39]=1;En[39]=1;bn[39]=-1;An[39]=0;Tn[39]=0;Rn[39]=0;Ln[39]=-1;Nn[39]=1;Cn[39]=0;Pn[39]=1;In[39]=0;cn[39]=-1;fn[39]=0;hn[39]=1;pn[39]=1;dn[39]=0;gn[39]=0;var j_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},Q_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},t1=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},e1=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},n1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},r1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},i1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},o1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},uZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},lZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},cZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},fZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},hZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},pZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},dZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},gZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},mZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},yZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},vZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},_Z=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},xZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},EZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},wZ=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},SZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},MZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},bZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},AZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},TZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},CZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},PZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},IZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},RZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},LZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},NZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},OZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},DZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},FZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},UZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},BZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},zZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[],Wn=[];kn[1]=qn[1]=18;kn[169]=qn[169]=18;Gn[4]=zn[4]=12;Gn[166]=zn[166]=12;Bn[16]=Wn[16]=4;Bn[154]=Wn[154]=4;Hn[64]=Vn[64]=22;Hn[106]=Vn[106]=22;Gn[2]=Hn[2]=17;kn[2]=qn[2]=18;Gn[168]=Hn[168]=17;kn[168]=qn[168]=18;Bn[8]=kn[8]=9;zn[8]=Gn[8]=12;Bn[162]=kn[162]=9;zn[162]=Gn[162]=12;Bn[32]=Wn[32]=4;zn[32]=Vn[32]=1;Bn[138]=Wn[138]=4;zn[138]=Vn[138]=1;qn[128]=Wn[128]=21;Hn[128]=Vn[128]=22;qn[42]=Wn[42]=21;Hn[42]=Vn[42]=22;zn[5]=qn[5]=14;zn[165]=qn[165]=14;Gn[20]=Wn[20]=6;Gn[150]=Wn[150]=6;Bn[80]=Hn[80]=11;Bn[90]=Hn[90]=11;kn[65]=Vn[65]=3;kn[105]=Vn[105]=3;Bn[160]=Hn[160]=11;zn[160]=qn[160]=14;Bn[10]=Hn[10]=11;zn[10]=qn[10]=14;Gn[130]=Wn[130]=6;kn[130]=Vn[130]=3;Gn[40]=Wn[40]=6;kn[40]=Vn[40]=3;zn[101]=Vn[101]=1;zn[69]=Vn[69]=1;qn[149]=Wn[149]=21;qn[21]=Wn[21]=21;Gn[86]=Hn[86]=17;Gn[84]=Hn[84]=17;Bn[89]=kn[89]=9;Bn[81]=kn[81]=9;Bn[96]=Vn[96]=0;zn[96]=Hn[96]=15;Bn[74]=Vn[74]=0;zn[74]=Hn[74]=15;Bn[24]=Gn[24]=8;kn[24]=Wn[24]=7;Bn[146]=Gn[146]=8;kn[146]=Wn[146]=7;zn[6]=Hn[6]=15;Gn[6]=qn[6]=16;zn[164]=Hn[164]=15;Gn[164]=qn[164]=16;kn[129]=Wn[129]=7;qn[129]=Vn[129]=20;kn[41]=Wn[41]=7;qn[41]=Vn[41]=20;Gn[66]=Vn[66]=2;kn[66]=Hn[66]=19;Gn[104]=Vn[104]=2;kn[104]=Hn[104]=19;Bn[144]=qn[144]=10;Hn[144]=Wn[144]=23;Bn[26]=qn[26]=10;Hn[26]=Wn[26]=23;zn[36]=Wn[36]=5;Gn[36]=Vn[36]=2;zn[134]=Wn[134]=5;Gn[134]=Vn[134]=2;Bn[9]=qn[9]=10;zn[9]=kn[9]=13;Bn[161]=qn[161]=10;zn[161]=kn[161]=13;zn[37]=Wn[37]=5;qn[37]=Vn[37]=20;zn[133]=Wn[133]=5;qn[133]=Vn[133]=20;Gn[148]=qn[148]=16;Hn[148]=Wn[148]=23;Gn[22]=qn[22]=16;Hn[22]=Wn[22]=23;Bn[82]=Gn[82]=8;kn[82]=Hn[82]=19;Bn[88]=Gn[88]=8;kn[88]=Hn[88]=19;Bn[73]=Vn[73]=0;zn[73]=kn[73]=13;Bn[97]=Vn[97]=0;zn[97]=kn[97]=13;Bn[145]=kn[145]=9;qn[145]=Wn[145]=21;Bn[25]=kn[25]=9;qn[25]=Wn[25]=21;zn[70]=Vn[70]=1;Gn[70]=Hn[70]=17;zn[100]=Vn[100]=1;Gn[100]=Hn[100]=17;Bn[34]=kn[34]=9;zn[34]=Gn[34]=12;qn[34]=Wn[34]=21;Hn[34]=Vn[34]=22;Bn[136]=Wn[136]=4;zn[136]=Vn[136]=1;Gn[136]=Hn[136]=17;kn[136]=qn[136]=18;Bn[35]=Wn[35]=4;zn[35]=Gn[35]=12;kn[35]=qn[35]=18;Hn[35]=Vn[35]=22;Bn[153]=Wn[153]=4;kn[153]=qn[153]=18;zn[102]=Gn[102]=12;Hn[102]=Vn[102]=22;Bn[155]=kn[155]=9;qn[155]=Wn[155]=23;zn[103]=Vn[103]=1;Gn[103]=Hn[103]=17;Bn[152]=Wn[152]=4;Gn[152]=Hn[152]=17;kn[152]=qn[152]=18;Bn[156]=Gn[156]=8;kn[156]=qn[156]=18;Hn[156]=Wn[156]=23;Bn[137]=Wn[137]=4;zn[137]=Vn[137]=1;kn[137]=qn[137]=18;Bn[139]=Wn[139]=4;zn[139]=kn[139]=13;qn[139]=Vn[139]=20;Bn[98]=kn[98]=9;zn[98]=Gn[98]=12;Hn[98]=Vn[98]=22;Bn[99]=Vn[99]=0;zn[99]=Gn[99]=12;kn[99]=Hn[99]=19;zn[38]=Gn[38]=12;qn[38]=Wn[38]=21;Hn[38]=Vn[38]=22;zn[39]=Wn[39]=5;Gn[39]=qn[39]=16;Hn[39]=Vn[39]=22;var re=[];re[1]=re[169]=j_;re[4]=re[166]=Q_;re[16]=re[154]=t1;re[64]=re[106]=e1;re[168]=re[2]=n1;re[162]=re[8]=r1;re[138]=re[32]=i1;re[42]=re[128]=o1;re[5]=re[165]=uZ;re[20]=re[150]=lZ;re[80]=re[90]=cZ;re[65]=re[105]=fZ;re[160]=re[10]=hZ;re[130]=re[40]=pZ;re[85]=dZ;re[101]=re[69]=gZ;re[149]=re[21]=mZ;re[86]=re[84]=yZ;re[89]=re[81]=vZ;re[96]=re[74]=_Z;re[24]=re[146]=xZ;re[6]=re[164]=EZ;re[129]=re[41]=wZ;re[66]=re[104]=SZ;re[144]=re[26]=MZ;re[36]=re[134]=bZ;re[9]=re[161]=AZ;re[37]=re[133]=TZ;re[148]=re[22]=CZ;re[82]=re[88]=PZ;re[73]=re[97]=IZ;re[145]=re[25]=RZ;re[70]=re[100]=LZ;re[34]=function(n){return[o1(n),r1(n)]};re[35]=NZ;re[136]=function(n){return[i1(n),n1(n)]};re[153]=function(n){return[t1(n),j_(n)]};re[102]=function(n){return[Q_(n),e1(n)]};re[155]=OZ;re[103]=DZ;re[152]=function(n){return[t1(n),n1(n)]};re[156]=FZ;re[137]=function(n){return[i1(n),j_(n)]};re[139]=UZ;re[98]=function(n){return[r1(n),e1(n)]};re[99]=BZ;re[38]=function(n){return[Q_(n),o1(n)]};re[39]=zZ;function kZ(n){return(n>0)-(n<0)||+n}function cf(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],l=e[0]-t[0],p=e[1]-t[1];return kZ(o*p-l*s)}function dL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),l=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,l)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,l)}function s1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function gL(n,t){return n[0]===t[0]&&n[1]===t[1]}var qZ=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,l=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&l.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&l.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&l.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||l.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-l.coordinates[1]:l.coordinates[1]-s.coordinates[1];var p=cf(t.coordinates,s.coordinates,l.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(l.coordinates[0]-t.coordinates[0],2)+Math.pow(l.coordinates[1]-t.coordinates[1],2);return h-g}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),a1=qZ;var HZ=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return cf(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),mL=HZ;var VZ=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,l=cf(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return l===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:l>0},n.prototype.toMultiPoint=function(){return Bv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=r_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,l;return e.forEach(function(p){var h=p.getEnvelope();if(l&&(s=l.getEnvelope()),!dL(h,o)&&s1(h,o)){for(var g=t.map(function(C){return C.from.coordinates}),m=void 0,_=function(C){p.some(function(R){return gL(C,R.from.coordinates)})||(m=C)},w=0,S=g;w<S.length;w++){var b=S[w];_(b)}m&&p.inside(Pr(m))&&(!l||s1(s,h))&&(l=p)}}),l},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),u1=VZ;function WZ(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var fct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){WZ(t);var e=new n;return ms(t,function(o){Gv(o,"LineString","Graph::fromGeoJson"),TC(o,function(s,l){if(s){var p=e.getNode(s),h=e.getNode(l);e.addEdge(p,h)}return l})}),e},n.prototype.getNode=function(t){var e=a1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new a1(t)),o},n.prototype.addEdge=function(t,e){var o=new mL(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,l,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,_=void 0;h.label===e&&(m=h),g.label===e&&(_=g),!(!m||!_)&&(_&&(l=_),m&&(l&&(l.next=m,l=void 0),s||(s=m)))}l&&(l.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var l=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++l}),l>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new u1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var ZZ=$e(l1(),1);var KZ=$e(l1(),1);var jZ=$e(bL(),1);var oK=$e(DL(),1);function UL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function aK(){return new BL(function(n){return n.f})}var p1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||p1.heuristics.manhattan,l=o.closest||!1,p=aK(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return UL(g);g.closed=!0;for(var m=n.neighbors(g),_=0,w=m.length;_<w;++_){var S=m[_];if(!(S.closed||S.isWall())){var b=g.g+S.getCost(g),C=S.visited;(!C||b<S.g)&&(S.visited=!0,S.parent=g,S.h=S.h||s(S,e),S.g=b,S.f=S.g+S.h,n.markDirty(S),l&&(S.h<h.h||S.h===h.h&&S.g<h.g)&&(h=S),C?p.rescoreElement(S):p.push(S))}}}return l?UL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),l=Math.abs(t.y-n.y);return e*(s+l)+(o-2*e)*Math.min(s,l)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ph(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var o=0,s=n[e];o<s.length;o++){var l=new Bg(e,o,s[o]);this.grid[e][o]=l,this.nodes.push(l)}}this.init()}Ph.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)p1.cleanNode(this.nodes[n])};Ph.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)p1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ph.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ph.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ph.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,l,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,l=o.length;s<l;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(`
|
|
3825
|
-
`)};function Bg(n,t,e){this.x=n,this.y=t,this.weight=e}Bg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Bg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Bg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function d1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}d1.prototype={constructor:d1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ih(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Rh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ih(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Rh(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ih(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Rh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ih(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Rh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var g1=d1;function pf(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Lh(s,n,t,e),o&&Lh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Lh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function uK(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],_=p[1],w=0,S=1,b=m-h,C=_-g,R;if(R=t-h,!(!b&&R>0)){if(R/=b,b<0){if(R<w)return;R<S&&(S=R)}else if(b>0){if(R>S)return;R>w&&(w=R)}if(R=o-h,!(!b&&R<0)){if(R/=b,b<0){if(R>S)return;R>w&&(w=R)}else if(b>0){if(R<w)return;R<S&&(S=R)}if(R=e-g,!(!C&&R>0)){if(R/=C,C<0){if(R<w)return;R<S&&(S=R)}else if(C>0){if(R>S)return;R>w&&(w=R)}if(R=s-g,!(!C&&R<0)){if(R/=C,C<0){if(R>S)return;R>w&&(w=R)}else if(C>0){if(R<w)return;R<S&&(S=R)}return!(w>0)&&!(S<1)||(w>0&&(n[0]=[h+w*b,g+w*C]),S<1&&(n[1]=[h+S*b,g+S*C])),!0}}}}}function lK(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],S=g[1],b=(m+w)/2,C=(_+S)/2,R,x;if(S===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;l=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;l=[b,e]}}else if(R=(m-w)/(S-_),x=C-R*b,R<-1||R>1)if(m>w){if(!p)p=[(e-x)/R,e];else if(p[1]>=s)return;l=[(s-x)/R,s]}else{if(!p)p=[(s-x)/R,s];else if(p[1]<e)return;l=[(e-x)/R,e]}else if(_<S){if(!p)p=[t,R*t+x];else if(p[0]>=o)return;l=[o,R*o+x]}else{if(!p)p=[o,R*o+x];else if(p[0]<t)return;l=[t,R*t+x]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!lK(l=Hi[s],n,t,e,o)||!uK(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function cK(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function m1(n,t){return t[+(t.left!==n.site)]}function fK(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=cK(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,_,w,S,b,C,R,x,E=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)C=fK(p,Hi[m[g]]),R=C[0],x=C[1],w=m1(p,Hi[m[++g%_]]),S=w[0],b=w[1],(Math.abs(R-S)>Er||Math.abs(x-b)>Er)&&(m.splice(g,0,Hi.push(df(h,C,Math.abs(R-n)<Er&&o-x>Er?[n,Math.abs(S-n)<Er?b:o]:Math.abs(x-o)<Er&&e-R>Er?[Math.abs(b-o)<Er?S:e,o]:Math.abs(R-e)<Er&&x-t>Er?[e,Math.abs(S-e)<Er?b:t]:Math.abs(x-t)<Er&&R-n>Er?[Math.abs(b-t)<Er?S:n,t]:null))-1),++_);_&&(E=!1)}if(E){var I,A,F,V=1/0;for(l=0,E=null;l<s;++l)(p=To[l])&&(h=p.site,I=h[0]-n,A=h[1]-t,F=I*I+A*A,F<V&&(V=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],zg;function hK(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=l[0]-p,w=l[1]-h,S=2*(g*w-m*_);if(!(S>=-WL)){var b=g*g+m*m,C=_*_+w*w,R=(w*b-m*C)/S,x=(g*C-_*b)/S,E=VL.pop()||new hK;E.arc=n,E.site=s,E.x=R+p,E.y=(E.cy=x+h)+Math.sqrt(R*R+x*x),n.circle=E;for(var I=null,A=gf._;A;)if(E.y<A.y||E.y===A.y&&E.x<=A.x)if(A.L)A=A.L;else{I=A.P;break}else if(A.R)A=A.R;else{I=A;break}gf.insert(I,E),I||(zg=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(zg=t.N),gf.remove(t),VL.push(t),hf(t),n.circle=null)}var YL=[];function pK(){hf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new pK;return t.site=n,t}function y1(n){Xl(n),Yl.remove(n),YL.push(n),hf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];y1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),y1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),y1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Lh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=KL(h,e)-t,l>Er)h=h.L;else if(p=t-dK(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],S=n[0]-_,b=n[1]-w,C=s.site,R=C[0]-_,x=C[1]-w,E=2*(S*x-b*R),I=S*S+b*b,A=R*R+x*x,F=[(x*I-b*A)/E+_,(S*A-R*I)/E+w];Lh(s.edge,m,C,F),g.edge=pf(m,n,null,F),s.edge=pf(n,C,null,F),Wl(o),Wl(s)}}function KL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/l-1/m,S=_/m;return w?(-S+Math.sqrt(S*S-2*w*(_*_/(-2*m)-g+m/2+s-l/2)))/w+o:(o+h)/2}function dK(n,t){var e=n.N;if(e)return KL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,gf,Hi;function gK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function mK(n,t){return t[1]-n[1]||t[0]-n[0]}function Gg(n,t){var e=n.sort(mK).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new g1,gf=new g1;;)if(l=zg,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Gg.prototype={constructor:Gg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return m1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[l[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&gK(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(w){var S=o.edges[w],b=S.left;if(!((b===h.site||!b)&&!(b=S.right))){var C=n-b[0],R=t-b[1],x=C*C+R*R;x<_&&(_=x,l=b.index)}});while(l!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var MK=$e(mf(),1);var L1=$e(tN(),1);function Zo(){return new Hg}function Hg(){this.reset()}Hg.prototype={constructor:Hg,reset:function(){this.s=this.t=0},add:function(n){eN(qg,n,this.t),eN(this,qg.s,this.s),this.s?this.t+=qg.t:this.s=qg.t},valueOf:function(){return this.s}};var qg=new Hg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,Vg=gr/4,Na=gr*2,$l=180/gr,Ko=gr/180,Zr=Math.abs,sa=Math.atan,Jo=Math.atan2,Xn=Math.cos;var Wg=Math.exp;var Nh=Math.log;var un=Math.sin;var ro=Math.sqrt,Oh=Math.tan;function x1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function aa(){}var bK=Zo(),opt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*un(t),un(e)]}function Dh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Fh(n){var t=ro(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var gpt=Zo();function rN(n,t){return[n>gr?n-Na:n<-gr?n+Na:n,t]}rN.invert=rN;function E1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:aa,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function w1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Xg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function S1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(C){if(!((R=C.length-1)<=0)){var R,x=C[0],E=C[R],I;if(w1(x,E)){for(s.lineStart(),h=0;h<R;++h)s.point((x=C[h])[0],x[1]);s.lineEnd();return}l.push(I=new Xg(x,C,null,!0)),p.push(I.o=new Xg(x,null,I,!1)),l.push(I=new Xg(E,C,null,!1)),p.push(I.o=new Xg(E,null,I,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],_,w;;){for(var S=m,b=!0;S.v;)if((S=S.n)===m)return;_=S.z,s.lineStart();do{if(S.v=S.o.v=!0,S.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(S.x,S.n.x,1,s);S=S.n}else{if(b)for(_=S.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(S.x,S.p.x,-1,s);S=S.p}S=S.o,_=S.z,b=!b}while(!S.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function M1(n){return n.length===1&&(n=CK(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function CK(n){return function(t,e){return sl(n(t),e)}}var oN=M1(sl),PK=oN.right,IK=oN.left;var sN=Array.prototype,LK=sN.slice,NK=sN.map;var adt=Math.sqrt(50),udt=Math.sqrt(10),ldt=Math.sqrt(2);function $g(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var kK=1e9,Xgt=-kK;var b1=Zo();function A1(n,t){var e=t[0],o=t[1],s=[un(e),-Xn(e),0],l=0,p=0;b1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],S=w[0],b=w[1]/2+Vg,C=un(b),R=Xn(b),x=0;x<_;++x,S=I,C=F,R=V,w=E){var E=m[x],I=E[0],A=E[1]/2+Vg,F=un(A),V=Xn(A),X=I-S,q=X>=0?1:-1,D=q*X,xt=D>gr,B=C*F;if(b1.add(Jo(B*q*un(D),R*V+B*Xn(D))),l+=xt?X+q*Na:X,xt^S>=e^I>=e){var j=Dh(Zl(w),Zl(E));Fh(j);var K=Dh(s,j);Fh(K);var Dt=(xt^X>=0?-1:1)*Co(K[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&b1<-er)^p&1}var nmt=Zo();var Emt=Zo(),wmt=Zo();var VK=1/0;var bmt=-VK;function T1(n){this._context=n}T1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Na);break}}},result:aa};var Dmt=Zo();function C1(){this._string=[]}C1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function P1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=E1(),m=t(g),_=!1,w,S,b,C={point:R,lineStart:E,lineEnd:I,polygonStart:function(){C.point=A,C.lineStart=F,C.lineEnd=V,S=[],w=[]},polygonEnd:function(){C.point=R,C.lineStart=E,C.lineEnd=I,S=$g(S);var X=A1(w,h);S.length?(_||(l.polygonStart(),_=!0),S1(S,YK,X,e,l)):X&&(_||(l.polygonStart(),_=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),_&&(l.polygonEnd(),_=!1),S=w=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function R(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function x(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){C.point=x,p.lineStart()}function I(){C.point=R,p.lineEnd()}function A(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function V(){A(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,K;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(l.polygonStart(),_=!0),l.lineStart(),D=0;D<B;++D)l.point((K=j[D])[0],K[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),S.push(q.filter(XK))}}return C}}function XK(n){return n.length>1}function YK(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var $K=P1(function(){return!0},ZK,JK,[-gr,-Mi]);function ZK(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=KK(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function KK(n,t,e,o){var s,l,p=un(n-e);return Zr(p)>er?sa((un(t)*(l=Xn(o))*un(e)-un(o)*(s=Xn(t))*un(n))/(s*l*p)):(t+o)/2}function JK(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Zg(n){return function(t){var e=new I1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function I1(){}I1.prototype={constructor:I1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var w0t=Xn(30*Ko);var F0t=Zg({point:function(n,t){this.stream.point(n*Ko,t*Ko)}});function Kg(n){return function(t,e){var o=Xn(t),s=Xn(e),l=n(o*s);return[l*s*un(t),l*un(e)]}}function Oa(n){return function(t,e){var o=ro(t*t+e*e),s=n(o),l=un(s),p=Xn(s);return[Jo(t*l,o*p),Co(o&&e*l/o)]}}var mN=Kg(function(n){return ro(2/(1+n))});mN.invert=Oa(function(n){return 2*Co(n/2)});var yN=Kg(function(n){return(n=x1(n))&&n/un(n)});yN.invert=Oa(function(n){return n});function R1(n,t){return[n,Nh(Oh((Mi+t)/2))]}R1.invert=function(n,t){return[n,2*sa(Wg(t))-Mi]};function Jg(n,t){return[n,t]}Jg.invert=Jg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*un(n)/o,un(t)/o]}vN.invert=Oa(sa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Xn(t)*un(n),un(t)]}xN.invert=Oa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*un(n)/o,un(t)/o]}EN.invert=Oa(function(n){return 2*sa(n)});function wN(n,t){return[Nh(Oh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*sa(Wg(n))-Mi]};var rJ=$e(mf(),1);var iJ=$e(mf(),1);var sJ=$e(mf(),1);var aJ=$e(mf(),1);function Da(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Da(n[e],n[e+1]);return t}function bN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var _f=$e(AN(),1);var Ze="___",mJ=1e4;function mu(n){let t=new Map;return n.forEach((e,o)=>{t.set(o,new Map(e))}),t}var jg=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return eu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Ze+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Ze+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,_f.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,_f.isNil)(h.coverageArea)&&h.coverageArea!==0);this.weightPointMap.set(l.floor,p),(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(C=>+C),[_,w]=h.endTime.split(":").map(C=>+C),S=g*60+m,b=_*60+w;return s>=S&&s<=b}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+Ze+h.id,m=""+l.floor+Ze+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+l.floor+Ze+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+Ze+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(S=>S.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(x=>x.floor===l.floor)&&w.entry_start_floor.find(x=>x.floor===l.floor)){let x=this.straightLadderMap.get(h.targetId)||[];x.push(eu({},h)),this.straightLadderMap.set(h.targetId,x)}break;case"staircase":if(w.entry_end_floor.find(x=>x.floor===l.floor)&&w.entry_start_floor.find(x=>x.floor===l.floor)){let x=this.staircaseMap.get(h.targetId)||[];x.push(eu({},h)),this.staircaseMap.set(h.targetId,x)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=b.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:b.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=b.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let C=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=C.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:C.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=C.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:C.push({end:h})}this.rampMap.set(h.targetId,C);break;case"connectionPoint":let R=this.connectionPointMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=R.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:R.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=R.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:R.push({end:h})}this.connectionPointMap.set(h.targetId,R);break}let S=this.facilityMap.get(h.targetId)||[];S.push(eu({},h)),this.facilityMap.set(h.targetId,S)}}h.type==="parkingSpace"&&h.name.split(/[,,]/).forEach(S=>{this.parkingMap.set(""+l.floor+Ze+S,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+Ze+h.from,m=""+l.floor+Ze+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let S=_.cds,b=w.cds,C=Da(S,b);if(!_.permission&&!w.permission){switch(h.direction){case"single-people":this.addLineItem(g,m,C);break;case"back-people":this.addLineItem(m,g,C);break;default:this.addLineItem(g,m,C),this.addLineItem(m,g,C)}switch(h.direction){case"double":this.addLineItem(g,m,C,this.forwardLineMap),this.addLineItem(m,g,C,this.forwardLineMap);break;case"single":this.addLineItem(g,m,C,this.forwardLineMap);break;case"back":this.addLineItem(m,g,C,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,C,this.forwardLineMap),this.addLineItem(m,g,C,this.forwardLineMap))}else _.permission&&this.setPermissionLine(g,m,_.permission,C,"",h.direction),w.permission&&w.permission!==_.permission&&this.setPermissionLine(g,m,w.permission,C,"",h.direction)})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l,p){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l,direction:p})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Ze+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Ze+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Ze+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Ze+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Ze+o.start.id,l=""+o.end.floor+Ze+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Ze+o.start.id,l=""+o.end.floor+Ze+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Ze+o.start.id,l=""+o.end.floor+Ze+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"connectionPoint"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"connectionPoint"))}})})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{if(e.includes(p.type))if(p.type==="")switch(p.direction){case"single":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;case"single-people":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back-people":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;default:this.addLineItem(p.fromKey,p.toKey,p.distance,o),this.addLineItem(p.toKey,p.fromKey,p.distance,o);break}else this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o)})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map,p=this.pointMap.get(t),h=this.pointMap.get(e);if(!p||!h)return;let g=this.weightPointMap.get(p.floor)||[],m=this.weightPointMap.get(h.floor)||[];g.forEach(_=>{_.id===p.id&&(o=o/_.passWeight),Da(p.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),m.forEach(_=>{_.id===h.id&&(o=o/_.passWeight),Da(h.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Ze+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let S=""+h[w].floor+Ze+h[w].id,b=this.pointMap.get(S);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let C=e;this.addLineItem(m,S,C,s)}else{let C=o;this.addLineItem(m,S,C,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Ze+h.start.id,m=""+h.end.floor+Ze+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let S=t;this.addLineItem(g,m,S,s)}}})}),this.connectionPointMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Ze+h.start.id,m=""+h.end.floor+Ze+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);_&&w&&!_.permission&&!w.permission&&this.addLineItem(g,m,100,s)}})})}initBaseRoute(){let t=new Map(mu(this.lineMap));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new Vi.default(t)}initEscalatorRoute(){let t=new Map(mu(this.lineMap)),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new Vi.default(t)}initStraightLadderRoute(){let t=new Map(mu(this.lineMap)),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new Vi.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Ze+o.start.id,l=""+o.end.floor+Ze+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Ze+o.start.id,l=""+o.end.floor+Ze+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,100,this.forwardLineMap)}})}),this.forwardRoute=new Vi.default(this.forwardLineMap)}addNoProofWeight(t,e){let o=(s,l)=>{let p=t.get(s),h=p==null?void 0:p.get(l);p&&!(0,_f.isNil)(h)&&p.set(l,h*mJ)};this.roadInfo.forEach(s=>{(s.lines||[]).filter(l=>l.to!==l.from&&l[e]===!1).forEach(l=>{let p=""+s.floor+Ze+l.from,h=""+s.floor+Ze+l.to;switch(l.direction){case"single-people":o(p,h);break;case"back-people":o(h,p);break;default:o(p,h),o(h,p)}})})}getRouteByType(t){switch(t){case"escalator":return this.escalatorRoute;case"straightLadder":return this.straightLadderRoute;case"forward":return this.forwardRoute;default:return this.baseRoute}}getProofRoute(t,e,o){let s=""+t+Ze+e+Ze+o,l=this.proofRouteMap.get(s);if(l)return l;let p=new Map(mu(this.getRouteByType(t).graph));e&&this.addNoProofWeight(p,"sunProof"),o&&this.addNoProofWeight(p,"rain");let h=new Vi.default(p);return this.proofRouteMap.set(s,h),h}checkStart(t){return!(!t.floor||!t.routePointId&&!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.routePointId)return[{floor:t.floor,id:t.routePointId}];if(t.nodeId){let l=this.nodeMap.get(""+t.floor+Ze+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(Ze);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let _=""+m.floor+Ze+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Da(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.routePointId&&t.floor)return[{floor:t.floor,id:t.routePointId}];if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Ze+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let R=0;R<h.length;R++){let x=h[R];for(let E=0;E<g.length;E++){let I=g[E];if(x.floor===I.floor&&x.id===I.id)return"near"}}else{m=this.facilities.filter(x=>+x.type_id==+e.facility).map(x=>x.id).map(x=>this.facilityMap.get(""+x)).flat(2).filter(x=>x).filter(x=>g.floor?x.floor===g.floor:!0);for(let x=0;x<h.length;x++){let E=h[x];for(let I=0;I<m.length;I++){let A=m[I];if(E.floor===A.floor&&E.id===A.id)return"near"}}}let _=Array.isArray(p.proof)?p.proof:p.proof?[p.proof]:[],w=o!=="forward"&&_.includes("sunProof"),S=o!=="forward"&&_.includes("rain"),b;switch(o){case"escalator":b=(R,x,E)=>this.getEscalatorPath(R,x,E,w,S);break;case"straightLadder":b=(R,x,E)=>this.getStraightLadderPath(R,x,E,w,S);break;case"forward":b=this.getForwardPath.bind(this);break;default:b=(R,x,E)=>this.getBasePath(R,x,E,w,S);break}let C=null;return h.forEach(R=>{if(Array.isArray(g))g.forEach(x=>{let E=b(R,x,s,l);E&&E&&(!C||E[0].consume<C[0].consume)&&(C=E)});else{if(!m.length)return null;let x=m.map(E=>b(R,{floor:E.floor,id:E.id},s,l)).filter(E=>!!E);C=x.reduce((E,I)=>{let A=I[0].consume;return A<E.distance&&(E.distance=A,E.path=I),E},{distance:1/0,path:x[0]}).path}}),C}getRoutePath(t,e,o){let s=""+t.floor+Ze+t.id,l=this.pointMap.get(s),p=""+e.floor+Ze+e.id,h=this.pointMap.get(p);if(!l||!h)return null;let g=""+l.floor+Ze+(l.relatedId||l.id),m=""+h.floor+Ze+(h.relatedId||h.id),_=o.path(g,m);if(!_)return null;let w=[],S=_.reduce((b,C,R,x)=>{if(R===0)return 0;let E=x[R-1],I=o.graph.get(E).get(C);return b+I},0);return _.map(b=>{let C=this.pointMap.get(b);if(C){var R;let{floor:x}=C,E=C.type;if(this.isFacilityByType(C.type)){let I=this.facilities.find(A=>A.id===+C.targetId);I&&(E=I.entry_infra_type)}if(((R=w[w.length-1])==null?void 0:R.floor)===x){let I=w[w.length-1];I.points.push(C.cds),I.pointInfos.push(C),I.endType=E,I.destId=C.nodeId,I.distance=MN(I.points)}else w.push({floor:x,points:[C.cds],pointInfos:[C],endType:E,destId:C.nodeId,distance:0,consume:S})}}),w}getBasePath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("",s,l):this.baseRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=_=>{this.addPermissionLineToMap(_,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(_=>{g(_)}):g(o);let m=new Vi.default(h);return this.getRoutePath(t,e,m)}getEscalatorPath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("escalator",s,l):this.escalatorRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=1e4,m=w=>{this.addPermissionLineToMap(w,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*g],["staircase",3e4*g]]))};Array.isArray(o)?o.forEach(w=>{m(w)}):m(o);let _=new Vi.default(h);return this.getRoutePath(t,e,_)}getStraightLadderPath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("straightLadder",s,l):this.straightLadderRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=1e4,m=w=>{this.addPermissionLineToMap(w,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",3*g],["connectionPoint",100],["straightLadder",300],["staircase",3e4*g]]))};Array.isArray(o)?o.forEach(w=>{m(w)}):m(o);let _=new Vi.default(h);return this.getRoutePath(t,e,_)}getSunProofPath(t,e,o,s,l,p){return o===void 0&&(o=""),p===void 0&&(p={}),this.getPath(t,e,o,s,l,eu({},p,{proof:"sunProof"}))}getRainProofPath(t,e,o,s,l,p){return o===void 0&&(o=""),p===void 0&&(p={}),this.getPath(t,e,o,s,l,eu({},p,{proof:"rain"}))}getForwardPath(t,e,o,s){let l=new Map,p=b=>{let C=this.forwardRoute.graph.get(g);b.forEach(R=>{let x=C.get(R);(0,_f.isNil)(x)||(l.set(R,x),C.delete(R))})},h=()=>{let b=this.forwardRoute.graph.get(g);l.forEach((C,R)=>{b.set(R,C)})},g=""+t.floor+Ze+t.id;if(!(0,_f.isNil)(s)){let b=this.forwardLineMap.get(g),C=this.pointMap.get(g);if(C&&(b!=null&&b.size)&&b.size>1){let R=new ze(C.cds[0],C.cds[1]),x=new Map;b.forEach((I,A)=>{let F=this.pointMap.get(A);if(F){let V=new ze(F.cds[0],F.cds[1]),q=360-(new ze().subVectors(V,R).angle()/Math.PI*180-90+360)%360;x.set(A,q)}});let E=Array.from(x).filter(I=>{let[A,F]=I;return Math.abs(F-s)<=60}).map(I=>{let[A]=I;return A});if(E.length)E.forEach(I=>x.delete(I)),p([...x.keys()]);else{let I=Array.from(x).reduce((A,F)=>{let V=Math.abs(F[1]-s);return V<A.diff?{diff:V,key:F[0]}:A},{diff:1/0,key:""});x.delete(I.key),p([...x.keys()])}}}if(!o){let b=this.getRoutePath(t,e,this.forwardRoute);return h(),b||this.getRoutePath(t,e,this.forwardRoute)}let m=mu(this.forwardRoute.graph),_=b=>{this.addPermissionLineToMap(b,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(b=>{_(b)}):_(o);let w=new Vi.default(m),S=this.getRoutePath(t,e,w);if(h(),S)return S;{let b=mu(this.forwardRoute.graph);Array.isArray(o)?o.forEach(x=>{_(x)}):_(o);let C=new Vi.default(b);return this.getRoutePath(t,e,C)}}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 Vi.default,this.escalatorRoute=new Vi.default,this.straightLadderRoute=new Vi.default,this.proofRouteMap.clear()}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.weightPointMap=new Map,this.baseRoute=new Vi.default,this.escalatorRoute=new Vi.default,this.straightLadderRoute=new Vi.default,this.forwardLineMap=new Map,this.forwardRoute=new Vi.default,this.proofRouteMap=new Map}};var owt=$e(kp(),1),swt=$e(Zp(),1);var yJ=$e(RN(),1);function vJ(n,t,e){let o=bN(n,t,e);return _J(o)}function _J(n){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 LN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Da(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=vJ(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],l=Da(n[e-1],n[e]);s.distance+=l,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Da(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var ywt=$e(o2(),1),vwt=$e(Yp(),1),_wt=$e(Zp(),1);function s2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function a2(n){let t={};for(let o in n)o.startsWith("on")&&(t[s2(o.slice(2))]=n[o],t[o]=n[o]);let e=o=>dp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var tm=new jg;a2({onSetLiftPriority(n){tm.setLiftPriority(n)},onSetRoadInfo(n){let{roadData:t,facilities:e}=n;tm.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:l,options:p}=n;return tm.getPath(t,e,o,s,l,p)},onGetDirectionPath(n){return LN(n)},onClear(){tm.clear()}});
|
|
3825
|
+
`)};function Bg(n,t,e){this.x=n,this.y=t,this.weight=e}Bg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Bg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Bg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function d1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}d1.prototype={constructor:d1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ih(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Rh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ih(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Rh(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ih(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Rh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ih(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Rh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var g1=d1;function pf(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Lh(s,n,t,e),o&&Lh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Lh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function uK(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],_=p[1],w=0,S=1,b=m-h,C=_-g,R;if(R=t-h,!(!b&&R>0)){if(R/=b,b<0){if(R<w)return;R<S&&(S=R)}else if(b>0){if(R>S)return;R>w&&(w=R)}if(R=o-h,!(!b&&R<0)){if(R/=b,b<0){if(R>S)return;R>w&&(w=R)}else if(b>0){if(R<w)return;R<S&&(S=R)}if(R=e-g,!(!C&&R>0)){if(R/=C,C<0){if(R<w)return;R<S&&(S=R)}else if(C>0){if(R>S)return;R>w&&(w=R)}if(R=s-g,!(!C&&R<0)){if(R/=C,C<0){if(R>S)return;R>w&&(w=R)}else if(C>0){if(R<w)return;R<S&&(S=R)}return!(w>0)&&!(S<1)||(w>0&&(n[0]=[h+w*b,g+w*C]),S<1&&(n[1]=[h+S*b,g+S*C])),!0}}}}}function lK(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],S=g[1],b=(m+w)/2,C=(_+S)/2,R,x;if(S===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;l=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;l=[b,e]}}else if(R=(m-w)/(S-_),x=C-R*b,R<-1||R>1)if(m>w){if(!p)p=[(e-x)/R,e];else if(p[1]>=s)return;l=[(s-x)/R,s]}else{if(!p)p=[(s-x)/R,s];else if(p[1]<e)return;l=[(e-x)/R,e]}else if(_<S){if(!p)p=[t,R*t+x];else if(p[0]>=o)return;l=[o,R*o+x]}else{if(!p)p=[o,R*o+x];else if(p[0]<t)return;l=[t,R*t+x]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!lK(l=Hi[s],n,t,e,o)||!uK(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function cK(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function m1(n,t){return t[+(t.left!==n.site)]}function fK(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=cK(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,_,w,S,b,C,R,x,E=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)C=fK(p,Hi[m[g]]),R=C[0],x=C[1],w=m1(p,Hi[m[++g%_]]),S=w[0],b=w[1],(Math.abs(R-S)>Er||Math.abs(x-b)>Er)&&(m.splice(g,0,Hi.push(df(h,C,Math.abs(R-n)<Er&&o-x>Er?[n,Math.abs(S-n)<Er?b:o]:Math.abs(x-o)<Er&&e-R>Er?[Math.abs(b-o)<Er?S:e,o]:Math.abs(R-e)<Er&&x-t>Er?[e,Math.abs(S-e)<Er?b:t]:Math.abs(x-t)<Er&&R-n>Er?[Math.abs(b-t)<Er?S:n,t]:null))-1),++_);_&&(E=!1)}if(E){var I,A,F,V=1/0;for(l=0,E=null;l<s;++l)(p=To[l])&&(h=p.site,I=h[0]-n,A=h[1]-t,F=I*I+A*A,F<V&&(V=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],zg;function hK(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=l[0]-p,w=l[1]-h,S=2*(g*w-m*_);if(!(S>=-WL)){var b=g*g+m*m,C=_*_+w*w,R=(w*b-m*C)/S,x=(g*C-_*b)/S,E=VL.pop()||new hK;E.arc=n,E.site=s,E.x=R+p,E.y=(E.cy=x+h)+Math.sqrt(R*R+x*x),n.circle=E;for(var I=null,A=gf._;A;)if(E.y<A.y||E.y===A.y&&E.x<=A.x)if(A.L)A=A.L;else{I=A.P;break}else if(A.R)A=A.R;else{I=A;break}gf.insert(I,E),I||(zg=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(zg=t.N),gf.remove(t),VL.push(t),hf(t),n.circle=null)}var YL=[];function pK(){hf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new pK;return t.site=n,t}function y1(n){Xl(n),Yl.remove(n),YL.push(n),hf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];y1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),y1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),y1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Lh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=KL(h,e)-t,l>Er)h=h.L;else if(p=t-dK(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],S=n[0]-_,b=n[1]-w,C=s.site,R=C[0]-_,x=C[1]-w,E=2*(S*x-b*R),I=S*S+b*b,A=R*R+x*x,F=[(x*I-b*A)/E+_,(S*A-R*I)/E+w];Lh(s.edge,m,C,F),g.edge=pf(m,n,null,F),s.edge=pf(n,C,null,F),Wl(o),Wl(s)}}function KL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/l-1/m,S=_/m;return w?(-S+Math.sqrt(S*S-2*w*(_*_/(-2*m)-g+m/2+s-l/2)))/w+o:(o+h)/2}function dK(n,t){var e=n.N;if(e)return KL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,gf,Hi;function gK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function mK(n,t){return t[1]-n[1]||t[0]-n[0]}function Gg(n,t){var e=n.sort(mK).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new g1,gf=new g1;;)if(l=zg,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Gg.prototype={constructor:Gg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return m1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[l[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&gK(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(w){var S=o.edges[w],b=S.left;if(!((b===h.site||!b)&&!(b=S.right))){var C=n-b[0],R=t-b[1],x=C*C+R*R;x<_&&(_=x,l=b.index)}});while(l!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var MK=$e(mf(),1);var L1=$e(tN(),1);function Zo(){return new Hg}function Hg(){this.reset()}Hg.prototype={constructor:Hg,reset:function(){this.s=this.t=0},add:function(n){eN(qg,n,this.t),eN(this,qg.s,this.s),this.s?this.t+=qg.t:this.s=qg.t},valueOf:function(){return this.s}};var qg=new Hg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,Vg=gr/4,Na=gr*2,$l=180/gr,Ko=gr/180,Zr=Math.abs,sa=Math.atan,Jo=Math.atan2,Xn=Math.cos;var Wg=Math.exp;var Nh=Math.log;var un=Math.sin;var ro=Math.sqrt,Oh=Math.tan;function x1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function aa(){}var bK=Zo(),opt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*un(t),un(e)]}function Dh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Fh(n){var t=ro(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var gpt=Zo();function rN(n,t){return[n>gr?n-Na:n<-gr?n+Na:n,t]}rN.invert=rN;function E1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:aa,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function w1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Xg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function S1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(C){if(!((R=C.length-1)<=0)){var R,x=C[0],E=C[R],I;if(w1(x,E)){for(s.lineStart(),h=0;h<R;++h)s.point((x=C[h])[0],x[1]);s.lineEnd();return}l.push(I=new Xg(x,C,null,!0)),p.push(I.o=new Xg(x,null,I,!1)),l.push(I=new Xg(E,C,null,!1)),p.push(I.o=new Xg(E,null,I,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],_,w;;){for(var S=m,b=!0;S.v;)if((S=S.n)===m)return;_=S.z,s.lineStart();do{if(S.v=S.o.v=!0,S.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(S.x,S.n.x,1,s);S=S.n}else{if(b)for(_=S.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(S.x,S.p.x,-1,s);S=S.p}S=S.o,_=S.z,b=!b}while(!S.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function M1(n){return n.length===1&&(n=CK(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function CK(n){return function(t,e){return sl(n(t),e)}}var oN=M1(sl),PK=oN.right,IK=oN.left;var sN=Array.prototype,LK=sN.slice,NK=sN.map;var adt=Math.sqrt(50),udt=Math.sqrt(10),ldt=Math.sqrt(2);function $g(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var kK=1e9,Xgt=-kK;var b1=Zo();function A1(n,t){var e=t[0],o=t[1],s=[un(e),-Xn(e),0],l=0,p=0;b1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],S=w[0],b=w[1]/2+Vg,C=un(b),R=Xn(b),x=0;x<_;++x,S=I,C=F,R=V,w=E){var E=m[x],I=E[0],A=E[1]/2+Vg,F=un(A),V=Xn(A),X=I-S,q=X>=0?1:-1,D=q*X,xt=D>gr,B=C*F;if(b1.add(Jo(B*q*un(D),R*V+B*Xn(D))),l+=xt?X+q*Na:X,xt^S>=e^I>=e){var j=Dh(Zl(w),Zl(E));Fh(j);var K=Dh(s,j);Fh(K);var Dt=(xt^X>=0?-1:1)*Co(K[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&b1<-er)^p&1}var nmt=Zo();var Emt=Zo(),wmt=Zo();var VK=1/0;var bmt=-VK;function T1(n){this._context=n}T1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Na);break}}},result:aa};var Dmt=Zo();function C1(){this._string=[]}C1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function P1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=E1(),m=t(g),_=!1,w,S,b,C={point:R,lineStart:E,lineEnd:I,polygonStart:function(){C.point=A,C.lineStart=F,C.lineEnd=V,S=[],w=[]},polygonEnd:function(){C.point=R,C.lineStart=E,C.lineEnd=I,S=$g(S);var X=A1(w,h);S.length?(_||(l.polygonStart(),_=!0),S1(S,YK,X,e,l)):X&&(_||(l.polygonStart(),_=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),_&&(l.polygonEnd(),_=!1),S=w=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function R(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function x(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){C.point=x,p.lineStart()}function I(){C.point=R,p.lineEnd()}function A(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function V(){A(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,K;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(l.polygonStart(),_=!0),l.lineStart(),D=0;D<B;++D)l.point((K=j[D])[0],K[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),S.push(q.filter(XK))}}return C}}function XK(n){return n.length>1}function YK(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var $K=P1(function(){return!0},ZK,JK,[-gr,-Mi]);function ZK(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=KK(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function KK(n,t,e,o){var s,l,p=un(n-e);return Zr(p)>er?sa((un(t)*(l=Xn(o))*un(e)-un(o)*(s=Xn(t))*un(n))/(s*l*p)):(t+o)/2}function JK(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Zg(n){return function(t){var e=new I1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function I1(){}I1.prototype={constructor:I1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var w0t=Xn(30*Ko);var F0t=Zg({point:function(n,t){this.stream.point(n*Ko,t*Ko)}});function Kg(n){return function(t,e){var o=Xn(t),s=Xn(e),l=n(o*s);return[l*s*un(t),l*un(e)]}}function Oa(n){return function(t,e){var o=ro(t*t+e*e),s=n(o),l=un(s),p=Xn(s);return[Jo(t*l,o*p),Co(o&&e*l/o)]}}var mN=Kg(function(n){return ro(2/(1+n))});mN.invert=Oa(function(n){return 2*Co(n/2)});var yN=Kg(function(n){return(n=x1(n))&&n/un(n)});yN.invert=Oa(function(n){return n});function R1(n,t){return[n,Nh(Oh((Mi+t)/2))]}R1.invert=function(n,t){return[n,2*sa(Wg(t))-Mi]};function Jg(n,t){return[n,t]}Jg.invert=Jg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*un(n)/o,un(t)/o]}vN.invert=Oa(sa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Xn(t)*un(n),un(t)]}xN.invert=Oa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*un(n)/o,un(t)/o]}EN.invert=Oa(function(n){return 2*sa(n)});function wN(n,t){return[Nh(Oh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*sa(Wg(n))-Mi]};var rJ=$e(mf(),1);var iJ=$e(mf(),1);var sJ=$e(mf(),1);var aJ=$e(mf(),1);function Da(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Da(n[e],n[e+1]);return t}function bN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var _f=$e(AN(),1);var je="___",mJ=1e4;function mu(n){let t=new Map;return n.forEach((e,o)=>{t.set(o,new Map(e))}),t}var jg=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return eu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+je+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+je+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,_f.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,_f.isNil)(h.coverageArea)&&h.coverageArea!==0);this.weightPointMap.set(l.floor,p),(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(C=>+C),[_,w]=h.endTime.split(":").map(C=>+C),S=g*60+m,b=_*60+w;return s>=S&&s<=b}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+je+h.id,m=""+l.floor+je+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+l.floor+je+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+je+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(S=>S.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(x=>x.floor===l.floor)&&w.entry_start_floor.find(x=>x.floor===l.floor)){let x=this.straightLadderMap.get(h.targetId)||[];x.push(eu({},h)),this.straightLadderMap.set(h.targetId,x)}break;case"staircase":if(w.entry_end_floor.find(x=>x.floor===l.floor)&&w.entry_start_floor.find(x=>x.floor===l.floor)){let x=this.staircaseMap.get(h.targetId)||[];x.push(eu({},h)),this.staircaseMap.set(h.targetId,x)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=b.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:b.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=b.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let C=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=C.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:C.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=C.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:C.push({end:h})}this.rampMap.set(h.targetId,C);break;case"connectionPoint":let R=this.connectionPointMap.get(h.targetId)||[];if(w.entry_start_floor.find(x=>x.floor===l.floor)){let x=R.find(E=>{var I;return((I=E.end)==null?void 0:I.floor)!==l.floor&&!E.start});x?x.start=h:R.push({start:h})}if(w.entry_end_floor.find(x=>x.floor===l.floor)){let x=R.find(E=>{var I;return((I=E.start)==null?void 0:I.floor)!==l.floor&&!E.end});x?x.end=h:R.push({end:h})}this.connectionPointMap.set(h.targetId,R);break}let S=this.facilityMap.get(h.targetId)||[];S.push(eu({},h)),this.facilityMap.set(h.targetId,S)}}h.type==="parkingSpace"&&h.name.split(/[,,]/).forEach(S=>{this.parkingMap.set(""+l.floor+je+S,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+je+h.from,m=""+l.floor+je+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let S=_.cds,b=w.cds,C=Da(S,b);if(!_.permission&&!w.permission){switch(h.direction){case"single-people":this.addLineItem(g,m,C);break;case"back-people":this.addLineItem(m,g,C);break;default:this.addLineItem(g,m,C),this.addLineItem(m,g,C)}switch(h.direction){case"double":this.addLineItem(g,m,C,this.forwardLineMap),this.addLineItem(m,g,C,this.forwardLineMap);break;case"single":this.addLineItem(g,m,C,this.forwardLineMap);break;case"back":this.addLineItem(m,g,C,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,C,this.forwardLineMap),this.addLineItem(m,g,C,this.forwardLineMap))}else _.permission&&this.setPermissionLine(g,m,_.permission,C,"",h.direction),w.permission&&w.permission!==_.permission&&this.setPermissionLine(g,m,w.permission,C,"",h.direction)})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l,p){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l,direction:p})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+je+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+je+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+je+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+je+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+je+o.start.id,l=""+o.end.floor+je+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+je+o.start.id,l=""+o.end.floor+je+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+je+o.start.id,l=""+o.end.floor+je+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"connectionPoint"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"connectionPoint"))}})})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{if(e.includes(p.type))if(p.type==="")switch(p.direction){case"single":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;case"single-people":this.addLineItem(p.fromKey,p.toKey,p.distance,o);break;case"back-people":this.addLineItem(p.toKey,p.fromKey,p.distance,o);break;default:this.addLineItem(p.fromKey,p.toKey,p.distance,o),this.addLineItem(p.toKey,p.fromKey,p.distance,o);break}else this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o)})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map,p=this.pointMap.get(t),h=this.pointMap.get(e);if(!p||!h)return;let g=this.weightPointMap.get(p.floor)||[],m=this.weightPointMap.get(h.floor)||[];g.forEach(_=>{_.id===p.id&&(o=o/_.passWeight),Da(p.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),m.forEach(_=>{_.id===h.id&&(o=o/_.passWeight),Da(h.cds,_.cds)<=_.coverageArea&&(o=o/_.passWeight)}),l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+je+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let S=""+h[w].floor+je+h[w].id,b=this.pointMap.get(S);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let C=e;this.addLineItem(m,S,C,s)}else{let C=o;this.addLineItem(m,S,C,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+je+h.start.id,m=""+h.end.floor+je+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let S=t;this.addLineItem(g,m,S,s)}}})}),this.connectionPointMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+je+h.start.id,m=""+h.end.floor+je+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);_&&w&&!_.permission&&!w.permission&&this.addLineItem(g,m,100,s)}})})}initBaseRoute(){let t=new Map(mu(this.lineMap));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new Vi.default(t)}initEscalatorRoute(){let t=new Map(mu(this.lineMap)),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new Vi.default(t)}initStraightLadderRoute(){let t=new Map(mu(this.lineMap)),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new Vi.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+je+o.start.id,l=""+o.end.floor+je+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+je+o.start.id,l=""+o.end.floor+je+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,100,this.forwardLineMap)}})}),this.forwardRoute=new Vi.default(this.forwardLineMap)}addNoProofWeight(t,e){let o=(s,l)=>{let p=t.get(s),h=p==null?void 0:p.get(l);p&&!(0,_f.isNil)(h)&&p.set(l,h*mJ)};this.roadInfo.forEach(s=>{(s.lines||[]).filter(l=>l.to!==l.from&&l[e]===!1).forEach(l=>{let p=""+s.floor+je+l.from,h=""+s.floor+je+l.to;switch(l.direction){case"single-people":o(p,h);break;case"back-people":o(h,p);break;default:o(p,h),o(h,p)}})})}getRouteByType(t){switch(t){case"escalator":return this.escalatorRoute;case"straightLadder":return this.straightLadderRoute;case"forward":return this.forwardRoute;default:return this.baseRoute}}getProofRoute(t,e,o){let s=""+t+je+e+je+o,l=this.proofRouteMap.get(s);if(l)return l;let p=new Map(mu(this.getRouteByType(t).graph));e&&this.addNoProofWeight(p,"sunProof"),o&&this.addNoProofWeight(p,"rain");let h=new Vi.default(p);return this.proofRouteMap.set(s,h),h}checkStart(t){return t.floor?t.parkingSpace?!0:!(!t.routePointId&&!t.nodeId&&(!t.coord||t.coord.length<2)):!1}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.routePointId)return[{floor:t.floor,id:t.routePointId}];if(t.floor&&t.parkingSpace){let l=this.getParkingSpaceInfo(t.floor,t.parkingSpace);if(l)return[{floor:l.floor,id:l.id}]}if(t.nodeId){let l=this.nodeMap.get(""+t.floor+je+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(je);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let _=""+m.floor+je+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Da(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.routePointId&&t.floor)return[{floor:t.floor,id:t.routePointId}];if(t.floor){let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let R=0;R<h.length;R++){let x=h[R];for(let E=0;E<g.length;E++){let I=g[E];if(x.floor===I.floor&&x.id===I.id)return"near"}}else{m=this.facilities.filter(x=>+x.type_id==+e.facility).map(x=>x.id).map(x=>this.facilityMap.get(""+x)).flat(2).filter(x=>x).filter(x=>g.floor?x.floor===g.floor:!0);for(let x=0;x<h.length;x++){let E=h[x];for(let I=0;I<m.length;I++){let A=m[I];if(E.floor===A.floor&&E.id===A.id)return"near"}}}let _=Array.isArray(p.proof)?p.proof:p.proof?[p.proof]:[],w=o!=="forward"&&_.includes("sunProof"),S=o!=="forward"&&_.includes("rain"),b;switch(o){case"escalator":b=(R,x,E)=>this.getEscalatorPath(R,x,E,w,S);break;case"straightLadder":b=(R,x,E)=>this.getStraightLadderPath(R,x,E,w,S);break;case"forward":b=this.getForwardPath.bind(this);break;default:b=(R,x,E)=>this.getBasePath(R,x,E,w,S);break}let C=null;return h.forEach(R=>{if(Array.isArray(g))g.forEach(x=>{let E=b(R,x,s,l);E&&E&&(!C||E[0].consume<C[0].consume)&&(C=E)});else{if(!m.length)return null;let x=m.map(E=>b(R,{floor:E.floor,id:E.id},s,l)).filter(E=>!!E);C=x.reduce((E,I)=>{let A=I[0].consume;return A<E.distance&&(E.distance=A,E.path=I),E},{distance:1/0,path:x[0]}).path}}),C}getRoutePath(t,e,o){let s=""+t.floor+je+t.id,l=this.pointMap.get(s),p=""+e.floor+je+e.id,h=this.pointMap.get(p);if(!l||!h)return null;let g=""+l.floor+je+(l.relatedId||l.id),m=""+h.floor+je+(h.relatedId||h.id),_=o.path(g,m);if(!_)return null;let w=[],S=_.reduce((b,C,R,x)=>{if(R===0)return 0;let E=x[R-1],I=o.graph.get(E).get(C);return b+I},0);return _.map(b=>{let C=this.pointMap.get(b);if(C){var R;let{floor:x}=C,E=C.type;if(this.isFacilityByType(C.type)){let I=this.facilities.find(A=>A.id===+C.targetId);I&&(E=I.entry_infra_type)}if(((R=w[w.length-1])==null?void 0:R.floor)===x){let I=w[w.length-1];I.points.push(C.cds),I.pointInfos.push(C),I.endType=E,I.destId=C.nodeId,I.distance=MN(I.points)}else w.push({floor:x,points:[C.cds],pointInfos:[C],endType:E,destId:C.nodeId,distance:0,consume:S})}}),w}getBasePath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("",s,l):this.baseRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=_=>{this.addPermissionLineToMap(_,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(_=>{g(_)}):g(o);let m=new Vi.default(h);return this.getRoutePath(t,e,m)}getEscalatorPath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("escalator",s,l):this.escalatorRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=1e4,m=w=>{this.addPermissionLineToMap(w,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*g],["staircase",3e4*g]]))};Array.isArray(o)?o.forEach(w=>{m(w)}):m(o);let _=new Vi.default(h);return this.getRoutePath(t,e,_)}getStraightLadderPath(t,e,o,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);let p=s||l?this.getProofRoute("straightLadder",s,l):this.straightLadderRoute;if(!o)return this.getRoutePath(t,e,p);let h=mu(p.graph),g=1e4,m=w=>{this.addPermissionLineToMap(w,["","escalator","staircase","straightLadder","connectionPoint"],h,new Map([["escalator",3*g],["connectionPoint",100],["straightLadder",300],["staircase",3e4*g]]))};Array.isArray(o)?o.forEach(w=>{m(w)}):m(o);let _=new Vi.default(h);return this.getRoutePath(t,e,_)}getSunProofPath(t,e,o,s,l,p){return o===void 0&&(o=""),p===void 0&&(p={}),this.getPath(t,e,o,s,l,eu({},p,{proof:"sunProof"}))}getRainProofPath(t,e,o,s,l,p){return o===void 0&&(o=""),p===void 0&&(p={}),this.getPath(t,e,o,s,l,eu({},p,{proof:"rain"}))}getForwardPath(t,e,o,s){let l=new Map,p=b=>{let C=this.forwardRoute.graph.get(g);b.forEach(R=>{let x=C.get(R);(0,_f.isNil)(x)||(l.set(R,x),C.delete(R))})},h=()=>{let b=this.forwardRoute.graph.get(g);l.forEach((C,R)=>{b.set(R,C)})},g=""+t.floor+je+t.id;if(!(0,_f.isNil)(s)){let b=this.forwardLineMap.get(g),C=this.pointMap.get(g);if(C&&(b!=null&&b.size)&&b.size>1){let R=new ze(C.cds[0],C.cds[1]),x=new Map;b.forEach((I,A)=>{let F=this.pointMap.get(A);if(F){let V=new ze(F.cds[0],F.cds[1]),q=360-(new ze().subVectors(V,R).angle()/Math.PI*180-90+360)%360;x.set(A,q)}});let E=Array.from(x).filter(I=>{let[A,F]=I;return Math.abs(F-s)<=60}).map(I=>{let[A]=I;return A});if(E.length)E.forEach(I=>x.delete(I)),p([...x.keys()]);else{let I=Array.from(x).reduce((A,F)=>{let V=Math.abs(F[1]-s);return V<A.diff?{diff:V,key:F[0]}:A},{diff:1/0,key:""});x.delete(I.key),p([...x.keys()])}}}if(!o){let b=this.getRoutePath(t,e,this.forwardRoute);return h(),b||this.getRoutePath(t,e,this.forwardRoute)}let m=mu(this.forwardRoute.graph),_=b=>{this.addPermissionLineToMap(b,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(b=>{_(b)}):_(o);let w=new Vi.default(m),S=this.getRoutePath(t,e,w);if(h(),S)return S;{let b=mu(this.forwardRoute.graph);Array.isArray(o)?o.forEach(x=>{_(x)}):_(o);let C=new Vi.default(b);return this.getRoutePath(t,e,C)}}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 Vi.default,this.escalatorRoute=new Vi.default,this.straightLadderRoute=new Vi.default,this.proofRouteMap.clear()}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.weightPointMap=new Map,this.baseRoute=new Vi.default,this.escalatorRoute=new Vi.default,this.straightLadderRoute=new Vi.default,this.forwardLineMap=new Map,this.forwardRoute=new Vi.default,this.proofRouteMap=new Map}};var owt=$e(kp(),1),swt=$e(Zp(),1);var yJ=$e(RN(),1);function vJ(n,t,e){let o=bN(n,t,e);return _J(o)}function _J(n){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 LN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Da(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=vJ(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],l=Da(n[e-1],n[e]);s.distance+=l,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Da(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var ywt=$e(o2(),1),vwt=$e(Yp(),1),_wt=$e(Zp(),1);function s2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function a2(n){let t={};for(let o in n)o.startsWith("on")&&(t[s2(o.slice(2))]=n[o],t[o]=n[o]);let e=o=>dp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var tm=new jg;a2({onSetLiftPriority(n){tm.setLiftPriority(n)},onSetRoadInfo(n){let{roadData:t,facilities:e}=n;tm.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:l,options:p}=n;return tm.getPath(t,e,o,s,l,p)},onGetDirectionPath(n){return LN(n)},onClear(){tm.clear()}});
|