@mappedin/mappedin-js 6.0.1-beta.25 → 6.0.1-beta.26
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/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-MHPZU3XO.js → GLTFExporter-E4CFNJU2.js} +1 -1
- package/lib/esm/{GLTFLoader-U7AA3ANF.js → GLTFLoader-RR3SOQAO.js} +1 -1
- package/lib/esm/{browser-WPSSSHWP.js → browser-LGLZW75B.js} +1 -1
- package/lib/esm/{chunk-NOC4HUGQ.js → chunk-464QB2FL.js} +1 -1
- package/lib/esm/{chunk-HNXEE7EF.js → chunk-7F2EB5HA.js} +1 -1
- package/lib/esm/{chunk-5CCCMZFJ.js → chunk-7JLMOMCP.js} +1 -1
- package/lib/esm/chunk-KN7LUPZI.js +1 -0
- package/lib/esm/{chunk-3Q3CKEJT.js → chunk-U74CQPJ5.js} +1 -1
- package/lib/esm/chunk-YZUKJOGG.js +1 -0
- package/lib/esm/index.d.ts +254 -146
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-B7DLKDU3.js +1 -0
- package/lib/esm/internal-VVNLOL2A.js +1 -0
- package/lib/esm/{outdoor-context-v4-OB4C7C4T.js → outdoor-context-v4-OAGPVYEO.js} +1 -1
- package/lib/esm/text3d-Q7FFP3YS.css +1 -0
- package/lib/esm/text3d-XLQK46LO.js +1 -0
- package/package.json +2 -2
- package/lib/esm/chunk-2573CS4P.js +0 -1
- package/lib/esm/chunk-OHSR5FWH.js +0 -1
- package/lib/esm/inspector-VHBJTER4.js +0 -1
- package/lib/esm/internal-D52X6FJE.js +0 -1
- package/lib/esm/text3d-XRL4YUO2.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as Qr,B as Em,C as El,D as xv,E as Cv,F as Qp,G as za,a as Pl,b as ce,c as sv,d as br,e as $r,f as Jr,g as Te,h as Im,i as cv,j as Xa,k as To,l as uv,m as Ya,n as pv,o as dv,p as wm,q as qp,r as $p,s as hv,t as fv,u as mv,v as Jp,w as yv,x as gv,y as vv,z as bv}from"./chunk-OHSR5FWH.js";import{j as lv}from"./chunk-NOC4HUGQ.js";import{a as Kr}from"./chunk-HNXEE7EF.js";import{A as te,Aa as ev,Ba as Xr,Ca as Yr,Da as tv,E as U0,Ea as rv,F as W0,Fa as iv,G as Z0,H as $,Ha as zr,I as ki,J as X0,K as In,L as Ha,M as Fi,N as Ie,P as Yt,Pa as Za,Q as Il,R as Y0,S as Se,Sa as zp,T as Wp,Ta as nv,V as wl,W as z0,X as Pm,Xa as ov,Y as q0,Z as vr,_a as qr,a as Up,ab as av,b as G0,c as V0,d as Li,da as $0,e as Zr,ea as J0,fa as Ua,ka as Q0,n as j0,na as Zp,o as H0,oa as Wa,pa as Xp,ra as So,w as Ai,xa as K0,ya as wn,z as ge,za as Yp}from"./chunk-5CCCMZFJ.js";import{a as f,b as S}from"./chunk-3Q3CKEJT.js";import{b as G,c as O6,d as Ml,e as p,f as s,g as C,h as M,i as V}from"./chunk-H2E2454S.js";var nb=G((jm,Hm)=>{f();(function(r,t){typeof jm=="object"&&typeof Hm<"u"?Hm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(jm,function(){"use strict";function r(v,b,P,I,w){(function _(D,k,N,R,j){for(;R>N;){if(R-N>600){var Z=R-N+1,se=k-N+1,me=Math.log(Z),Pe=.5*Math.exp(2*me/3),De=.5*Math.sqrt(me*Pe*(Z-Pe)/Z)*(se-Z/2<0?-1:1),ze=Math.max(N,Math.floor(k-se*Pe/Z+De)),Wt=Math.min(R,Math.floor(k+(Z-se)*Pe/Z+De));_(D,k,ze,Wt,j)}var Oe=D[k],qe=N,je=R;for(t(D,N,k),j(D[R],Oe)>0&&t(D,N,R);qe<je;){for(t(D,qe,je),qe++,je--;j(D[qe],Oe)<0;)qe++;for(;j(D[je],Oe)>0;)je--}j(D[N],Oe)===0?t(D,N,je):t(D,++je,R),je<=k&&(N=je+1),k<=je&&(R=je-1)}})(v,b,P||0,I||v.length-1,w||e)}function t(v,b,P){var I=v[b];v[b]=v[P],v[P]=I}function e(v,b){return v<b?-1:v>b?1:0}var i=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(v,b,P){if(!P)return b.indexOf(v);for(var I=0;I<b.length;I++)if(P(v,b[I]))return I;return-1}function o(v,b){a(v,0,v.children.length,b,v)}function a(v,b,P,I,w){w||(w=x(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var _=b;_<P;_++){var D=v.children[_];l(w,v.leaf?I(D):D)}return w}function l(v,b){return v.minX=Math.min(v.minX,b.minX),v.minY=Math.min(v.minY,b.minY),v.maxX=Math.max(v.maxX,b.maxX),v.maxY=Math.max(v.maxY,b.maxY),v}function c(v,b){return v.minX-b.minX}function u(v,b){return v.minY-b.minY}function d(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function m(v){return v.maxX-v.minX+(v.maxY-v.minY)}function y(v,b){return v.minX<=b.minX&&v.minY<=b.minY&&b.maxX<=v.maxX&&b.maxY<=v.maxY}function g(v,b){return b.minX<=v.maxX&&b.minY<=v.maxY&&b.maxX>=v.minX&&b.maxY>=v.minY}function x(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(v,b,P,I,w){for(var _=[b,P];_.length;)if(!((P=_.pop())-(b=_.pop())<=I)){var D=b+Math.ceil((P-b)/I/2)*I;r(v,D,b,P,w),_.push(b,D,D,P)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var b=this.data,P=[];if(!g(v,b))return P;for(var I=this.toBBox,w=[];b;){for(var _=0;_<b.children.length;_++){var D=b.children[_],k=b.leaf?I(D):D;g(v,k)&&(b.leaf?P.push(D):y(v,k)?this._all(D,P):w.push(D))}b=w.pop()}return P},i.prototype.collides=function(v){var b=this.data;if(!g(v,b))return!1;for(var P=[];b;){for(var I=0;I<b.children.length;I++){var w=b.children[I],_=b.leaf?this.toBBox(w):w;if(g(v,_)){if(b.leaf||y(v,_))return!0;P.push(w)}}b=P.pop()}return!1},i.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var b=0;b<v.length;b++)this.insert(v[b]);return this}var P=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var I=this.data;this.data=P,P=I}this._insert(P,this.data.height-P.height-1,!0)}else this.data=P;return this},i.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},i.prototype.clear=function(){return this.data=x([]),this},i.prototype.remove=function(v,b){if(!v)return this;for(var P,I,w,_=this.data,D=this.toBBox(v),k=[],N=[];_||k.length;){if(_||(_=k.pop(),I=k[k.length-1],P=N.pop(),w=!0),_.leaf){var R=n(v,_.children,b);if(R!==-1)return _.children.splice(R,1),k.push(_),this._condense(k),this}w||_.leaf||!y(_,D)?I?(P++,_=I.children[P],w=!1):_=null:(k.push(_),N.push(P),P=0,I=_,_=_.children[0])}return this},i.prototype.toBBox=function(v){return v},i.prototype.compareMinX=function(v,b){return v.minX-b.minX},i.prototype.compareMinY=function(v,b){return v.minY-b.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(v){return this.data=v,this},i.prototype._all=function(v,b){for(var P=[];v;)v.leaf?b.push.apply(b,v.children):P.push.apply(P,v.children),v=P.pop();return b},i.prototype._build=function(v,b,P,I){var w,_=P-b+1,D=this._maxEntries;if(_<=D)return o(w=x(v.slice(b,P+1)),this.toBBox),w;I||(I=Math.ceil(Math.log(_)/Math.log(D)),D=Math.ceil(_/Math.pow(D,I-1))),(w=x([])).leaf=!1,w.height=I;var k=Math.ceil(_/D),N=k*Math.ceil(Math.sqrt(D));T(v,b,P,N,this.compareMinX);for(var R=b;R<=P;R+=N){var j=Math.min(R+N-1,P);T(v,R,j,k,this.compareMinY);for(var Z=R;Z<=j;Z+=k){var se=Math.min(Z+k-1,j);w.children.push(this._build(v,Z,se,I-1))}}return o(w,this.toBBox),w},i.prototype._chooseSubtree=function(v,b,P,I){for(;I.push(b),!b.leaf&&I.length-1!==P;){for(var w=1/0,_=1/0,D=void 0,k=0;k<b.children.length;k++){var N=b.children[k],R=d(N),j=(Z=v,se=N,(Math.max(se.maxX,Z.maxX)-Math.min(se.minX,Z.minX))*(Math.max(se.maxY,Z.maxY)-Math.min(se.minY,Z.minY))-R);j<_?(_=j,w=R<w?R:w,D=N):j===_&&R<w&&(w=R,D=N)}b=D||b.children[0]}var Z,se;return b},i.prototype._insert=function(v,b,P){var I=P?v:this.toBBox(v),w=[],_=this._chooseSubtree(I,this.data,b,w);for(_.children.push(v),l(_,I);b>=0&&w[b].children.length>this._maxEntries;)this._split(w,b),b--;this._adjustParentBBoxes(I,w,b)},i.prototype._split=function(v,b){var P=v[b],I=P.children.length,w=this._minEntries;this._chooseSplitAxis(P,w,I);var _=this._chooseSplitIndex(P,w,I),D=x(P.children.splice(_,P.children.length-_));D.height=P.height,D.leaf=P.leaf,o(P,this.toBBox),o(D,this.toBBox),b?v[b-1].children.push(D):this._splitRoot(P,D)},i.prototype._splitRoot=function(v,b){this.data=x([v,b]),this.data.height=v.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(v,b,P){for(var I,w,_,D,k,N,R,j=1/0,Z=1/0,se=b;se<=P-b;se++){var me=a(v,0,se,this.toBBox),Pe=a(v,se,P,this.toBBox),De=(w=me,_=Pe,D=void 0,k=void 0,N=void 0,R=void 0,D=Math.max(w.minX,_.minX),k=Math.max(w.minY,_.minY),N=Math.min(w.maxX,_.maxX),R=Math.min(w.maxY,_.maxY),Math.max(0,N-D)*Math.max(0,R-k)),ze=d(me)+d(Pe);De<j?(j=De,I=se,Z=ze<Z?ze:Z):De===j&&ze<Z&&(Z=ze,I=se)}return I||P-b},i.prototype._chooseSplitAxis=function(v,b,P){var I=v.leaf?this.compareMinX:c,w=v.leaf?this.compareMinY:u;this._allDistMargin(v,b,P,I)<this._allDistMargin(v,b,P,w)&&v.children.sort(I)},i.prototype._allDistMargin=function(v,b,P,I){v.children.sort(I);for(var w=this.toBBox,_=a(v,0,b,w),D=a(v,P-b,P,w),k=m(_)+m(D),N=b;N<P-b;N++){var R=v.children[N];l(_,v.leaf?w(R):R),k+=m(_)}for(var j=P-b-1;j>=b;j--){var Z=v.children[j];l(D,v.leaf?w(Z):Z),k+=m(D)}return k},i.prototype._adjustParentBBoxes=function(v,b,P){for(var I=P;I>=0;I--)l(b[I],v)},i.prototype._condense=function(v){for(var b=v.length-1,P=void 0;b>=0;b--)v[b].children.length===0?b>0?(P=v[b-1].children).splice(P.indexOf(v[b]),1):this.clear():o(v[b],this.toBBox)},i})});var Ym=G(q=>{"use strict";f();Object.defineProperty(q,"__esModule",{value:!0});q.earthRadius=63710088e-1;q.factors={centimeters:q.earthRadius*100,centimetres:q.earthRadius*100,degrees:q.earthRadius/111325,feet:q.earthRadius*3.28084,inches:q.earthRadius*39.37,kilometers:q.earthRadius/1e3,kilometres:q.earthRadius/1e3,meters:q.earthRadius,metres:q.earthRadius,miles:q.earthRadius/1609.344,millimeters:q.earthRadius*1e3,millimetres:q.earthRadius*1e3,nauticalmiles:q.earthRadius/1852,radians:1,yards:q.earthRadius*1.0936};q.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/q.earthRadius,yards:1.0936133};q.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 On(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}q.feature=On;function hT(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Um(t).geometry;case"LineString":return Zm(t).geometry;case"Polygon":return Wm(t).geometry;case"MultiPoint":return ab(t).geometry;case"MultiLineString":return ob(t).geometry;case"MultiPolygon":return sb(t).geometry;default:throw new Error(r+" is invalid")}}q.geometry=hT;function Um(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!fd(r[0])||!fd(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return On(i,t,e)}q.point=Um;function fT(r,t,e){return e===void 0&&(e={}),md(r.map(function(i){return Um(i,t)}),e)}q.points=fT;function Wm(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:r};return On(l,t,e)}q.polygon=Wm;function mT(r,t,e){return e===void 0&&(e={}),md(r.map(function(i){return Wm(i,t)}),e)}q.polygons=mT;function Zm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return On(i,t,e)}q.lineString=Zm;function yT(r,t,e){return e===void 0&&(e={}),md(r.map(function(i){return Zm(i,t)}),e)}q.lineStrings=yT;function md(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}q.featureCollection=md;function ob(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return On(i,t,e)}q.multiLineString=ob;function ab(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return On(i,t,e)}q.multiPoint=ab;function sb(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return On(i,t,e)}q.multiPolygon=sb;function gT(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return On(i,t,e)}q.geometryCollection=gT;function vT(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}q.round=vT;function lb(r,t){t===void 0&&(t="kilometers");var e=q.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}q.radiansToLength=lb;function Xm(r,t){t===void 0&&(t="kilometers");var e=q.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}q.lengthToRadians=Xm;function bT(r,t){return cb(Xm(r,t))}q.lengthToDegrees=bT;function xT(r){var t=r%360;return t<0&&(t+=360),t}q.bearingToAzimuth=xT;function cb(r){var t=r%(2*Math.PI);return t*180/Math.PI}q.radiansToDegrees=cb;function CT(r){var t=r%360;return t*Math.PI/180}q.degreesToRadians=CT;function ST(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return lb(Xm(r,t),e)}q.convertLength=ST;function TT(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=q.areaFactors[t];if(!i)throw new Error("invalid original units");var n=q.areaFactors[e];if(!n)throw new Error("invalid final units");return r/i*n}q.convertArea=TT;function fd(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}q.isNumber=fd;function MT(r){return!!r&&r.constructor===Object}q.isObject=MT;function PT(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!fd(t))throw new Error("bbox must only contain numbers")})}q.validateBBox=PT;function IT(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}q.validateId=IT});var fb=G(Je=>{"use strict";f();Object.defineProperty(Je,"__esModule",{value:!0});var lt=Ym();function Gl(r,t,e){if(r!==null)for(var i,n,o,a,l,c,u,d=0,m=0,y,g=r.type,x=g==="FeatureCollection",T=g==="Feature",v=x?r.features.length:1,b=0;b<v;b++){u=x?r.features[b].geometry:T?r.geometry:r,y=u?u.type==="GeometryCollection":!1,l=y?u.geometries.length:1;for(var P=0;P<l;P++){var I=0,w=0;if(a=y?u.geometries[P]:u,a!==null){c=a.coordinates;var _=a.type;switch(d=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,m,b,I,w)===!1)return!1;m++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],m,b,I,w)===!1)return!1;m++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-d;n++){if(t(c[i][n],m,b,I,w)===!1)return!1;m++}_==="MultiLineString"&&I++,_==="Polygon"&&w++}_==="Polygon"&&I++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-d;o++){if(t(c[i][n][o],m,b,I,w)===!1)return!1;m++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Gl(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function wT(r,t,e,i){var n=e;return Gl(r,function(o,a,l,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,l,c,u)},i),n}function ub(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function ET(r,t,e){var i=e;return ub(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}function pb(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function _T(r,t,e){var i=e;return pb(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}function DT(r){var t=[];return Gl(r,function(e){t.push(e)}),t}function zm(r,t){var e,i,n,o,a,l,c,u,d,m,y=0,g=r.type==="FeatureCollection",x=r.type==="Feature",T=g?r.features.length:1;for(e=0;e<T;e++){for(l=g?r.features[e].geometry:x?r.geometry:r,u=g?r.features[e].properties:x?r.properties:{},d=g?r.features[e].bbox:x?r.bbox:void 0,m=g?r.features[e].id:x?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,y,u,d,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,y,u,d,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],y,u,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function OT(r,t,e){var i=e;return zm(r,function(n,o,a,l,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,l,c)}),i}function yd(r,t){zm(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(lt.feature(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],m={type:c,coordinates:d};if(t(lt.feature(m,n),i,u)===!1)return!1}})}function LT(r,t,e){var i=e;return yd(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}function db(r,t){yd(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,u=0,d=0;if(Gl(e,function(m,y,g,x,T){if(l===void 0||i>c||x>u||T>d){l=m,c=i,u=x,d=T,o=0;return}var v=lt.lineString([l,m],e.properties);if(t(v,i,n,T,o)===!1)return!1;o++,l=m})===!1)return!1}}})}function AT(r,t,e){var i=e,n=!1;return db(r,function(o,a,l,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,u),n=!0}),i}function hb(r,t){if(!r)throw new Error("geojson is required");yd(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(lt.lineString(a[l],e.properties),i,n,l)===!1)return!1;break}}})}function kT(r,t,e){var i=e;return hb(r,function(n,o,a,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,l)}),i}function FT(r,t){if(t=t||{},!lt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),lt.lineString([c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),lt.lineString([c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),lt.lineString([c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),lt.lineString([c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}function BT(r,t){if(t=t||{},!lt.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return lt.point(c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),lt.point(c[i],a,t);case"LineString":return o<0&&(o=c.length+o),lt.point(c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),lt.point(c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),lt.point(c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),lt.point(c[i][n][o],a,t)}throw new Error("geojson is invalid")}Je.coordAll=DT;Je.coordEach=Gl;Je.coordReduce=wT;Je.featureEach=pb;Je.featureReduce=_T;Je.findPoint=BT;Je.findSegment=FT;Je.flattenEach=yd;Je.flattenReduce=LT;Je.geomEach=zm;Je.geomReduce=OT;Je.lineEach=hb;Je.lineReduce=kT;Je.propEach=ub;Je.propReduce=ET;Je.segmentEach=db;Je.segmentReduce=AT});var qm=G((dF,yb)=>{"use strict";f();var mb=Object.prototype.toString;yb.exports=function(t){var e=mb.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&mb.call(t.callee)==="[object Function]"),i}});var Pb=G((fF,Mb)=>{"use strict";f();var Tb;Object.keys||(Vl=Object.prototype.hasOwnProperty,$m=Object.prototype.toString,gb=qm(),Jm=Object.prototype.propertyIsEnumerable,vb=!Jm.call({toString:null},"toString"),bb=Jm.call(function(){},"prototype"),jl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],gd=function(r){var t=r.constructor;return t&&t.prototype===r},xb={$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},Cb=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!xb["$"+r]&&Vl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{gd(window[r])}catch{return!0}}catch{return!0}return!1}(),Sb=function(r){if(typeof window>"u"||!Cb)return gd(r);try{return gd(r)}catch{return!1}},Tb=function(t){var e=t!==null&&typeof t=="object",i=$m.call(t)==="[object Function]",n=gb(t),o=e&&$m.call(t)==="[object String]",a=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var l=bb&&i;if(o&&t.length>0&&!Vl.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(n&&t.length>0)for(var u=0;u<t.length;++u)a.push(String(u));else for(var d in t)!(l&&d==="prototype")&&Vl.call(t,d)&&a.push(String(d));if(vb)for(var m=Sb(t),y=0;y<jl.length;++y)!(m&&jl[y]==="constructor")&&Vl.call(t,jl[y])&&a.push(jl[y]);return a});var Vl,$m,gb,Jm,vb,bb,jl,gd,xb,Cb,Sb;Mb.exports=Tb});var bd=G((yF,Eb)=>{"use strict";f();var RT=Array.prototype.slice,NT=qm(),Ib=Object.keys,vd=Ib?function(t){return Ib(t)}:Pb(),wb=Object.keys;vd.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(i){return NT(i)?wb(RT.call(i)):wb(i)})}else Object.keys=vd;return Object.keys||vd};Eb.exports=vd});var Db=G((vF,_b)=>{"use strict";f();_b.exports=Error});var Lb=G((xF,Ob)=>{"use strict";f();Ob.exports=EvalError});var kb=G((SF,Ab)=>{"use strict";f();Ab.exports=RangeError});var Bb=G((MF,Fb)=>{"use strict";f();Fb.exports=ReferenceError});var Qm=G((IF,Rb)=>{"use strict";f();Rb.exports=SyntaxError});var ji=G((EF,Nb)=>{"use strict";f();Nb.exports=TypeError});var Vb=G((DF,Gb)=>{"use strict";f();Gb.exports=URIError});var Hl=G((LF,jb)=>{"use strict";f();jb.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[e]=n;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==n||a.enumerable!==!0)return!1}return!0}});var xd=G((kF,Ub)=>{"use strict";f();var Hb=typeof Symbol<"u"&&Symbol,GT=Hl();Ub.exports=function(){return typeof Hb!="function"||typeof Symbol!="function"||typeof Hb("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:GT()}});var Zb=G((BF,Wb)=>{"use strict";f();var Km={__proto__:null,foo:{}},VT=Object;Wb.exports=function(){return{__proto__:Km}.foo===Km.foo&&!(Km instanceof VT)}});var zb=G((NF,Yb)=>{"use strict";f();var jT="Function.prototype.bind called on incompatible ",HT=Object.prototype.toString,UT=Math.max,WT="[object Function]",Xb=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i},ZT=function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},XT=function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e};Yb.exports=function(t){var e=this;if(typeof e!="function"||HT.apply(e)!==WT)throw new TypeError(jT+e);for(var i=ZT(arguments,1),n,o=function(){if(this instanceof n){var d=e.apply(this,Xb(i,arguments));return Object(d)===d?d:this}return e.apply(t,Xb(i,arguments))},a=UT(0,e.length-i.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(n=Function("binder","return function ("+XT(l,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var u=function(){};u.prototype=e.prototype,n.prototype=new u,u.prototype=null}return n}});var Cd=G((VF,qb)=>{"use strict";f();var YT=zb();qb.exports=Function.prototype.bind||YT});var ey=G((HF,$b)=>{"use strict";f();var zT=Function.prototype.call,qT=Object.prototype.hasOwnProperty,$T=Cd();$b.exports=$T.call(zT,qT)});var Mr=G((WF,t2)=>{"use strict";f();var de,JT=Db(),QT=Lb(),KT=kb(),eM=Bb(),rs=Qm(),ts=ji(),tM=Vb(),e2=Function,ty=function(r){try{return e2('"use strict"; return ('+r+").constructor;")()}catch{}},Eo=Object.getOwnPropertyDescriptor;if(Eo)try{Eo({},"")}catch{Eo=null}var ry=function(){throw new ts},rM=Eo?function(){try{return arguments.callee,ry}catch{try{return Eo(arguments,"callee").get}catch{return ry}}}():ry,Ka=xd()(),iM=Zb()(),it=Object.getPrototypeOf||(iM?function(r){return r.__proto__}:null),es={},nM=typeof Uint8Array>"u"||!it?de:it(Uint8Array),_o={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?de:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?de:ArrayBuffer,"%ArrayIteratorPrototype%":Ka&&it?it([][Symbol.iterator]()):de,"%AsyncFromSyncIteratorPrototype%":de,"%AsyncFunction%":es,"%AsyncGenerator%":es,"%AsyncGeneratorFunction%":es,"%AsyncIteratorPrototype%":es,"%Atomics%":typeof Atomics>"u"?de:Atomics,"%BigInt%":typeof BigInt>"u"?de:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?de:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?de:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?de:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":JT,"%eval%":eval,"%EvalError%":QT,"%Float32Array%":typeof Float32Array>"u"?de:Float32Array,"%Float64Array%":typeof Float64Array>"u"?de:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?de:FinalizationRegistry,"%Function%":e2,"%GeneratorFunction%":es,"%Int8Array%":typeof Int8Array>"u"?de:Int8Array,"%Int16Array%":typeof Int16Array>"u"?de:Int16Array,"%Int32Array%":typeof Int32Array>"u"?de:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ka&&it?it(it([][Symbol.iterator]())):de,"%JSON%":typeof JSON=="object"?JSON:de,"%Map%":typeof Map>"u"?de:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ka||!it?de:it(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?de:Promise,"%Proxy%":typeof Proxy>"u"?de:Proxy,"%RangeError%":KT,"%ReferenceError%":eM,"%Reflect%":typeof Reflect>"u"?de:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?de:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ka||!it?de:it(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?de:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ka&&it?it(""[Symbol.iterator]()):de,"%Symbol%":Ka?Symbol:de,"%SyntaxError%":rs,"%ThrowTypeError%":rM,"%TypedArray%":nM,"%TypeError%":ts,"%Uint8Array%":typeof Uint8Array>"u"?de:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?de:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?de:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?de:Uint32Array,"%URIError%":tM,"%WeakMap%":typeof WeakMap>"u"?de:WeakMap,"%WeakRef%":typeof WeakRef>"u"?de:WeakRef,"%WeakSet%":typeof WeakSet>"u"?de:WeakSet};if(it)try{null.error}catch(r){Jb=it(it(r)),_o["%Error.prototype%"]=Jb}var Jb,oM=function r(t){var e;if(t==="%AsyncFunction%")e=ty("async function () {}");else if(t==="%GeneratorFunction%")e=ty("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=ty("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&it&&(e=it(n.prototype))}return _o[t]=e,e},Qb={__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"]},Ul=Cd(),Sd=ey(),aM=Ul.call(Function.call,Array.prototype.concat),sM=Ul.call(Function.apply,Array.prototype.splice),Kb=Ul.call(Function.call,String.prototype.replace),Td=Ul.call(Function.call,String.prototype.slice),lM=Ul.call(Function.call,RegExp.prototype.exec),cM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,uM=/\\(\\)?/g,pM=function(t){var e=Td(t,0,1),i=Td(t,-1);if(e==="%"&&i!=="%")throw new rs("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new rs("invalid intrinsic syntax, expected opening `%`");var n=[];return Kb(t,cM,function(o,a,l,c){n[n.length]=l?Kb(c,uM,"$1"):a||o}),n},dM=function(t,e){var i=t,n;if(Sd(Qb,i)&&(n=Qb[i],i="%"+n[0]+"%"),Sd(_o,i)){var o=_o[i];if(o===es&&(o=oM(i)),typeof o>"u"&&!e)throw new ts("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new rs("intrinsic "+t+" does not exist!")};t2.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new ts("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new ts('"allowMissing" argument must be a boolean');if(lM(/^%?[^%]*%?$/,t)===null)throw new rs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=pM(t),n=i.length>0?i[0]:"",o=dM("%"+n+"%",e),a=o.name,l=o.value,c=!1,u=o.alias;u&&(n=u[0],sM(i,aM([0,1],u)));for(var d=1,m=!0;d<i.length;d+=1){var y=i[d],g=Td(y,0,1),x=Td(y,-1);if((g==='"'||g==="'"||g==="`"||x==='"'||x==="'"||x==="`")&&g!==x)throw new rs("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(c=!0),n+="."+y,a="%"+n+"%",Sd(_o,a))l=_o[a];else if(l!=null){if(!(y in l)){if(!e)throw new ts("base intrinsic for "+t+" exists, but the property is not available.");return}if(Eo&&d+1>=i.length){var T=Eo(l,y);m=!!T,m&&"get"in T&&!("originalValue"in T.get)?l=T.get:l=l[y]}else m=Sd(l,y),l=l[y];m&&!c&&(_o[a]=l)}}return l}});var Pd=G((XF,r2)=>{"use strict";f();var hM=Mr(),Md=hM("%Object.defineProperty%",!0)||!1;if(Md)try{Md({},"a",{value:1})}catch{Md=!1}r2.exports=Md});var wd=G((zF,i2)=>{"use strict";f();var fM=Mr(),Id=fM("%Object.getOwnPropertyDescriptor%",!0);if(Id)try{Id([],"length")}catch{Id=null}i2.exports=Id});var Ed=G(($F,a2)=>{"use strict";f();var n2=Pd(),mM=Qm(),is=ji(),o2=wd();a2.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new is("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new is("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new is("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new is("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new is("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new is("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!o2&&o2(t,e);if(n2)n2(t,e,{configurable:a===null&&c?c.configurable:!a,enumerable:n===null&&c?c.enumerable:!n,value:i,writable:o===null&&c?c.writable:!o});else if(l||!n&&!o&&!a)t[e]=i;else throw new mM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var _d=G((QF,l2)=>{"use strict";f();var iy=Pd(),s2=function(){return!!iy};s2.hasArrayLengthDefineBug=function(){if(!iy)return null;try{return iy([],"length",{value:1}).length!==1}catch{return!0}};l2.exports=s2});var Ln=G((eB,d2)=>{"use strict";f();var yM=bd(),gM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",vM=Object.prototype.toString,bM=Array.prototype.concat,c2=Ed(),xM=function(r){return typeof r=="function"&&vM.call(r)==="[object Function]"},u2=_d()(),CM=function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!xM(i)||!i())return}u2?c2(r,t,e,!0):c2(r,t,e)},p2=function(r,t){var e=arguments.length>2?arguments[2]:{},i=yM(t);gM&&(i=bM.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;n+=1)CM(r,i[n],t[i[n]],e[i[n]])};p2.supportsDescriptors=!!u2;d2.exports=p2});var g2=G((rB,y2)=>{"use strict";f();var SM=Mr(),h2=Ed(),TM=_d()(),f2=wd(),m2=ji(),MM=SM("%Math.floor%");y2.exports=function(t,e){if(typeof t!="function")throw new m2("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||MM(e)!==e)throw new m2("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&f2){var a=f2(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(TM?h2(t,"length",e,!0,!0):h2(t,"length",e)),t}});var Do=G((nB,Dd)=>{"use strict";f();var ny=Cd(),Od=Mr(),PM=g2(),IM=ji(),x2=Od("%Function.prototype.apply%"),C2=Od("%Function.prototype.call%"),S2=Od("%Reflect.apply%",!0)||ny.call(C2,x2),v2=Pd(),wM=Od("%Math.max%");Dd.exports=function(t){if(typeof t!="function")throw new IM("a function is required");var e=S2(ny,C2,arguments);return PM(e,1+wM(0,t.length-(arguments.length-1)),!0)};var b2=function(){return S2(ny,x2,arguments)};v2?v2(Dd.exports,"apply",{value:b2}):Dd.exports.apply=b2});var qt=G((aB,P2)=>{"use strict";f();var T2=Mr(),M2=Do(),EM=M2(T2("String.prototype.indexOf"));P2.exports=function(t,e){var i=T2(t,!!e);return typeof i=="function"&&EM(t,".prototype.")>-1?M2(i):i}});var oy=G((lB,D2)=>{"use strict";f();var _M=bd(),E2=Hl()(),_2=qt(),I2=Object,DM=_2("Array.prototype.push"),w2=_2("Object.prototype.propertyIsEnumerable"),OM=E2?Object.getOwnPropertySymbols:null;D2.exports=function(t,e){if(t==null)throw new TypeError("target must be an object");var i=I2(t);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=I2(arguments[n]),a=_M(o),l=E2&&(Object.getOwnPropertySymbols||OM);if(l)for(var c=l(o),u=0;u<c.length;++u){var d=c[u];w2(o,d)&&DM(a,d)}for(var m=0;m<a.length;++m){var y=a[m];if(w2(o,y)){var g=o[y];i[y]=g}}}return i}});var sy=G((uB,O2)=>{"use strict";f();var ay=oy(),LM=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var n=Object.assign({},e),o="";for(var a in n)o+=a;return r!==o},AM=function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1};O2.exports=function(){return!Object.assign||LM()||AM()?ay:Object.assign}});var A2=G((dB,L2)=>{"use strict";f();var kM=Ln(),FM=sy();L2.exports=function(){var t=FM();return kM(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var R2=G((fB,B2)=>{"use strict";f();var BM=Ln(),RM=Do(),NM=oy(),k2=sy(),GM=A2(),VM=RM.apply(k2()),F2=function(t,e){return VM(Object,arguments)};BM(F2,{getPolyfill:k2,implementation:NM,shim:GM});B2.exports=F2});var G2=G((yB,N2)=>{"use strict";f();var Zl=function(){return typeof(function(){}).name=="string"},Wl=Object.getOwnPropertyDescriptor;if(Wl)try{Wl([],"length")}catch{Wl=null}Zl.functionsHaveConfigurableNames=function(){if(!Zl()||!Wl)return!1;var t=Wl(function(){},"name");return!!t&&!!t.configurable};var jM=Function.prototype.bind;Zl.boundFunctionsHaveNames=function(){return Zl()&&typeof jM=="function"&&(function(){}).bind().name!==""};N2.exports=Zl});var H2=G((vB,j2)=>{"use strict";f();var V2=Ed(),HM=_d()(),UM=G2().functionsHaveConfigurableNames(),WM=ji();j2.exports=function(t,e){if(typeof t!="function")throw new WM("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||UM)&&(HM?V2(t,"name",e,!0,!0):V2(t,"name",e)),t}});var ly=G((xB,U2)=>{"use strict";f();var ZM=H2(),XM=ji(),YM=Object;U2.exports=ZM(function(){if(this==null||this!==YM(this))throw new XM("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 cy=G((SB,W2)=>{"use strict";f();var zM=ly(),qM=Ln().supportsDescriptors,$M=Object.getOwnPropertyDescriptor;W2.exports=function(){if(qM&&/a/mig.flags==="gim"){var t=$M(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return zM}});var Y2=G((MB,X2)=>{"use strict";f();var JM=Ln().supportsDescriptors,QM=cy(),KM=Object.getOwnPropertyDescriptor,e8=Object.defineProperty,t8=TypeError,Z2=Object.getPrototypeOf,r8=/a/;X2.exports=function(){if(!JM||!Z2)throw new t8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=QM(),e=Z2(r8),i=KM(e,"flags");return(!i||i.get!==t)&&e8(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var J2=G((IB,$2)=>{"use strict";f();var i8=Ln(),n8=Do(),o8=ly(),z2=cy(),a8=Y2(),q2=n8(z2());i8(q2,{getPolyfill:z2,implementation:o8,shim:a8});$2.exports=q2});var An=G((EB,Q2)=>{"use strict";f();var s8=Hl();Q2.exports=function(){return s8()&&!!Symbol.toStringTag}});var py=G((DB,e3)=>{"use strict";f();var l8=An()(),c8=qt(),uy=c8("Object.prototype.toString"),Ld=function(t){return l8&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:uy(t)==="[object Arguments]"},K2=function(t){return Ld(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&uy(t)!=="[object Array]"&&uy(t.callee)==="[object Function]"},u8=function(){return Ld(arguments)}();Ld.isLegacyArguments=K2;e3.exports=u8?Ld:K2});var t3=G(()=>{f()});var C3=G((FB,x3)=>{f();var Cy=typeof Map=="function"&&Map.prototype,dy=Object.getOwnPropertyDescriptor&&Cy?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,kd=Cy&&dy&&typeof dy.get=="function"?dy.get:null,r3=Cy&&Map.prototype.forEach,Sy=typeof Set=="function"&&Set.prototype,hy=Object.getOwnPropertyDescriptor&&Sy?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Fd=Sy&&hy&&typeof hy.get=="function"?hy.get:null,i3=Sy&&Set.prototype.forEach,p8=typeof WeakMap=="function"&&WeakMap.prototype,Yl=p8?WeakMap.prototype.has:null,d8=typeof WeakSet=="function"&&WeakSet.prototype,zl=d8?WeakSet.prototype.has:null,h8=typeof WeakRef=="function"&&WeakRef.prototype,n3=h8?WeakRef.prototype.deref:null,f8=Boolean.prototype.valueOf,m8=Object.prototype.toString,y8=Function.prototype.toString,g8=String.prototype.match,Ty=String.prototype.slice,Fn=String.prototype.replace,v8=String.prototype.toUpperCase,o3=String.prototype.toLowerCase,f3=RegExp.prototype.test,a3=Array.prototype.concat,ei=Array.prototype.join,b8=Array.prototype.slice,s3=Math.floor,yy=typeof BigInt=="function"?BigInt.prototype.valueOf:null,fy=Object.getOwnPropertySymbols,gy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ns=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ct=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ns||!0)?Symbol.toStringTag:null,m3=Object.prototype.propertyIsEnumerable,l3=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function c3(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||f3.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-s3(-r):s3(r);if(i!==r){var n=String(i),o=Ty.call(t,n.length+1);return Fn.call(n,e,"$&_")+"."+Fn.call(Fn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Fn.call(t,e,"$&_")}var vy=t3(),u3=vy.custom,p3=g3(u3)?u3:null;x3.exports=function r(t,e,i,n){var o=e||{};if(kn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(kn(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=kn(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(kn(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(kn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return b3(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?c3(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return l?c3(t,u):u}var d=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof t=="object")return by(t)?"[Array]":"[Object]";var m=R8(o,i);if(typeof n>"u")n=[];else if(v3(n,t)>=0)return"[Circular]";function y(me,Pe,De){if(Pe&&(n=b8.call(n),n.push(Pe)),De){var ze={depth:o.depth};return kn(o,"quoteStyle")&&(ze.quoteStyle=o.quoteStyle),r(me,ze,i+1,n)}return r(me,o,i+1,n)}if(typeof t=="function"&&!d3(t)){var g=E8(t),x=Ad(t,y);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(x.length>0?" { "+ei.call(x,", ")+" }":"")}if(g3(t)){var T=ns?Fn.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):gy.call(t);return typeof t=="object"&&!ns?Xl(T):T}if(k8(t)){for(var v="<"+o3.call(String(t.nodeName)),b=t.attributes||[],P=0;P<b.length;P++)v+=" "+b[P].name+"="+y3(x8(b[P].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+o3.call(String(t.nodeName))+">",v}if(by(t)){if(t.length===0)return"[]";var I=Ad(t,y);return m&&!B8(I)?"["+xy(I,m)+"]":"[ "+ei.call(I,", ")+" ]"}if(S8(t)){var w=Ad(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!m3.call(t,"cause")?"{ ["+String(t)+"] "+ei.call(a3.call("[cause]: "+y(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ei.call(w,", ")+" }"}if(typeof t=="object"&&a){if(p3&&typeof t[p3]=="function"&&vy)return vy(t,{depth:d-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(_8(t)){var _=[];return r3&&r3.call(t,function(me,Pe){_.push(y(Pe,t,!0)+" => "+y(me,t))}),h3("Map",kd.call(t),_,m)}if(L8(t)){var D=[];return i3&&i3.call(t,function(me){D.push(y(me,t))}),h3("Set",Fd.call(t),D,m)}if(D8(t))return my("WeakMap");if(A8(t))return my("WeakSet");if(O8(t))return my("WeakRef");if(M8(t))return Xl(y(Number(t)));if(I8(t))return Xl(y(yy.call(t)));if(P8(t))return Xl(f8.call(t));if(T8(t))return Xl(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!C8(t)&&!d3(t)){var k=Ad(t,y),N=l3?l3(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",j=!N&&ct&&Object(t)===t&&ct in t?Ty.call(Bn(t),8,-1):R?"Object":"",Z=N||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",se=Z+(j||R?"["+ei.call(a3.call([],j||[],R||[]),": ")+"] ":"");return k.length===0?se+"{}":m?se+"{"+xy(k,m)+"}":se+"{ "+ei.call(k,", ")+" }"}return String(t)};function y3(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function x8(r){return Fn.call(String(r),/"/g,""")}function by(r){return Bn(r)==="[object Array]"&&(!ct||!(typeof r=="object"&&ct in r))}function C8(r){return Bn(r)==="[object Date]"&&(!ct||!(typeof r=="object"&&ct in r))}function d3(r){return Bn(r)==="[object RegExp]"&&(!ct||!(typeof r=="object"&&ct in r))}function S8(r){return Bn(r)==="[object Error]"&&(!ct||!(typeof r=="object"&&ct in r))}function T8(r){return Bn(r)==="[object String]"&&(!ct||!(typeof r=="object"&&ct in r))}function M8(r){return Bn(r)==="[object Number]"&&(!ct||!(typeof r=="object"&&ct in r))}function P8(r){return Bn(r)==="[object Boolean]"&&(!ct||!(typeof r=="object"&&ct in r))}function g3(r){if(ns)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gy)return!1;try{return gy.call(r),!0}catch{}return!1}function I8(r){if(!r||typeof r!="object"||!yy)return!1;try{return yy.call(r),!0}catch{}return!1}var w8=Object.prototype.hasOwnProperty||function(r){return r in this};function kn(r,t){return w8.call(r,t)}function Bn(r){return m8.call(r)}function E8(r){if(r.name)return r.name;var t=g8.call(y8.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function v3(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}function _8(r){if(!kd||!r||typeof r!="object")return!1;try{kd.call(r);try{Fd.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function D8(r){if(!Yl||!r||typeof r!="object")return!1;try{Yl.call(r,Yl);try{zl.call(r,zl)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function O8(r){if(!n3||!r||typeof r!="object")return!1;try{return n3.call(r),!0}catch{}return!1}function L8(r){if(!Fd||!r||typeof r!="object")return!1;try{Fd.call(r);try{kd.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function A8(r){if(!zl||!r||typeof r!="object")return!1;try{zl.call(r,zl);try{Yl.call(r,Yl)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function k8(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function b3(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return b3(Ty.call(r,0,t.maxStringLength),t)+i}var n=Fn.call(Fn.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,F8);return y3(n,"single",t)}function F8(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+v8.call(t.toString(16))}function Xl(r){return"Object("+r+")"}function my(r){return r+" { ? }"}function h3(r,t,e,i){var n=i?xy(e,i):ei.call(e,", ");return r+" ("+t+") {"+n+"}"}function B8(r){for(var t=0;t<r.length;t++)if(v3(r[t],"\n")>=0)return!1;return!0}function R8(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=ei.call(Array(r.indent+1)," ");else return null;return{base:e,prev:ei.call(Array(t+1),e)}}function xy(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+ei.call(r,","+e)+"\n"+t.prev}function Ad(r,t){var e=by(r),i=[];if(e){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=kn(r,n)?t(r[n],r):""}var o=typeof fy=="function"?fy(r):[],a;if(ns){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var c in r)kn(r,c)&&(e&&String(Number(c))===c&&c<r.length||ns&&a["$"+c]instanceof Symbol||(f3.call(/[^\w$]/,c)?i.push(t(c,r)+": "+t(r[c],r)):i.push(c+": "+t(r[c],r))));if(typeof fy=="function")for(var u=0;u<o.length;u++)m3.call(r,o[u])&&i.push("["+t(o[u])+"]: "+t(r[o[u]],r));return i}});var Py=G((RB,T3)=>{"use strict";f();var S3=Mr(),os=qt(),N8=C3(),G8=ji(),Bd=S3("%WeakMap%",!0),Rd=S3("%Map%",!0),V8=os("WeakMap.prototype.get",!0),j8=os("WeakMap.prototype.set",!0),H8=os("WeakMap.prototype.has",!0),U8=os("Map.prototype.get",!0),W8=os("Map.prototype.set",!0),Z8=os("Map.prototype.has",!0),My=function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},X8=function(r,t){var e=My(r,t);return e&&e.value},Y8=function(r,t,e){var i=My(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},z8=function(r,t){return!!My(r,t)};T3.exports=function(){var t,e,i,n={assert:function(o){if(!n.has(o))throw new G8("Side channel does not contain "+N8(o))},get:function(o){if(Bd&&o&&(typeof o=="object"||typeof o=="function")){if(t)return V8(t,o)}else if(Rd){if(e)return U8(e,o)}else if(i)return X8(i,o)},has:function(o){if(Bd&&o&&(typeof o=="object"||typeof o=="function")){if(t)return H8(t,o)}else if(Rd){if(e)return Z8(e,o)}else if(i)return z8(i,o);return!1},set:function(o,a){Bd&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new Bd),j8(t,o,a)):Rd?(e||(e=new Rd),W8(e,o,a)):(i||(i={key:{},next:null}),Y8(i,o,a))}};return n}});var P3=G((GB,M3)=>{"use strict";f();var q8=ey(),ql=Py()(),Hi=ji(),Iy={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Hi("`O` is not an object");if(typeof t!="string")throw new Hi("`slot` must be a string");if(ql.assert(r),!Iy.has(r,t))throw new Hi("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Hi("`O` is not an object");if(typeof t!="string")throw new Hi("`slot` must be a string");var e=ql.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Hi("`O` is not an object");if(typeof t!="string")throw new Hi("`slot` must be a string");var e=ql.get(r);return!!e&&q8(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Hi("`O` is not an object");if(typeof t!="string")throw new Hi("`slot` must be a string");var i=ql.get(r);i||(i={},ql.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(Iy);M3.exports=Iy});var E3=G((jB,w3)=>{"use strict";f();var $l=P3(),$8=SyntaxError,I3=typeof StopIteration=="object"?StopIteration:null;w3.exports=function(t){if(!I3)throw new $8("this environment lacks StopIteration");$l.set(t,"[[Done]]",!1);var e={next:function(){var n=$l.get(this,"[[Iterator]]"),o=$l.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if($l.set(n,"[[Done]]",!0),a!==I3)throw a;return{done:!0,value:void 0}}}};return $l.set(e,"[[Iterator]]",t),e}});var wy=G((UB,_3)=>{f();var J8={}.toString;_3.exports=Array.isArray||function(r){return J8.call(r)=="[object Array]"}});var Ey=G((ZB,D3)=>{"use strict";f();var Q8=String.prototype.valueOf,K8=function(t){try{return Q8.call(t),!0}catch{return!1}},e9=Object.prototype.toString,t9="[object String]",r9=An()();D3.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:r9?K8(t):e9.call(t)===t9}});var Dy=G((YB,A3)=>{"use strict";f();var _y=typeof Map=="function"&&Map.prototype?Map:null,i9=typeof Set=="function"&&Set.prototype?Set:null,Nd;_y||(Nd=function(t){return!1});var L3=_y?Map.prototype.has:null,O3=i9?Set.prototype.has:null;!Nd&&!L3&&(Nd=function(t){return!1});A3.exports=Nd||function(t){if(!t||typeof t!="object")return!1;try{if(L3.call(t),O3)try{O3.call(t)}catch{return!0}return t instanceof _y}catch{}return!1}});var Ly=G((qB,B3)=>{"use strict";f();var n9=typeof Map=="function"&&Map.prototype?Map:null,Oy=typeof Set=="function"&&Set.prototype?Set:null,Gd;Oy||(Gd=function(t){return!1});var k3=n9?Map.prototype.has:null,F3=Oy?Set.prototype.has:null;!Gd&&!F3&&(Gd=function(t){return!1});B3.exports=Gd||function(t){if(!t||typeof t!="object")return!1;try{if(F3.call(t),k3)try{k3.call(t)}catch{return!0}return t instanceof Oy}catch{}return!1}});var z3=G((JB,Hd)=>{"use strict";f();var R3=py(),N3=E3();xd()()||Hl()()?(Vd=Symbol.iterator,Hd.exports=function(t){if(t!=null&&typeof t[Vd]<"u")return t[Vd]();if(R3(t))return Array.prototype[Vd].call(t)}):(G3=wy(),V3=Ey(),Ay=Mr(),j3=Ay("%Map%",!0),H3=Ay("%Set%",!0),pr=qt(),ky=pr("Array.prototype.push"),Fy=pr("String.prototype.charCodeAt"),U3=pr("String.prototype.slice"),W3=function(t,e){var i=t.length;if(e+1>=i)return e+1;var n=Fy(t,e);if(n<55296||n>56319)return e+1;var o=Fy(t,e+1);return o<56320||o>57343?e+1:e+2},jd=function(t){var e=0;return{next:function(){var n=e>=t.length,o;return n||(o=t[e],e+=1),{done:n,value:o}}}},By=function(t,e){if(G3(t)||R3(t))return jd(t);if(V3(t)){var i=0;return{next:function(){var o=W3(t,i),a=U3(t,i,o);return i=o,{done:o>t.length,value:a}}}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!j3&&!H3?Hd.exports=function(t){if(t!=null)return By(t,!0)}:(Z3=Dy(),X3=Ly(),Ry=pr("Map.prototype.forEach",!0),Ny=pr("Set.prototype.forEach",!0),(typeof S>"u"||!S.versions||!S.versions.node)&&(Gy=pr("Map.prototype.iterator",!0),Vy=pr("Set.prototype.iterator",!0)),jy=pr("Map.prototype.@@iterator",!0)||pr("Map.prototype._es6-shim iterator_",!0),Hy=pr("Set.prototype.@@iterator",!0)||pr("Set.prototype._es6-shim iterator_",!0),Y3=function(t){if(Z3(t)){if(Gy)return N3(Gy(t));if(jy)return jy(t);if(Ry){var e=[];return Ry(t,function(n,o){ky(e,[o,n])}),jd(e)}}if(X3(t)){if(Vy)return N3(Vy(t));if(Hy)return Hy(t);if(Ny){var i=[];return Ny(t,function(n){ky(i,n)}),jd(i)}}},Hd.exports=function(t){return Y3(t)||By(t)}));var Vd,G3,V3,Ay,j3,H3,pr,ky,Fy,U3,W3,jd,By,Z3,X3,Ry,Ny,Gy,Vy,jy,Hy,Y3});var Uy=G((KB,$3)=>{"use strict";f();var q3=function(r){return r!==r};$3.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||q3(t)&&q3(e))}});var Wy=G((tR,J3)=>{"use strict";f();var o9=Uy();J3.exports=function(){return typeof Object.is=="function"?Object.is:o9}});var K3=G((iR,Q3)=>{"use strict";f();var a9=Wy(),s9=Ln();Q3.exports=function(){var t=a9();return s9(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var ix=G((oR,rx)=>{"use strict";f();var l9=Ln(),c9=Do(),u9=Uy(),ex=Wy(),p9=K3(),tx=c9(ex(),Object);l9(tx,{getPolyfill:ex,implementation:u9,shim:p9});rx.exports=tx});var Xy=G((sR,sx)=>{"use strict";f();var d9=Do(),ax=qt(),h9=Mr(),Zy=h9("%ArrayBuffer%",!0),Ud=ax("ArrayBuffer.prototype.byteLength",!0),f9=ax("Object.prototype.toString"),nx=!!Zy&&!Ud&&new Zy(0).slice,ox=!!nx&&d9(nx);sx.exports=Ud||ox?function(t){if(!t||typeof t!="object")return!1;try{return Ud?Ud(t):ox(t,0),!0}catch{return!1}}:Zy?function(t){return f9(t)==="[object ArrayBuffer]"}:function(t){return!1}});var cx=G((cR,lx)=>{"use strict";f();var m9=Date.prototype.getDay,y9=function(t){try{return m9.call(t),!0}catch{return!1}},g9=Object.prototype.toString,v9="[object Date]",b9=An()();lx.exports=function(t){return typeof t!="object"||t===null?!1:b9?y9(t):g9.call(t)===v9}});var fx=G((pR,hx)=>{"use strict";f();var Yy=qt(),ux=An()(),px,dx,zy,qy;ux&&(px=Yy("Object.prototype.hasOwnProperty"),dx=Yy("RegExp.prototype.exec"),zy={},Wd=function(){throw zy},qy={toString:Wd,valueOf:Wd},typeof Symbol.toPrimitive=="symbol"&&(qy[Symbol.toPrimitive]=Wd));var Wd,x9=Yy("Object.prototype.toString"),C9=Object.getOwnPropertyDescriptor,S9="[object RegExp]";hx.exports=ux?function(t){if(!t||typeof t!="object")return!1;var e=C9(t,"lastIndex"),i=e&&px(e,"value");if(!i)return!1;try{dx(t,qy)}catch(n){return n===zy}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:x9(t)===S9}});var gx=G((hR,yx)=>{"use strict";f();var T9=qt(),mx=T9("SharedArrayBuffer.prototype.byteLength",!0);yx.exports=mx?function(t){if(!t||typeof t!="object")return!1;try{return mx(t),!0}catch{return!1}}:function(t){return!1}});var bx=G((mR,vx)=>{"use strict";f();var M9=Number.prototype.toString,P9=function(t){try{return M9.call(t),!0}catch{return!1}},I9=Object.prototype.toString,w9="[object Number]",E9=An()();vx.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:E9?P9(t):I9.call(t)===w9}});var Sx=G((gR,Cx)=>{"use strict";f();var xx=qt(),_9=xx("Boolean.prototype.toString"),D9=xx("Object.prototype.toString"),O9=function(t){try{return _9(t),!0}catch{return!1}},L9="[object Boolean]",A9=An()();Cx.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:A9&&Symbol.toStringTag in t?O9(t):D9(t)===L9}});var Ix=G((bR,$y)=>{"use strict";f();var k9=Object.prototype.toString,F9=xd()();F9?(Tx=Symbol.prototype.toString,Mx=/^Symbol\(.*\)$/,Px=function(t){return typeof t.valueOf()!="symbol"?!1:Mx.test(Tx.call(t))},$y.exports=function(t){if(typeof t=="symbol")return!0;if(k9.call(t)!=="[object Symbol]")return!1;try{return Px(t)}catch{return!1}}):$y.exports=function(t){return!1};var Tx,Mx,Px});var _x=G((CR,Ex)=>{"use strict";f();var wx=typeof BigInt<"u"&&BigInt;Ex.exports=function(){return typeof wx=="function"&&typeof BigInt=="function"&&typeof wx(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var Lx=G((TR,Jy)=>{"use strict";f();var B9=_x()();B9?(Dx=BigInt.prototype.valueOf,Ox=function(t){try{return Dx.call(t),!0}catch{}return!1},Jy.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:Ox(t)}):Jy.exports=function(t){return!1};var Dx,Ox});var kx=G((PR,Ax)=>{"use strict";f();var R9=Ey(),N9=bx(),G9=Sx(),V9=Ix(),j9=Lx();Ax.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(R9(t))return"String";if(N9(t))return"Number";if(G9(t))return"Boolean";if(V9(t))return"Symbol";if(j9(t))return"BigInt"}});var Rx=G((wR,Bx)=>{"use strict";f();var Zd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Fx=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Xd;Zd||(Xd=function(t){return!1});var Ky=Zd?Zd.prototype.has:null,Qy=Fx?Fx.prototype.has:null;!Xd&&!Ky&&(Xd=function(t){return!1});Bx.exports=Xd||function(t){if(!t||typeof t!="object")return!1;try{if(Ky.call(t,Ky),Qy)try{Qy.call(t,Qy)}catch{return!0}return t instanceof Zd}catch{}return!1}});var Gx=G((_R,tg)=>{"use strict";f();var H9=Mr(),Nx=qt(),U9=H9("%WeakSet%",!0),eg=Nx("WeakSet.prototype.has",!0);eg?(Yd=Nx("WeakMap.prototype.has",!0),tg.exports=function(t){if(!t||typeof t!="object")return!1;try{if(eg(t,eg),Yd)try{Yd(t,Yd)}catch{return!0}return t instanceof U9}catch{}return!1}):tg.exports=function(t){return!1};var Yd});var jx=G((OR,Vx)=>{"use strict";f();var W9=Dy(),Z9=Ly(),X9=Rx(),Y9=Gx();Vx.exports=function(t){if(t&&typeof t=="object"){if(W9(t))return"Map";if(Z9(t))return"Set";if(X9(t))return"WeakMap";if(Y9(t))return"WeakSet"}return!1}});var Zx=G((AR,Wx)=>{"use strict";f();var Ux=Function.prototype.toString,as=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ig,zd;if(typeof as=="function"&&typeof Object.defineProperty=="function")try{ig=Object.defineProperty({},"length",{get:function(){throw zd}}),zd={},as(function(){throw 42},null,ig)}catch(r){r!==zd&&(as=null)}else as=null;var z9=/^\s*class\b/,ng=function(t){try{var e=Ux.call(t);return z9.test(e)}catch{return!1}},rg=function(t){try{return ng(t)?!1:(Ux.call(t),!0)}catch{return!1}},qd=Object.prototype.toString,q9="[object Object]",$9="[object Function]",J9="[object GeneratorFunction]",Q9="[object HTMLAllCollection]",K9="[object HTML document.all class]",eP="[object HTMLCollection]",tP=typeof Symbol=="function"&&!!Symbol.toStringTag,rP=!(0 in[,]),og=function(){return!1};typeof document=="object"&&(Hx=document.all,qd.call(Hx)===qd.call(document.all)&&(og=function(t){if((rP||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=qd.call(t);return(e===Q9||e===K9||e===eP||e===q9)&&t("")==null}catch{}return!1}));var Hx;Wx.exports=as?function(t){if(og(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{as(t,null,ig)}catch(e){if(e!==zd)return!1}return!ng(t)&&rg(t)}:function(t){if(og(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(tP)return rg(t);if(ng(t))return!1;var e=qd.call(t);return e!==$9&&e!==J9&&!/^\[object HTML/.test(e)?!1:rg(t)}});var zx=G((FR,Yx)=>{"use strict";f();var iP=Zx(),nP=Object.prototype.toString,Xx=Object.prototype.hasOwnProperty,oP=function(t,e,i){for(var n=0,o=t.length;n<o;n++)Xx.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},aP=function(t,e,i){for(var n=0,o=t.length;n<o;n++)i==null?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)},sP=function(t,e,i){for(var n in t)Xx.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},lP=function(t,e,i){if(!iP(e))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),nP.call(t)==="[object Array]"?oP(t,e,n):typeof t=="string"?aP(t,e,n):sP(t,e,n)};Yx.exports=lP});var $x=G((RR,qx)=>{"use strict";f();qx.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Qx=G((GR,Jx)=>{"use strict";f();var ag=$x(),cP=typeof globalThis>"u"?global:globalThis;Jx.exports=function(){for(var t=[],e=0;e<ag.length;e++)typeof cP[ag[e]]=="function"&&(t[t.length]=ag[e]);return t}});var iC=G((jR,rC)=>{"use strict";f();var Jd=zx(),uP=Qx(),Kx=Do(),cg=qt(),$d=wd(),pP=cg("Object.prototype.toString"),tC=An()(),eC=typeof globalThis>"u"?global:globalThis,lg=uP(),ug=cg("String.prototype.slice"),sg=Object.getPrototypeOf,dP=cg("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},Qd={__proto__:null};tC&&$d&&sg?Jd(lg,function(r){var t=new eC[r];if(Symbol.toStringTag in t){var e=sg(t),i=$d(e,Symbol.toStringTag);if(!i){var n=sg(e);i=$d(n,Symbol.toStringTag)}Qd["$"+r]=Kx(i.get)}}):Jd(lg,function(r){var t=new eC[r],e=t.slice||t.set;e&&(Qd["$"+r]=Kx(e))});var hP=function(t){var e=!1;return Jd(Qd,function(i,n){if(!e)try{"$"+i(t)===n&&(e=ug(n,1))}catch{}}),e},fP=function(t){var e=!1;return Jd(Qd,function(i,n){if(!e)try{i(t),e=ug(n,1)}catch{}}),e};rC.exports=function(t){if(!t||typeof t!="object")return!1;if(!tC){var e=ug(pP(t),8,-1);return dP(lg,e)>-1?e:e!=="Object"?!1:fP(t)}return $d?hP(t):null}});var aC=G((UR,oC)=>{"use strict";f();var mP=qt(),nC=mP("ArrayBuffer.prototype.byteLength",!0),yP=Xy();oC.exports=function(t){return yP(t)?nC?nC(t):t.byteLength:NaN}});var OC=G((ZR,DC)=>{"use strict";f();var wC=R2(),ti=qt(),sC=J2(),gP=Mr(),ss=z3(),vP=Py(),lC=ix(),cC=py(),uC=wy(),pC=Xy(),dC=cx(),hC=fx(),fC=gx(),mC=bd(),yC=kx(),gC=jx(),vC=iC(),bC=aC(),xC=ti("SharedArrayBuffer.prototype.byteLength",!0),CC=ti("Date.prototype.getTime"),pg=Object.getPrototypeOf,SC=ti("Object.prototype.toString"),eh=gP("%Set%",!0),dg=ti("Map.prototype.has",!0),th=ti("Map.prototype.get",!0),TC=ti("Map.prototype.size",!0),rh=ti("Set.prototype.add",!0),EC=ti("Set.prototype.delete",!0),ih=ti("Set.prototype.has",!0),Kd=ti("Set.prototype.size",!0);function MC(r,t,e,i){for(var n=ss(r),o;(o=n.next())&&!o.done;)if(Pr(t,o.value,e,i))return EC(r,o.value),!0;return!1}function _C(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}function bP(r,t,e,i,n,o){var a=_C(e);if(a!=null)return a;var l=th(t,a),c=wC({},n,{strict:!1});return typeof l>"u"&&!dg(t,a)||!Pr(i,l,c,o)?!1:!dg(r,a)&&Pr(i,l,c,o)}function xP(r,t,e){var i=_C(e);return i!=null?i:ih(t,i)&&!ih(r,i)}function PC(r,t,e,i,n,o){for(var a=ss(r),l,c;(l=a.next())&&!l.done;)if(c=l.value,Pr(e,c,n,o)&&Pr(i,th(t,c),n,o))return EC(r,c),!0;return!1}function Pr(r,t,e,i){var n=e||{};if(n.strict?lC(r,t):r===t)return!0;var o=yC(r),a=yC(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return n.strict?lC(r,t):r==t;var l=i.has(r),c=i.has(t),u;if(l&&c){if(i.get(r)===i.get(t))return!0}else u={};return l||i.set(r,u),c||i.set(t,u),TP(r,t,n,i)}function IC(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function CP(r,t,e,i){if(Kd(r)!==Kd(t))return!1;for(var n=ss(r),o=ss(t),a,l,c;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new eh),rh(c,a.value);else if(!ih(t,a.value)){if(e.strict||!xP(r,t,a.value))return!1;c||(c=new eh),rh(c,a.value)}if(c){for(;(l=o.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!MC(c,l.value,e.strict,i))return!1}else if(!e.strict&&!ih(r,l.value)&&!MC(c,l.value,e.strict,i))return!1;return Kd(c)===0}return!0}function SP(r,t,e,i){if(TC(r)!==TC(t))return!1;for(var n=ss(r),o=ss(t),a,l,c,u,d,m;(a=n.next())&&!a.done;)if(u=a.value[0],d=a.value[1],u&&typeof u=="object")c||(c=new eh),rh(c,u);else if(m=th(t,u),typeof m>"u"&&!dg(t,u)||!Pr(d,m,e,i)){if(e.strict||!bP(r,t,u,d,e,i))return!1;c||(c=new eh),rh(c,u)}if(c){for(;(l=o.next())&&!l.done;)if(u=l.value[0],m=l.value[1],u&&typeof u=="object"){if(!PC(c,r,u,m,e,i))return!1}else if(!e.strict&&(!r.has(u)||!Pr(th(r,u),m,e,i))&&!PC(c,r,u,m,wC({},e,{strict:!1}),i))return!1;return Kd(c)===0}return!0}function TP(r,t,e,i){var n,o;if(typeof r!=typeof t||r==null||t==null||SC(r)!==SC(t)||cC(r)!==cC(t))return!1;var a=uC(r),l=uC(t);if(a!==l)return!1;var c=r instanceof Error,u=t instanceof Error;if(c!==u||(c||u)&&(r.name!==t.name||r.message!==t.message))return!1;var d=hC(r),m=hC(t);if(d!==m||(d||m)&&(r.source!==t.source||sC(r)!==sC(t)))return!1;var y=dC(r),g=dC(t);if(y!==g||(y||g)&&CC(r)!==CC(t)||e.strict&&pg&&pg(r)!==pg(t))return!1;var x=vC(r),T=vC(t);if(x!==T)return!1;if(x||T){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var v=IC(r),b=IC(t);if(v!==b)return!1;if(v||b){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var P=pC(r),I=pC(t);if(P!==I)return!1;if(P||I)return bC(r)!==bC(t)?!1:typeof Uint8Array=="function"&&Pr(new Uint8Array(r),new Uint8Array(t),e,i);var w=fC(r),_=fC(t);if(w!==_)return!1;if(w||_)return xC(r)!==xC(t)?!1:typeof Uint8Array=="function"&&Pr(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var D=mC(r),k=mC(t);if(D.length!==k.length)return!1;for(D.sort(),k.sort(),n=D.length-1;n>=0;n--)if(D[n]!=k[n])return!1;for(n=D.length-1;n>=0;n--)if(o=D[n],!Pr(r[o],t[o],e,i))return!1;var N=gC(r),R=gC(t);return N!==R?!1:N==="Set"||R==="Set"?CP(r,t,e,i):N==="Map"?SP(r,t,e,i):!0}DC.exports=function(t,e,i){return Pr(t,e,i,vP())}});var YC=G(ye=>{"use strict";f();Object.defineProperty(ye,"__esModule",{value:!0});function MP(r){return r&&r.__esModule?r:{default:r}}var PP=Object.defineProperty,be=(r,t)=>PP(r,"name",{value:t,configurable:!0}),IP=OC(),wP=MP(IP),LC=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,n;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(i=t==null?void 0:t.direction)!=null?i:!1,this.compareProperties=(n=t==null?void 0:t.compareProperties)!=null?n:!0}compare(t,e){if(t.type!==e.type||!Jl(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){let i=hg(t),n=hg(e);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,n)=>Math.abs(i-e[n])<this.precision)}compareLine(t,e,i=0,n=!1){if(!Jl(t,e))return!1;let o=t,a=e;if(n&&!this.compareCoord(o[0],a[0])){let c=this.fixStartIndex(a,o);if(c)a=c;else return!1}let l=this.compareCoord(o[i],a[i]);return this.direction||l?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(t,e){let i,n=-1;for(let o=0;o<t.length;o++)if(this.compareCoord(t[o],e[0])){n=o;break}return n>=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i}comparePath(t,e){return t.every((i,n)=>this.compareCoord(i,e[n]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(t,e){return Jl(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,n)=>this.compare(i,e.geometries[n]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?wP.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Jl(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,n)=>this.compare(i,e.features[n]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}};be(LC,"GeojsonEquality");var EP=LC;function Jl(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}be(Jl,"sameLength");function hg(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}be(hg,"explode");var Ft=63710088e-1,mg={centimeters:Ft*100,centimetres:Ft*100,degrees:360/(2*Math.PI),feet:Ft*3.28084,inches:Ft*39.37,kilometers:Ft/1e3,kilometres:Ft/1e3,meters:Ft,metres:Ft,miles:Ft/1609.344,millimeters:Ft*1e3,millimetres:Ft*1e3,nauticalmiles:Ft/1852,radians:1,yards:Ft*1.0936},fg={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ui(r,t,e={}){let i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}be(Ui,"feature");function AC(r,t,e={}){switch(r){case"Point":return nh(t).geometry;case"LineString":return ah(t).geometry;case"Polygon":return oh(t).geometry;case"MultiPoint":return gg(t).geometry;case"MultiLineString":return yg(t).geometry;case"MultiPolygon":return vg(t).geometry;default:throw new Error(r+" is invalid")}}be(AC,"geometry");function nh(r,t,e={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ql(r[0])||!Ql(r[1]))throw new Error("coordinates must contain numbers");return Ui({type:"Point",coordinates:r},t,e)}be(nh,"point");function kC(r,t,e={}){return Kl(r.map(i=>nh(i,t)),e)}be(kC,"points");function oh(r,t,e={}){for(let n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<n[n.length-1].length;o++)if(n[n.length-1][o]!==n[0][o])throw new Error("First and last Position are not equivalent.")}return Ui({type:"Polygon",coordinates:r},t,e)}be(oh,"polygon");function FC(r,t,e={}){return Kl(r.map(i=>oh(i,t)),e)}be(FC,"polygons");function ah(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Ui({type:"LineString",coordinates:r},t,e)}be(ah,"lineString");function BC(r,t,e={}){return Kl(r.map(i=>ah(i,t)),e)}be(BC,"lineStrings");function Kl(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}be(Kl,"featureCollection");function yg(r,t,e={}){return Ui({type:"MultiLineString",coordinates:r},t,e)}be(yg,"multiLineString");function gg(r,t,e={}){return Ui({type:"MultiPoint",coordinates:r},t,e)}be(gg,"multiPoint");function vg(r,t,e={}){return Ui({type:"MultiPolygon",coordinates:r},t,e)}be(vg,"multiPolygon");function RC(r,t,e={}){return Ui({type:"GeometryCollection",geometries:r},t,e)}be(RC,"geometryCollection");function NC(r,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let e=Math.pow(10,t||0);return Math.round(r*e)/e}be(NC,"round");function bg(r,t="kilometers"){let e=mg[t];if(!e)throw new Error(t+" units is invalid");return r*e}be(bg,"radiansToLength");function sh(r,t="kilometers"){let e=mg[t];if(!e)throw new Error(t+" units is invalid");return r/e}be(sh,"lengthToRadians");function GC(r,t){return xg(sh(r,t))}be(GC,"lengthToDegrees");function VC(r){let t=r%360;return t<0&&(t+=360),t}be(VC,"bearingToAzimuth");function xg(r){return r%(2*Math.PI)*180/Math.PI}be(xg,"radiansToDegrees");function jC(r){return r%360*Math.PI/180}be(jC,"degreesToRadians");function HC(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return bg(sh(r,t),e)}be(HC,"convertLength");function UC(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=fg[t];if(!i)throw new Error("invalid original units");let n=fg[e];if(!n)throw new Error("invalid final units");return r/i*n}be(UC,"convertArea");function Ql(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}be(Ql,"isNumber");function WC(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}be(WC,"isObject");function ZC(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(t=>{if(!Ql(t))throw new Error("bbox must only contain numbers")})}be(ZC,"validateBBox");function XC(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}be(XC,"validateId");ye.GeojsonEquality=EP;ye.areaFactors=fg;ye.bearingToAzimuth=VC;ye.convertArea=UC;ye.convertLength=HC;ye.degreesToRadians=jC;ye.earthRadius=Ft;ye.factors=mg;ye.feature=Ui;ye.featureCollection=Kl;ye.geometry=AC;ye.geometryCollection=RC;ye.isNumber=Ql;ye.isObject=WC;ye.lengthToDegrees=GC;ye.lengthToRadians=sh;ye.lineString=ah;ye.lineStrings=BC;ye.multiLineString=yg;ye.multiPoint=gg;ye.multiPolygon=vg;ye.point=nh;ye.points=kC;ye.polygon=oh;ye.polygons=FC;ye.radiansToDegrees=xg;ye.radiansToLength=bg;ye.round=NC;ye.validateBBox=ZC;ye.validateId=XC});var n4=G(Qe=>{"use strict";f();Object.defineProperty(Qe,"__esModule",{value:!0});var _P=Object.defineProperty,at=(r,t)=>_P(r,"name",{value:t,configurable:!0}),ut=YC();function ls(r,t,e){if(r!==null)for(var i,n,o,a,l,c,u,d=0,m=0,y,g=r.type,x=g==="FeatureCollection",T=g==="Feature",v=x?r.features.length:1,b=0;b<v;b++){u=x?r.features[b].geometry:T?r.geometry:r,y=u?u.type==="GeometryCollection":!1,l=y?u.geometries.length:1;for(var P=0;P<l;P++){var I=0,w=0;if(a=y?u.geometries[P]:u,a!==null){c=a.coordinates;var _=a.type;switch(d=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,m,b,I,w)===!1)return!1;m++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],m,b,I,w)===!1)return!1;m++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-d;n++){if(t(c[i][n],m,b,I,w)===!1)return!1;m++}_==="MultiLineString"&&I++,_==="Polygon"&&w++}_==="Polygon"&&I++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-d;o++){if(t(c[i][n][o],m,b,I,w)===!1)return!1;m++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ls(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}at(ls,"coordEach");function zC(r,t,e,i){var n=e;return ls(r,function(o,a,l,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,l,c,u)},i),n}at(zC,"coordReduce");function Cg(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}at(Cg,"propEach");function qC(r,t,e){var i=e;return Cg(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}at(qC,"propReduce");function Sg(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}at(Sg,"featureEach");function $C(r,t,e){var i=e;return Sg(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}at($C,"featureReduce");function JC(r){var t=[];return ls(r,function(e){t.push(e)}),t}at(JC,"coordAll");function lh(r,t){var e,i,n,o,a,l,c,u,d,m,y=0,g=r.type==="FeatureCollection",x=r.type==="Feature",T=g?r.features.length:1;for(e=0;e<T;e++){for(l=g?r.features[e].geometry:x?r.geometry:r,u=g?r.features[e].properties:x?r.properties:{},d=g?r.features[e].bbox:x?r.bbox:void 0,m=g?r.features[e].id:x?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,y,u,d,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,y,u,d,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],y,u,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}at(lh,"geomEach");function QC(r,t,e){var i=e;return lh(r,function(n,o,a,l,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,l,c)}),i}at(QC,"geomReduce");function ec(r,t){lh(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(ut.feature.call(void 0,e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],m={type:c,coordinates:d};if(t(ut.feature.call(void 0,m,n),i,u)===!1)return!1}})}at(ec,"flattenEach");function KC(r,t,e){var i=e;return ec(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}at(KC,"flattenReduce");function Tg(r,t){ec(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,u=0,d=0;if(ls(e,function(m,y,g,x,T){if(l===void 0||i>c||x>u||T>d){l=m,c=i,u=x,d=T,o=0;return}var v=ut.lineString.call(void 0,[l,m],e.properties);if(t(v,i,n,T,o)===!1)return!1;o++,l=m})===!1)return!1}}})}at(Tg,"segmentEach");function e4(r,t,e){var i=e,n=!1;return Tg(r,function(o,a,l,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,u),n=!0}),i}at(e4,"segmentReduce");function Mg(r,t){if(!r)throw new Error("geojson is required");ec(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(ut.lineString.call(void 0,a[l],e.properties),i,n,l)===!1)return!1;break}}})}at(Mg,"lineEach");function t4(r,t,e){var i=e;return Mg(r,function(n,o,a,l){o===0&&e===void 0?i=n:i=t(i,n,o,a,l)}),i}at(t4,"lineReduce");function r4(r,t){if(t=t||{},!ut.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),ut.lineString.call(void 0,[c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),ut.lineString.call(void 0,[c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),ut.lineString.call(void 0,[c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),ut.lineString.call(void 0,[c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}at(r4,"findSegment");function i4(r,t){if(t=t||{},!ut.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return ut.point.call(void 0,c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),ut.point.call(void 0,c[i],a,t);case"LineString":return o<0&&(o=c.length+o),ut.point.call(void 0,c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),ut.point.call(void 0,c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),ut.point.call(void 0,c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),ut.point.call(void 0,c[i][n][o],a,t)}throw new Error("geojson is invalid")}at(i4,"findPoint");Qe.coordAll=JC;Qe.coordEach=ls;Qe.coordReduce=zC;Qe.featureEach=Sg;Qe.featureReduce=$C;Qe.findPoint=i4;Qe.findSegment=r4;Qe.flattenEach=ec;Qe.flattenReduce=KC;Qe.geomEach=lh;Qe.geomReduce=QC;Qe.lineEach=Mg;Qe.lineReduce=t4;Qe.propEach=Cg;Qe.propReduce=qC;Qe.segmentEach=Tg;Qe.segmentReduce=e4});var o4=G(ch=>{"use strict";f();Object.defineProperty(ch,"__esModule",{value:!0});var DP=Object.defineProperty,OP=(r,t)=>DP(r,"name",{value:t,configurable:!0}),LP=n4();function Pg(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return LP.coordEach.call(void 0,r,i=>{e[0]>i[0]&&(e[0]=i[0]),e[1]>i[1]&&(e[1]=i[1]),e[2]<i[0]&&(e[2]=i[0]),e[3]<i[1]&&(e[3]=i[1])}),e}OP(Pg,"bbox");var AP=Pg;ch.bbox=Pg;ch.default=AP});var u4=G((rN,Ig)=>{f();var ri=nb(),s4=Ym(),l4=fb(),cs=o4().default,kP=l4.featureEach,eN=l4.coordEach,tN=s4.polygon,a4=s4.featureCollection;function c4(r){var t=new ri(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cs(e),ri.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:cs(n),i.push(n)}):kP(e,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:cs(n),i.push(n)}),ri.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cs(e),ri.prototype.remove.call(this,e,i)},t.clear=function(){return ri.prototype.clear.call(this)},t.search=function(e){var i=ri.prototype.search.call(this,this.toBBox(e));return a4(i)},t.collides=function(e){return ri.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ri.prototype.all.call(this);return a4(e)},t.toJSON=function(){return ri.prototype.toJSON.call(this)},t.fromJSON=function(e){return ri.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=cs(e);else if(e.type==="FeatureCollection")i=cs(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}Ig.exports=c4;Ig.exports.default=c4});var w1=G((Zc,As)=>{f();var Fw=200,FS="__lodash_hash_undefined__",Bw=800,Rw=16,BS=9007199254740991,RS="[object Arguments]",Nw="[object Array]",Gw="[object AsyncFunction]",Vw="[object Boolean]",jw="[object Date]",Hw="[object Error]",NS="[object Function]",Uw="[object GeneratorFunction]",Ww="[object Map]",Zw="[object Number]",Xw="[object Null]",GS="[object Object]",Yw="[object Proxy]",zw="[object RegExp]",qw="[object Set]",$w="[object String]",Jw="[object Undefined]",Qw="[object WeakMap]",Kw="[object ArrayBuffer]",eE="[object DataView]",tE="[object Float32Array]",rE="[object Float64Array]",iE="[object Int8Array]",nE="[object Int16Array]",oE="[object Int32Array]",aE="[object Uint8Array]",sE="[object Uint8ClampedArray]",lE="[object Uint16Array]",cE="[object Uint32Array]",uE=/[\\^$.*+?()[\]{}|]/g,pE=/^\[object .+?Constructor\]$/,dE=/^(?:0|[1-9]\d*)$/,we={};we[tE]=we[rE]=we[iE]=we[nE]=we[oE]=we[aE]=we[sE]=we[lE]=we[cE]=!0;we[RS]=we[Nw]=we[Kw]=we[Vw]=we[eE]=we[jw]=we[Hw]=we[NS]=we[Ww]=we[Zw]=we[GS]=we[zw]=we[qw]=we[$w]=we[Qw]=!1;var VS=typeof global=="object"&&global&&global.Object===Object&&global,hE=typeof self=="object"&&self&&self.Object===Object&&self,zc=VS||hE||Function("return this")(),jS=typeof Zc=="object"&&Zc&&!Zc.nodeType&&Zc,Xc=jS&&typeof As=="object"&&As&&!As.nodeType&&As,HS=Xc&&Xc.exports===jS,y1=HS&&VS.process,IS=function(){try{var r=Xc&&Xc.require&&Xc.require("util").types;return r||y1&&y1.binding&&y1.binding("util")}catch{}}(),wS=IS&&IS.isTypedArray;function US(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function fE(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}function mE(r){return function(t){return r(t)}}function yE(r,t){return r==null?void 0:r[t]}function gE(r,t){return function(e){return r(t(e))}}var vE=Array.prototype,bE=Function.prototype,Wh=Object.prototype,g1=zc["__core-js_shared__"],Zh=bE.toString,nn=Wh.hasOwnProperty,ES=function(){var r=/[^.]+$/.exec(g1&&g1.keys&&g1.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),WS=Wh.toString,xE=Zh.call(Object),CE=RegExp("^"+Zh.call(nn).replace(uE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hh=HS?zc.Buffer:void 0,_S=zc.Symbol,DS=zc.Uint8Array,OS=Hh?Hh.allocUnsafe:void 0,ZS=gE(Object.getPrototypeOf,Object),LS=Object.create,SE=Wh.propertyIsEnumerable,TE=vE.splice,pa=_S?_S.toStringTag:void 0,Uh=function(){try{var r=M1(Object,"defineProperty");return r({},"",{}),r}catch{}}(),ME=Hh?Hh.isBuffer:void 0,AS=Math.max,PE=Date.now,XS=M1(zc,"Map"),Yc=M1(Object,"create"),IE=function(){function r(){}return function(t){if(!rn(t))return{};if(LS)return LS(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function da(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function wE(){this.__data__=Yc?Yc(null):{},this.size=0}function EE(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}function _E(r){var t=this.__data__;if(Yc){var e=t[r];return e===FS?void 0:e}return nn.call(t,r)?t[r]:void 0}function DE(r){var t=this.__data__;return Yc?t[r]!==void 0:nn.call(t,r)}function OE(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Yc&&t===void 0?FS:t,this}da.prototype.clear=wE;da.prototype.delete=EE;da.prototype.get=_E;da.prototype.has=DE;da.prototype.set=OE;function on(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function LE(){this.__data__=[],this.size=0}function AE(r){var t=this.__data__,e=Xh(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():TE.call(t,e,1),--this.size,!0}function kE(r){var t=this.__data__,e=Xh(t,r);return e<0?void 0:t[e][1]}function FE(r){return Xh(this.__data__,r)>-1}function BE(r,t){var e=this.__data__,i=Xh(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}on.prototype.clear=LE;on.prototype.delete=AE;on.prototype.get=kE;on.prototype.has=FE;on.prototype.set=BE;function ks(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}function RE(){this.size=0,this.__data__={hash:new da,map:new(XS||on),string:new da}}function NE(r){var t=zh(this,r).delete(r);return this.size-=t?1:0,t}function GE(r){return zh(this,r).get(r)}function VE(r){return zh(this,r).has(r)}function jE(r,t){var e=zh(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}ks.prototype.clear=RE;ks.prototype.delete=NE;ks.prototype.get=GE;ks.prototype.has=VE;ks.prototype.set=jE;function Fs(r){var t=this.__data__=new on(r);this.size=t.size}function HE(){this.__data__=new on,this.size=0}function UE(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function WE(r){return this.__data__.get(r)}function ZE(r){return this.__data__.has(r)}function XE(r,t){var e=this.__data__;if(e instanceof on){var i=e.__data__;if(!XS||i.length<Fw-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new ks(i)}return e.set(r,t),this.size=e.size,this}Fs.prototype.clear=HE;Fs.prototype.delete=UE;Fs.prototype.get=WE;Fs.prototype.has=ZE;Fs.prototype.set=XE;function YE(r,t){var e=C1(r),i=!e&&x1(r),n=!e&&!i&&JS(r),o=!e&&!i&&!n&&KS(r),a=e||i||n||o,l=a?fE(r.length,String):[],c=l.length;for(var u in r)(t||nn.call(r,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||qS(u,c)))&&l.push(u);return l}function v1(r,t,e){(e!==void 0&&!qh(r[t],e)||e===void 0&&!(t in r))&&S1(r,t,e)}function zE(r,t,e){var i=r[t];(!(nn.call(r,t)&&qh(i,e))||e===void 0&&!(t in r))&&S1(r,t,e)}function Xh(r,t){for(var e=r.length;e--;)if(qh(r[e][0],t))return e;return-1}function S1(r,t,e){t=="__proto__"&&Uh?Uh(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var qE=s_();function Yh(r){return r==null?r===void 0?Jw:Xw:pa&&pa in Object(r)?l_(r):f_(r)}function kS(r){return qc(r)&&Yh(r)==RS}function $E(r){if(!rn(r)||d_(r))return!1;var t=I1(r)?CE:pE;return t.test(v_(r))}function JE(r){return qc(r)&&QS(r.length)&&!!we[Yh(r)]}function QE(r){if(!rn(r))return h_(r);var t=$S(r),e=[];for(var i in r)i=="constructor"&&(t||!nn.call(r,i))||e.push(i);return e}function T1(r,t,e,i,n){r!==t&&qE(t,function(o,a){if(n||(n=new Fs),rn(o))KE(r,t,a,e,T1,i,n);else{var l=i?i(b1(r,a),o,a+"",r,t,n):void 0;l===void 0&&(l=o),v1(r,a,l)}},e5)}function KE(r,t,e,i,n,o,a){var l=b1(r,e),c=b1(t,e),u=a.get(c);if(u){v1(r,e,u);return}var d=o?o(l,c,e+"",r,t,a):void 0,m=d===void 0;if(m){var y=C1(c),g=!y&&JS(c),x=!y&&!g&&KS(c);d=c,y||g||x?C1(l)?d=l:b_(l)?d=n_(l):g?(m=!1,d=t_(c,!0)):x?(m=!1,d=i_(c,!0)):d=[]:x_(c)||x1(c)?(d=l,x1(l)?d=C_(l):(!rn(l)||I1(l))&&(d=c_(c))):m=!1}m&&(a.set(c,d),n(d,c,i,o,a),a.delete(c)),v1(r,e,d)}function YS(r,t){return y_(m_(r,t,t5),r+"")}var e_=Uh?function(r,t){return Uh(r,"toString",{configurable:!0,enumerable:!1,value:M_(t),writable:!0})}:t5;function t_(r,t){if(t)return r.slice();var e=r.length,i=OS?OS(e):new r.constructor(e);return r.copy(i),i}function r_(r){var t=new r.constructor(r.byteLength);return new DS(t).set(new DS(r)),t}function i_(r,t){var e=t?r_(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}function n_(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}function o_(r,t,e,i){var n=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var l=t[o],c=i?i(e[l],r[l],l,e,r):void 0;c===void 0&&(c=r[l]),n?S1(e,l,c):zE(e,l,c)}return e}function a_(r){return YS(function(t,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&u_(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++i<n;){var l=e[i];l&&r(t,l,i,o)}return t})}function s_(r){return function(t,e,i){for(var n=-1,o=Object(t),a=i(t),l=a.length;l--;){var c=a[r?l:++n];if(e(o[c],c,o)===!1)break}return t}}function zS(r,t,e,i,n,o){return rn(r)&&rn(t)&&(o.set(t,r),T1(r,t,void 0,zS,o),o.delete(t)),r}function zh(r,t){var e=r.__data__;return p_(t)?e[typeof t=="string"?"string":"hash"]:e.map}function M1(r,t){var e=yE(r,t);return $E(e)?e:void 0}function l_(r){var t=nn.call(r,pa),e=r[pa];try{r[pa]=void 0;var i=!0}catch{}var n=WS.call(r);return i&&(t?r[pa]=e:delete r[pa]),n}function c_(r){return typeof r.constructor=="function"&&!$S(r)?IE(ZS(r)):{}}function qS(r,t){var e=typeof r;return t=t==null?BS:t,!!t&&(e=="number"||e!="symbol"&&dE.test(r))&&r>-1&&r%1==0&&r<t}function u_(r,t,e){if(!rn(e))return!1;var i=typeof t;return(i=="number"?P1(e)&&qS(t,e.length):i=="string"&&t in e)?qh(e[t],r):!1}function p_(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function d_(r){return!!ES&&ES in r}function $S(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Wh;return r===e}function h_(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}function f_(r){return WS.call(r)}function m_(r,t,e){return t=AS(t===void 0?r.length-1:t,0),function(){for(var i=arguments,n=-1,o=AS(i.length-t,0),a=Array(o);++n<o;)a[n]=i[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=i[n];return l[t]=e(a),US(r,this,l)}}function b1(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var y_=g_(e_);function g_(r){var t=0,e=0;return function(){var i=PE(),n=Rw-(i-e);if(e=i,n>0){if(++t>=Bw)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function v_(r){if(r!=null){try{return Zh.call(r)}catch{}try{return r+""}catch{}}return""}function qh(r,t){return r===t||r!==r&&t!==t}var x1=kS(function(){return arguments}())?kS:function(r){return qc(r)&&nn.call(r,"callee")&&!SE.call(r,"callee")},C1=Array.isArray;function P1(r){return r!=null&&QS(r.length)&&!I1(r)}function b_(r){return qc(r)&&P1(r)}var JS=ME||P_;function I1(r){if(!rn(r))return!1;var t=Yh(r);return t==NS||t==Uw||t==Gw||t==Yw}function QS(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=BS}function rn(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function qc(r){return r!=null&&typeof r=="object"}function x_(r){if(!qc(r)||Yh(r)!=GS)return!1;var t=ZS(r);if(t===null)return!0;var e=nn.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Zh.call(e)==xE}var KS=wS?mE(wS):JE;function C_(r){return o_(r,e5(r))}var S_=YS(function(r){return r.push(void 0,zS),US(T_,void 0,r)});function e5(r){return P1(r)?YE(r,!0):QE(r)}var T_=a_(function(r,t,e,i){T1(r,t,e,i)});function M_(r){return function(){return r}}function t5(r){return r}function P_(){return!1}As.exports=S_});var a7=G((yz,au)=>{"use strict";f();var eD=!1,ya=!1,K5=!0,e7=!1,h={},t7=!1;typeof au<"u"&&au.exports?(au.exports=h,t7=!0):typeof document<"u"?window.ClipperLib=h:self.ClipperLib=h;var df;t7?(rt="chrome",df="Netscape"):(rt=navigator.userAgent.toString().toLowerCase(),df=navigator.appName);var rt,ue={};rt.indexOf("chrome")!=-1&&rt.indexOf("chromium")==-1?ue.chrome=1:ue.chrome=0;rt.indexOf("chromium")!=-1?ue.chromium=1:ue.chromium=0;rt.indexOf("safari")!=-1&&rt.indexOf("chrome")==-1&&rt.indexOf("chromium")==-1?ue.safari=1:ue.safari=0;rt.indexOf("firefox")!=-1?ue.firefox=1:ue.firefox=0;rt.indexOf("firefox/17")!=-1?ue.firefox17=1:ue.firefox17=0;rt.indexOf("firefox/15")!=-1?ue.firefox15=1:ue.firefox15=0;rt.indexOf("firefox/3")!=-1?ue.firefox3=1:ue.firefox3=0;rt.indexOf("opera")!=-1?ue.opera=1:ue.opera=0;rt.indexOf("msie 10")!=-1?ue.msie10=1:ue.msie10=0;rt.indexOf("msie 9")!=-1?ue.msie9=1:ue.msie9=0;rt.indexOf("msie 8")!=-1?ue.msie8=1:ue.msie8=0;rt.indexOf("msie 7")!=-1?ue.msie7=1:ue.msie7=0;rt.indexOf("msie ")!=-1?ue.msie=1:ue.msie=0;h.biginteger_used=null;var io,tD=0xdeadbeefcafe,J5=(tD&16777215)==15715070;function F(r,t,e){h.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}function he(){return new F(null)}function rD(r,t,e,i,n,o){for(;--o>=0;){var a=t*this[r++]+e[i]+n;n=Math.floor(a/67108864),e[i++]=a&67108863}return n}function iD(r,t,e,i,n,o){for(var a=t&32767,l=t>>15;--o>=0;){var c=this[r]&32767,u=this[r++]>>15,d=l*c+u*a;c=a*c+((d&32767)<<15)+e[i]+(n&1073741823),n=(c>>>30)+(d>>>15)+l*u+(n>>>30),e[i++]=c&1073741823}return n}function nD(r,t,e,i,n,o){for(var a=t&16383,l=t>>14;--o>=0;){var c=this[r]&16383,u=this[r++]>>14,d=l*c+u*a;c=a*c+((d&16383)<<14)+e[i]+n,n=(c>>28)+(d>>14)+l*u,e[i++]=c&268435455}return n}J5&&df=="Microsoft Internet Explorer"?(F.prototype.am=iD,io=30):J5&&df!="Netscape"?(F.prototype.am=rD,io=26):(F.prototype.am=nD,io=28);F.prototype.DB=io;F.prototype.DM=(1<<io)-1;F.prototype.DV=1<<io;var z1=52;F.prototype.FV=Math.pow(2,z1);F.prototype.F1=z1-io;F.prototype.F2=2*io-z1;var oD="0123456789abcdefghijklmnopqrstuvwxyz",ff=new Array,js,yr;js=48;for(yr=0;yr<=9;++yr)ff[js++]=yr;js=97;for(yr=10;yr<36;++yr)ff[js++]=yr;js=65;for(yr=10;yr<36;++yr)ff[js++]=yr;function Q5(r){return oD.charAt(r)}function r7(r,t){var e=ff[r.charCodeAt(t)];return e==null?-1:e}function aD(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}function sD(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}function ro(r){var t=he();return t.fromInt(r),t}function lD(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var i=r.length,n=!1,o=0;--i>=0;){var a=e==8?r[i]&255:r7(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&F.ZERO.subTo(this,this)}function cD(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}function uD(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,i,n=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(i=this[a]>>l)>0&&(n=!0,o=Q5(i));a>=0;)l<t?(i=(this[a]&(1<<l)-1)<<t-l,i|=this[--a]>>(l+=this.DB-t)):(i=this[a]>>(l-=t)&e,l<=0&&(l+=this.DB,--a)),i>0&&(n=!0),n&&(o+=Q5(i));return n?o:"0"}function pD(){var r=he();return F.ZERO.subTo(this,r),r}function dD(){return this.s<0?this.negate():this}function hD(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}function mf(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}function fD(){return this.t<=0?0:this.DB*(this.t-1)+mf(this[this.t-1]^this.s&this.DM)}function mD(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}function yD(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}function gD(r,t){var e=r%this.DB,i=this.DB-e,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<e&this.DM,l;for(l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>i|a,a=(this[l]&n)<<e;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function vD(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var i=r%this.DB,n=this.DB-i,o=(1<<i)-1;t[0]=this[e]>>i;for(var a=e+1;a<this.t;++a)t[a-e-1]|=(this[a]&o)<<n,t[a-e]=this[a]>>i;i>0&&(t[this.t-e-1]|=(this.s&o)<<n),t.t=this.t-e,t.clamp()}function bD(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)i+=this[e]-r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i-=r[e],t[e++]=i&this.DM,i>>=this.DB;i-=r.s}t.s=i<0?-1:0,i<-1?t[e++]=this.DV+i:i>0&&(t[e++]=i),t.t=e,t.clamp()}function xD(r,t){var e=this.abs(),i=r.abs(),n=e.t;for(t.t=n+i.t;--n>=0;)t[n]=0;for(n=0;n<i.t;++n)t[n+e.t]=e.am(0,i[n],t,n,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&F.ZERO.subTo(t,t)}function CD(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var i=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,i,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}function SD(r,t,e){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=he());var o=he(),a=this.s,l=r.s,c=this.DB-mf(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,e)):(i.copyTo(o),n.copyTo(e));var u=o.t,d=o[u-1];if(d!=0){var m=d*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),y=this.FV/m,g=(1<<this.F1)/m,x=1<<this.F2,T=e.t,v=T-u,b=t==null?he():t;for(o.dlShiftTo(v,b),e.compareTo(b)>=0&&(e[e.t++]=1,e.subTo(b,e)),F.ONE.dlShiftTo(u,b),b.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--v>=0;){var P=e[--T]==d?this.DM:Math.floor(e[T]*y+(e[T-1]+x)*g);if((e[T]+=o.am(0,P,e,v,0,u))<P)for(o.dlShiftTo(v,b),e.subTo(b,e);e[T]<--P;)e.subTo(b,e)}t!=null&&(e.drShiftTo(u,t),a!=l&&F.ZERO.subTo(t,t)),e.t=u,e.clamp(),c>0&&e.rShiftTo(c,e),a<0&&F.ZERO.subTo(e,e)}}}function TD(r){var t=he();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(F.ZERO)>0&&r.subTo(t,t),t}function ga(r){this.m=r}function MD(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}function PD(r){return r}function ID(r){r.divRemTo(this.m,null,r)}function wD(r,t,e){r.multiplyTo(t,e),this.reduce(e)}function ED(r,t){r.squareTo(t),this.reduce(t)}ga.prototype.convert=MD;ga.prototype.revert=PD;ga.prototype.reduce=ID;ga.prototype.mulTo=wD;ga.prototype.sqrTo=ED;function _D(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}function va(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}function DD(r){var t=he();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(F.ZERO)>0&&this.m.subTo(t,t),t}function OD(r){var t=he();return r.copyTo(t),this.reduce(t),t}function LD(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,i=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,i,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}function AD(r,t){r.squareTo(t),this.reduce(t)}function kD(r,t,e){r.multiplyTo(t,e),this.reduce(e)}va.prototype.convert=DD;va.prototype.revert=OD;va.prototype.reduce=LD;va.prototype.mulTo=kD;va.prototype.sqrTo=AD;function FD(){return(this.t>0?this[0]&1:this.s)==0}function BD(r,t){if(r>4294967295||r<1)return F.ONE;var e=he(),i=he(),n=t.convert(this),o=mf(r)-1;for(n.copyTo(e);--o>=0;)if(t.sqrTo(e,i),(r&1<<o)>0)t.mulTo(i,n,e);else{var a=e;e=i,i=a}return t.revert(e)}function RD(r,t){var e;return r<256||t.isEven()?e=new ga(t):e=new va(t),this.exp(r,e)}F.prototype.copyTo=aD;F.prototype.fromInt=sD;F.prototype.fromString=lD;F.prototype.clamp=cD;F.prototype.dlShiftTo=mD;F.prototype.drShiftTo=yD;F.prototype.lShiftTo=gD;F.prototype.rShiftTo=vD;F.prototype.subTo=bD;F.prototype.multiplyTo=xD;F.prototype.squareTo=CD;F.prototype.divRemTo=SD;F.prototype.invDigit=_D;F.prototype.isEven=FD;F.prototype.exp=BD;F.prototype.toString=uD;F.prototype.negate=pD;F.prototype.abs=dD;F.prototype.compareTo=hD;F.prototype.bitLength=fD;F.prototype.mod=TD;F.prototype.modPowInt=RD;F.ZERO=ro(0);F.ONE=ro(1);function ND(){var r=he();return this.copyTo(r),r}function GD(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function VD(){return this.t==0?this.s:this[0]<<24>>24}function jD(){return this.t==0?this.s:this[0]<<16>>16}function HD(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}function UD(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function WD(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var t=this.chunkSize(r),e=Math.pow(r,t),i=ro(e),n=he(),o=he(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(e+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}function ZD(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),n=!1,o=0,a=0,l=0;l<r.length;++l){var c=r7(r,l);if(c<0){r.charAt(l)=="-"&&this.signum()==0&&(n=!0);continue}a=t*a+c,++o>=e&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),n&&F.ZERO.subTo(this,this)}function XD(r,t,e){if(typeof t=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,e),this.testBit(r-1)||this.bitwiseTo(F.ONE.shiftLeft(r-1),q1,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(F.ONE.shiftLeft(r-1),this);else{var i=new Array,n=r&7;i.length=(r>>3)+1,t.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}function YD(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[n++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(t[n++]=i);return t}function zD(r){return this.compareTo(r)==0}function qD(r){return this.compareTo(r)<0?this:r}function $D(r){return this.compareTo(r)>0?this:r}function JD(r,t,e){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)e[i]=t(this[i],n);e.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)e[i]=t(n,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}function QD(r,t){return r&t}function KD(r){var t=he();return this.bitwiseTo(r,QD,t),t}function q1(r,t){return r|t}function eO(r){var t=he();return this.bitwiseTo(r,q1,t),t}function i7(r,t){return r^t}function tO(r){var t=he();return this.bitwiseTo(r,i7,t),t}function n7(r,t){return r&~t}function rO(r){var t=he();return this.bitwiseTo(r,n7,t),t}function iO(){for(var r=he(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}function nO(r){var t=he();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}function oO(r){var t=he();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}function aO(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}function sO(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+aO(this[r]);return this.s<0?this.t*this.DB:-1}function lO(r){for(var t=0;r!=0;)r&=r-1,++t;return t}function cO(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=lO(this[e]^t);return r}function uO(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}function pO(r,t){var e=F.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}function dO(r){return this.changeBit(r,q1)}function hO(r){return this.changeBit(r,n7)}function fO(r){return this.changeBit(r,i7)}function mO(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)i+=this[e]+r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i+=r[e],t[e++]=i&this.DM,i>>=this.DB;i+=r.s}t.s=i<0?-1:0,i>0?t[e++]=i:i<-1&&(t[e++]=this.DV+i),t.t=e,t.clamp()}function yO(r){var t=he();return this.addTo(r,t),t}function gO(r){var t=he();return this.subTo(r,t),t}function vO(r){var t=he();return this.multiplyTo(r,t),t}function bO(){var r=he();return this.squareTo(r),r}function xO(r){var t=he();return this.divRemTo(r,t,null),t}function CO(r){var t=he();return this.divRemTo(r,null,t),t}function SO(r){var t=he(),e=he();return this.divRemTo(r,t,e),new Array(t,e)}function TO(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}function MO(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function su(){}function o7(r){return r}function PO(r,t,e){r.multiplyTo(t,e)}function IO(r,t){r.squareTo(t)}su.prototype.convert=o7;su.prototype.revert=o7;su.prototype.mulTo=PO;su.prototype.sqrTo=IO;function wO(r){return this.exp(r,new su)}function EO(r,t,e){var i=Math.min(this.t+r.t,t);for(e.s=0,e.t=i;i>0;)e[--i]=0;var n;for(n=e.t-this.t;i<n;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(n=Math.min(r.t,t);i<n;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}function _O(r,t,e){--t;var i=e.t=this.t+r.t-t;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(t-this.t,0);i<r.t;++i)e[this.t+i-t]=this.am(t-i,r[i],e,0,0,this.t+i-t);e.clamp(),e.drShiftTo(1,e)}function Hs(r){this.r2=he(),this.q3=he(),F.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}function DO(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var t=he();return r.copyTo(t),this.reduce(t),t}function OO(r){return r}function LO(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}function AO(r,t){r.squareTo(t),this.reduce(t)}function kO(r,t,e){r.multiplyTo(t,e),this.reduce(e)}Hs.prototype.convert=DO;Hs.prototype.revert=OO;Hs.prototype.reduce=LO;Hs.prototype.mulTo=kO;Hs.prototype.sqrTo=AO;function FO(r,t){var e=r.bitLength(),i,n=ro(1),o;if(e<=0)return n;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?o=new ga(t):t.isEven()?o=new Hs(t):o=new va(t);var a=new Array,l=3,c=i-1,u=(1<<i)-1;if(a[1]=o.convert(this),i>1){var d=he();for(o.sqrTo(a[1],d);l<=u;)a[l]=he(),o.mulTo(d,a[l-2],a[l]),l+=2}var m=r.t-1,y,g=!0,x=he(),T;for(e=mf(r[m])-1;m>=0;){for(e>=c?y=r[m]>>e-c&u:(y=(r[m]&(1<<e+1)-1)<<c-e,m>0&&(y|=r[m-1]>>this.DB+e-c)),l=i;!(y&1);)y>>=1,--l;if((e-=l)<0&&(e+=this.DB,--m),g)a[y].copyTo(n),g=!1;else{for(;l>1;)o.sqrTo(n,x),o.sqrTo(x,n),l-=2;l>0?o.sqrTo(n,x):(T=n,n=x,x=T),o.mulTo(x,a[y],n)}for(;m>=0&&!(r[m]&1<<e);)o.sqrTo(n,x),T=n,n=x,x=T,--e<0&&(e=this.DB-1,--m)}return o.revert(n)}function BO(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var i=t;t=e,e=i}var n=t.getLowestSetBit(),o=e.getLowestSetBit();if(o<0)return t;for(n<o&&(o=n),o>0&&(t.rShiftTo(o,t),e.rShiftTo(o,e));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return o>0&&e.lShiftTo(o,e),e}function RO(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var i=this.t-1;i>=0;--i)e=(t*e+this[i])%r;return e}function NO(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return F.ZERO;for(var e=r.clone(),i=this.clone(),n=ro(1),o=ro(0),a=ro(0),l=ro(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(r,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),t?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(r,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(r,l),l.rShiftTo(1,l);e.compareTo(i)>=0?(e.subTo(i,e),t&&n.subTo(a,n),o.subTo(l,o)):(i.subTo(e,i),t&&a.subTo(n,a),l.subTo(o,l))}if(i.compareTo(F.ONE)!=0)return F.ZERO;if(l.compareTo(r)>=0)return l.subtract(r);if(l.signum()<0)l.addTo(r,l);else return l;return l.signum()<0?l.add(r):l}var Pt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],GO=(1<<26)/Pt[Pt.length-1];function VO(r){var t,e=this.abs();if(e.t==1&&e[0]<=Pt[Pt.length-1]){for(t=0;t<Pt.length;++t)if(e[0]==Pt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<Pt.length;){for(var i=Pt[t],n=t+1;n<Pt.length&&i<GO;)i*=Pt[n++];for(i=e.modInt(i);t<n;)if(i%Pt[t++]==0)return!1}return e.millerRabin(r)}function jO(r){var t=this.subtract(F.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>Pt.length&&(r=Pt.length);for(var n=he(),o=0;o<r;++o){n.fromInt(Pt[Math.floor(Math.random()*Pt.length)]);var a=n.modPow(i,this);if(a.compareTo(F.ONE)!=0&&a.compareTo(t)!=0){for(var l=1;l++<e&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(F.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}F.prototype.chunkSize=HD;F.prototype.toRadix=WD;F.prototype.fromRadix=ZD;F.prototype.fromNumber=XD;F.prototype.bitwiseTo=JD;F.prototype.changeBit=pO;F.prototype.addTo=mO;F.prototype.dMultiply=TO;F.prototype.dAddOffset=MO;F.prototype.multiplyLowerTo=EO;F.prototype.multiplyUpperTo=_O;F.prototype.modInt=RO;F.prototype.millerRabin=jO;F.prototype.clone=ND;F.prototype.intValue=GD;F.prototype.byteValue=VD;F.prototype.shortValue=jD;F.prototype.signum=UD;F.prototype.toByteArray=YD;F.prototype.equals=zD;F.prototype.min=qD;F.prototype.max=$D;F.prototype.and=KD;F.prototype.or=eO;F.prototype.xor=tO;F.prototype.andNot=rO;F.prototype.not=iO;F.prototype.shiftLeft=nO;F.prototype.shiftRight=oO;F.prototype.getLowestSetBit=sO;F.prototype.bitCount=cO;F.prototype.testBit=uO;F.prototype.setBit=dO;F.prototype.clearBit=hO;F.prototype.flipBit=fO;F.prototype.add=yO;F.prototype.subtract=gO;F.prototype.multiply=vO;F.prototype.divide=xO;F.prototype.remainder=CO;F.prototype.divideAndRemainder=SO;F.prototype.modPow=FO;F.prototype.modInverse=NO;F.prototype.pow=wO;F.prototype.gcd=BO;F.prototype.isProbablePrime=VO;F.prototype.square=bO;var le=F;le.prototype.IsNegative=function(){return this.compareTo(le.ZERO)==-1};le.op_Equality=function(r,t){return r.compareTo(t)==0};le.op_Inequality=function(r,t){return r.compareTo(t)!=0};le.op_GreaterThan=function(r,t){return r.compareTo(t)>0};le.op_LessThan=function(r,t){return r.compareTo(t)<0};le.op_Addition=function(r,t){return new le(r).add(new le(t))};le.op_Subtraction=function(r,t){return new le(r).subtract(new le(t))};le.Int128Mul=function(r,t){return new le(r).multiply(new le(t))};le.op_Division=function(r,t){return r.divide(t)};le.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof hf>"u"&&(hf=function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(t.prototype,i[n]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}});var hf;h.Path=function(){return[]};h.Paths=function(){return[]};h.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};h.DoublePoint0=function(){this.X=0,this.Y=0};h.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};h.DoublePoint2=function(r,t){this.X=r,this.Y=t};h.PolyNode=function(){this.m_Parent=null,this.m_polygon=new h.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};h.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};h.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};h.PolyNode.prototype.Contour=function(){return this.m_polygon};h.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};h.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};h.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};h.PolyNode.prototype.Childs=function(){return this.m_Childs};h.PolyNode.prototype.Parent=function(){return this.m_Parent};h.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};h.PolyTree=function(){this.m_AllPolys=[],h.PolyNode.call(this)};h.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};h.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};h.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};hf(h.PolyTree,h.PolyNode);h.Math_Abs_Int64=h.Math_Abs_Int32=h.Math_Abs_Double=function(r){return Math.abs(r)};h.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};ue.msie||ue.opera||ue.safari?h.Cast_Int32=function(r){return r|0}:h.Cast_Int32=function(r){return~~r};ue.chrome?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ue.firefox&&typeof Number.toInteger=="function"?h.Cast_Int64=function(r){return Number.toInteger(r)}:ue.msie7||ue.msie8?h.Cast_Int64=function(r){return parseInt(r,10)}:ue.msie?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:h.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};h.Clear=function(r){r.length=0};h.PI=3.141592653589793;h.PI2=2*3.141592653589793;h.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,ya)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};h.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};h.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};ya?(h.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y),this.Z=0},h.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},h.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(h.IntPoint0=function(){this.X=0,this.Y=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y)},h.IntPoint2=function(r,t){this.X=r,this.Y=t});h.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};h.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};h.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};h.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};h.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};h.PolyType={ptSubject:0,ptClip:1};h.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};h.JoinType={jtSquare:0,jtRound:1,jtMiter:2};h.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};e7&&(h.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});h.EdgeSide={esLeft:0,esRight:1};h.Direction={dRightToLeft:0,dLeftToRight:1};h.TEdge=function(){this.Bot=new h.IntPoint,this.Curr=new h.IntPoint,this.Top=new h.IntPoint,this.Delta=new h.IntPoint,this.Dx=0,this.PolyTyp=h.PolyType.ptSubject,this.Side=h.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};h.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new h.IntPoint};h.MyIntersectNodeSort=function(){};h.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};h.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};h.Scanbeam=function(){this.Y=0,this.Next=null};h.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};h.OutPt=function(){this.Idx=0,this.Pt=new h.IntPoint,this.Next=null,this.Prev=null};h.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new h.IntPoint};h.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};h.ClipperBase.horizontal=-9007199254740992;h.ClipperBase.Skip=-2;h.ClipperBase.Unassigned=-1;h.ClipperBase.tolerance=1e-20;eD?(h.ClipperBase.loRange=46340,h.ClipperBase.hiRange=46340):(h.ClipperBase.loRange=47453132,h.ClipperBase.hiRange=0xfffffffffffff);h.ClipperBase.near_zero=function(r){return r>-h.ClipperBase.tolerance&&r<h.ClipperBase.tolerance};h.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};h.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(h.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};h.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&le.op_Equality(le.Int128Mul(r.X-t.X,e.Y-t.Y),le.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};h.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};h.ClipperBase.prototype.SlopesEqual=h.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,n,o,a,l,c;return t==3?(e=r[0],i=r[1],c=r[2],c?le.op_Equality(le.Int128Mul(e.Delta.Y,i.Delta.X),le.Int128Mul(e.Delta.X,i.Delta.Y)):h.Cast_Int64(e.Delta.Y*i.Delta.X)==h.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(n=r[0],o=r[1],a=r[2],c=r[3],c?le.op_Equality(le.Int128Mul(n.Y-o.Y,o.X-a.X),le.Int128Mul(n.X-o.X,o.Y-a.Y)):h.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-h.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],l=r[3],c=r[4],c?le.op_Equality(le.Int128Mul(n.Y-o.Y,a.X-l.X),le.Int128Mul(n.X-o.X,a.Y-l.Y)):h.Cast_Int64((n.Y-o.Y)*(a.X-l.X))-h.Cast_Int64((n.X-o.X)*(a.Y-l.Y))===0)};h.ClipperBase.SlopesEqual3=function(r,t,e){return e?le.op_Equality(le.Int128Mul(r.Delta.Y,t.Delta.X),le.Int128Mul(r.Delta.X,t.Delta.Y)):h.Cast_Int64(r.Delta.Y*t.Delta.X)==h.Cast_Int64(r.Delta.X*t.Delta.Y)};h.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?le.op_Equality(le.Int128Mul(r.Y-t.Y,t.X-e.X),le.Int128Mul(r.X-t.X,t.Y-e.Y)):h.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-h.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};h.ClipperBase.SlopesEqual5=function(r,t,e,i,n){return n?le.op_Equality(le.Int128Mul(r.Y-t.Y,e.X-i.X),le.Int128Mul(r.X-t.X,e.Y-i.Y)):h.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-h.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};h.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;h.Clear(this.m_edges[r])}h.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};h.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};h.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>h.ClipperBase.hiRange||r.Y>h.ClipperBase.hiRange||-r.X>h.ClipperBase.hiRange||-r.Y>h.ClipperBase.hiRange)&&h.Error("Coordinate outside allowed range in RangeTest()."):(r.X>h.ClipperBase.loRange||r.Y>h.ClipperBase.loRange||-r.X>h.ClipperBase.loRange||-r.Y>h.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};h.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};h.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};h.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;h.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||h.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=h.ClipperBase.horizontal&&r.Prev.Dx!=h.ClipperBase.horizontal)break;for(;r.Prev.Dx==h.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==h.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};h.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,n,o;if(r.Dx==h.ClipperBase.horizontal&&(t?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=h.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=h.ClipperBase.Skip;)i=i.Next;if(i.Dx==h.ClipperBase.horizontal&&i.Next.OutIdx!=h.ClipperBase.Skip){for(n=i;n.Prev.Dx==h.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?t||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=h.ClipperBase.Skip;)i=i.Prev;if(i.Dx==h.ClipperBase.horizontal&&i.Prev.OutIdx!=h.ClipperBase.Skip){for(n=i;n.Next.Dx==h.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?t||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==h.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==h.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==h.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var a=new h.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return i};h.ClipperBase.prototype.AddPath=function(r,t,e){K5?!e&&t==h.PolyType.ptClip&&h.Error("AddPath: Open paths must be subject."):e||h.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&h.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&h.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new h.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[1].Curr.Y=r[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(r[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(r[i],l),this.m_UseFullRange=l.Value,this.InitEdge(n[0],n[1],n[i],r[0]),this.InitEdge(n[i],n[0],n[i-1],r[i]);for(var o=i-1;o>=1;--o)l.Value=this.m_UseFullRange,this.RangeTest(r[o],l),this.m_UseFullRange=l.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var c=n[0],u=c,d=c;;){if(h.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==c&&(c=u.Next),u=this.RemoveEdge(u),d=u;continue}if(u.Prev==u.Next)break;if(e&&h.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==c&&(c=u.Next),u=this.RemoveEdge(u),u=u.Prev,d=u;continue}if(u=u.Next,u==d)break}if(!e&&u==u.Next||e&&u.Prev==u.Next)return!1;e||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=h.ClipperBase.Skip);var m=c;u=c;do this.InitEdge2(u,t),u=u.Next,a&&u.Curr.Y!=c.Curr.Y&&(a=!1);while(u!=c);if(a){if(e)return!1;u.Prev.OutIdx=h.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var y=new h.LocalMinima;for(y.Next=null,y.Y=u.Bot.Y,y.LeftBound=null,y.RightBound=u,y.RightBound.Side=h.EdgeSide.esRight,y.RightBound.WindDelta=0;u.Next.OutIdx!=h.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(y),this.m_edges.push(n),!0}this.m_edges.push(n);for(var g,x=null;u=this.FindNextLocMin(u),u!=x;){x==null&&(x=u);var y=new h.LocalMinima;y.Next=null,y.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(y.LeftBound=u.Prev,y.RightBound=u,g=!1):(y.LeftBound=u,y.RightBound=u.Prev,g=!0),y.LeftBound.Side=h.EdgeSide.esLeft,y.RightBound.Side=h.EdgeSide.esRight,e?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,u=this.ProcessBound(y.LeftBound,g);var T=this.ProcessBound(y.RightBound,!g);y.LeftBound.OutIdx==h.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==h.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),g||(u=T)}return!0};h.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],t,e)&&(i=!0);return i};h.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return h.IntPoint.op_Equality(r,e)||h.IntPoint.op_Equality(r,t)||h.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};h.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};h.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=h.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};h.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};h.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};h.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,ya&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};h.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=h.EdgeSide.esLeft,t.OutIdx=h.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=h.EdgeSide.esRight,t.OutIdx=h.ClipperBase.Unassigned),r=r.Next}};h.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=h.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=h.PolyFillType.pftEvenOdd,this.m_SubjFillType=h.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,h.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=h.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,ya&&(this.ZFillFunction=null)};h.Clipper.ioReverseSolution=1;h.Clipper.ioStrictlySimple=2;h.Clipper.ioPreserveCollinear=4;h.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),h.ClipperBase.prototype.Clear.call(this))};h.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};h.Clipper.prototype.Reset=function(){h.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};h.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new h.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new h.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new h.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};h.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof h.PolyTree;if(t==4&&!e){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&h.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,h.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var l=this.ExecuteInternal();l&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==4&&e){var i=r[0],c=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var l=this.ExecuteInternal();l&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==2&&!e){var i=r[0],n=r[1];return this.Execute(i,n,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],c=r[1];return this.Execute(i,c,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}};h.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};h.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),h.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{h.Clear(this.m_Joins),h.Clear(this.m_GhostJoins)}};h.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};h.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);h.Clear(this.m_PolyOuts)};h.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};h.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};h.Clipper.prototype.AddJoin=function(r,t,e){var i=new h.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};h.Clipper.prototype.AddGhostJoin=function(r,t){var e=new h.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};ya&&(h.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});h.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(h.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&h.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,e.Bot,e.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,l,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,l,e.Top)}var c=t.NextInAEL;if(c!==null)for(;c!=e;)this.IntersectEdges(e,c,t.Curr,!1),c=c.NextInAEL}}}};h.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};h.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<h.Clipper.TopX(r,t.Top.Y):r.Top.X>h.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};h.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_SubjFillType==h.PolyFillType.pftEvenOdd:this.m_ClipFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_ClipFillType==h.PolyFillType.pftEvenOdd:this.m_SubjFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==h.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case h.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case h.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case h.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case h.ClipType.ctIntersection:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctUnion:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case h.ClipType.ctDifference:if(r.PolyTyp==h.PolyType.ptSubject)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctXor:if(r.WindDelta===0)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};h.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=h.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};h.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};h.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};h.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};h.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};h.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};h.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,n,o;if(h.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=h.EdgeSide.esLeft,t.Side=h.EdgeSide.esRight,n=r,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=h.EdgeSide.esRight,t.Side=h.EdgeSide.esLeft,n=t,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&h.Clipper.TopX(o,e.Y)==h.Clipper.TopX(n,e.Y)&&h.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,e);this.AddJoin(i,a,n.Top)}return i};h.Clipper.prototype.CreateOutRec=function(){var r=new h.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};h.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==h.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new h.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),ya&&(h.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),r.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[r.OutIdx],o=i.Pts;if(e&&h.IntPoint.op_Equality(t,o.Pt))return o;if(!e&&h.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var n=new h.OutPt;return n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,e&&(i.Pts=n),ya&&(h.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};h.Clipper.prototype.SwapPoints=function(r,t){var e=new h.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};h.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};h.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new h.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};h.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};h.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?h.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};h.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;h.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;h.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var n=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;h.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var o=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;h.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var a=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=o&&i>=a||n>=o&&n>=a};h.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;h.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};h.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};h.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};h.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};h.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],n;this.Param1RightOfParam2(e,i)?n=i:this.Param1RightOfParam2(i,e)?n=e:n=this.GetLowermostRec(e,i);var o=e.Pts,a=o.Prev,l=i.Pts,c=l.Prev,u;r.Side==h.EdgeSide.esLeft?(t.Side==h.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=o,o.Prev=l,a.Next=c,c.Prev=a,e.Pts=c):(c.Next=o,o.Prev=c,l.Prev=a,a.Next=l,e.Pts=l),u=h.EdgeSide.esLeft):(t.Side==h.EdgeSide.esRight?(this.ReversePolyPtLinks(l),a.Next=c,c.Prev=a,l.Next=o,o.Prev=l):(a.Next=l,l.Prev=a,o.Prev=c,c.Next=o),u=h.EdgeSide.esRight),e.BottomPt=null,n==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var d=r.OutIdx,m=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==m){y.OutIdx=d,y.Side=u;break}y=y.NextInAEL}i.Idx=e.Idx};h.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};h.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};h.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};h.Clipper.prototype.IntersectEdges=function(r,t,e,i){var n=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,o=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,a=r.OutIdx>=0,l=t.OutIdx>=0;if(K5&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(n||o)&&a&&l&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==h.ClipType.ctUnion?r.WindDelta===0?l&&(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(t,e),l&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),l&&(t.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):h.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):h.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var c=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=c}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var u,d,m,y;r.PolyTyp==h.PolyType.ptSubject?(u=this.m_SubjFillType,m=this.m_ClipFillType):(u=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==h.PolyType.ptSubject?(d=this.m_SubjFillType,y=this.m_ClipFillType):(d=this.m_ClipFillType,y=this.m_SubjFillType);var g,x;switch(u){case h.PolyFillType.pftPositive:g=r.WindCnt;break;case h.PolyFillType.pftNegative:g=-r.WindCnt;break;default:g=Math.abs(r.WindCnt);break}switch(d){case h.PolyFillType.pftPositive:x=t.WindCnt;break;case h.PolyFillType.pftNegative:x=-t.WindCnt;break;default:x=Math.abs(t.WindCnt);break}if(a&&l)n||o||g!==0&&g!=1||x!==0&&x!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=h.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(a)(x===0||x==1)&&(this.AddOutPt(r,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(l)(g===0||g==1)&&(this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if((g===0||g==1)&&(x===0||x==1)&&!n&&!o){var T,v;switch(m){case h.PolyFillType.pftPositive:T=r.WindCnt2;break;case h.PolyFillType.pftNegative:T=-r.WindCnt2;break;default:T=Math.abs(r.WindCnt2);break}switch(y){case h.PolyFillType.pftPositive:v=t.WindCnt2;break;case h.PolyFillType.pftNegative:v=-t.WindCnt2;break;default:v=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(g==1&&x==1)switch(this.m_ClipType){case h.ClipType.ctIntersection:T>0&&v>0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctUnion:T<=0&&v<=0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctDifference:(r.PolyTyp==h.PolyType.ptClip&&T>0&&v>0||r.PolyTyp==h.PolyType.ptSubject&&T<=0&&v<=0)&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else h.Clipper.SwapSides(r,t)}n!=o&&(n&&r.OutIdx>=0||o&&t.OutIdx>=0)&&(h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(t)};h.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};h.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};h.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&h.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,h.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};h.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};h.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=h.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=h.Direction.dRightToLeft)};h.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=h.EdgeSide.esLeft&&(e=e.Prev),t&&(h.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};h.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,n=e.Left,o=e.Right,a=r,l=null;a.NextInLML!==null&&h.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(l=this.GetMaximaPair(a));;){for(var c=r==a,u=this.GetNextInAEL(r,i);u!==null&&!(u.Curr.X==r.Top.X&&r.NextInLML!==null&&u.Dx<r.NextInLML.Dx);){var d=this.GetNextInAEL(u,i);if(i==h.Direction.dLeftToRight&&u.Curr.X<=o||i==h.Direction.dRightToLeft&&u.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),u==l&&c){i==h.Direction.dLeftToRight?this.IntersectEdges(r,u,u.Top,!1):this.IntersectEdges(u,r,u.Top,!1),l.OutIdx>=0&&h.Error("ProcessHorizontal error");return}else if(i==h.Direction.dLeftToRight){var m=new h.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,m,!0)}else{var m=new h.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,m,!0)}this.SwapPositionsInAEL(r,u)}else if(i==h.Direction.dLeftToRight&&u.Curr.X>=o||i==h.Direction.dRightToLeft&&u.Curr.X<=n)break;u=d}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&h.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,e),i=e.Dir,n=e.Left,o=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var y=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var g=r.PrevInAEL,d=r.NextInAEL;if(g!==null&&g.Curr.X==r.Bot.X&&g.Curr.Y==r.Bot.Y&&g.WindDelta!==0&&g.OutIdx>=0&&g.Curr.Y>g.Top.Y&&h.ClipperBase.SlopesEqual(r,g,this.m_UseFullRange)){var x=this.AddOutPt(g,r.Bot);this.AddJoin(y,x,r.Top)}else if(d!==null&&d.Curr.X==r.Bot.X&&d.Curr.Y==r.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&h.ClipperBase.SlopesEqual(r,d,this.m_UseFullRange)){var x=this.AddOutPt(d,r.Bot);this.AddJoin(y,x,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else l!==null?l.OutIdx>=0?(i==h.Direction.dLeftToRight?this.IntersectEdges(r,l,r.Top,!1):this.IntersectEdges(l,r,r.Top,!1),l.OutIdx>=0&&h.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(l)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};h.Clipper.prototype.GetNextInAEL=function(r,t){return t==h.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};h.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};h.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};h.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};h.Clipper.prototype.GetMaximaPair=function(r){var t=null;return h.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:h.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!h.ClipperBase.IsHorizontal(t))?null:t};h.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,h.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};h.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=h.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var n=e.NextInSEL,o=new h.IntPoint;if(e.Curr.X>n.Curr.X){!this.IntersectPoint(e,n,o)&&e.Curr.X>n.Curr.X+1&&h.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(e.Dx)>Math.abs(n.Dx)?o.X=h.Clipper.TopX(n,r):o.X=h.Clipper.TopX(e,r));var a=new h.IntersectNode;a.Edge1=e,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(e,n),i=!0}else e=n}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};h.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};h.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};h.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};h.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var HO=function(r){return r<0?Math.ceil(r-.5):Math.round(r)},UO=function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},WO=function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},ZO=function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)};ue.msie?h.Clipper.Round=HO:ue.chromium?h.Clipper.Round=WO:ue.safari?h.Clipper.Round=ZO:h.Clipper.Round=UO;h.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+h.Clipper.Round(r.Dx*(t-r.Bot.Y))};h.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,n;if(h.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,h.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(n=t.Bot.Y-t.Bot.X/t.Dx,e.Y=h.Clipper.Round(e.X/t.Dx+n));else if(t.Delta.X===0)e.X=t.Bot.X,h.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=h.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=t.Bot.X-t.Bot.Y*t.Dx;var o=(n-i)/(r.Dx-t.Dx);e.Y=h.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.Round(r.Dx*o+i):e.X=h.Clipper.Round(t.Dx*o+n)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=h.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.TopX(r,e.Y):e.X=h.Clipper.TopX(t,e.Y)}return!0};h.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!h.ClipperBase.IsHorizontal(i)}if(e){var n=t.PrevInAEL;this.DoMaxima(t),n===null?t=this.m_ActiveEdges:t=n.NextInAEL}else{if(this.IsIntermediate(t,r)&&h.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=h.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var n=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==t.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(o,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var o=null;t.OutIdx>=0&&(o=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var n=t.PrevInAEL,l=t.NextInAEL;if(n!==null&&n.Curr.X==t.Bot.X&&n.Curr.Y==t.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&h.ClipperBase.SlopesEqual(t,n,this.m_UseFullRange)&&t.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,t.Bot);this.AddJoin(o,a,t.Top)}else if(l!==null&&l.Curr.X==t.Bot.X&&l.Curr.Y==t.Bot.Y&&o!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&h.ClipperBase.SlopesEqual(t,l,this.m_UseFullRange)&&t.WindDelta!==0&&l.WindDelta!==0){var a=this.AddOutPt(l,t.Bot);this.AddJoin(o,a,t.Top)}}t=t.NextInAEL}};h.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):h.Error("DoMaxima error")};h.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};h.Clipper.Orientation=function(r){return h.Clipper.Area(r)>=0};h.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};h.Clipper.prototype.BuildResult=function(r){h.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),l=0;l<o;l++)a[l]=n.Pt,n=n.Prev;r.push(a)}}}};h.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new h.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,l=0;l<n;l++)o.m_polygon[l]=a.Pt,a=a.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};h.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(h.IntPoint.op_Equality(e.Pt,e.Next.Pt)||h.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||h.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};h.Clipper.prototype.DupOutPt=function(r,t){var e=new h.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};h.Clipper.prototype.GetOverlap=function(r,t,e,i,n){return r<t?e<i?(n.Left=Math.max(r,e),n.Right=Math.min(t,i)):(n.Left=Math.max(r,i),n.Right=Math.min(t,e)):e<i?(n.Left=Math.max(t,e),n.Right=Math.min(r,i)):(n.Left=Math.max(t,i),n.Right=Math.min(r,e)),n.Left<n.Right};h.Clipper.prototype.JoinHorz=function(r,t,e,i,n,o){var a=r.Pt.X>t.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight,l=e.Pt.X>i.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight;if(a==l)return!1;if(a==h.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,!o),h.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,o),h.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,o))}if(l==h.Direction.dLeftToRight){for(;e.Next.Pt.X<=n.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,!o),h.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,!o))}else{for(;e.Next.Pt.X>=n.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;!o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,o),h.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,o))}return a==h.Direction.dLeftToRight==o?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};h.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,n=new h.OutPt,o=r.OutPt2,a=new h.OutPt,l=r.OutPt1.Pt.Y==r.OffPt.Y;if(l&&h.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&h.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&h.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var c=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&h.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var u=a.Pt.Y>r.OffPt.Y;return c==u?!1:c?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(l){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var d={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,d))return!1;var m=d.Left,y=d.Right,g=new h.IntPoint,x;return i.Pt.X>=m&&i.Pt.X<=y?(g.X=i.Pt.X,g.Y=i.Pt.Y,x=i.Pt.X>n.Pt.X):o.Pt.X>=m&&o.Pt.X<=y?(g.X=o.Pt.X,g.Y=o.Pt.Y,x=o.Pt.X>a.Pt.X):n.Pt.X>=m&&n.Pt.X<=y?(g.X=n.Pt.X,g.Y=n.Pt.Y,x=n.Pt.X>i.Pt.X):(g.X=a.Pt.X,g.Y=a.Pt.Y,x=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,g,x)}else{for(n=i.Next;h.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var T=n.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(T){for(n=i.Prev;h.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;h.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var v=a.Pt.Y>o.Pt.Y||!h.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(v){for(a=o.Prev;h.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!h.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||t==e&&T==v?!1:T?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};h.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new h.IntRect(0,0,0,0);var i=new h.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var n=0,o=r[t].length;n<o;n++)r[t][n].X<i.left?i.left=r[t][n].X:r[t][n].X>i.right&&(i.right=r[t][n].X),r[t][n].Y<i.top?i.top=r[t][n].Y:r[t][n].Y>i.bottom&&(i.bottom=r[t][n].Y);return i};h.Clipper.prototype.GetBounds2=function(r){var t=r,e=new h.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};h.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var n=t[0],o=1;o<=i;++o){var a=o==i?t[0]:t[o];if(a.Y==r.Y&&(a.X==r.X||n.Y==r.Y&&a.X>r.X==n.X<r.X))return-1;if(n.Y<r.Y!=a.Y<r.Y){if(n.X>=r.X)if(a.X>r.X)e=1-e;else{var l=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(e=1-e)}else if(a.X>r.X){var l=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(e=1-e)}}n=a}return e};h.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var n=t.Pt.X,o=t.Pt.Y,a=t.Next.Pt.X,l=t.Next.Pt.Y;if(l==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=l<r.Y){if(n>=r.X)if(a>r.X)e=1-e;else{var c=(n-r.X)*(l-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==l>o&&(e=1-e)}else if(a>r.X){var c=(n-r.X)*(l-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==l>o&&(e=1-e)}}if(t=t.Next,i==t)break}return e};h.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};h.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,t.Pts)&&(n.FirstLeft=t)}};h.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,n=i.length,o=i[e];e<n;e++,o=i[e])o.FirstLeft==r&&(o.FirstLeft=t)};h.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};h.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),n=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(e,i,n))if(i==n){if(i.Pts=e.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=e.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,l=this.m_PolyOuts.length;a<l-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||h.Clipper.ParseFirstLeft(c.FirstLeft)!=i||c.IsHole==i.IsHole||this.Poly2ContainsPoly1(c.Pts,e.OutPt2)&&(c.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};h.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};h.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(h.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var n=e.Prev,o=i.Prev;e.Prev=o,o.Next=e,i.Prev=n,n.Next=i,t.Pts=e;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};h.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,n=t-1;i<t;++i)e+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-e*.5};h.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};e7&&(h.Clipper.OffsetPaths=function(r,t,e,i,n){var o=new h.Paths,a=new h.ClipperOffset(n,n);return a.AddPaths(r,e,i),a.Execute(o,t),o});h.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=h.PolyFillType.pftEvenOdd);var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};h.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,n=e.X-t.X,o=i*t.X+n*t.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};h.Clipper.SlopesNearCollinear=function(r,t,e,i){return h.Clipper.DistanceFromLineSqrd(t,r,e)<i};h.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,n=r.Y-t.Y;return i*i+n*n<=e};h.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};h.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),n=0;n<e;++n)i[n]=new h.OutPt;for(var n=0;n<e;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%e],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=t*t,a=i[0];a.Idx==0&&a.Next!=a.Prev;)h.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=h.Clipper.ExcludeOp(a),e--):h.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(h.Clipper.ExcludeOp(a.Next),a=h.Clipper.ExcludeOp(a),e-=2):h.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=h.Clipper.ExcludeOp(a),e--):(a.Idx=1,a=a.Next);e<3&&(e=0);for(var l=new Array(e),n=0;n<e;++n)l[n]=new h.IntPoint(a.Pt),a=a.Next;return i=null,l};h.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,n=r.length;i<n;i++)e[i]=h.Clipper.CleanPolygon(r[i],t);return e};h.Clipper.Minkowski=function(r,t,e,i){var n=i?1:0,o=r.length,a=t.length,l=new Array;if(e)for(var c=0;c<a;c++){for(var u=new Array(o),d=0,m=r.length,y=r[d];d<m;d++,y=r[d])u[d]=new h.IntPoint(t[c].X+y.X,t[c].Y+y.Y);l.push(u)}else for(var c=0;c<a;c++){for(var u=new Array(o),d=0,m=r.length,y=r[d];d<m;d++,y=r[d])u[d]=new h.IntPoint(t[c].X-y.X,t[c].Y-y.Y);l.push(u)}for(var g=new Array,c=0;c<a-1+n;c++)for(var d=0;d<o;d++){var x=new Array;x.push(l[c%a][d%o]),x.push(l[(c+1)%a][d%o]),x.push(l[(c+1)%a][(d+1)%o]),x.push(l[c%a][(d+1)%o]),h.Clipper.Orientation(x)||x.reverse(),g.push(x)}var T=new h.Clipper(0);return T.AddPaths(g,h.PolyType.ptSubject,!0),T.Execute(h.ClipType.ctUnion,l,h.PolyFillType.pftNonZero,h.PolyFillType.pftNonZero),l};h.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],n=r[2];return h.Clipper.Minkowski(e,i,!0,n)}else if(t==4){for(var e=r[0],o=r[1],a=r[2],n=r[3],l=new h.Clipper,c,u=0,d=o.length;u<d;++u){var c=h.Clipper.Minkowski(e,o[u],!0,n);l.AddPaths(c,h.PolyType.ptSubject,!0)}n&&l.AddPaths(o,h.PolyType.ptClip,!0);var m=new h.Paths;return l.Execute(h.ClipType.ctUnion,m,a,a),m}};h.Clipper.MinkowskiDiff=function(r,t,e){return h.Clipper.Minkowski(r,t,!1,e)};h.Clipper.PolyTreeToPaths=function(r){var t=new Array;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntAny,t),t};h.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case h.Clipper.NodeType.ntOpen:return;case h.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,l=o[n];n<a;n++,l=o[n])h.Clipper.AddPolyNodeToPaths(l,t,e)};h.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new h.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};h.Clipper.ClosedPathsFromPolyTree=function(r){var t=new h.Paths;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntClosed,t),t};hf(h.Clipper,h.ClipperBase);h.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};h.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=h.ClipperOffset.def_arc_tolerance),this.m_destPolys=new h.Paths,this.m_srcPoly=new h.Path,this.m_destPoly=new h.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new h.IntPoint,this.m_polyNodes=new h.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};h.ClipperOffset.two_pi=6.28318530717959;h.ClipperOffset.def_arc_tolerance=.25;h.ClipperOffset.prototype.Clear=function(){h.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};h.ClipperOffset.Round=h.Clipper.Round;h.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var n=new h.PolyNode;if(n.m_jointype=t,n.m_endtype=e,e==h.EndType.etClosedLine||e==h.EndType.etClosedPolygon)for(;i>0&&h.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,l=1;l<=i;l++)h.IntPoint.op_Inequality(n.m_polygon[o],r[l])&&(o++,n.m_polygon.push(r[l]),(r[l].Y>n.m_polygon[a].Y||r[l].Y==n.m_polygon[a].Y&&r[l].X<n.m_polygon[a].X)&&(a=o));if(!(e==h.EndType.etClosedPolygon&&o<2||e!=h.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),e==h.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new h.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>c.Y||n.m_polygon[a].Y==c.Y&&n.m_polygon[a].X<c.X)&&(this.m_lowest=new h.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};h.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],t,e)};h.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!h.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==h.EndType.etClosedPolygon||t.m_endtype==h.EndType.etClosedLine&&h.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==h.EndType.etClosedLine&&!h.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};h.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new h.DoublePoint(0,0);var n=1/Math.sqrt(e*e+i*i);return e*=n,i*=n,new h.DoublePoint(i,-e)};h.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,h.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==h.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=h.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*h.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*h.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(h.ClipperOffset.two_pi/n),this.m_cos=Math.cos(h.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/h.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||e.m_endtype!=h.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(e.m_jointype==h.JoinType.jtRound)for(var a=1,l=0,c=1;c<=n;c++){this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+l*r)));var u=a;a=a*this.m_cos-this.m_sin*l,l=u*this.m_sin+l*this.m_cos}else for(var a=-1,l=-1,c=0;c<4;++c)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+l*r))),a<0?a=1:l<0?l=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<o-1;c++)this.m_normals.push(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(e.m_endtype==h.EndType.etClosedLine||e.m_endtype==h.EndType.etClosedPolygon?this.m_normals.push(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new h.DoublePoint(this.m_normals[o-2])),e.m_endtype==h.EndType.etClosedPolygon){for(var d=o-1,c=0;c<o;c++)d=this.OffsetPoint(c,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==h.EndType.etClosedLine){for(var d=o-1,c=0;c<o;c++)d=this.OffsetPoint(c,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[o-1],c=o-1;c>0;c--)this.m_normals[c]=new h.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new h.DoublePoint(-m.X,-m.Y),d=0;for(var c=o-1;c>=0;c--)d=this.OffsetPoint(c,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,c=1;c<o-1;++c)d=this.OffsetPoint(c,d,e.m_jointype);var y;if(e.m_endtype==h.EndType.etOpenButt){var c=o-1;y=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*r),h.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*r)),this.m_destPoly.push(y),y=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*r),h.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*r)),this.m_destPoly.push(y)}else{var c=o-1;d=o-2,this.m_sinA=0,this.m_normals[c]=new h.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(c,d):this.DoRound(c,d)}for(var c=o-1;c>0;c--)this.m_normals[c]=new h.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new h.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),d=o-1;for(var c=d-1;c>0;--c)d=this.OffsetPoint(c,d,e.m_jointype);e.m_endtype==h.EndType.etOpenButt?(y=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(y),y=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(y)):(d=1,this.m_sinA=0,e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};h.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof h.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new h.Clipper(0);if(n.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var o=h.Clipper.GetBounds(this.m_destPolys),a=new h.Path;if(a.push(new h.IntPoint(o.left-10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.top-10)),a.push(new h.IntPoint(o.left-10,o.top-10)),n.AddPath(a,h.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var l=e.Childs()[0];e.Childs()[0]=l.Childs()[0];for(var c=1;c<l.ChildCount();c++)e.AddChild(l.Childs()[c])}else e.Clear()}}else{var e=r[0],i=r[1];h.Clear(e),this.FixOrientations(),this.DoOffset(i);var n=new h.Clipper(0);if(n.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var o=h.Clipper.GetBounds(this.m_destPolys),a=new h.Path;a.push(new h.IntPoint(o.left-10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.bottom+10)),a.push(new h.IntPoint(o.right+10,o.top-10)),a.push(new h.IntPoint(o.left-10,o.top-10)),n.AddPath(a,h.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};h.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new h.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case h.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case h.JoinType.jtSquare:this.DoSquare(r,t);break;case h.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};h.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};h.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),h.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};h.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=h.Cast_Int32(h.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),n=this.m_normals[t].X,o=this.m_normals[t].Y,a,l=0;l<i;++l)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};h.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};h.JS={};h.JS.AreaOfPolygon=function(r,t){return t||(t=1),h.Clipper.Area(r)/(t*t)};h.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=h.Clipper.Area(r[i]);return e/(t*t)};h.JS.BoundsOfPath=function(r,t){return h.JS.BoundsOfPaths([r],t)};h.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=h.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};h.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=h.JS.Clone(i);if(typeof t!="number"||t===null)return h.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var n=i.length,o,a,l,c,u,d,m,y=[],g=0;g<n;g++)if(a=i[g],o=a.length,o!==0){if(o<3){l=a,y.push(l);continue}for(l=a,c=t*t,u=a[0],d=1,m=1;m<o;m++)(a[m].X-u.X)*(a[m].X-u.X)+(a[m].Y-u.Y)*(a[m].Y-u.Y)<=c||(l[d]=a[m],u=a[m],d++);u=a[d-1],(a[0].X-u.X)*(a[0].X-u.X)+(a[0].Y-u.Y)*(a[0].Y-u.Y)<=c&&d--,d<o&&l.splice(d,o-d),l.length&&y.push(l)}return!e&&y.length?y=y[0]:!e&&y.length===0?y=[]:e&&y.length===0&&(y=[[]]),y};h.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,n,o,a,l=new Array(e);for(n=0;n<e;n++){for(i=r[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:r[n][o].X,Y:r[n][o].Y};l[n]=a}return t||(l=l[0]),l};h.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return h.Error("Tolerance is not a number in Lighten()."),h.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return h.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,n,o,a,l,c,u,d,m,y,g,x,T,v,b,P,I=r.length,w=t*t,_=[];for(e=0;e<I;e++)if(n=r[e],l=n.length,l!=0){for(o=0;o<1e6;o++){for(a=[],l=n.length,n[l-1].X!=n[0].X||n[l-1].Y!=n[0].Y?(g=1,n.push({X:n[0].X,Y:n[0].Y}),l=n.length):g=0,y=[],i=0;i<l-2;i++)c=n[i],d=n[i+1],u=n[i+2],b=c.X,P=c.Y,x=u.X-b,T=u.Y-P,(x!==0||T!==0)&&(v=((d.X-b)*x+(d.Y-P)*T)/(x*x+T*T),v>1?(b=u.X,P=u.Y):v>0&&(b+=x*v,P+=T*v)),x=d.X-b,T=d.Y-P,m=x*x+T*T,m<=w&&(y[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<l-1;i++)y[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[l-1].X,Y:n[l-1].Y}),g&&n.pop(),y.length)n=a;else break}l=a.length,a[l-1].X==a[0].X&&a[l-1].Y==a[0].Y&&a.pop(),a.length>2&&_.push(a)}return!r[0]instanceof Array&&(_=_[0]),typeof _>"u"&&(_=[[]]),_};h.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,l=0,c=0,u=0,d=0,m=r.length;if(m<2)return 0;for(t&&(r[m]=r[0],m++);--m;)o=r[m],l=o.X,c=o.Y,a=r[m-1],u=a.X,d=a.Y,n+=i((l-u)*(l-u)+(c-d)*(c-d));return t&&r.pop(),n/e};h.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,n=0;n<r.length;n++)i+=h.JS.PerimeterOfPath(r[n],t,e);return i};h.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};h.JS.ScaleDownPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=n.X/t,n.Y=n.Y/t};h.JS.ScaleUpPath=function(r,t){var e,i,n=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=n(i.X*t),i.Y=n(i.Y*t)};h.JS.ScaleUpPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=o(n.X*t),n.Y=o(n.Y*t)};h.ExPolygons=function(){return[]};h.ExPolygon=function(){this.outer=null,this.holes=null};h.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new h.ExPolygon;e.outer=r.Contour();var i=r.Childs(),n=i.length;e.holes=new Array(n);var o,a,l,c,u,d;for(l=0;l<n;l++)for(o=i[l],e.holes[l]=o.Contour(),c=0,u=o.Childs(),d=u.length;c<d;c++)a=u[c],h.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(e)};h.JS.ExPolygonsToPaths=function(r){var t,e,i,n,o=new h.Paths;for(t=0,i=r.length;t<i;t++)for(o.push(r[t].outer),e=0,n=r[t].holes.length;e<n;e++)o.push(r[t].holes[e]);return o};h.JS.PolyTreeToExPolygons=function(r){var t=new h.ExPolygons,e,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)e=n[i],h.JS.AddOuterPolyNodeToExPolygons(e,t);return t};au.exports=h});var y6=G((Fie,hm)=>{f();(function(){"use strict";function r(a,l){var c=a.x-l.x,u=a.y-l.y;return c*c+u*u}function t(a,l,c){var u=l.x,d=l.y,m=c.x-u,y=c.y-d;if(m!==0||y!==0){var g=((a.x-u)*m+(a.y-d)*y)/(m*m+y*y);g>1?(u=c.x,d=c.y):g>0&&(u+=m*g,d+=y*g)}return m=a.x-u,y=a.y-d,m*m+y*y}function e(a,l){for(var c=a[0],u=[c],d,m=1,y=a.length;m<y;m++)d=a[m],r(d,c)>l&&(u.push(d),c=d);return c!==d&&u.push(d),u}function i(a,l,c,u,d){for(var m=u,y,g=l+1;g<c;g++){var x=t(a[g],a[l],a[c]);x>m&&(y=g,m=x)}m>u&&(y-l>1&&i(a,l,y,u,d),d.push(a[y]),c-y>1&&i(a,y,c,u,d))}function n(a,l){var c=a.length-1,u=[a[0]];return i(a,0,c,l,u),u.push(a[c]),u}function o(a,l,c){if(a.length<=2)return a;var u=l!==void 0?l*l:1;return a=c?a:e(a,u),a=n(a,u),a}typeof define=="function"&&define.amd?define(function(){return o}):typeof hm<"u"?(hm.exports=o,hm.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});f();f();f();f();f();f();var Kp="[MappedinJS]",Sv=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))(Sv||{});function L6(r){0<=r&&r<=3&&(Tv.logState=r)}var Tv={logState:S.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(Kp,...r)},warn(...r){this.logState<=1&&console.warn(Kp,...r)},error(...r){this.logState<=2&&console.error(Kp,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,t){throw new Error("".concat(Kp," ").concat(r),t)}},O=Tv;f();f();var Mo=class extends Error{};Mo.prototype.name="InvalidTokenError";function A6(r){return decodeURIComponent(atob(r).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}function k6(r){let t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return A6(t)}catch{return atob(t)}}function Mv(r,t){if(typeof r!="string")throw new Mo("Invalid token specified: must be a string");t||(t={});let e=t.header===!0?0:1,i=r.split(".")[e];if(typeof i!="string")throw new Mo("Invalid token specified: missing part #".concat(e+1));let n;try{n=k6(i)}catch(o){throw new Mo("Invalid token specified: invalid base64 for part #".concat(e+1," (").concat(o.message,")"))}try{return JSON.parse(n)}catch(o){throw new Mo("Invalid token specified: invalid json for part #".concat(e+1," (").concat(o.message,")"))}}function ed(r){var e,i;let t=Mv(r);if(t.sub==null)throw new Error("Access token is missing sub claim.");return{sub:t.sub,aud:typeof t.aud=="string"?[t.aud]:(e=t.aud)!=null?e:[],capabilities:(i=t.capabilities)!=null?i:{}}}function En(r){return r*(Math.PI/180)}function F6(r){return r*(180/Math.PI)}function Pv(r,t){return(r%t+t)%t}function td([r,t],[e,i]){let n=En(i-t),o=En(e-r),a=En(t),l=En(i),c=Math.sin(n/2)*Math.sin(n/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(l),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Pl*u}function Iv([r,t],[e,i]){let n=En(t),o=En(r),a=En(i),c=En(e)-o,u=Math.sin(c)*Math.cos(a),d=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(c);return F6((Math.atan2(u,d)+Math.PI*2)%(Math.PI*2))}function rd(r,t){let e=Pv(r,Math.PI*2),i=Pv(t,Math.PI*2),n=i-e,o=i+(n>Math.PI?-Math.PI*2:n<-Math.PI?Math.PI*2:0);return{start:e,end:o}}f();function wv(r,t,e=!1){let i=null,n=0;return function(...o){n++,n===1&&e===!0&&r(...o);let a=()=>{(!e||n>1)&&r(...o),i=null,n=0};clearTimeout(i),i=setTimeout(a,t)}}f();var z=class{constructor(){p(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach(function(i){typeof i=="function"&&i(e)})}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||this._subscribers[t]==null)return;let i=this._subscribers[t].indexOf(e);i!==-1&&this._subscribers[t].splice(i,1)}destroy(){this._subscribers={}}};f();var Ev="mi-session-data",_v="mi-local-data",Po,xr,Cr,id=class id{constructor(){C(this,xr,void 0);C(this,Cr,void 0);try{let t=sessionStorage.getItem(Ev);t?M(this,xr,JSON.parse(t)):M(this,xr,{id:ce()})}catch{M(this,xr,{id:ce()})}try{let t=localStorage.getItem(_v);t?M(this,Cr,JSON.parse(t)):M(this,Cr,{deviceId:ce()})}catch{M(this,Cr,{deviceId:ce()})}s(this,xr).id||(s(this,xr).id=ce()),s(this,Cr).deviceId||(s(this,Cr).deviceId=ce())}static getInstance(){return s(this,Po)||M(this,Po,new id),s(this,Po)}static ___clearInstance(){M(this,Po,void 0)}saveSessionData(t,e){s(this,xr)[t]=e;try{return sessionStorage.setItem(Ev,JSON.stringify(s(this,xr))),!0}catch{return!1}}loadSessionData(t){let e=s(this,xr)[t];if(e!=null)return e}saveLocalData(t,e){s(this,Cr)[t]=e;try{return localStorage.setItem(_v,JSON.stringify(s(this,Cr))),!0}catch{return!1}}loadLocalData(t){let e=s(this,Cr)[t];if(e!=null)return e}};Po=new WeakMap,xr=new WeakMap,Cr=new WeakMap,C(id,Po,void 0);var Bi=id;f();f();var _l=r=>r!=null;var B6=function(){let t=globalThis.fetch;return{fetch(...e){if(!_l(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}}(),Dv=B6.fetch;var kv=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],Ov=kv[0],Fv="https://api-gateway.mappedin.com/track-analytics/a/",Bv="deny-watchposition",Rv="load-mapview",Nv="load-mapdata",Gv="change-language",Vv="query-directions";var Ri,Sr,qa,nd,$a=class{constructor(){C(this,qa);C(this,Ri,Object.freeze({}));C(this,Sr,void 0);p(this,"oneTimeEventsSent",new Set);p(this,"sendGetDirectionsEvent",wv((t,e)=>this.sendAnalyticEvent(Vv,{start:t,end:e,type:"location_to_location"}),2500));M(this,Sr,V(this,qa,nd).call(this,s(this,Ri)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){M(this,Ri,{}),M(this,Sr,V(this,qa,nd).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return M(this,Ri,Object.freeze(Object.assign({},s(this,Ri),t))),M(this,Sr,V(this,qa,nd).call(this,t)),s(this,Sr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=_m({...s(this,Sr),mapId:e.mapId})),e.context&&(e.context=Av(e.context)),e.baseUri&&(e.analyticsBaseUrl=_m({baseUri:e.baseUri,mapId:s(this,Sr).mapId})),Object.assign(s(this,Sr),e),this.handleStateUpdate(t)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:i}=this.getState();return!!(t&&e)||!!i}getState(){return s(this,Sr)}getContext(){return this.getState().context||s(this,Ri).context||Ov}getSessionId(){return this.getState().sessionId||s(this,Ri).sessionId||Lv()}sendAnalyticEvent(t,e={}){let i=this.getState(),n=N6(i.analyticsBaseUrl,t),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&O.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return O.warn("Auth needs to be ready to send analytics.");let a={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(a,i.userPosition),o["Content-Type"]="application/json",i.accessToken?o.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(o["x-mappedin-key"]=btoa(i.key),o["x-mappedin-secret"]=btoa(i.secret)),Dv(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(t,e){if(V6.includes(t))return O.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=G6.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(Nv,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(Gv,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Bv)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(Rv,{type:"3d",firstRenderDuration:t,width:e.width,height:e.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Ri=new WeakMap,Sr=new WeakMap,qa=new WeakSet,nd=function(t){var i,n,o,a;let e=(i=t.baseUri)!=null?i:Fv;return{baseUri:e,analyticsBaseUrl:_m({...t,baseUri:e}),version:((n=S==null?void 0:S.env)==null?void 0:n.npm_package_version)||"v6",deviceId:t.deviceId||R6(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Lv(),platformString:t.platformString||"",context:Av(t.context)||Ov,geolocationMode:!1,sendEvents:(o=t.sendEvents)!=null?o:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}};function _m({mapId:r,baseUri:t=Fv}){return"".concat(t).concat(r,"/")}function R6(){return Bi.getInstance().loadLocalData("deviceId")}function Lv(){return Bi.getInstance().loadSessionData("id")}function N6(r,t){return r+t}function Av(r){return kv.find(t=>t===r)}var G6=["$select-location","$select-category","$query-suggest","$query-search"],V6=[Rv,Nv,Vv,Bv,Gv],qA=new $a,Ni,Dl=class{constructor(t){C(this,Ni,void 0);p(this,"capture");p(this,"updateState");M(this,Ni,t),this.capture=s(this,Ni).capture.bind(s(this,Ni)),this.updateState=s(this,Ni).updateState.bind(s(this,Ni))}getState(){return Object.assign({},s(this,Ni).getState())}};Ni=new WeakMap;f();f();var Ll,Al,kl,Ol=class{constructor(t,e,{enabled:i=!1}={}){C(this,Ll,void 0);p(this,"searchInstance");C(this,Al,void 0);C(this,kl,void 0);p(this,"enabled",!1);M(this,Ll,t),M(this,Al,e),M(this,kl,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return O.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return O.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-D52X6FJE.js").then(({InternalSearch:t})=>new t(s(this,Ll)))),s(this,Al).on("language-change",s(this,kl)),await this.searchInstance)}};Ll=new WeakMap,Al=new WeakMap,kl=new WeakMap;var jv=new WeakMap,$e,Dm=class extends z{constructor(e,{search:i}={}){super();C(this,$e,void 0);p(this,"Analytics");p(this,"Search");p(this,"Query");p(this,"getDirections",(e,i,n)=>s(this,$e).getDirections(e,i,n));p(this,"getDirectionsMultiDestination",(e,i,n)=>s(this,$e).getDirectionsMultiDestination(e,i,n));M(this,$e,e),jv.set(this,e),this.Analytics=new Dl(e.Analytics),this.Query=e.Query,this.Search=new Ol(this,e,{enabled:i==null?void 0:i.enabled}),s(this,$e).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,$e).getEnv()}get mapName(){return s(this,$e).mapName}get mapCenter(){return s(this,$e).mapCenter}get organizationId(){return s(this,$e).organizationId}get outdoorViewToken(){return s(this,$e).outdoorViewToken}getByType(e){return s(this,$e).getByType(e)}getById(e,i){return s(this,$e).getById(e,i)}async changeLanguage(e){return s(this,$e).changeLanguage(e)}get currentLanguage(){return s(this,$e).currentLanguage}getDistance(e,i){return s(this,$e).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return s(this,$e).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return s(this,$e).toJSONBundle({downloadLanguagePacks:e})}};$e=new WeakMap;var od=Dm;function Ja(r){let t=jv.get(r);if(!t)throw new Error("MapDataInternal not found");return t}f();f();f();f();var Hv=globalThis.fetch,Xv,j6=(Xv=S==null?void 0:S.env)==null?void 0:Xv.npm_package_version,Lm="https://app.mappedin.com/",H6="https://auth.mappedin.com/",Uv="accessTokens",Wv="sasTokens";function Gi(){if(Hv==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Hv}var Yv={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function zv(r){var e;let t={...Yv,...r};return t.headers={...t.headers,"mappedin-sdk-version":j6},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}function U6(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language;let{headers:n}=r;n["Content-Type"]=n["Content-Type"]||"text/json",r.accessToken?n.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(n["x-mappedin-key"]=btoa(r.clientId),n["x-mappedin-secret"]=btoa(r.clientSecret));let o={method:"GET",headers:n};return r.secure&&(t+="&withcdntoken"),{req:o,url:t}}async function W6(r,t,e=!1){let i=U6(r,t,e),n=await Gi()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}async function Z6(r,t="exports/mvf/1/bundle"){var o;let e=zv({baseUri:"https://api-gateway.mappedin.com/",...Yv,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((o=e.version)!=null?o:"2.0.0");return e.headers["Content-Type"]="application/zip",await W6(e,i)}var Om=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function Am(r,{signal:t}){let e=await(await Gi()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}async function Qa(r){let e=(await import("./browser-WPSSSHWP.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let n=e["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(Om().decode(n)));let o=e["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(Om().decode(o)))}return e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Om().decode(e["manifest.json"]))),i}async function qv(r,{signal:t}){try{let e=await(await Gi()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Qa(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}async function km(r){return new Promise(async(t,e)=>{try{let{url:i,locale_packs:n}=await Z6(r,"exports/mvf2/1/bundle"),o=await Gi()(i).then(l=>l.arrayBuffer()),a=new Uint8Array(o);t({compressed:a,localePacks:n})}catch(i){e(i)}})}async function Fm(r,t){return new Promise(async(e,i)=>{try{let{url:n}=await X6(r,t),o=await Gi()(n).then(l=>l.arrayBuffer()),a=new Uint8Array(o);e(a)}catch(n){i(n)}})}function Bm(r){return r.endsWith("/")?r:"".concat(r,"/")}async function X6(r,t){let e="".concat(r.baseUri?Bm(r.baseUri):Lm,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Gi()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}async function Fl(r,t=!1){let e="".concat(r.key),i=Bi.getInstance(),n=(i==null?void 0:i.loadSessionData(Uv))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&o<n[e].expiresTimestamp)return n[e];let a=t?await Y6(r,o):await z6(r,o),l={...n,[e]:a};return i==null||i.saveSessionData(Uv,l),a}async function Y6(r,t){var o;let e="".concat((o=r.baseAuthUri)!=null?o:H6,"oauth2/token"),i=await Gi()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}async function z6(r,t){let e="".concat(r.baseAuthUri?Bm(r.baseAuthUri):Lm,"api/api-key/token"),i=await Gi()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}function ad(r){var i,n,o,a,l,c,u,d;let t=new TextDecoder,e=t.decode.bind(t);try{let m={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{}};if(r.enterprise!=null&&(m.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(m.enterprise.locations=JSON.parse(e((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(m.enterprise.categories=JSON.parse(e((a=r.enterprise)==null?void 0:a["categories.json"]))),(l=r.enterprise)!=null&&l["venue.json"]&&(m.enterprise.venue=JSON.parse(e((c=r.enterprise)==null?void 0:c["venue.json"]))),(u=r.enterprise)!=null&&u["locationInstances.json"]&&(m.enterprise.locationInstances=JSON.parse(e((d=r.enterprise)==null?void 0:d["locationInstances.json"])))),r["floorstack.json"]!=null?m["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(m["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),m["floorstack.json"]==null&&m["mapstack.json"]==null&&m["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(m["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),m["floor.geojson"]==null&&m["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(m["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(m["shapes.json"]=JSON.parse(e(r["shapes.json"]))),r.annotation!=null){m.annotation={};let g=Object.keys(r.annotation);for(let x of g){let T=x.replace(/\.json|\.geojson/g,"");m.annotation[T]=JSON.parse(e(r.annotation[x]))}}let y=Object.keys(r.space);for(let g of y){let x=g.replace(/\.json|\.geojson/g,"");m.space[x]=JSON.parse(e(r.space[g]))}if(r.obstruction!=null){let g=Object.keys(r.obstruction);for(let x of g){let T=x.replace(/\.json|\.geojson/g,"");m.obstruction[T]=JSON.parse(e(r.obstruction[x]))}}else m.obstruction={};if(r.entrance!=null){let g=Object.keys(r.entrance);for(let x of g){let T=x.replace(/\.json|\.geojson/g,"");m.entrance[T]=JSON.parse(e(r.entrance[x]))}}else m.entrance={};if("floorImages"in r&&r.floorImages!=null){m.floorImages={};for(let g of Object.keys(r.floorImages)){let x=g.replace(/\.json|\.geojson/g,"");m.floorImages[x]=JSON.parse(e(r.floorImages[g]))}}if("textAreas"in r&&r.textAreas!=null){m.textAreas={};for(let g of Object.keys(r.textAreas)){let x=g.replace(/\.json|\.geojson/g,"");m.textAreas[x]=JSON.parse(e(r.textAreas[g]))}}if("facade"in r&&r.facade!=null){m.facade={};for(let g of Object.keys(r.facade)){let x=g.replace(/\.json|\.geojson/g,"");m.facade[x]=JSON.parse(e(r.facade[g]))}}if("area"in r&&r.area!=null){m.area={};for(let g of Object.keys(r.area)){let x=g.replace(/\.json|\.geojson/g,"");m.area[x]=JSON.parse(e(r.area[g]))}}return m}catch(m){throw O.error(m),new Error("MVF parsing failed! Probably encountered a bad file.")}}function q6(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function sd(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let n=(await import("./browser-WPSSSHWP.js")).unzipSync(r);if(!q6(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let l of a){if(n[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){o[c[0]]=n[l];continue}if(c[0]==="image"){O.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[c[0]]==null&&(o[c[0]]={}),o[c[0]][c[1]]=n[l]}t(o)}catch(i){e(i)}})}async function ld(r,t){let e="".concat(t),i=Bi.getInstance(),n=(i==null?void 0:i.loadSessionData(Wv))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&o<n[e].expires)return n[e];let a=await $6(r,t),l={...n,[e]:{token:a.token,expires:o+new Date(a.expires).getTime()/1e3}};return i==null||i.saveSessionData(Wv,l),a}async function $6(r,t){let e="".concat(r.baseAuthUri?Bm(r.baseAuthUri):Lm,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Gi()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}function Io(){let r="us",t={};function e(){return K6(tT(r),t)}return{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(t.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?Zv.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?Zv.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}var $v=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Zv=Object.freeze({...$v,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),J6=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),Q6=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function K6(r,t){return{...r,...t}}var eT={eu:J6,us:$v,"us-staging":Q6};function tT(r){return eT[r]}f();f();f();f();var mt=63710088e-1,Jv={centimeters:mt*100,centimetres:mt*100,degrees:mt/111325,feet:mt*3.28084,inches:mt*39.37,kilometers:mt/1e3,kilometres:mt/1e3,meters:mt,metres:mt,miles:mt/1609.344,millimeters:mt*1e3,millimetres:mt*1e3,nauticalmiles:mt/1852,radians:1,yards:mt*1.0936},xk={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/mt,yards:1.0936133};function _n(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function Tr(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Rm(r[0])||!Rm(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return _n(i,t,e)}function Vi(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return _n(i,t,e)}function Bl(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Qv(r,t){t===void 0&&(t="kilometers");var e=Jv[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Kv(r,t){t===void 0&&(t="kilometers");var e=Jv[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Rl(r){var t=r%(2*Math.PI);return t*180/Math.PI}function kt(r){var t=r%360;return t*Math.PI/180}function Rm(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function ur(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function zt(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function eb(r){return r.type==="Feature"?r.geometry:r}function tb(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function rT(r,t,e){e===void 0&&(e={});for(var i=ur(r),n=zt(t),o=0;o<n.length-1;o++){var a=!1;if(e.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),iT(n[o],n[o+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function iT(r,t,e,i,n){var o=e[0],a=e[1],l=r[0],c=r[1],u=t[0],d=t[1],m=e[0]-l,y=e[1]-c,g=u-l,x=d-c,T=m*x-y*g;if(n!==null){if(Math.abs(T)>n)return!1}else if(T!==0)return!1;if(i){if(i==="start")return Math.abs(g)>=Math.abs(x)?g>0?l<o&&o<=u:u<=o&&o<l:x>0?c<a&&a<=d:d<=a&&a<c;if(i==="end")return Math.abs(g)>=Math.abs(x)?g>0?l<=o&&o<u:u<o&&o<=l:x>0?c<=a&&a<d:d<a&&a<=c;if(i==="both")return Math.abs(g)>=Math.abs(x)?g>0?l<o&&o<u:u<o&&o<l:x>0?c<a&&a<d:d<a&&a<c}else return Math.abs(g)>=Math.abs(x)?g>0?l<=o&&o<=u:u<=o&&o<=l:x>0?c<=a&&a<=d:d<=a&&a<=c;return!1}var rb=rT;f();f();f();function cd(r,t,e){if(r!==null)for(var i,n,o,a,l,c,u,d=0,m=0,y,g=r.type,x=g==="FeatureCollection",T=g==="Feature",v=x?r.features.length:1,b=0;b<v;b++){u=x?r.features[b].geometry:T?r.geometry:r,y=u?u.type==="GeometryCollection":!1,l=y?u.geometries.length:1;for(var P=0;P<l;P++){var I=0,w=0;if(a=y?u.geometries[P]:u,a!==null){c=a.coordinates;var _=a.type;switch(d=e&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,m,b,I,w)===!1)return!1;m++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],m,b,I,w)===!1)return!1;m++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-d;n++){if(t(c[i][n],m,b,I,w)===!1)return!1;m++}_==="MultiLineString"&&I++,_==="Polygon"&&w++}_==="Polygon"&&I++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-d;o++){if(t(c[i][n][o],m,b,I,w)===!1)return!1;m++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(cd(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Nm(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function nT(r,t){var e,i,n,o,a,l,c,u,d,m,y=0,g=r.type==="FeatureCollection",x=r.type==="Feature",T=g?r.features.length:1;for(e=0;e<T;e++){for(l=g?r.features[e].geometry:x?r.geometry:r,u=g?r.features[e].properties:x?r.properties:{},d=g?r.features[e].bbox:x?r.bbox:void 0,m=g?r.features[e].id:x?r.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(t(null,y,u,d,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,y,u,d,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],y,u,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function Nl(r,t){nT(r,function(e,i,n,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(_n(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],m={type:c,coordinates:d};if(t(_n(m,n),i,u)===!1)return!1}})}function oT(r,t){Nl(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,u=0,d=0;if(cd(e,function(m,y,g,x,T){if(l===void 0||i>c||x>u||T>d){l=m,c=i,u=x,d=T,o=0;return}var v=Vi([l,m],e.properties);if(t(v,i,n,T,o)===!1)return!1;o++,l=m})===!1)return!1}}})}function ib(r,t,e){var i=e,n=!1;return oT(r,function(o,a,l,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,l,c,u),n=!0}),i}function Gm(r){var t=[1/0,1/0,-1/0,-1/0];return cd(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Gm.default=Gm;var ud=Gm;function aT(r,t){t===void 0&&(t={});var e=ud(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Tr([i,n],t.properties,t)}var pd=aT;f();f();function sT(r,t,e){e===void 0&&(e={});var i=ur(r),n=ur(t),o=kt(n[1]-i[1]),a=kt(n[0]-i[0]),l=kt(i[1]),c=kt(n[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return Qv(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}var Dn=sT;function dd(r,t){return t===void 0&&(t={}),ib(r,function(e,i){var n=i.geometry.coordinates;return e+Dn(n[0],n[1],t)},0)}f();f();f();function hd(r,t,e){if(e===void 0&&(e={}),e.final===!0)return lT(r,t);var i=ur(r),n=ur(t),o=kt(i[0]),a=kt(n[0]),l=kt(i[1]),c=kt(n[1]),u=Math.sin(a-o)*Math.cos(c),d=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-o);return Rl(Math.atan2(u,d))}function lT(r,t){var e=hd(t,r);return e=(e+180)%360,e}f();function wo(r,t,e,i){i===void 0&&(i={});var n=ur(r),o=kt(n[0]),a=kt(n[1]),l=kt(e),c=Kv(t,i.units),u=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),d=o+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(u)),m=Rl(d),y=Rl(u);return Tr([m,y],i.properties)}f();f();function cT(r){if(!r)throw new Error("geojson is required");var t=[];return Nl(r,function(e){uT(e,t)}),Bl(t)}function uT(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=zt(i);break;case"LineString":e=[zt(i)]}e.forEach(function(n){var o=pT(n,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}function pT(r,t){var e=[];return r.reduce(function(i,n){var o=Vi([i,n],t);return o.bbox=dT(i,n),e.push(o),n}),e}function dT(r,t){var e=r[0],i=r[1],n=t[0],o=t[1],a=e<n?e:n,l=i<o?i:o,c=e>n?e:n,u=i>o?i:o;return[a,l,c,u]}var Vm=cT;var d4=Ml(u4(),1);function FP(r,t){var e={},i=[];if(r.type==="LineString"&&(r=_n(r)),t.type==="LineString"&&(t=_n(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var n=p4(r,t);return n&&i.push(n),Bl(i)}var o=(0,d4.default)();return o.load(Vm(t)),Nm(Vm(r),function(a){Nm(o.search(a),function(l){var c=p4(a,l);if(c){var u=zt(c).join(",");e[u]||(e[u]=!0,i.push(c))}})}),Bl(i)}function p4(r,t){var e=zt(r),i=zt(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=e[0][0],o=e[0][1],a=e[1][0],l=e[1][1],c=i[0][0],u=i[0][1],d=i[1][0],m=i[1][1],y=(m-u)*(a-n)-(d-c)*(l-o),g=(d-c)*(o-u)-(m-u)*(n-c),x=(a-n)*(o-u)-(l-o)*(n-c);if(y===0)return null;var T=g/y,v=x/y;if(T>=0&&T<=1&&v>=0&&v<=1){var b=n+T*(a-n),P=o+T*(l-o);return Tr([b,P])}return null}var h4=FP;function BP(r,t,e){e===void 0&&(e={});var i=Tr([1/0,1/0],{dist:1/0}),n=0;return Nl(r,function(o){for(var a=zt(o),l=0;l<a.length-1;l++){var c=Tr(a[l]);c.properties.dist=Dn(t,c,e);var u=Tr(a[l+1]);u.properties.dist=Dn(t,u,e);var d=Dn(c,u,e),m=Math.max(c.properties.dist,u.properties.dist),y=hd(c,u),g=wo(t,m,y+90,e),x=wo(t,m,y-90,e),T=h4(Vi([g.geometry.coordinates,x.geometry.coordinates]),Vi([c.geometry.coordinates,u.geometry.coordinates])),v=null;T.features.length>0&&(v=T.features[0],v.properties.dist=Dn(t,v,e),v.properties.location=n+Dn(c,v,e)),c.properties.dist<i.properties.dist&&(i=c,i.properties.index=l,i.properties.location=n),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=l+1,i.properties.location=n+d),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=l),n+=d}}),i}var tc=BP;function RP(r,t,e){var i=zt(e);if(tb(e)!=="LineString")throw new Error("line must be a LineString");var n=tc(e,r),o=tc(e,t),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(i[c]);return l.push(a[1].geometry.coordinates),Vi(l,e.properties)}var wg=RP;var NP=1e-7;function Eg(r){return{type:"Point",coordinates:r}}function GP(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,n=e.map(o=>tc(r,Eg(o)));return i.reduce((o,a)=>{let l=wg(Eg(a),n[0],r),c=wg(Eg(a),n[1],r),u=dd(l)<dd(c)?l:c;return u.properties={...r.properties,entrances:[]},o.concat([u])},[])}function _g(r,t){return t.reduce((e,i)=>{let n={epsilon:NP},o=e.obstructions.findIndex(l=>rb(pd(i),l,n)),a=e.obstructions[o];if(a){let[l,c]=GP(a,i);e.entrances.push(i),e.obstructions.splice(o,1,l,c)}return e},{obstructions:[r],entrances:[]})}f();f();f();var rc=class rc{constructor(t,e,i){p(this,"__type",rc.__type);p(this,"id",ce());p(this,"latitude");p(this,"longitude");p(this,"floorId");this.latitude=t,this.longitude=e,this.floorId=i}static is(t){return t.__type===rc.__type}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};p(rc,"__type","coordinate");var Dg=rc,ae=Dg;f();var yt=class{constructor(t){p(this,"id");this.id=t}};var Rn,gt,Oo,Lo,ic=class ic extends yt{constructor(e,i){super(i.mvfData.properties.id);p(this,"__type",ic.__type);C(this,Rn,void 0);C(this,gt,{});C(this,Oo,void 0);C(this,Lo,void 0);M(this,Rn,e),M(this,Oo,i.floorId),M(this,Lo,i.mvfData)}static is(e){return e.__type===ic.__type}get locations(){return s(this,gt).locations?s(this,gt).locations:(s(this,gt).locations=(s(this,Rn).locationIdsByNodeId[this.id]||[]).map(e=>s(this,Rn).getById("enterprise-location",e)).filter(Boolean),s(this,gt).locations)}get floor(){let e=s(this,Rn).getById("floor",s(this,Oo));if(e==null)throw new Error("Floor ".concat(s(this,Oo)," not found!"));return e}get coordinate(){if(s(this,gt).coordinate==null){let[e,i]=s(this,Lo).geometry.coordinates;s(this,gt).coordinate=new ae(i,e,s(this,Oo))}return s(this,gt).coordinate}get externalId(){var e;return(e=s(this,Lo).properties.externalId)!=null?e:""}get neighbors(){if(s(this,gt).neighbours==null){let e=s(this,Lo).properties.neighbors.map(i=>{let n=s(this,Rn).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,gt).neighbours=e}return s(this,gt).neighbours}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,gt)))delete s(this,gt)[e]}};Rn=new WeakMap,gt=new WeakMap,Oo=new WeakMap,Lo=new WeakMap,p(ic,"__type","node");var Og=ic,ii=Og;f();f();f();f();var nc,us,uh=class uh extends yt{constructor(e){super(String(ce()));C(this,nc,{});C(this,us,void 0);M(this,us,e.mvfData)}static is(e){return e.__type===uh.__type}get url(){return s(this,us).url}get name(){return s(this,us).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,nc)))delete s(this,nc)[e]}};nc=new WeakMap,us=new WeakMap,p(uh,"__type","hyperlink");var Lg=uh,ph=Lg;f();var oc,Ao,dh=class dh extends yt{constructor(e){super(String(ce()));C(this,oc,{});C(this,Ao,void 0);M(this,Ao,e.mvfData)}static is(e){return e.__type===dh.__type}get url(){return s(this,Ao).url}get name(){return s(this,Ao).altText}get altText(){return s(this,Ao).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(s(this,oc)))delete s(this,oc)[e]}};oc=new WeakMap,Ao=new WeakMap,p(dh,"__type","image");var Ag=dh,hh=Ag;var Fe=class{constructor(t,e,i){p(this,"id");p(this,"links");p(this,"images");var n,o,a,l;this.id=t,this.links=(o=(n=i==null?void 0:i.links)==null?void 0:n.map(c=>new ph({mvfData:c})))!=null?o:[],this.images=(l=(a=i==null?void 0:i.images)==null?void 0:a.map(c=>new hh({mvfData:{...c,url:e.sasToken?c.url+"?".concat(e.sasToken):c.url}})))!=null?l:[]}};var sc,ko,ps,Nn,ac=class ac extends Fe{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);p(this,"__type",ac.__type);C(this,sc,void 0);C(this,ko,void 0);C(this,ps,{});C(this,Nn,void 0);M(this,sc,e),M(this,ko,i.floorId),M(this,Nn,i.mvfData)}static is(e){return e.__type===ac.__type}get name(){var e,i;return(i=(e=s(this,Nn).properties.details)==null?void 0:e.name)!=null?i:""}get externalId(){var e;return(e=s(this,Nn).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,Nn).properties.details)==null?void 0:e.description)!=null?i:""}get center(){var e;if(s(this,ps).center==null){let[i,n]=(e=s(this,Nn).properties.center)!=null?e:[0,0];s(this,ps).center=new ae(n,i,s(this,ko))}return s(this,ps).center}get floor(){let e=s(this,sc).getById("floor",s(this,ko));if(e==null)throw new Error("Floor ".concat(s(this,ko)," not found!"));return e}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};sc=new WeakMap,ko=new WeakMap,ps=new WeakMap,Nn=new WeakMap,p(ac,"__type","area");var kg=ac,Wi=kg;f();var Fo,Zi,Bo,ni,lc=class lc extends Fe{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);p(this,"__type",lc.__type);C(this,Fo,void 0);C(this,Zi,void 0);C(this,Bo,void 0);C(this,ni,void 0);M(this,Zi,{}),M(this,ni,i.mvfData),M(this,Fo,e),M(this,Bo,i.floorId)}static is(e){return e.__type===lc.__type}get name(){var e,i,n;return"details"in s(this,ni).properties?(n=(i=s(this,ni).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,ni).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,ni).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,ni).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=s(this,Fo).getById("floor",s(this,Bo));if(e==null)throw new Error("Floor ".concat(s(this,Bo)," not found!"));return e}get center(){if(s(this,Zi).center==null){let[[e,i],[n,o]]=s(this,ni).geometry.coordinates,a=(e+n)/2,l=(i+o)/2;s(this,Zi).center=new ae(l,a,s(this,Bo))}return s(this,Zi).center}get isExterior(){var n;let e=s(this,Fo).obstructionIdByEntranceId[this.id],i=s(this,Fo).getMVFFeatureById("obstruction",e);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,Zi)))delete s(this,Zi)[e]}};Fo=new WeakMap,Zi=new WeakMap,Bo=new WeakMap,ni=new WeakMap,p(lc,"__type","door");var Fg=lc,dr=Fg;f();var Gn,Ro,$t,Bt,cc=class cc extends Fe{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);p(this,"__type",cc.__type);C(this,Gn,void 0);C(this,Ro,void 0);C(this,$t,{});C(this,Bt,void 0);M(this,Gn,e),M(this,Ro,i.floorId),M(this,Bt,i.mvfData)}getMvfData(){return s(this,Bt)}static is(e){return e.__type===cc.__type}get name(){var e,i,n;return"details"in s(this,Bt).properties?(n=(i=s(this,Bt).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,Bt).properties.externalId)!=null?e:""}get type(){return jP(s(this,Bt).properties.kind)}get description(){var e,i;return(i=(e=s(this,Bt).properties.details)==null?void 0:e.description)!=null?i:""}get externalId(){var e;return(e=s(this,Bt).properties.externalId)!=null?e:""}get locations(){if(s(this,$t).locations)return s(this,$t).locations;s(this,$t).locations=[];let e=s(this,Gn).locationsBySpaceId[s(this,Bt).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let n=s(this,Gn).getById("enterprise-location",i.id);n&&s(this,$t).locations.push(n)}return s(this,$t).locations}get floor(){let e=s(this,Gn).getById("floor",s(this,Ro));if(e==null)throw new Error("Floor ".concat(s(this,Ro)," not found!"));return e}get doors(){return s(this,Bt).properties.destinationNodes.reduce((e,i)=>{let n=s(this,Gn).doorsByNodeId[i];return n&&e.push(n),e},[])}get center(){var e;if(s(this,$t).center==null){let[i,n]=(e=s(this,Bt).properties.center)!=null?e:[0,0];s(this,$t).center=new ae(n,i,s(this,Ro))}return s(this,$t).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(s(this,$t)))delete s(this,$t)[e]}};Gn=new WeakMap,Ro=new WeakMap,$t=new WeakMap,Bt=new WeakMap,p(cc,"__type","space");var Bg=cc,VP=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function jP(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return VP.includes(t)?t:"room"}var st=Bg;f();var Ir,Me,Xi,uc=class uc extends Fe{constructor(e,i){super(i.mvfData.id,e);p(this,"__type",uc.__type);C(this,Ir,void 0);C(this,Me,{});C(this,Xi,void 0);M(this,Ir,e),M(this,Xi,i.mvfData)}static is(e){return e.__type===uc.__type}get name(){var e,i;return"name"in s(this,Xi)?(i=s(this,Xi).name)!=null?i:"":(e=s(this,Xi).externalId)!=null?e:""}get externalId(){var e;return(e=s(this,Xi).externalId)!=null?e:""}get elevation(){return s(this,Xi).elevation}get spaces(){if(s(this,Me).spaces==null){let e=s(this,Ir).spaces.filter(i=>i.floor.id===this.id);s(this,Me).spaces=e}return s(this,Me).spaces}get objects(){if(s(this,Me).objects==null){let e=s(this,Ir).objects.filter(i=>i.floor.id===this.id);s(this,Me).objects=e}return s(this,Me).objects}get connections(){if(s(this,Me).connections==null){let e=s(this,Ir).connections.filter(i=>i.floors.includes(this));s(this,Me).connections=e}return s(this,Me).connections}get doors(){if(s(this,Me).doors==null){let e=s(this,Ir).doors.filter(i=>i.floor.id===this.id);s(this,Me).doors=e}return s(this,Me).doors}get annotations(){if(s(this,Me).annotations==null){let e=s(this,Ir).annotations.filter(i=>i.floor.id===this.id);s(this,Me).annotations=e}return s(this,Me).annotations}get pois(){if(s(this,Me).pois==null){let e=s(this,Ir).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Me).pois=e}return s(this,Me).pois}get floorStack(){if(s(this,Me).floorStack==null){let e=s(this,Ir).floorStacks.find(i=>i.floors.includes(this));s(this,Me).floorStack=e}return s(this,Me).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,Me)))delete s(this,Me)[e]}};Ir=new WeakMap,Me=new WeakMap,Xi=new WeakMap,p(uc,"__type","floor");var Rg=uc,Yi=Rg;f();f();f();function pc(r){return typeof r=="string"?r:r.id}function Ng(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}f();function Ke(r){let t;if(st.is(r)||dr.is(r)||Rt.is(r)||Wi.is(r)||Jt.is(r))t=r.center;else if(oi.is(r)||Vn.is(r))t=r.coordinate;else if(ae.is(r))t=r;else if(ii.is(r))t=r.coordinate;else if(wr.is(r))t=r.coordinates[0];else return;return t}f();f();var dc={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},ai="ExteriorWalls",jn="Walls",f4=0,ds="InteriorDoors",hs="ExteriorDoors",He="GeometryLayer",Hn="LabelsLayer",si="MarkersLayer",fs="FootprintLayer",m4="ImagesLayer";var y4=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function Gg(r){var t,e;if((t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}function Vg(r,t){var n,o,a,l;let e=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,i={...dc,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!e:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(l=dc.outdoorView)==null?void 0:l.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}function g4(r){let t={remove_watermark:!1};if(r)try{let e=ed(r);Object.assign(t,e.capabilities)}catch(e){O.error("Error decoding capabilities from token",e)}return t}var ms,zi,Er,hc=class hc extends Fe{constructor(e,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,e,"details"in n.properties?n.properties.details:void 0);p(this,"__type",hc.__type);C(this,ms,void 0);C(this,zi,void 0);C(this,Er,void 0);M(this,zi,{}),M(this,ms,e),M(this,Er,i.mvfDataByFloorId)}static is(e){return e.__type===hc.__type}get name(){var i,n,o;let e=Object.values(s(this,Er))[0];return"details"in e.properties?(o=(n=e.properties.details)==null?void 0:n.name)!=null?o:"":(i=e.properties.externalId)!=null?i:""}get description(){var e,i;return(i=(e=Object.values(s(this,Er))[0].properties.details)==null?void 0:e.description)!=null?i:""}get accessible(){var e;return(e=Object.values(s(this,Er))[0].properties.accessible)!=null?e:!1}get externalId(){var e;return(e=Object.values(s(this,Er))[0].properties.externalId)!=null?e:""}get type(){var e,i;return(i=(e=Object.values(s(this,Er))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get coordinates(){return s(this,zi).coordinates==null&&(s(this,zi).coordinates=Object.entries(s(this,Er)).map(([e,i])=>new ae(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),s(this,zi).coordinates}get nodes(){return Object.values(s(this,Er))[0].properties.nodes.map(e=>s(this,ms).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?s(this,ms).getById("floor",e.floorId):void 0).filter(_l)}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id)}}destroy(){for(let e of Object.keys(s(this,zi)))delete s(this,zi)[e]}};ms=new WeakMap,zi=new WeakMap,Er=new WeakMap,p(hc,"__type","connection");var jg=hc,qi=jg;f();var mc,No,Un,_r,fc=class fc extends Fe{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);p(this,"__type",fc.__type);C(this,mc,void 0);C(this,No,void 0);C(this,Un,{});C(this,_r,void 0);M(this,mc,e),M(this,No,i.floorId),M(this,_r,i.mvfData)}static is(e){return e.__type===fc.__type}get name(){var e,i,n;return"details"in s(this,_r).properties?(n=(i=s(this,_r).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,_r).properties.externalId)!=null?e:""}get externalId(){var e;return(e=s(this,_r).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,_r).properties.details)==null?void 0:e.description)!=null?i:""}get type(){let e=s(this,_r).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=s(this,mc).getById("floor",s(this,No));if(e==null)throw new Error("Floor ".concat(s(this,No)," not found!"));return e}get center(){var e;if(s(this,Un).center==null){let[i,n]=(e=s(this,_r).properties.center)!=null?e:[0,0];s(this,Un).center=new ae(n,i,s(this,No))}return s(this,Un).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(s(this,Un)))s(this,Un)[e]=null}};mc=new WeakMap,No=new WeakMap,Un=new WeakMap,_r=new WeakMap,p(fc,"__type","object");var Hg=fc,Rt=Hg;f();var gc,Go,Wn,li,yc=class yc extends Fe{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);p(this,"__type",yc.__type);C(this,gc,void 0);C(this,Go,void 0);C(this,Wn,{});C(this,li,void 0);M(this,gc,e),M(this,li,i.mvfData),M(this,Go,i.floorId)}static is(e){return e.__type===yc.__type}get name(){var e,i,n;return"details"in s(this,li).properties?(n=(i=s(this,li).properties.details)==null?void 0:i.name)!=null?n:"":(e=s(this,li).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=s(this,li).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=s(this,gc).getById("floor",s(this,Go));if(e==null)throw new Error("Floor ".concat(s(this,Go)," not found!"));return e}get coordinate(){var e;if(s(this,Wn).coordinate==null){let[i,n]=(e=s(this,li).geometry.coordinates)!=null?e:[0,0];s(this,Wn).coordinate=new ae(n,i,s(this,Go))}return s(this,Wn).coordinate}get externalId(){var e;return(e=s(this,li).properties.externalId)!=null?e:""}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in s(this,Wn))s(this,Wn)[e]=null}};gc=new WeakMap,Go=new WeakMap,Wn=new WeakMap,li=new WeakMap,p(yc,"__type","point-of-interest");var Ug=yc,oi=Ug;f();var bc,Vo,Zn,jo,xc,Zg,vc=class vc extends Fe{constructor(e,i){super(i.mvfData.properties.id,e);C(this,xc);p(this,"__type",vc.__type);C(this,bc,void 0);C(this,Vo,void 0);C(this,Zn,{});C(this,jo,void 0);M(this,bc,e),M(this,Vo,i.floorId),M(this,jo,i.mvfData)}static is(e){return e.__type===vc.__type}get group(){return V(this,xc,Zg).call(this).group}get type(){return V(this,xc,Zg).call(this).type}get externalId(){var e;return(e=s(this,jo).properties.externalId)!=null?e:""}get coordinate(){if(s(this,Zn).coordinate==null){let[e,i]=s(this,jo).geometry.coordinates;s(this,Zn).coordinate=new ae(i,e,s(this,Vo))}return s(this,Zn).coordinate}get floor(){let e=s(this,bc).getById("floor",s(this,Vo));if(e==null)throw new Error("Floor ".concat(s(this,Vo)," not found!"));return e}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(s(this,Zn)))delete s(this,Zn)[e]}};bc=new WeakMap,Vo=new WeakMap,Zn=new WeakMap,jo=new WeakMap,xc=new WeakSet,Zg=function(){let[e,i]=s(this,jo).properties.symbolId.split("--");return{group:e,type:i}},p(vc,"__type","annotation");var Wg=vc,Vn=Wg;f();var Ho,hr,Dr,ys,Cc=class Cc extends Fe{constructor(e,i){super(i.mvfData.id,e);p(this,"__type",Cc.__type);C(this,Ho,void 0);C(this,hr,{});C(this,Dr,void 0);C(this,ys,void 0);M(this,Ho,e),M(this,Dr,i.mvfData),M(this,ys,i.facadeId)}static is(e){return e.__type===Cc.__type}get type(){return s(this,Dr).type}get name(){var e;return(e=s(this,Dr).name)!=null?e:""}get externalId(){var e;return(e=s(this,Dr).externalId)!=null?e:""}get floors(){var e,i;if(s(this,hr).floors==null){let n=((i=(e=s(this,Dr).floors)!=null?e:s(this,Dr).maps)!=null?i:[]).reduce((o,a)=>{let l=s(this,Ho).floorsById[a];return l&&o.push(l),o},[]);n.length===0&&O.error("Floor stack ".concat(this.id," has no floors")),s(this,hr).floors=n}return s(this,hr).floors}get defaultFloor(){if(s(this,hr).defaultFloor!=null)return s(this,hr).defaultFloor;let e=s(this,Dr).defaultFloor?s(this,Ho).getById("floor",s(this,Dr).defaultFloor):void 0;return s(this,hr).defaultFloor=e||this.floors.reduce((i,n)=>Math.abs(n.elevation)<Math.abs(i.elevation)?n:i),s(this,hr).defaultFloor}get facade(){return s(this,ys)?s(this,Ho).facadesById[s(this,ys)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(s(this,hr)))delete s(this,hr)[e]}};Ho=new WeakMap,hr=new WeakMap,Dr=new WeakMap,ys=new WeakMap,p(Cc,"__type","floor-stack");var Xg=Cc,fh=Xg;f();var gs,Uo,Tc,ci,Sc=class Sc extends Fe{constructor(e,i){super(i.mvfData.id,e);p(this,"__type",Sc.__type);C(this,gs,void 0);C(this,Uo,void 0);C(this,Tc,void 0);C(this,ci,{});M(this,gs,i.mvfData),M(this,Uo,e),M(this,Tc,i.floorStackId)}static is(e){return e.__type===Sc.__type}get floorStack(){return s(this,Uo).getById("floor-stack",s(this,Tc))}get spaces(){if(!s(this,ci).spaces){s(this,ci).spaces=[];for(let e of s(this,gs).spaces){let i=s(this,Uo).getById("space",e.spaceId);i&&s(this,ci).spaces.push(i)}}return s(this,ci).spaces}get center(){if(!s(this,ci).center){let e={type:"FeatureCollection",features:[]};for(let n of this.spaces){let o=s(this,Uo).mvfSpacesById[n.id];o&&e.features.push(o)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=pd(e);s(this,ci).center=new ae(i.geometry.coordinates[1],i.geometry.coordinates[0],s(this,gs).spaces[0].floorId)}return s(this,ci).center}};gs=new WeakMap,Uo=new WeakMap,Tc=new WeakMap,ci=new WeakMap,p(Sc,"__type","facade");var Yg=Sc,Jt=Yg;f();var HP=(r,t)=>{var g,x;let e={},i={},n={},o={},a={},l={},c={},u={},d={},m={},y=globalThis.Object.keys(r.space);for(let T of y){let v=r.space[T];if(v!=null)for(let b of v.features){m[b.properties.id]=T,a[b.properties.id]=b;for(let P of b.properties.destinationNodes)n[P]==null&&(n[P]=[]),n[P].push(b.properties.id);if(b.properties.kind==="desk-entrance"&&(o[b.properties.externalId]==null&&(o[b.properties.externalId]=[]),o[b.properties.externalId].push(...b.properties.destinationNodes)),!["void","desk-entrance"].includes((g=b.properties.kind)!=null?g:"")){if((x=b.properties.kind)!=null&&x.includes("connection")){let P="".concat(b.geometry.coordinates[1],"-").concat(b.geometry.coordinates[0]);u[P]==null&&(u[P]=[]),u[P].push(b.properties.id);continue}if(b.properties.kind==="poi"){let P=new oi(t,{floorId:T,mvfData:b});i[b.properties.id]=P,c[T]||(c[T]=[]),c[T].push(b)}else{let P=new st(t,{floorId:T,mvfData:b});e[b.properties.id]=P,l[T]||(l[T]=[]),l[T].push(b)}}}}for(let T in u){let v=u[T],b={};for(let I of v){let w=m[I],_=a[I];b[w]=_}let P=new qi(t,{mvfDataByFloorId:b});d[P.id]=P}return{spacesById:e,poisById:i,connectionsById:d,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:u,mvfSpacesByFloorId:l,mvfPoisByFloorId:c}},UP=(r,t)=>{var o,a;let e={},i={},n={};for(let l of r["node.geojson"].features){i[l.properties.id]=l;let c=new ii(t,{mvfData:l,floorId:(o=l.properties.floor)!=null?o:l.properties.map});e[l.properties.id]=c;let u=(a=l.properties.floor)!=null?a:l.properties.map;n[u]||(n[u]=[]),n[u].push(l)}return{nodesById:e,mvfNodesById:i,mvfNodesByFloorId:n}},WP=(r,t)=>{let e={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let l=r.obstruction[a];if(l!=null)for(let c of l.features){i[c.properties.id]=c;for(let d of c.properties.entrances)n[d]=c.properties.id;if(c.properties.kind==="Wall")continue;let u=new Rt(t,{floorId:a,mvfData:c});e[c.properties.id]=u}}return{objectsById:e,mvfObstructionById:i,obstructionIdByEntranceId:n}},ZP=(r,t)=>{let e={},i={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){i[n.properties.id]=n.properties;let o=new Yi(t,{mvfData:n.properties});e[n.properties.id]=o}else for(let n of r["map.geojson"]){i[n.id]=n;let o=new Yi(t,{mvfData:n});e[n.id]=o}return{floorsById:e,mvfFloorsById:i}},XP=(r,t)=>{var l;let e={},i={},n={},o={},a=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(a!=null)for(let c of a){let u=(l=r.facade)==null?void 0:l[c.id],d=new fh(t,{mvfData:c,facadeId:u==null?void 0:u.id});if(e[c.id]=d,i[c.id]=c,u){let m=new Jt(t,{mvfData:u,floorStackId:c.id});n[u.id]=m;for(let y of u.spaces)o[y.spaceId]=m}}return{floorStacksById:e,mvfFloorStacksById:i,facadesById:n,facadesBySpaceId:o}},YP=r=>{let t={},e=r["connection.json"].reduce((i,n)=>(n.nodes.forEach(o=>i[o]=n),t[n.id]=n,i),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:e}},zP=(r,t)=>{let e={},i={},n={},o={},a=globalThis.Object.keys(r.entrance);for(let l of a){let c=r.entrance[l];if(c!=null)for(let u of c.features){n[u.properties.id]=u;let d=new dr(t,{floorId:l,mvfData:u});u.properties.node&&(i[u.properties.node]=d),e[u.properties.id]=d,o[l]||(o[l]=[]),o[l].push(u)}}return{doorsById:e,doorsByNodeId:i,mvfEntrancesById:n,mvfEntrancesByFloorId:o}},qP=(r,t,e)=>{var i;if(r.textAreas!=null)for(let n in r.textAreas){let o=(i=r.textAreas[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||e[l.anchorId];if(c!=null&&l!=null){let u=c.properties;u.textArea=l,u.textArea&&(u.textArea.position=a.geometry.coordinates)}}}}},$P=(r,t,e)=>{var i;if(r.floorImages!=null)for(let n in r.floorImages){let o=(i=r.floorImages[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||e[l.anchorId];if(c!=null&&l!=null){let u=c.properties;u.image=l,u.image&&(u.image.position=a.geometry.coordinates)}}}}},JP=(r,t)=>{let e={},i={},n={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n};let o=globalThis.Object.keys(r.annotation);for(let a of o){let l=r.annotation[a];if(l!=null)for(let c of l.features){i[c.properties.id]=c;let u=new Vn(t,{floorId:a,mvfData:c});e[c.properties.id]=u,n[a]||(n[a]=[]),n[a].push(c)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n}},QP=(r,t)=>{let e={},i={};if(r.area==null)return{areasById:e,mvfAreasById:i};let n=globalThis.Object.keys(r.area);for(let o of n){let a=r.area[o];if(a!=null)for(let l of a.features){i[l.properties.id]=l;let c=new Wi(t,{floorId:o,mvfData:l});e[l.properties.id]=c}}return{areasById:e,mvfAreasById:i}},v4=(r,t)=>{var g,x,T,v,b,P,I,w,_;let e={},i={},n=((x=(g=r.enterprise)==null?void 0:g.locations)!=null?x:[]).reduce((D,k)=>(D[k.id]=k,D),{}),o={},a={},l={},c={},u={},d=((T=r.enterprise)==null?void 0:T.venue)||{},m={};for(let D of(b=(v=r.enterprise)==null?void 0:v.categories)!=null?b:[])o[D.id]=new mh(t,{mvfData:D}),a[D.id]=D,D.locations.forEach(k=>{c[k]==null&&(c[k]=[]),c[k].push(D.id)});let y={};for(let D of(I=(P=r.enterprise)==null?void 0:P.locationInstances)!=null?I:[]){let k=n[D.parent],N=Object.keys(k),R={};for(let Z of N)R[Z]=void 0;let j={...R,polygons:[],nodes:[],...D};y[j.parent]==null&&(y[j.parent]=[]),y[j.parent].push(new wr(t,{mvfData:j,categoryIds:c[j.id],parentId:D.parent})),m[j.id]=D}for(let D of(_=(w=r.enterprise)==null?void 0:w.locations)!=null?_:[]){i[D.id]=new wr(t,{mvfData:D,categoryIds:c[D.id],locationInstances:y[D.id]}),D.nodes.forEach(k=>{u[k.id]==null&&(u[k.id]=[]),u[k.id].push(D.id)});for(let k of D.polygons)l[k.id]==null&&(l[k.id]=[]),l[k.id].push(D)}if(t.enterpriseMode===!0){for(let D in t.mvfConnectionsById){let k={};for(let N of t.mvfConnectionsById[D].nodes){let R=t.nodesById[N],j=t.mvfConnectionsById[D];R!=null&&(k[R.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[R.coordinate.longitude,R.coordinate.latitude]},properties:{id:D,externalId:j.externalId,kind:"enterprise."+j.type,destinationNodes:[],flags:"",type:j.type,nodes:j.nodes,accessible:j.accessible}})}Object.keys(k).length>0&&(e[D]=new qi(t,{mvfDataByFloorId:k}))}t.connectionsById=e}return{locationIdsByNodeId:u,locationsBySpaceId:l,mvfLocationsById:n,mvfCategoriesById:a,locationsById:i,locationInstancesById:m,categoriesById:o,venue:d}},b4=(r,t)=>{let{spacesById:e,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:l,connectionIdsByLatLon:c,mvfSpacesByFloorId:u,mvfPoisByFloorId:d}=HP(r,t),{nodesById:m,mvfNodesById:y,mvfNodesByFloorId:g}=UP(r,t),{objectsById:x,mvfObstructionById:T,obstructionIdByEntranceId:v}=WP(r,t),{floorsById:b,mvfFloorsById:P}=ZP(r,t),{floorStacksById:I,mvfFloorStacksById:w,facadesById:_,facadesBySpaceId:D}=XP(r,t),{mvfConnectionsById:k,mvfConnectionsByNodeId:N}=YP(r),{doorsById:R,doorsByNodeId:j,mvfEntrancesById:Z,mvfEntrancesByFloorId:se}=zP(r,t),{annotationsById:me,mvfAnnotationsById:Pe,mvfAnnotationsByFloorId:De}=JP(r,t),{areasById:ze,mvfAreasById:Wt}=QP(r,t);return $P(r,o,T),qP(r,o,T),{spacesById:e,nodesById:m,objectsById:x,floorsById:b,floorStacksById:I,facadesById:_,facadesBySpaceId:D,connectionsById:l,doorsById:R,doorsByNodeId:j,poisById:n,annotationsById:me,areasById:ze,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:v,connectionIdsByLatLon:c,mvfSpacesById:o,mvfNodesById:y,mvfObstructionById:T,mvfFloorsById:P,mvfFloorStacksById:w,mvfConnectionsById:k,mvfConnectionsByNodeId:N,mvfEntrancesById:Z,mvfAnnotationsById:Pe,mvfNodesByFloorId:g,mvfSpacesByFloorId:u,mvfPoisByFloorId:d,mvfAreasById:Wt,mvfEntrancesByFloorId:se,mvfAnnotationsByFloorId:De}};f();var KP=new Set(["polygons"]),Or,Ae,Nt,Pc,Mc=class Mc extends yt{constructor(e,i){super(i.mvfData.externalId);p(this,"__type",Mc.__type);p(this,"description");p(this,"name","");p(this,"amenity");p(this,"externalId","");p(this,"extra");p(this,"gallery");p(this,"instances");p(this,"logo");p(this,"operationHours");p(this,"phone");p(this,"picture");p(this,"shortName");p(this,"showFloatingLabelWhenImagePresent");p(this,"showLogo");p(this,"siblingGroups");p(this,"social");p(this,"sortOrder",-1);p(this,"states");p(this,"tags");p(this,"type","");C(this,Or,void 0);C(this,Ae,{});C(this,Nt,void 0);C(this,Pc,void 0);M(this,Or,e),M(this,Nt,i.mvfData),M(this,Pc,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!KP.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(i.parentId){let o=s(this,Or).locationsById[i.parentId];return s(this,Nt)[n]!=null?s(this,Or).getPropTranslation(this.__type,n,s(this,Nt).id,s(this,Nt)[n]):s(this,Or).getPropTranslation(this.__type,n,s(this,Nt).id,o[n])}return s(this,Or).getPropTranslation(this.__type,n,s(this,Nt).id,s(this,Nt)[n])}})}static is(e){return e.__type===Mc.__type}get categories(){return s(this,Ae).categories?s(this,Ae).categories:(s(this,Ae).categories=(s(this,Pc).map(e=>s(this,Or).getById("enterprise-category",e))||[]).filter(Boolean),s(this,Ae).categories)}get coordinates(){if(s(this,Ae).coordinates)return s(this,Ae).coordinates;s(this,Ae).coordinates=[];for(let e=0;e<this.nodes.length;e++)s(this,Ae).coordinates.push(this.nodes[e].coordinate);return s(this,Ae).coordinates}get nodes(){if(s(this,Ae).nodes)return s(this,Ae).nodes;s(this,Ae).nodes=[];for(let e=0;e<s(this,Nt).nodes.length;e++){let i=s(this,Or).getById("node",s(this,Nt).nodes[e].id);i&&s(this,Ae).nodes.push(i)}return s(this,Ae).nodes}get spaces(){if(s(this,Ae).spaces)return s(this,Ae).spaces;s(this,Ae).spaces=[];for(let e=0;e<s(this,Nt).polygons.length;e++){let i=s(this,Or).getById("space",s(this,Nt).polygons[e].id);i&&s(this,Ae).spaces.push(i)}return s(this,Ae).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Ae)))delete s(this,Ae)[e]}};Or=new WeakMap,Ae=new WeakMap,Nt=new WeakMap,Pc=new WeakMap,p(Mc,"__type","enterprise-location");var zg=Mc,wr=zg;f();var eI=new Set,Wo,vt,ui,Ic=class Ic extends yt{constructor(e,i){super(i.mvfData.externalId);p(this,"__type",Ic.__type);p(this,"name","");p(this,"color");p(this,"externalId","");p(this,"extra");p(this,"icon");p(this,"iconFromDefaultList");p(this,"sortOrder",-1);C(this,Wo,void 0);C(this,vt,{});C(this,ui,void 0);M(this,Wo,e),M(this,ui,i.mvfData);for(let n in i.mvfData)!eI.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Wo).getPropTranslation(this.__type,n,s(this,ui).id,s(this,ui)[n])}})}static is(e){return e.__type===Ic.__type}get children(){if(s(this,vt).children)return s(this,vt).children;s(this,vt).children=[];for(let e=0;e<s(this,ui).children.length;e++){let i=s(this,Wo).getById("enterprise-category",s(this,ui).children[e]);i&&s(this,vt).children.push(i)}return s(this,vt).children}get locations(){if(s(this,vt).locations)return s(this,vt).locations;s(this,vt).locations=[];for(let e=0;e<s(this,ui).locations.length;e++){let i=s(this,Wo).getById("enterprise-location",s(this,ui).locations[e]);i&&s(this,vt).locations.push(i)}return s(this,vt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,vt)))delete s(this,vt)[e]}};Wo=new WeakMap,vt=new WeakMap,ui=new WeakMap,p(Ic,"__type","enterprise-category");var qg=Ic,mh=qg;f();var tI=new Set,Ec,_c,wc=class wc extends yt{constructor(e,i){super(i.mvfData.externalId);p(this,"__type",wc.__type);p(this,"countrycode");p(this,"externalId","");p(this,"defaultLanguage",{code:"en",name:"English"});p(this,"defaultMap");p(this,"extra");p(this,"icon");p(this,"languages",[]);p(this,"links",[]);p(this,"logo");p(this,"mappedinWebUrl");p(this,"slug","");p(this,"topLocations");p(this,"tzid");C(this,Ec,{});C(this,_c,void 0);M(this,_c,i.mvfData);for(let n in i.mvfData)!tI.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(e){return e.__type===wc.__type}get name(){var e;return(e=s(this,_c).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(s(this,Ec)))delete s(this,Ec)[e]}};Ec=new WeakMap,_c=new WeakMap,p(wc,"__type","enterprise-venue");var $g=wc,Jg=$g;f();function Qg(r){var e,i,n,o,a;let t=((i=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:i.reduce((l,c)=>(l[c.id]=c,l),{}))||{};for(let l of((n=r.enterprise)==null?void 0:n.locationInstances)||[])t[l.id]=l;return{type:"downloaded",data:r,optimized:{locations:t,categories:(a=(o=r.enterprise)==null?void 0:o.categories)==null?void 0:a.reduce((l,c)=>(l[c.id]=c,l),{})}}}f();f();f();f();f();f();f();var Zo=class{constructor({origin:t,destination:e,distance:i=0,angle:n=0,pathWeight:o=0}){p(this,"origin");p(this,"destination");p(this,"distance");p(this,"angle");p(this,"weight");this.origin=t,this.destination=e,this.distance=i,this.angle=n;let a=o||0;if(this.weight=a>=0?this.distance+a:0,isNaN(this.angle))throw new Error("nan angle")}};f();f();f();function Kg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=ur(r),n=eb(t),o=n.type,a=t.bbox,l=n.coordinates;if(a&&rI(i,a)===!1)return!1;o==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(x4(i,l[u][0],e.ignoreBoundary)){for(var d=!1,m=1;m<l[u].length&&!d;)x4(i,l[u][m],!e.ignoreBoundary)&&(d=!0),m++;d||(c=!0)}return c}function x4(r,t,e){var i=!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 n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],l=t[n][1],c=t[o][0],u=t[o][1],d=r[1]*(a-c)+l*(c-r[0])+u*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(l-r[1])*(u-r[1])<=0;if(d)return!e;var m=l>r[1]!=u>r[1]&&r[0]<(c-a)*(r[1]-l)/(u-l)+a;m&&(i=!i)}return i}function rI(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}f();f();function $i([r,t],[e,i]){let n=t-i,o=r-e;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}f();var iI=63710088e-1;function Lr(r,t){let[e,i]=r.map(d=>d*Math.PI/180),[n,o]=t.map(d=>d*Math.PI/180),a=o-i,l=n-e,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return iI*u}f();f();function yh(r,t,e,i){let[n,o]=r,[a,l]=t,[c,u]=e,[d,m]=i;if(o===l&&n===a||u===m&&c===d)return null;let y=(d-c)*(l-o)-(m-u)*(a-n);if(y===0)return null;let g=((m-u)*(n-c)-(d-c)*(o-u))/y,x=((l-o)*(n-c)-(a-n)*(o-u))/y;if(g<0||g>1||x<0||x>1)return null;let T=o+g*(l-o);return[n+g*(a-n),T]}f();function e1(r,t,e,i){let n=wo(r,e/1e3,i),o=wo(t,e/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}f();function t1(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}function C4(r,t,e=[],i=0){let n=!0,o=r.geometry.coordinates,a=t.geometry.coordinates,l=t1($i(o,a)-Math.PI/2),c=t1($i(o,a)+Math.PI/2);return e.forEach(u=>{if(i>0){let d=e1(o,a,i,l),m=e1(o,a,i,c);if(yh(d[0],d[1],u[0],u[1])||yh(m[0],m[1],u[0],u[1])){n=!1;return}}else if(yh(o,a,u[0],u[1])){n=!1;return}}),n}var Xo,Dc,r1,vh,S4,bh,T4,xh,M4,Ch,P4,Sh,I4,Th,w4,Mh,gh=class{constructor({nodes:t,groupBy:e}){C(this,Dc);C(this,vh);C(this,bh);C(this,xh);C(this,Ch);C(this,Sh);C(this,Th);p(this,"edges",{});p(this,"nodesById");p(this,"nodesByGroup",new Map);C(this,Xo,void 0);C(this,Mh,(t,e)=>{let i=0;for(let n of e)(!n[s(this,Xo)]||n[s(this,Xo)]===t.properties[s(this,Xo)])&&Kg(t.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i});M(this,Xo,e);let{features:i}=t;this.nodesById=V(this,vh,S4).call(this,i),V(this,bh,T4).call(this),V(this,xh,M4).call(this,i,e)}getShortestEuclideanDistance(t,e){return e.reduce((i,n)=>{let o=Lr(t.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,zones:n}){let o=V(this,Dc,r1).call(this,t),a=V(this,Dc,r1).call(this,e);if(o.length===0||a.length===0)return[];let{frontier:l,cameFrom:c,costSoFar:u}=V(this,Ch,P4).call(this,o,a);for(;l.length>0;){let d=l.shift();if(!d)break;if(V(this,Sh,I4).call(this,d.origin,a))return V(this,Th,w4).call(this,c,d.origin.properties.id);for(let m of this.edges[d.origin.properties.id]){let y=u[d.origin.properties.id]+m.weight+s(this,Mh).call(this,m.destination,n);if(!(y===1/0||i!=null&&i.has(m.destination.properties.id))&&(u[m.destination.properties.id]==null||y<u[m.destination.properties.id])){let g=y+this.getShortestEuclideanDistance(m.destination,a);u[m.destination.properties.id]=y,c[m.destination.properties.id]=m,l.push({origin:m.destination,priority:g})}}l.sort((m,y)=>m.priority-y.priority)}return[]}};Xo=new WeakMap,Dc=new WeakSet,r1=function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},vh=new WeakSet,S4=function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},bh=new WeakSet,T4=function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},xh=new WeakSet,M4=function(t,e){t.forEach(i=>{let n=e==="default"?e:i.properties[e];this.nodesByGroup.has(n)||this.nodesByGroup.set(n,[]),this.nodesByGroup.get(n).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:o,weight:a})=>{let l=this.nodesById[o],c=Lr(i.geometry.coordinates,l.geometry.coordinates),u=$i(i.geometry.coordinates,l.geometry.coordinates);return new Zo({origin:i,destination:l,pathWeight:a,distance:c,angle:u})})})},Ch=new WeakSet,P4=function(t,e){let i=[],n={},o={};return t.forEach(a=>{let l=this.getShortestEuclideanDistance(a,e);i.push({origin:a,priority:l}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,l)=>a.priority-l.priority),{frontier:i,cameFrom:n,costSoFar:o}},Sh=new WeakSet,I4=function(t,e){return e.some(i=>i.properties.id===t.properties.id)},Th=new WeakSet,w4=function(t,e){let i=[],n=t[e];for(;n;)i.push(n),n=t[n.origin.properties.id];return i.reverse()},Mh=new WeakMap;var nI=.4,vs=class{constructor({nodes:t,geojsonCollection:e,groupBy:i="default"}){p(this,"groupBy");p(this,"graph");p(this,"geometryEdgesByMapId",new Map);p(this,"generatePath",t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<t.length;o++){let{origin:a}=t[o],l={id:a.properties.id,angle:t[o].angle,distance:t[o].distance};this.groupBy!=="default"&&(l.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:l})}let n={id:e.properties.id};return this.groupBy!=="default"&&(n.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:n}),i});p(this,"getDistance",(t,e)=>Lr(t,e));p(this,"getAngle",(t,e)=>$i(t,e));this.groupBy=i,this.graph=new gh({nodes:t,groupBy:this.groupBy}),((e==null?void 0:e.features)||[]).forEach(o=>{let a=null;if(o.geometry.type==="LineString"?a=o.geometry.coordinates:o.geometry.type==="Polygon"&&(a=o.geometry.coordinates.flat()),a){let l=this.groupBy==="default"?this.groupBy:o.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),a.forEach((c,u)=>{this.geometryEdgesByMapId.get(l).push([c,a[u+1]||a[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var u,d;let a=(u=o==null?void 0:o.enabled)!=null?u:!0,l=t!=null?t:[],c=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:l,excludedNodeIds:new Set(n)});return c.length===0?{type:"FeatureCollection",features:[]}:(a&&(c=this.simplifyAllSteps(c,(d=o==null?void 0:o.bufferRadius)!=null?d:nI)),this.generatePath(c))}simplifyAllSteps(t,e){var c,u;let i=[],n=[t[0]];for(let d=1;d<t.length;d++)if(this.groupBy!=="default"&&t[d].origin.properties[this.groupBy]!==t[d-1].origin.properties[this.groupBy]){let m=t[d-1].origin.properties[this.groupBy],y=(c=this.geometryEdgesByMapId.get(m))!=null?c:[];i.push(...this.simplifySteps(n,y,e)),n=[t[d]]}else n.push(t[d]);let o=t[t.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],l=(u=this.geometryEdgesByMapId.get(a))!=null?u:[];return i.push(...this.simplifySteps(n,l,e)),i}simplifySteps(t,e,i){if(t.length<3)return t;let n=[t[0]],o=1;for(let a=o+2;a<t.length;a++)if(!C4(t[o].origin,t[a].origin,e,i)){let l=a-1;n.push(new Zo({...t[o],destination:t[l].origin,distance:Lr(t[o].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:$i(t[o].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),o=l}return n.push(new Zo({...t[o],destination:t[t.length-1].origin,distance:Lr(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:$i(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates)}),t[t.length-1]),n}};f();function pi(r){return[r.longitude,r.latitude]}function oI(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}var i1=(r,t)=>{let e=oI(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of r){let o=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((l,c)=>(e.has(c)&&l.push(e.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=_g(n,a);o=c.map(u=>u.geometry.coordinates),i.entrances.features.push(...l)}i.walls.geometry.coordinates.push(...o)}return i};function E4(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),e}function _4(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),e}function Ph(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function n1(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function o1(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function D4(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function O4(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}function L4(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let n of i.polygons)t[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)t[n]=i;else if("points"in i)for(let n of i.points)t[n]=i}}return t}function a1(r,t){return r.reduce((e,i)=>{let n=t[i.properties.id];return n==null||(e.has(n)||e.set(n,[]),e.get(n).push(i)),e},new Map)}function Oc(r,t={}){var n,o,a,l,c,u;let e={...r},i=(o=(n=t==null?void 0:t.style)==null?void 0:n.shading)!=null?o:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(l=(a=t==null?void 0:t.style)==null?void 0:a.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let d=(u=(c=t==null?void 0:t.style)==null?void 0:c.wallTopColor)!=null?u:t==null?void 0:t.wallTopColor;d!=null&&(e.topColor=d)}return e}var A4=(r,t)=>{var n;let i=((n=t.currentMap)==null?void 0:n.currentFloor).layers.get(He);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(jn);case"exterior-walls":return i==null?void 0:i.layers.get(ai);case"interior-doors":return i==null?void 0:i.layers.get(ds);case"exterior-doors":return i==null?void 0:i.layers.get(hs);default:return typeof r=="string"?r:r.id}};function s1(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}function k4(r){return[...new Set(r)]}var F4=Math.PI*.1,bt,xt,Qt,Ji,Yo,Dh,B4,Xn,bs,Oh,R4,Eh=class{constructor(t,e){C(this,Dh);C(this,Xn);C(this,Oh);C(this,bt,{});C(this,xt,void 0);C(this,Qt,void 0);C(this,Ji,void 0);C(this,Yo,void 0);M(this,xt,e),M(this,Qt,t.features),M(this,xt,e),M(this,Qt,t.features)}get path(){return s(this,Qt).map(t=>s(this,xt).getById("node",t.properties.id)).filter(Boolean)}get coordinates(){return s(this,bt).coordinates?s(this,bt).coordinates:(s(this,bt).coordinates=s(this,Qt).map(t=>new ae(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),s(this,bt).coordinates)}get distance(){return s(this,bt).distance?s(this,bt).distance:(s(this,bt).distance=s(this,Qt).reduce((t,e)=>t+(e.properties.distance||0),0),s(this,bt).distance)}get instructions(){if(s(this,Qt).length<2)return[];if(s(this,bt).instructions)return s(this,bt).instructions;let t=[],e=0;for(let i=0;i<s(this,Qt).length;i++){let n=s(this,Qt)[i],o=s(this,Qt)[i-1],a=s(this,Qt)[i+1],l=new ae(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=V(this,Dh,B4).call(this,{prevDirection:o,direction:n,nextDirection:a});e+=(o==null?void 0:o.properties.distance)||0;for(let u of c)u&&(t.push({action:u,distance:e,coordinate:l,node:s(this,xt).getById("node",n.properties.id)}),e=0)}return s(this,bt).instructions=t,s(this,bt).instructions}};bt=new WeakMap,xt=new WeakMap,Qt=new WeakMap,Ji=new WeakMap,Yo=new WeakMap,Dh=new WeakSet,B4=function(t){var y,g,x;let{prevDirection:e,direction:i,nextDirection:n}=t,o=e&&s(this,xt).getById("floor",e.properties.groupBy),a=s(this,xt).getById("floor",i.properties.groupBy),l=n&&s(this,xt).getById("floor",n.properties.groupBy),c=[];e||c.push({type:"Departure"});let u=s(this,xt).getMVFFeatureByNodeId("connection",i.properties.id),d=s(this,xt).getMVFFeatureByNodeId("connection",(y=n==null?void 0:n.properties.id)!=null?y:""),m=u?s(this,xt).getById("connection",u.id):void 0;if(u)if(!s(this,Ji)||s(this,Ji)==="exit")c.push(V(this,Xn,bs).call(this,"TakeConnection",a,l,m,u)),M(this,Ji,"take"),M(this,Yo,m);else{let T=s(this,xt).getMVFFeatureByNodeId("connection",(g=e==null?void 0:e.properties.id)!=null?g:""),v=s(this,xt).getById("connection",(x=T==null?void 0:T.id)!=null?x:"");c.push(V(this,Xn,bs).call(this,"ExitConnection",a,o,v,T)),M(this,Ji,"exit"),M(this,Yo,m)}else d&&s(this,Ji)==="take"?(c.push(V(this,Xn,bs).call(this,"ExitConnection",a,o,s(this,Yo))),M(this,Ji,"exit"),M(this,Yo,m)):l&&a.id!==l.id?c.push(V(this,Xn,bs).call(this,"TakeConnection",a,l,m)):o&&o.id!==a.id?c.push(V(this,Xn,bs).call(this,"ExitConnection",a,o,m)):c.push(V(this,Oh,R4).call(this,e,i));return n||c.push({type:"Arrival"}),c},Xn=new WeakSet,bs=function(t,e,i,n,o){var c,u;let a="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let d=e.elevation-i.elevation;d>0?a="down":d<0&&(a="up")}let l=(u=(c=n==null?void 0:n.type)!=null?c:o==null?void 0:o.type)!=null?u:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:a,connection:n,connectionType:l}},Oh=new WeakSet,R4=function(t,e){let i=t?-D4(t.properties.angle,e.properties.angle):0;return Math.abs(i)>=F4?{type:"Turn",bearing:O4(i,F4),referencePosition:"At"}:null};var _h=class{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:n}){p(this,"navigator");p(this,"connections");p(this,"getDirections",(t,e,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:l}}=i,c=t.flatMap(g=>this.getNodesFromTarget(g,n)),u=e.flatMap(g=>this.getNodesFromTarget(g,n)),d=this.getExcludedNodeIds(o).filter(g=>!c.includes(g)&&!u.includes(g)),m=this.navigator.getDirections({zones:i.zones.map(g=>{var x;return{geometry:g.geometry,cost:g.cost,map:(x=g.floor)==null?void 0:x.id}}),originIds:c,destinationNodeIds:u,excludedNodeIds:d,simplify:{enabled:a,bufferRadius:l}});this.addCoordinateDirections(m,t,e);let y=new Eh(m,n);if(!(y.distance===0&&new Set([...c,...u]).size===c.length+u.length))return y});p(this,"getExcludedNodeIds",t=>t?this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]):[]);p(this,"addCoordinateDirections",(t,[e],[i])=>{if(t.features.length){if(ae.is(e)){let n=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,n)}if(ae.is(i)){let n=this.createDirectionFeature(i,0,0),o=t.features[t.features.length-1];o.properties.distance=this.navigator.getDistance(o.geometry.coordinates,[i.longitude,i.latitude]),o.properties.angle=this.navigator.getAngle(o.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(n)}}});p(this,"getNodesFromTarget",(t,e)=>{var i,n,o,a;if(ae.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(oi.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if(dr.is(t)){let l=e.Query.nearest(t,{types:["node"]});return(o=l==null?void 0:l[0])!=null&&o.feature.id?[l[0].feature.id]:[]}else if(Wi.is(t)){let l=e==null?void 0:e.getMVFFeatureById("area",t.id);return(a=l==null?void 0:l.properties.destinationNodes)!=null?a:[]}else if(st.is(t)){let l=e==null?void 0:e.getMVFFeatureById("space",t.id);return l==null?[]:l.properties.destinationNodes}else{if(qi.is(t))return t.coordinates.reduce((l,c)=>{var d;let u=e.Query.nearest(c,{types:["node"]});return(d=u==null?void 0:u[0])!=null&&d.feature.id&&l.push(u[0].feature.id),l},[]);if(Rt.is(t)){let l=e==null?void 0:e.objectEntranceNodeIdsByObstructionId[t.id];return l!=null?l:[]}else return Jt.is(t)?t.spaces.flatMap(l=>{var c,u;return(u=(c=e==null?void 0:e.getMVFFeatureById("space",l.id))==null?void 0:c.properties.destinationNodes)!=null?u:[]}).filter(l=>typeof l=="string"):wr.is(t)?t.nodes.map(l=>l.id):ii.is(t)?[t.id]:[]}});p(this,"createDirectionFeature",(t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i}}));this.navigator=new vs({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,n])=>e.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};f();f();f();f();f();f();function N4(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return G4(this.cover(t,e),t,e,r)}function G4(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var n,o=r._root,a={data:i},l=r._x0,c=r._y0,u=r._x1,d=r._y1,m,y,g,x,T,v,b,P;if(!o)return r._root=a,r;for(;o.length;)if((T=t>=(m=(l+u)/2))?l=m:u=m,(v=e>=(y=(c+d)/2))?c=y:d=y,n=o,!(o=o[b=v<<1|T]))return n[b]=a,r;if(g=+r._x.call(null,o.data),x=+r._y.call(null,o.data),t===g&&e===x)return a.next=o,n?n[b]=a:r._root=a,r;do n=n?n[b]=new Array(4):r._root=new Array(4),(T=t>=(m=(l+u)/2))?l=m:u=m,(v=e>=(y=(c+d)/2))?c=y:d=y;while((b=v<<1|T)===(P=(x>=y)<<1|g>=m));return n[P]=o,n[b]=a,r}function V4(r){var t,e,i=r.length,n,o,a=new Array(i),l=new Array(i),c=1/0,u=1/0,d=-1/0,m=-1/0;for(e=0;e<i;++e)isNaN(n=+this._x.call(null,t=r[e]))||isNaN(o=+this._y.call(null,t))||(a[e]=n,l[e]=o,n<c&&(c=n),n>d&&(d=n),o<u&&(u=o),o>m&&(m=o));if(c>d||u>m)return this;for(this.cover(c,u).cover(d,m),e=0;e<i;++e)G4(this,a[e],l[e],r[e]);return this}f();function j4(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(e))n=(e=Math.floor(r))+1,o=(i=Math.floor(t))+1;else{for(var a=n-e||1,l=this._root,c,u;e>r||r>=n||i>t||t>=o;)switch(u=(t<i)<<1|r<e,c=new Array(4),c[u]=l,l=c,a*=2,u){case 0:n=e+a,o=i+a;break;case 1:e=n-a,o=i+a;break;case 2:n=e+a,i=o-a;break;case 3:e=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=i,this._x1=n,this._y1=o,this}f();function H4(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}f();function U4(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}f();f();function nt(r,t,e,i,n){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=n}function W4(r,t,e){var i,n=this._x0,o=this._y0,a,l,c,u,d=this._x1,m=this._y1,y=[],g=this._root,x,T;for(g&&y.push(new nt(g,n,o,d,m)),e==null?e=1/0:(n=r-e,o=t-e,d=r+e,m=t+e,e*=e);x=y.pop();)if(!(!(g=x.node)||(a=x.x0)>d||(l=x.y0)>m||(c=x.x1)<n||(u=x.y1)<o))if(g.length){var v=(a+c)/2,b=(l+u)/2;y.push(new nt(g[3],v,b,c,u),new nt(g[2],a,b,v,u),new nt(g[1],v,l,c,b),new nt(g[0],a,l,v,b)),(T=(t>=b)<<1|r>=v)&&(x=y[y.length-1],y[y.length-1]=y[y.length-1-T],y[y.length-1-T]=x)}else{var P=r-+this._x.call(null,g.data),I=t-+this._y.call(null,g.data),w=P*P+I*I;if(w<e){var _=Math.sqrt(e=w);n=r-_,o=t-_,d=r+_,m=t+_,i=g.data}}return i}f();function Z4(r){if(isNaN(d=+this._x.call(null,r))||isNaN(m=+this._y.call(null,r)))return this;var t,e=this._root,i,n,o,a=this._x0,l=this._y0,c=this._x1,u=this._y1,d,m,y,g,x,T,v,b;if(!e)return this;if(e.length)for(;;){if((x=d>=(y=(a+c)/2))?a=y:c=y,(T=m>=(g=(l+u)/2))?l=g:u=g,t=e,!(e=e[v=T<<1|x]))return this;if(!e.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(i=t,b=v)}for(;e.data!==r;)if(n=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,n?(o?n.next=o:delete n.next,this):t?(o?t[v]=o:delete t[v],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[b]=e:this._root=e),this):(this._root=o,this)}function X4(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}f();function Y4(){return this._root}f();function z4(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}f();function q4(r){var t=[],e,i=this._root,n,o,a,l,c;for(i&&t.push(new nt(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,o=e.x0,a=e.y0,l=e.x1,c=e.y1)&&i.length){var u=(o+l)/2,d=(a+c)/2;(n=i[3])&&t.push(new nt(n,u,d,l,c)),(n=i[2])&&t.push(new nt(n,o,d,u,c)),(n=i[1])&&t.push(new nt(n,u,a,l,d)),(n=i[0])&&t.push(new nt(n,o,a,u,d))}return this}f();function $4(r){var t=[],e=[],i;for(this._root&&t.push(new nt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var n=i.node;if(n.length){var o,a=i.x0,l=i.y0,c=i.x1,u=i.y1,d=(a+c)/2,m=(l+u)/2;(o=n[0])&&t.push(new nt(o,a,l,d,m)),(o=n[1])&&t.push(new nt(o,d,l,c,m)),(o=n[2])&&t.push(new nt(o,a,m,d,u)),(o=n[3])&&t.push(new nt(o,d,m,c,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}f();function J4(r){return r[0]}function Q4(r){return arguments.length?(this._x=r,this):this._x}f();function K4(r){return r[1]}function eS(r){return arguments.length?(this._y=r,this):this._y}function Lc(r,t,e){var i=new l1(t==null?J4:t,e==null?K4:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function l1(r,t,e,i,n,o){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}function tS(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var Ct=Lc.prototype=l1.prototype;Ct.copy=function(){var r=new l1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,i;if(!t)return r;if(!t.length)return r._root=tS(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var n=0;n<4;++n)(i=t.source[n])&&(i.length?e.push({source:i,target:t.target[n]=new Array(4)}):t.target[n]=tS(i));return r};Ct.add=N4;Ct.addAll=V4;Ct.cover=j4;Ct.data=H4;Ct.extent=U4;Ct.find=W4;Ct.remove=Z4;Ct.removeAll=X4;Ct.root=Y4;Ct.size=z4;Ct.visit=q4;Ct.visitAfter=$4;Ct.x=Q4;Ct.y=eS;var Kt,Yn,Lh=class{constructor(t){C(this,Kt,{});C(this,Yn,void 0);M(this,Yn,t)}getTreeByType(t,e,i){if(s(this,Kt)[t]||(s(this,Kt)[t]={}),s(this,Kt)[t][e]&&s(this,Kt)[t][e][i])return s(this,Kt)[t][e][i];s(this,Kt)[t][e]||(s(this,Kt)[t][e]={}),s(this,Kt)[t][e][i]||(s(this,Kt)[t][e][i]=Lc());let n=s(this,Kt)[t][e][i];n.x(a=>a.geometry.coordinates[1]),n.y(a=>a.geometry.coordinates[0]);let o=[];switch(t){case"node":o=s(this,Yn).mvfNodesByFloorId[i]||[];break;case"point-of-interest":o=s(this,Yn).mvfPoisByFloorId[i]||[];break;case"door":o=s(this,Yn).mvfEntrancesByFloorId[i]||[];break;case"annotation":o=s(this,Yn).mvfAnnotationsByFloorId[i]||[];break}return(o==null?void 0:o.length)>0&&n.addAll(o),n}};Kt=new WeakMap,Yn=new WeakMap;f();var fe;(function(r){r.assertEqual=n=>n;function t(n){}r.assertIs=t;function e(n){throw new Error}r.assertNever=e,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(l=>typeof n[n[l]]!="number"),a={};for(let l of o)a[l]=n[l];return r.objectValues(a)},r.objectValues=n=>r.objectKeys(n).map(function(o){return n[o]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},r.find=(n,o)=>{for(let a of n)if(o(a))return a},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(fe||(fe={}));var u1;(function(r){r.mergeShapes=(t,e)=>({...t,...e})})(u1||(u1={}));var U=fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=r=>{switch(typeof r){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(r)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(r)?U.array:r===null?U.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?U.promise:typeof Map<"u"&&r instanceof Map?U.map:typeof Set<"u"&&r instanceof Set?U.set:typeof Date<"u"&&r instanceof Date?U.date:U.object;default:return U.unknown}},B=fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),aI=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),er=class r extends Error{constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let e=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(e(a));else{let l=i,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(e(a))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return n(this),i}static assert(t){if(!(t instanceof r))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},i=[];for(let n of this.issues)n.path.length>0?(e[n.path[0]]=e[n.path[0]]||[],e[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:e}}get formErrors(){return this.flatten()}};er.create=r=>new er(r);var Ss=(r,t)=>{let e;switch(r.code){case B.invalid_type:r.received===U.undefined?e="Required":e="Expected ".concat(r.expected,", received ").concat(r.received);break;case B.invalid_literal:e="Invalid literal value, expected ".concat(JSON.stringify(r.expected,fe.jsonStringifyReplacer));break;case B.unrecognized_keys:e="Unrecognized key(s) in object: ".concat(fe.joinValues(r.keys,", "));break;case B.invalid_union:e="Invalid input";break;case B.invalid_union_discriminator:e="Invalid discriminator value. Expected ".concat(fe.joinValues(r.options));break;case B.invalid_enum_value:e="Invalid enum value. Expected ".concat(fe.joinValues(r.options),", received '").concat(r.received,"'");break;case B.invalid_arguments:e="Invalid function arguments";break;case B.invalid_return_type:e="Invalid function return type";break;case B.invalid_date:e="Invalid date";break;case B.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(e="".concat(e," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?e='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?e='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):fe.assertNever(r.validation):r.validation!=="regex"?e="Invalid ".concat(r.validation):e="Invalid";break;case B.too_small:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):e="Invalid input";break;case B.too_big:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?e="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):e="Invalid input";break;case B.custom:e="Invalid input";break;case B.invalid_intersection_types:e="Intersection results could not be merged";break;case B.not_multiple_of:e="Number must be a multiple of ".concat(r.multipleOf);break;case B.not_finite:e="Number must be finite";break;default:e=t.defaultError,fe.assertNever(r)}return{message:e}},nS=Ss;function sI(r){nS=r}function Ah(){return nS}var kh=r=>{let{data:t,path:e,errorMaps:i,issueData:n}=r,o=[...e,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let l="",c=i.filter(u=>!!u).slice().reverse();for(let u of c)l=u(a,{data:t,defaultError:l}).message;return{...n,path:o,message:l}},lI=[];function H(r,t){let e=Ah(),i=kh({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===Ss?void 0:Ss].filter(n=>!!n)});r.common.issues.push(i)}var pt=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let i=[];for(let n of e){if(n.status==="aborted")return K;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,e){let i=[];for(let n of e){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return r.mergeObjectSync(t,i)}static mergeObjectSync(t,e){let i={};for(let n of e){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return K;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},K=Object.freeze({status:"aborted"}),Cs=r=>({status:"dirty",value:r}),St=r=>({status:"valid",value:r}),p1=r=>r.status==="aborted",d1=r=>r.status==="dirty",Fc=r=>r.status==="valid",Bc=r=>typeof Promise<"u"&&r instanceof Promise;function Fh(r,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(r):i?i.value:t.get(r)}function oS(r,t,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,e):n?n.value=e:t.set(r,e),e}var Y;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Y||(Y={}));var Ac,kc,mr=class{constructor(t,e,i,n){this._cachedPath=[],this.parent=t,this.data=e,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},rS=(r,t)=>{if(Fc(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new er(r.common.issues);return this._error=e,this._error}}};function ie(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:i,description:n}=r;if(t&&(e||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(a,l)=>{var c,u;let{message:d}=r;return a.code==="invalid_enum_value"?{message:d!=null?d:l.defaultError}:typeof l.data>"u"?{message:(c=d!=null?d:i)!==null&&c!==void 0?c:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(u=d!=null?d:e)!==null&&u!==void 0?u:l.defaultError}},description:n}}var ne=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return zn(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:zn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pt,ctx:{common:t.parent.common,data:t.data,parsedType:zn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Bc(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let i=this.safeParse(t,e);if(i.success)return i.data;throw i.error}safeParse(t,e){var i;let n={common:{issues:[],async:(i=e==null?void 0:e.async)!==null&&i!==void 0?i:!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return rS(n,o)}async parseAsync(t,e){let i=await this.safeParseAsync(t,e);if(i.success)return i.data;throw i.error}async safeParseAsync(t,e){let i={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zn(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(Bc(n)?n:Promise.resolve(n));return rS(i,o)}refine(t,e){let i=n=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(n):e;return this._refinement((n,o)=>{let a=t(n),l=()=>o.addIssue({code:B.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,e){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof e=="function"?e(i,n):e),!1))}_refinement(t){return new tr({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return fr.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.create(this,this._def)}promise(){return Jn.create(this,this._def)}or(t){return ea.create([this,t],this._def)}and(t){return ta.create(this,t,this._def)}transform(t){return new tr({...ie(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new aa({...ie(this._def),innerType:this,defaultValue:e,typeName:J.ZodDefault})}brand(){return new Rc({typeName:J.ZodBranded,type:this,...ie(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new sa({...ie(this._def),innerType:this,catchValue:e,typeName:J.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Nc.create(this,t)}readonly(){return la.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},cI=/^c[^\s-]{8,}$/i,uI=/^[0-9a-z]+$/,pI=/^[0-9A-HJKMNP-TV-Z]{26}$/,dI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hI=/^[a-z0-9_-]{21}$/i,fI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",c1,gI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vI=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,bI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xI=new RegExp("^".concat(aS,"$"));function sS(r){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?t="".concat(t,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}function CI(r){return new RegExp("^".concat(sS(r),"$"))}function lS(r){let t="".concat(aS,"T").concat(sS(r)),e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(e.join("|"),")"),new RegExp("^".concat(t,"$"))}function SI(r,t){return!!((t==="v4"||!t)&&gI.test(r)||(t==="v6"||!t)&&vI.test(r))}var qn=class r extends ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==U.string){let o=this._getOrReturnCtx(t);return H(o,{code:B.invalid_type,expected:U.string,received:o.parsedType}),K}let i=new pt,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),H(n,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),H(n,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,l=t.data.length<o.value;(a||l)&&(n=this._getOrReturnCtx(t,n),a?H(n,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&H(n,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")mI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"email",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")c1||(c1=new RegExp(yI,"u")),c1.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"emoji",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")dI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"uuid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")hI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"nanoid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")cI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"cuid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")uI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"cuid2",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")pI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"ulid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),H(n,{validation:"url",code:B.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"regex",code:B.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?lS(o).test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?xI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?CI(o).test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{code:B.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?fI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"duration",code:B.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?SI(t.data,o.version)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"ip",code:B.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?bI.test(t.data)||(n=this._getOrReturnCtx(t,n),H(n,{validation:"base64",code:B.invalid_string,message:o.message}),i.dirty()):fe.assertNever(o);return{status:i.value,value:t.data}}_regex(t,e,i){return this.refinement(n=>t.test(n),{validation:e,code:B.invalid_string,...Y.errToObj(i)})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Y.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Y.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Y.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Y.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Y.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Y.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Y.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Y.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Y.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Y.errToObj(t)})}datetime(t){var e,i;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(e=t==null?void 0:t.offset)!==null&&e!==void 0?e:!1,local:(i=t==null?void 0:t.local)!==null&&i!==void 0?i:!1,...Y.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Y.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Y.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...Y.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e==null?void 0:e.position,...Y.errToObj(e==null?void 0:e.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...Y.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...Y.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...Y.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...Y.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...Y.errToObj(e)})}nonempty(t){return this.min(1,Y.errToObj(t))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};qn.create=r=>{var t;return new qn({checks:[],typeName:J.ZodString,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...ie(r)})};function TI(r,t){let e=(r.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=e>i?e:i,o=parseInt(r.toFixed(n).replace(".","")),a=parseInt(t.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}var zo=class r extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==U.number){let o=this._getOrReturnCtx(t);return H(o,{code:B.invalid_type,expected:U.number,received:o.parsedType}),K}let i,n=new pt;for(let o of this._def.checks)o.kind==="int"?fe.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),H(i,{code:B.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?TI(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),H(i,{code:B.not_finite,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,Y.toString(e))}gt(t,e){return this.setLimit("min",t,!1,Y.toString(e))}lte(t,e){return this.setLimit("max",t,!0,Y.toString(e))}lt(t,e){return this.setLimit("max",t,!1,Y.toString(e))}setLimit(t,e,i,n){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:Y.toString(n)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Y.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Y.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:Y.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:Y.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Y.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Y.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&fe.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(e===null||i.value>e)&&(e=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(e)&&Number.isFinite(t)}};zo.create=r=>new zo({checks:[],typeName:J.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...ie(r)});var qo=class r extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==U.bigint){let o=this._getOrReturnCtx(t);return H(o,{code:B.invalid_type,expected:U.bigint,received:o.parsedType}),K}let i,n=new pt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),H(i,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,Y.toString(e))}gt(t,e){return this.setLimit("min",t,!1,Y.toString(e))}lte(t,e){return this.setLimit("max",t,!0,Y.toString(e))}lt(t,e){return this.setLimit("max",t,!1,Y.toString(e))}setLimit(t,e,i,n){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:i,message:Y.toString(n)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Y.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:Y.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};qo.create=r=>{var t;return new qo({checks:[],typeName:J.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!==null&&t!==void 0?t:!1,...ie(r)})};var $o=class extends ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==U.boolean){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.boolean,received:i.parsedType}),K}return St(t.data)}};$o.create=r=>new $o({typeName:J.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...ie(r)});var Jo=class r extends ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==U.date){let o=this._getOrReturnCtx(t);return H(o,{code:B.invalid_type,expected:U.date,received:o.parsedType}),K}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return H(o,{code:B.invalid_date}),K}let i=new pt,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),H(n,{code:B.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),H(n,{code:B.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):fe.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:Y.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:Y.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};Jo.create=r=>new Jo({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:J.ZodDate,...ie(r)});var Ts=class extends ne{_parse(t){if(this._getType(t)!==U.symbol){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.symbol,received:i.parsedType}),K}return St(t.data)}};Ts.create=r=>new Ts({typeName:J.ZodSymbol,...ie(r)});var Qo=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.undefined,received:i.parsedType}),K}return St(t.data)}};Qo.create=r=>new Qo({typeName:J.ZodUndefined,...ie(r)});var Ko=class extends ne{_parse(t){if(this._getType(t)!==U.null){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.null,received:i.parsedType}),K}return St(t.data)}};Ko.create=r=>new Ko({typeName:J.ZodNull,...ie(r)});var $n=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return St(t.data)}};$n.create=r=>new $n({typeName:J.ZodAny,...ie(r)});var Ki=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return St(t.data)}};Ki.create=r=>new Ki({typeName:J.ZodUnknown,...ie(r)});var Ar=class extends ne{_parse(t){let e=this._getOrReturnCtx(t);return H(e,{code:B.invalid_type,expected:U.never,received:e.parsedType}),K}};Ar.create=r=>new Ar({typeName:J.ZodNever,...ie(r)});var Ms=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.void,received:i.parsedType}),K}return St(t.data)}};Ms.create=r=>new Ms({typeName:J.ZodVoid,...ie(r)});var en=class r extends ne{_parse(t){let{ctx:e,status:i}=this._processInputParams(t),n=this._def;if(e.parsedType!==U.array)return H(e,{code:B.invalid_type,expected:U.array,received:e.parsedType}),K;if(n.exactLength!==null){let a=e.data.length>n.exactLength.value,l=e.data.length<n.exactLength.value;(a||l)&&(H(e,{code:a?B.too_big:B.too_small,minimum:l?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&e.data.length<n.minLength.value&&(H(e,{code:B.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&e.data.length>n.maxLength.value&&(H(e,{code:B.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),e.common.async)return Promise.all([...e.data].map((a,l)=>n.type._parseAsync(new mr(e,a,e.path,l)))).then(a=>pt.mergeArray(i,a));let o=[...e.data].map((a,l)=>n.type._parseSync(new mr(e,a,e.path,l)));return pt.mergeArray(i,o)}get element(){return this._def.type}min(t,e){return new r({...this._def,minLength:{value:t,message:Y.toString(e)}})}max(t,e){return new r({...this._def,maxLength:{value:t,message:Y.toString(e)}})}length(t,e){return new r({...this._def,exactLength:{value:t,message:Y.toString(e)}})}nonempty(t){return this.min(1,t)}};en.create=(r,t)=>new en({type:r,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...ie(t)});function xs(r){if(r instanceof Gt){let t={};for(let e in r.shape){let i=r.shape[e];t[e]=fr.create(xs(i))}return new Gt({...r._def,shape:()=>t})}else return r instanceof en?new en({...r._def,type:xs(r.element)}):r instanceof fr?fr.create(xs(r.unwrap())):r instanceof hi?hi.create(xs(r.unwrap())):r instanceof di?di.create(r.items.map(t=>xs(t))):r}var Gt=class r extends ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=fe.objectKeys(t);return this._cached={shape:t,keys:e}}_parse(t){if(this._getType(t)!==U.object){let u=this._getOrReturnCtx(t);return H(u,{code:B.invalid_type,expected:U.object,received:u.parsedType}),K}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ar&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||l.push(u);let c=[];for(let u of a){let d=o[u],m=n.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new mr(n,m,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Ar){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")l.length>0&&(H(n,{code:B.unrecognized_keys,keys:l}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of l){let m=n.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new mr(n,m,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let m=await d.key,y=await d.value;u.push({key:m,value:y,alwaysSet:d.alwaysSet})}return u}).then(u=>pt.mergeObjectSync(i,u)):pt.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return Y.errToObj,new r({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,i)=>{var n,o,a,l;let c=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,e,i).message)!==null&&a!==void 0?a:i.defaultError;return e.code==="unrecognized_keys"?{message:(l=Y.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(t){return new r({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new r({...this._def,catchall:t})}pick(t){let e={};return fe.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(e[i]=this.shape[i])}),new r({...this._def,shape:()=>e})}omit(t){let e={};return fe.objectKeys(this.shape).forEach(i=>{t[i]||(e[i]=this.shape[i])}),new r({...this._def,shape:()=>e})}deepPartial(){return xs(this)}partial(t){let e={};return fe.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];t&&!t[i]?e[i]=n:e[i]=n.optional()}),new r({...this._def,shape:()=>e})}required(t){let e={};return fe.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])e[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof fr;)o=o._def.innerType;e[i]=o}}),new r({...this._def,shape:()=>e})}keyof(){return cS(fe.objectKeys(this.shape))}};Gt.create=(r,t)=>new Gt({shape:()=>r,unknownKeys:"strip",catchall:Ar.create(),typeName:J.ZodObject,...ie(t)});Gt.strictCreate=(r,t)=>new Gt({shape:()=>r,unknownKeys:"strict",catchall:Ar.create(),typeName:J.ZodObject,...ie(t)});Gt.lazycreate=(r,t)=>new Gt({shape:r,unknownKeys:"strip",catchall:Ar.create(),typeName:J.ZodObject,...ie(t)});var ea=class extends ne{_parse(t){let{ctx:e}=this._processInputParams(t),i=this._def.options;function n(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return e.common.issues.push(...l.ctx.common.issues),l.result;let a=o.map(l=>new er(l.ctx.common.issues));return H(e,{code:B.invalid_union,unionErrors:a}),K}if(e.common.async)return Promise.all(i.map(async o=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await o._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let c of i){let u={...e,common:{...e.common,issues:[]},parent:null},d=c._parseSync({data:e.data,path:e.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return e.common.issues.push(...o.ctx.common.issues),o.result;let l=a.map(c=>new er(c));return H(e,{code:B.invalid_union,unionErrors:l}),K}}get options(){return this._def.options}};ea.create=(r,t)=>new ea({options:r,typeName:J.ZodUnion,...ie(t)});var Qi=r=>r instanceof ra?Qi(r.schema):r instanceof tr?Qi(r.innerType()):r instanceof ia?[r.value]:r instanceof na?r.options:r instanceof oa?fe.objectValues(r.enum):r instanceof aa?Qi(r._def.innerType):r instanceof Qo?[void 0]:r instanceof Ko?[null]:r instanceof fr?[void 0,...Qi(r.unwrap())]:r instanceof hi?[null,...Qi(r.unwrap())]:r instanceof Rc||r instanceof la?Qi(r.unwrap()):r instanceof sa?Qi(r._def.innerType):[],Bh=class r extends ne{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==U.object)return H(e,{code:B.invalid_type,expected:U.object,received:e.parsedType}),K;let i=this.discriminator,n=e.data[i],o=this.optionsMap.get(n);return o?e.common.async?o._parseAsync({data:e.data,path:e.path,parent:e}):o._parseSync({data:e.data,path:e.path,parent:e}):(H(e,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,i){let n=new Map;for(let o of e){let a=Qi(o.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let l of a){if(n.has(l))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(l)));n.set(l,o)}}return new r({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:n,...ie(i)})}};function h1(r,t){let e=zn(r),i=zn(t);if(r===t)return{valid:!0,data:r};if(e===U.object&&i===U.object){let n=fe.objectKeys(t),o=fe.objectKeys(r).filter(l=>n.indexOf(l)!==-1),a={...r,...t};for(let l of o){let c=h1(r[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(e===U.array&&i===U.array){if(r.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],l=t[o],c=h1(a,l);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return e===U.date&&i===U.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}var ta=class extends ne{_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=(o,a)=>{if(p1(o)||p1(a))return K;let l=h1(o.value,a.value);return l.valid?((d1(o)||d1(a))&&e.dirty(),{status:e.value,value:l.data}):(H(i,{code:B.invalid_intersection_types}),K)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ta.create=(r,t,e)=>new ta({left:r,right:t,typeName:J.ZodIntersection,...ie(e)});var di=class r extends ne{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.array)return H(i,{code:B.invalid_type,expected:U.array,received:i.parsedType}),K;if(i.data.length<this._def.items.length)return H(i,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let o=[...i.data].map((a,l)=>{let c=this._def.items[l]||this._def.rest;return c?c._parse(new mr(i,a,i.path,l)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>pt.mergeArray(e,a)):pt.mergeArray(e,o)}get items(){return this._def.items}rest(t){return new r({...this._def,rest:t})}};di.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new di({items:r,typeName:J.ZodTuple,rest:null,...ie(t)})};var Rh=class r extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.object)return H(i,{code:B.invalid_type,expected:U.object,received:i.parsedType}),K;let n=[],o=this._def.keyType,a=this._def.valueType;for(let l in i.data)n.push({key:o._parse(new mr(i,l,i.path,l)),value:a._parse(new mr(i,i.data[l],i.path,l)),alwaysSet:l in i.data});return i.common.async?pt.mergeObjectAsync(e,n):pt.mergeObjectSync(e,n)}get element(){return this._def.valueType}static create(t,e,i){return e instanceof ne?new r({keyType:t,valueType:e,typeName:J.ZodRecord,...ie(i)}):new r({keyType:qn.create(),valueType:t,typeName:J.ZodRecord,...ie(e)})}},Ps=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.map)return H(i,{code:B.invalid_type,expected:U.map,received:i.parsedType}),K;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([l,c],u)=>({key:n._parse(new mr(i,l,i.path,[u,"key"])),value:o._parse(new mr(i,c,i.path,[u,"value"]))}));if(i.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return K;(u.status==="dirty"||d.status==="dirty")&&e.dirty(),l.set(u.value,d.value)}return{status:e.value,value:l}})}else{let l=new Map;for(let c of a){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return K;(u.status==="dirty"||d.status==="dirty")&&e.dirty(),l.set(u.value,d.value)}return{status:e.value,value:l}}}};Ps.create=(r,t,e)=>new Ps({valueType:t,keyType:r,typeName:J.ZodMap,...ie(e)});var Is=class r extends ne{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.set)return H(i,{code:B.invalid_type,expected:U.set,received:i.parsedType}),K;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(H(i,{code:B.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),e.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(H(i,{code:B.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),e.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let d of c){if(d.status==="aborted")return K;d.status==="dirty"&&e.dirty(),u.add(d.value)}return{status:e.value,value:u}}let l=[...i.data.values()].map((c,u)=>o._parse(new mr(i,c,i.path,u)));return i.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,e){return new r({...this._def,minSize:{value:t,message:Y.toString(e)}})}max(t,e){return new r({...this._def,maxSize:{value:t,message:Y.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};Is.create=(r,t)=>new Is({valueType:r,minSize:null,maxSize:null,typeName:J.ZodSet,...ie(t)});var Nh=class r extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==U.function)return H(e,{code:B.invalid_type,expected:U.function,received:e.parsedType}),K;function i(l,c){return kh({data:l,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ah(),Ss].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:c}})}function n(l,c){return kh({data:l,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ah(),Ss].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:c}})}let o={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof Jn){let l=this;return St(async function(...c){let u=new er([]),d=await l._def.args.parseAsync(c,o).catch(g=>{throw u.addIssue(i(c,g)),u}),m=await Reflect.apply(a,this,d);return await l._def.returns._def.type.parseAsync(m,o).catch(g=>{throw u.addIssue(n(m,g)),u})})}else{let l=this;return St(function(...c){let u=l._def.args.safeParse(c,o);if(!u.success)throw new er([i(c,u.error)]);let d=Reflect.apply(a,this,u.data),m=l._def.returns.safeParse(d,o);if(!m.success)throw new er([n(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new r({...this._def,args:di.create(t).rest(Ki.create())})}returns(t){return new r({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,i){return new r({args:t||di.create([]).rest(Ki.create()),returns:e||Ki.create(),typeName:J.ZodFunction,...ie(i)})}},ra=class extends ne{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};ra.create=(r,t)=>new ra({getter:r,typeName:J.ZodLazy,...ie(t)});var ia=class extends ne{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return H(e,{received:e.data,code:B.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:t.data}}get value(){return this._def.value}};ia.create=(r,t)=>new ia({value:r,typeName:J.ZodLiteral,...ie(t)});function cS(r,t){return new na({values:r,typeName:J.ZodEnum,...ie(t)})}var na=class r extends ne{constructor(){super(...arguments),Ac.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),i=this._def.values;return H(e,{expected:fe.joinValues(i),received:e.parsedType,code:B.invalid_type}),K}if(Fh(this,Ac,"f")||oS(this,Ac,new Set(this._def.values),"f"),!Fh(this,Ac,"f").has(t.data)){let e=this._getOrReturnCtx(t),i=this._def.values;return H(e,{received:e.data,code:B.invalid_enum_value,options:i}),K}return St(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return r.create(t,{...this._def,...e})}exclude(t,e=this._def){return r.create(this.options.filter(i=>!t.includes(i)),{...this._def,...e})}};Ac=new WeakMap;na.create=cS;var oa=class extends ne{constructor(){super(...arguments),kc.set(this,void 0)}_parse(t){let e=fe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==U.string&&i.parsedType!==U.number){let n=fe.objectValues(e);return H(i,{expected:fe.joinValues(n),received:i.parsedType,code:B.invalid_type}),K}if(Fh(this,kc,"f")||oS(this,kc,new Set(fe.getValidEnumValues(this._def.values)),"f"),!Fh(this,kc,"f").has(t.data)){let n=fe.objectValues(e);return H(i,{received:i.data,code:B.invalid_enum_value,options:n}),K}return St(t.data)}get enum(){return this._def.values}};kc=new WeakMap;oa.create=(r,t)=>new oa({values:r,typeName:J.ZodNativeEnum,...ie(t)});var Jn=class extends ne{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==U.promise&&e.common.async===!1)return H(e,{code:B.invalid_type,expected:U.promise,received:e.parsedType}),K;let i=e.parsedType===U.promise?e.data:Promise.resolve(e.data);return St(i.then(n=>this._def.type.parseAsync(n,{path:e.path,errorMap:e.common.contextualErrorMap})))}};Jn.create=(r,t)=>new Jn({type:r,typeName:J.ZodPromise,...ie(t)});var tr=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:a=>{H(i,a),a.fatal?e.abort():e.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async l=>{if(e.value==="aborted")return K;let c=await this._def.schema._parseAsync({data:l,path:i.path,parent:i});return c.status==="aborted"?K:c.status==="dirty"||e.value==="dirty"?Cs(c.value):c});{if(e.value==="aborted")return K;let l=this._def.schema._parseSync({data:a,path:i.path,parent:i});return l.status==="aborted"?K:l.status==="dirty"||e.value==="dirty"?Cs(l.value):l}}if(n.type==="refinement"){let a=l=>{let c=n.refinement(l,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(i.common.async===!1){let l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?K:(l.status==="dirty"&&e.dirty(),a(l.value),{status:e.value,value:l.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>l.status==="aborted"?K:(l.status==="dirty"&&e.dirty(),a(l.value).then(()=>({status:e.value,value:l.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Fc(a))return a;let l=n.transform(a.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:l}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Fc(a)?Promise.resolve(n.transform(a.value,o)).then(l=>({status:e.value,value:l})):a);fe.assertNever(n)}};tr.create=(r,t,e)=>new tr({schema:r,typeName:J.ZodEffects,effect:t,...ie(e)});tr.createWithPreprocess=(r,t,e)=>new tr({schema:t,effect:{type:"preprocess",transform:r},typeName:J.ZodEffects,...ie(e)});var fr=class extends ne{_parse(t){return this._getType(t)===U.undefined?St(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fr.create=(r,t)=>new fr({innerType:r,typeName:J.ZodOptional,...ie(t)});var hi=class extends ne{_parse(t){return this._getType(t)===U.null?St(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};hi.create=(r,t)=>new hi({innerType:r,typeName:J.ZodNullable,...ie(t)});var aa=class extends ne{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return e.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};aa.create=(r,t)=>new aa({innerType:r,typeName:J.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ie(t)});var sa=class extends ne{_parse(t){let{ctx:e}=this._processInputParams(t),i={...e,common:{...e.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Bc(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new er(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};sa.create=(r,t)=>new sa({innerType:r,typeName:J.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ie(t)});var ws=class extends ne{_parse(t){if(this._getType(t)!==U.nan){let i=this._getOrReturnCtx(t);return H(i,{code:B.invalid_type,expected:U.nan,received:i.parsedType}),K}return{status:"valid",value:t.data}}};ws.create=r=>new ws({typeName:J.ZodNaN,...ie(r)});var MI=Symbol("zod_brand"),Rc=class extends ne{_parse(t){let{ctx:e}=this._processInputParams(t),i=e.data;return this._def.type._parse({data:i,path:e.path,parent:e})}unwrap(){return this._def.type}},Nc=class r extends ne{_parse(t){let{status:e,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?K:o.status==="dirty"?(e.dirty(),Cs(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?K:n.status==="dirty"?(e.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,e){return new r({in:t,out:e,typeName:J.ZodPipeline})}},la=class extends ne{_parse(t){let e=this._def.innerType._parse(t),i=n=>(Fc(n)&&(n.value=Object.freeze(n.value)),n);return Bc(e)?e.then(n=>i(n)):i(e)}unwrap(){return this._def.innerType}};la.create=(r,t)=>new la({innerType:r,typeName:J.ZodReadonly,...ie(t)});function uS(r,t={},e){return r?$n.create().superRefine((i,n)=>{var o,a;if(!r(i)){let l=typeof t=="function"?t(i):typeof t=="string"?{message:t}:t,c=(a=(o=l.fatal)!==null&&o!==void 0?o:e)!==null&&a!==void 0?a:!0,u=typeof l=="string"?{message:l}:l;n.addIssue({code:"custom",...u,fatal:c})}}):$n.create()}var PI={object:Gt.lazycreate},J;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(J||(J={}));var II=(r,t={message:"Input not instance of ".concat(r.name)})=>uS(e=>e instanceof r,t),pS=qn.create,dS=zo.create,wI=ws.create,EI=qo.create,hS=$o.create,_I=Jo.create,DI=Ts.create,OI=Qo.create,LI=Ko.create,AI=$n.create,kI=Ki.create,FI=Ar.create,BI=Ms.create,RI=en.create,NI=Gt.create,GI=Gt.strictCreate,VI=ea.create,jI=Bh.create,HI=ta.create,UI=di.create,WI=Rh.create,ZI=Ps.create,XI=Is.create,YI=Nh.create,zI=ra.create,qI=ia.create,$I=na.create,JI=oa.create,QI=Jn.create,iS=tr.create,KI=fr.create,ew=hi.create,tw=tr.createWithPreprocess,rw=Nc.create,iw=()=>pS().optional(),nw=()=>dS().optional(),ow=()=>hS().optional(),aw={string:r=>qn.create({...r,coerce:!0}),number:r=>zo.create({...r,coerce:!0}),boolean:r=>$o.create({...r,coerce:!0}),bigint:r=>qo.create({...r,coerce:!0}),date:r=>Jo.create({...r,coerce:!0})},sw=K,E=Object.freeze({__proto__:null,defaultErrorMap:Ss,setErrorMap:sI,getErrorMap:Ah,makeIssue:kh,EMPTY_PATH:lI,addIssueToContext:H,ParseStatus:pt,INVALID:K,DIRTY:Cs,OK:St,isAborted:p1,isDirty:d1,isValid:Fc,isAsync:Bc,get util(){return fe},get objectUtil(){return u1},ZodParsedType:U,getParsedType:zn,ZodType:ne,datetimeRegex:lS,ZodString:qn,ZodNumber:zo,ZodBigInt:qo,ZodBoolean:$o,ZodDate:Jo,ZodSymbol:Ts,ZodUndefined:Qo,ZodNull:Ko,ZodAny:$n,ZodUnknown:Ki,ZodNever:Ar,ZodVoid:Ms,ZodArray:en,ZodObject:Gt,ZodUnion:ea,ZodDiscriminatedUnion:Bh,ZodIntersection:ta,ZodTuple:di,ZodRecord:Rh,ZodMap:Ps,ZodSet:Is,ZodFunction:Nh,ZodLazy:ra,ZodLiteral:ia,ZodEnum:na,ZodNativeEnum:oa,ZodPromise:Jn,ZodEffects:tr,ZodTransformer:tr,ZodOptional:fr,ZodNullable:hi,ZodDefault:aa,ZodCatch:sa,ZodNaN:ws,BRAND:MI,ZodBranded:Rc,ZodPipeline:Nc,ZodReadonly:la,custom:uS,Schema:ne,ZodSchema:ne,late:PI,get ZodFirstPartyTypeKind(){return J},coerce:aw,any:AI,array:RI,bigint:EI,boolean:hS,date:_I,discriminatedUnion:jI,effect:iS,enum:$I,function:YI,instanceof:II,intersection:HI,lazy:zI,literal:qI,map:ZI,nan:wI,nativeEnum:JI,never:FI,null:LI,nullable:ew,number:dS,object:NI,oboolean:ow,onumber:nw,optional:KI,ostring:iw,pipeline:rw,preprocess:tw,promise:QI,record:WI,set:XI,strictObject:GI,string:pS,symbol:DI,transformer:iS,tuple:UI,undefined:OI,union:VI,unknown:kI,void:BI,NEVER:sw,ZodIssueCode:B,quotelessJson:aI,ZodError:er});var lw=E.object({limit:E.enum(["same-floor","same-elevation"]).optional(),radius:E.number().optional(),types:E.array(E.enum(["node","point-of-interest"])).min(1)}),fi,Vc,Gc=class{constructor(t){C(this,fi,void 0);C(this,Vc,void 0);M(this,fi,t),M(this,Vc,new Lh(s(this,fi)))}nearest(t,e){try{lw.parse(e)}catch(a){O.error(a);return}let i=Ke(t);if(!i)return;let n=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let a of s(this,fi).getByType("floor-stack")){let l=a.defaultFloor;l&&n.push(l.id)}else if(e.limit==="same-elevation"){let a=s(this,fi).floorsById[i.floorId];if(a){let l=a==null?void 0:a.elevation;l&&(n=s(this,fi).getByType("floor-stack").map(c=>{var u;return(u=c.floors.find(d=>d.elevation===l))==null?void 0:u.id}).filter(Boolean))}}let o=[];for(let a of k4(e.types))for(let l of n){let c=s(this,Vc).getTreeByType(a,s(this,fi).mapName,l).find(i.latitude,i.longitude,e.radius);if(c){let u=s(this,fi).getById(a,c==null?void 0:c.properties.id);u&&o.push({distance:Lr([i.longitude,i.latitude],c.geometry.coordinates),feature:u})}}return o.sort((a,l)=>a.distance-l.distance)}};fi=new WeakMap,Vc=new WeakMap;var ee,Es,_s=class extends z{constructor(e,i){var l,c,u,d;super();p(this,"Analytics");C(this,ee,{});p(this,"Query");p(this,"mvf");p(this,"outdoorViewToken");p(this,"spaceIdsByDestinationNodeId");p(this,"objectEntranceNodeIdsByObstructionId");p(this,"obstructionIdByEntranceId");p(this,"venue");p(this,"sasToken");p(this,"directions");p(this,"enterpriseMode",!1);p(this,"nodesById");p(this,"spacesById");p(this,"floorsById");p(this,"floorStacksById");p(this,"facadesById");p(this,"facadesBySpaceId");p(this,"connectionsById");p(this,"objectsById");p(this,"doorsById");p(this,"pointsOfInterestById");p(this,"annotationsById");p(this,"areasById");p(this,"locationsById");p(this,"categoriesById");p(this,"doorsByNodeId");p(this,"locationsBySpaceId");p(this,"locationIdsByNodeId");p(this,"mvfAnnotationsById");p(this,"mvfConnectionsById");p(this,"mvfConnectionsByNodeId");p(this,"mvfEntrancesById");p(this,"mvfNodesById");p(this,"mvfObstructionById");p(this,"mvfSpacesById");p(this,"mvfFloorsById");p(this,"mvfFloorStacksById");p(this,"mvfAreasById");p(this,"mvfNodesByFloorId");p(this,"mvfSpacesByFloorId");p(this,"mvfPoisByFloorId");p(this,"mvfEntrancesByFloorId");p(this,"mvfAnnotationsByFloorId");p(this,"localePacksUrls");p(this,"currentLanguage");p(this,"languagePacks",{});p(this,"binaryBundle");p(this,"envControl");C(this,Es,void 0);p(this,"getDirectionsMultiDestination",(e,i,n)=>this.getDirections(e,i,{...n,multiDestination:!0}));p(this,"getDirections",(e,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:l=!1}=n||{},c=typeof a=="object"?a.enabled:a,u=typeof a=="object"?a.radius:void 0,d=(n==null?void 0:n.zones)||[],m={accessible:o,zones:d,smoothing:{enabled:c!=null?c:!0,radius:u!=null?u:.75}};if(l&&Array.isArray(i)){let y=Array.isArray(e)?e:[e],g=[];for(let x of i){let T=Array.isArray(x)?x:[x],v=this.directions.getDirections(y,T,m,this);if(!v){O.error("getDirections failed due to missing directions for one of the segments");return}y=T,g.push(v)}return g}else{let y=Array.isArray(e)?e:[e],g=Array.isArray(i)?i:[i];if(Array.isArray(g[0])){O.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&g[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,g[0].id),this.directions.getDirections(y,g,m,this)}});let n=(l=i==null?void 0:i.env)!=null?l:Io();this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new $a,this.localePacksUrls=(c=i==null?void 0:i.localePacksUrls)!=null?c:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.enterpriseMode=(u=i==null?void 0:i.enterprise)!=null?u:!1,this.sasToken=i==null?void 0:i.sasToken;let o=b4(e,this);this.nodesById=o.nodesById,this.spacesById=o.spacesById,this.floorsById=o.floorsById,this.floorStacksById=o.floorStacksById,this.facadesById=o.facadesById,this.facadesBySpaceId=o.facadesBySpaceId,this.connectionsById=o.connectionsById,this.objectsById=o.objectsById,this.doorsById=o.doorsById,this.pointsOfInterestById=o.poisById,this.annotationsById=o.annotationsById,this.areasById=o.areasById,this.mvfAnnotationsById=o.mvfAnnotationsById,this.mvfConnectionsById=o.mvfConnectionsById,this.mvfConnectionsByNodeId=o.mvfConnectionsByNodeId,this.mvfEntrancesById=o.mvfEntrancesById,this.mvfNodesById=o.mvfNodesById,this.mvfObstructionById=o.mvfObstructionById,this.mvfSpacesById=o.mvfSpacesById,this.mvfFloorsById=o.mvfFloorsById,this.mvfFloorStacksById=o.mvfFloorStacksById,this.mvfNodesByFloorId=o.mvfNodesByFloorId,this.mvfSpacesByFloorId=o.mvfSpacesByFloorId,this.mvfPoisByFloorId=o.mvfPoisByFloorId,this.mvfEntrancesByFloorId=o.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=o.mvfAnnotationsByFloorId,this.mvfAreasById=o.mvfAreasById,this.doorsByNodeId=o.doorsByNodeId,this.spaceIdsByDestinationNodeId=o.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=o.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=o.obstructionIdByEntranceId;let a=v4(e,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.locationsBySpaceId=a.locationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,a.venue.name!=null){this.venue=new Jg(this,{mvfData:a.venue});let m={};for(let y in a.mvfLocationsById)m[y]=a.mvfLocationsById[y];for(let y in a.locationInstancesById)m[y]=a.locationInstancesById[y];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:m,categories:a.mvfCategoriesById}},(d=i==null?void 0:i.languagePacks)==null||d.forEach(({language:y,localePack:g})=>{this.languagePacks[y.code]=Qg(g)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Gc(this),this.directions=new _h({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map"})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new ae(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return s(this,ee).spaces==null&&(s(this,ee).spaces=globalThis.Object.values(this.spacesById)),s(this,ee).spaces}get objects(){return s(this,ee).objects==null&&(s(this,ee).objects=globalThis.Object.values(this.objectsById)),s(this,ee).objects}get connections(){return s(this,ee).connections==null&&(s(this,ee).connections=globalThis.Object.values(this.connectionsById)),s(this,ee).connections}get floors(){return s(this,ee).floors==null&&(s(this,ee).floors=globalThis.Object.values(this.floorsById)),s(this,ee).floors}get floorStacks(){return s(this,ee).floorStacks==null&&(s(this,ee).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,ee).floorStacks}get facades(){return s(this,ee).facades==null&&(s(this,ee).facades=globalThis.Object.values(this.facadesById)),s(this,ee).facades}get doors(){return s(this,ee).doors==null&&(s(this,ee).doors=globalThis.Object.values(this.doorsById)),s(this,ee).doors}get pointsOfInterest(){return s(this,ee).pointsOfInterest==null&&(s(this,ee).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,ee).pointsOfInterest}get annotations(){return s(this,ee).annotations==null&&(s(this,ee).annotations=globalThis.Object.values(this.annotationsById)),s(this,ee).annotations}get areas(){return s(this,ee).areas==null&&(s(this,ee).areas=globalThis.Object.values(this.areasById)),s(this,ee).areas}get nodes(){return s(this,ee).nodes==null&&(s(this,ee).nodes=globalThis.Object.values(this.nodesById)),s(this,ee).nodes}get locations(){return s(this,ee).locations==null&&(s(this,ee).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,ee).categories==null&&(s(this,ee).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get mvfFloors(){return s(this,ee).mvfFloors==null&&(s(this,ee).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,ee).mvfFloors}get mvfFloorStacks(){return s(this,ee).mvfFloorStacks==null&&(s(this,ee).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,ee).mvfFloorStacks}getByType(e){switch(e){case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":return this.connectionsById[i];case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:throw new Error("Unknown type: ".concat(e))}}getMapDataById(e){var i,n,o,a,l,c,u,d,m,y;return(y=(m=(d=(u=(c=(l=(a=(o=(n=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?n:this.floorStacksById[e])!=null?o:this.facadesById[e])!=null?a:this.nodesById[e])!=null?l:this.doorsById[e])!=null?c:this.connectionsById[e])!=null?u:this.objectsById[e])!=null?d:this.pointsOfInterestById[e])!=null?m:this.annotationsById[e])!=null?y:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,n,o){var u,d;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,l=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!l)return o;let c=(d=(u=this.languagePacks[a])==null?void 0:u.optimized)==null?void 0:d[l];if(c){let m=c[n];if(m!=null&&m[i]!==void 0)return m[i]}return o}async changeLanguage(e){var l;let i=e.toLowerCase();if(!i){O.error("language code must be defined");return}if(!this.currentLanguage){O.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(l=this.venue)==null?void 0:l.languages.find(({code:c})=>c.toLowerCase()===i.toLowerCase());if(!o){O.warn("language not found");return}if(n===o.code)return;let a=this.languagePacks[o.code];if(!a){let c=this.localePacksUrls[o.code];if(!c){O.error("locale packs url not found for ".concat(o.code));return}s(this,Es)&&s(this,Es).abort();let u=new AbortController;M(this,Es,u);let d;try{d=await qv(c,{signal:u.signal})}catch(m){O.error("failed downloading language pack",m);return}if(!d||u.signal.aborted)return;a=Qg(d),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let n=Ke(e),o=Ke(i);return Lr([n.longitude,n.latitude],[o.longitude,o.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var n;let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await Am(this.localePacksUrls[a.code],{signal:o.signal}),c=await Qa(l);c&&i.push({language:{code:a.code,name:a.name},localePack:c})}}catch(l){O.warn("failed downloading language pack",l)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var n;if(!this.binaryBundle){O.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await Am(this.localePacksUrls[a.code],{signal:o.signal});l&&i.push({language:{code:a.code,name:a.name},localePack:l})}}catch(l){O.warn("failed downloading language pack",l)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(s(this,ee)))s(this,ee)[e]=null}};ee=new WeakMap,Es=new WeakMap;f();f();f();f();f();f();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();f();f();f();f();function fS(r){return ud(r)}var mi=class extends Wa{constructor(){super(...arguments);p(this,"type","entityBatchedMesh");p(this,"userData",{entities:{}})}},jc,Hc,ca,Be=class{constructor(t){p(this,"mesh");p(this,"focusMesh");p(this,"outline");p(this,"imageMesh");p(this,"textMesh");p(this,"textEntityId");p(this,"type","geometry");p(this,"dirty",!0);p(this,"detached",!1);p(this,"instanceIndex",-1);p(this,"geometry");p(this,"material");p(this,"feature");p(this,"currentHeight",.1);p(this,"focusable",!1);p(this,"color",new Ie);p(this,"topColor",new Ie);p(this,"position",new $);C(this,jc,0);C(this,Hc,1);C(this,ca,void 0);p(this,"texturesVisible",!1);this.feature=t}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(t){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,t),this.imageMesh&&(this.imageMesh.visible=t)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}setColor(t,e){this.color.set(t),this.topColor.set(e),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var t;return(t=this.material)==null?void 0:t.getColor(this.instanceIndex)}get altitude(){return s(this,jc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,jc,t))}get opacity(){return s(this,Hc)}set opacity(t){this.material&&(this.material.opacity=t,this.material.transparent=t<1,this.material.needsUpdate=!0),M(this,Hc,t)}get texture(){var t,e;return(e=(t=this.material)==null?void 0:t.texture)==null?void 0:e.image.src}set texture(t){this.material&&(this.material.texture=t)}get textureInstance(){var t;return(t=this.material)==null?void 0:t.texture}set topTexture(t){this.material&&(this.material.topTexture=t)}get topTexture(){var t,e;return(e=(t=this.material)==null?void 0:t.topTexture)==null?void 0:e.image.src}get topTextureInstance(){var t;return(t=this.material)==null?void 0:t.topTexture}get featureBbox(){return s(this,ca)?s(this,ca):(M(this,ca,fS(this.feature)),s(this,ca))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};jc=new WeakMap,Hc=new WeakMap,ca=new WeakMap;f();var uw="#ffffff",Qn,ua=class{constructor(t={}){p(this,"color",uw);p(this,"topColor");p(this,"opacity",1);p(this,"height");C(this,Qn,void 0);p(this,"outline",!0);p(this,"texture");p(this,"topTexture");p(this,"dirty",!0);var e,i;this.color=(e=t==null?void 0:t.color)!=null?e:this.color,this.topColor=t==null?void 0:t.topColor,this.opacity=(i=t==null?void 0:t.opacity)!=null?i:this.opacity,this.height=t==null?void 0:t.height,this.shading=t==null?void 0:t.shading,this.outline=(t==null?void 0:t.outline)!==void 0?!!t.outline:this.outline}get shading(){return s(this,Qn)}set shading(t){var e;if(!t){M(this,Qn,void 0);return}M(this,Qn,(e=s(this,Qn))!=null?e:{start:0,end:0,intensity:0}),Object.assign(s(this,Qn),t)}};Qn=new WeakMap;f();f();function Kn(r){var e;let t=(e=r.parent)==null?void 0:e.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return t instanceof So?t:void 0}f();f();f();f();var Ds=class{constructor(){p(this,"hover",!1);p(this,"dirty",!1)}};f();f();var mS=["","","low","medium","high","always-visible"];function yS(r){return Math.min(5,Math.max(2,r))}function Os(r){if(typeof r=="number")return yS(r);let t=mS.indexOf(r);return t===-1?3:t}function Uc(r){let t=yS(r);return mS[t]}var Gh=4,f1=E.object({rank:E.union([E.enum(["low","medium","high","always-visible"]),E.number()]).optional(),interactive:E.union([E.boolean(),E.literal("pointer-events-auto")]).optional(),id:E.string().optional(),anchor:E.union([E.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),E.array(E.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:E.boolean().optional()});function gS(r,t,e){E.array(E.number()).refine(i=>i.length===2||i.length===3,{message:"Array length must be either 2 or 3"}).parse(r),E.string().parse(t),f1.parse(e)}var Ls=class Ls{constructor(t,e={}){p(this,"id");p(this,"type","marker");p(this,"rank",0);p(this,"initialRank",0);p(this,"activeAnchor","center");p(this,"pointerEvents","none");p(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1});p(this,"projection",new te);p(this,"enabled",!0);p(this,"offscreen",!1);p(this,"activeStrategyIndex",-1);p(this,"strategyIndex",-1);p(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});p(this,"dimensions",{width:0,height:0});p(this,"containerEl");p(this,"contentEl",null);p(this,"contentHtml","");p(this,"style",{top:"0px",left:"0px"});p(this,"dirty",!1);p(this,"collisionDirty",!0);p(this,"visibilityNeedsUpdate","show");p(this,"visible",!1);p(this,"animation",null);p(this,"currentStrategyIndex",-1);p(this,"onStrategySelected",(t,e=!1)=>{if(this.currentStrategyIndex===t||e)return;this.currentStrategyIndex=t,this.activeAnchor=this.strategies[t].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:i,height:n}=this.dimensions,o=-n/2+"px",a=-i/2+"px";switch(this.style.top=o,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-n+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-n+"px",this.style.left=-i+"px";break}case"top-right":{this.style.top=-n+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-i+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left});p(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(e==null?void 0:e.id)||ce(),this.options={...this.options,...e},typeof e.rank=="string")this.rank=Os(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let n=Math.trunc(S.env.NODE_ENV==="test"?Ls.testId:Ls.testId*10)/10;Ls.testId+=.001,this.rank=n}typeof e.interactive=="string"&&(this.pointerEvents=e.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank;let i=document.createElement("div");i.style.opacity="0",i.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=i.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:i,height:n}=this.containerEl.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"})}get strategies(){let{width:t,height:e}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(n=>({name:n,getBoundingBox:()=>{let o=e/2,a=e/2,l=t/2,c=t/2;switch(n){case"top":{o=e,a=0;break}case"bottom":{o=0,a=e;break}case"left":{l=t,c=0;break}case"right":{l=0,c=t;break}case"top-left":{o=e,l=t,a=0,c=0;break}case"top-right":{o=e,c=t,a=0,l=0;break}case"bottom-left":{a=e,l=t,o=0,c=0;break}case"bottom-right":{a=e,c=t,o=0,l=0;break}}return[o+Gh,a+Gh,l+Gh,c+Gh]}}))}toPackedMessage(t=!1){return this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0,this.visible&&t&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((e,i)=>[...e.getBoundingBox(),i]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};p(Ls,"testId",0);var yi=Ls;f();f();function Vh(r){"@babel/helpers - typeof";return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vh(r)}var pw=/^\s+/,dw=/\s+$/;function W(r,t){if(r=r||"",t=t||{},r instanceof W)return r;if(!(this instanceof W))return new W(r,t);var e=hw(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}W.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,i,n,o,a,l;return e=t.r/255,i=t.g/255,n=t.b/255,e<=.03928?o=e/12.92:o=Math.pow((e+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},setAlpha:function(t){return this._a=MS(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=bS(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=bS(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=vS(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=vS(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return xS(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return gw(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ke(this._r,255)*100)+"%",g:Math.round(ke(this._g,255)*100)+"%",b:Math.round(ke(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ke(this._r,255)*100)+"%, "+Math.round(ke(this._g,255)*100)+"%, "+Math.round(ke(this._b,255)*100)+"%)":"rgba("+Math.round(ke(this._r,255)*100)+"%, "+Math.round(ke(this._g,255)*100)+"%, "+Math.round(ke(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:_w[xS(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+CS(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=W(t);i="#"+CS(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!e&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return W(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(Cw,arguments)},brighten:function(){return this._applyModification(Sw,arguments)},darken:function(){return this._applyModification(Tw,arguments)},desaturate:function(){return this._applyModification(vw,arguments)},saturate:function(){return this._applyModification(bw,arguments)},greyscale:function(){return this._applyModification(xw,arguments)},spin:function(){return this._applyModification(Mw,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(ww,arguments)},complement:function(){return this._applyCombination(Pw,arguments)},monochromatic:function(){return this._applyCombination(Ew,arguments)},splitcomplement:function(){return this._applyCombination(Iw,arguments)},triad:function(){return this._applyCombination(SS,[3])},tetrad:function(){return this._applyCombination(SS,[4])}};W.fromRatio=function(r,t){if(Vh(r)=="object"){var e={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?e[i]=r[i]:e[i]=Wc(r[i]));r=e}return W(r,t)};function hw(r){var t={r:0,g:0,b:0},e=1,i=null,n=null,o=null,a=!1,l=!1;return typeof r=="string"&&(r=Aw(r)),Vh(r)=="object"&&(tn(r.r)&&tn(r.g)&&tn(r.b)?(t=fw(r.r,r.g,r.b),a=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):tn(r.h)&&tn(r.s)&&tn(r.v)?(i=Wc(r.s),n=Wc(r.v),t=yw(r.h,i,n),a=!0,l="hsv"):tn(r.h)&&tn(r.s)&&tn(r.l)&&(i=Wc(r.s),o=Wc(r.l),t=mw(r.h,i,o),a=!0,l="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=MS(e),{ok:a,format:r.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}function fw(r,t,e){return{r:ke(r,255)*255,g:ke(t,255)*255,b:ke(e,255)*255}}function vS(r,t,e){r=ke(r,255),t=ke(t,255),e=ke(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,l=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=l>.5?c/(2-i-n):c/(i+n),i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,l}}function mw(r,t,e){var i,n,o;r=ke(r,360),t=ke(t,100),e=ke(e,100);function a(u,d,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?u+(d-u)*6*m:m<1/2?d:m<2/3?u+(d-u)*(2/3-m)*6:u}if(t===0)i=n=o=e;else{var l=e<.5?e*(1+t):e+t-e*t,c=2*e-l;i=a(c,l,r+1/3),n=a(c,l,r),o=a(c,l,r-1/3)}return{r:i*255,g:n*255,b:o*255}}function bS(r,t,e){r=ke(r,255),t=ke(t,255),e=ke(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,l=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,v:l}}function yw(r,t,e){r=ke(r,360)*6,t=ke(t,100),e=ke(e,100);var i=Math.floor(r),n=r-i,o=e*(1-t),a=e*(1-n*t),l=e*(1-(1-n)*t),c=i%6,u=[e,a,o,o,l,e][c],d=[l,e,e,a,o,o][c],m=[o,o,l,e,e,a][c];return{r:u*255,g:d*255,b:m*255}}function xS(r,t,e,i){var n=[Fr(Math.round(r).toString(16)),Fr(Math.round(t).toString(16)),Fr(Math.round(e).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function gw(r,t,e,i,n){var o=[Fr(Math.round(r).toString(16)),Fr(Math.round(t).toString(16)),Fr(Math.round(e).toString(16)),Fr(PS(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function CS(r,t,e,i){var n=[Fr(PS(i)),Fr(Math.round(r).toString(16)),Fr(Math.round(t).toString(16)),Fr(Math.round(e).toString(16))];return n.join("")}W.equals=function(r,t){return!r||!t?!1:W(r).toRgbString()==W(t).toRgbString()};W.random=function(){return W.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function vw(r,t){t=t===0?0:t||10;var e=W(r).toHsl();return e.s-=t/100,e.s=jh(e.s),W(e)}function bw(r,t){t=t===0?0:t||10;var e=W(r).toHsl();return e.s+=t/100,e.s=jh(e.s),W(e)}function xw(r){return W(r).desaturate(100)}function Cw(r,t){t=t===0?0:t||10;var e=W(r).toHsl();return e.l+=t/100,e.l=jh(e.l),W(e)}function Sw(r,t){t=t===0?0:t||10;var e=W(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),W(e)}function Tw(r,t){t=t===0?0:t||10;var e=W(r).toHsl();return e.l-=t/100,e.l=jh(e.l),W(e)}function Mw(r,t){var e=W(r).toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,W(e)}function Pw(r){var t=W(r).toHsl();return t.h=(t.h+180)%360,W(t)}function SS(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=W(r).toHsl(),i=[W(r)],n=360/t,o=1;o<t;o++)i.push(W({h:(e.h+o*n)%360,s:e.s,l:e.l}));return i}function Iw(r){var t=W(r).toHsl(),e=t.h;return[W(r),W({h:(e+72)%360,s:t.s,l:t.l}),W({h:(e+216)%360,s:t.s,l:t.l})]}function ww(r,t,e){t=t||6,e=e||30;var i=W(r).toHsl(),n=360/e,o=[W(r)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(W(i));return o}function Ew(r,t){t=t||6;for(var e=W(r).toHsv(),i=e.h,n=e.s,o=e.v,a=[],l=1/t;t--;)a.push(W({h:i,s:n,v:o})),o=(o+l)%1;return a}W.mix=function(r,t,e){e=e===0?0:e||50;var i=W(r).toRgb(),n=W(t).toRgb(),o=e/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return W(a)};W.readability=function(r,t){var e=W(r),i=W(t);return(Math.max(e.getLuminance(),i.getLuminance())+.05)/(Math.min(e.getLuminance(),i.getLuminance())+.05)};W.isReadable=function(r,t,e){var i=W.readability(r,t),n,o;switch(o=!1,n=kw(e),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o};W.mostReadable=function(r,t,e){var i=null,n=0,o,a,l,c;e=e||{},a=e.includeFallbackColors,l=e.level,c=e.size;for(var u=0;u<t.length;u++)o=W.readability(r,t[u]),o>n&&(n=o,i=W(t[u]));return W.isReadable(r,i,{level:l,size:c})||!a?i:(e.includeFallbackColors=!1,W.mostReadable(r,["#fff","#000"],e))};var m1=W.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_w=W.hexNames=Dw(m1);function Dw(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}function MS(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function ke(r,t){Ow(r)&&(r="100%");var e=Lw(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}function jh(r){return Math.min(1,Math.max(0,r))}function rr(r){return parseInt(r,16)}function Ow(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}function Lw(r){return typeof r=="string"&&r.indexOf("%")!=-1}function Fr(r){return r.length==1?"0"+r:""+r}function Wc(r){return r<=1&&(r=r*100+"%"),r}function PS(r){return Math.round(parseFloat(r)*255).toString(16)}function TS(r){return rr(r)/255}var kr=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function tn(r){return!!kr.CSS_UNIT.exec(r)}function Aw(r){r=r.replace(pw,"").replace(dw,"").toLowerCase();var t=!1;if(m1[r])r=m1[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=kr.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=kr.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=kr.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=kr.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=kr.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=kr.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=kr.hex8.exec(r))?{r:rr(e[1]),g:rr(e[2]),b:rr(e[3]),a:TS(e[4]),format:t?"name":"hex8"}:(e=kr.hex6.exec(r))?{r:rr(e[1]),g:rr(e[2]),b:rr(e[3]),format:t?"name":"hex"}:(e=kr.hex4.exec(r))?{r:rr(e[1]+""+e[1]),g:rr(e[2]+""+e[2]),b:rr(e[3]+""+e[3]),a:TS(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=kr.hex3.exec(r))?{r:rr(e[1]+""+e[1]),g:rr(e[2]+""+e[2]),b:rr(e[3]+""+e[3]),format:t?"name":"hex"}:!1}function kw(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}var E1=Ml(w1());var D1=E.object({rank:E.union([E.enum(["low","medium","high","always-visible"]),E.number()]).optional(),interactive:E.boolean().optional(),appearance:E.object({margin:E.number().min(6).optional(),text:E.object({numLines:E.number().optional(),lineHeight:E.number().optional(),size:E.number().optional(),maxWidth:E.number().optional(),foregroundColor:E.string().optional(),backgroundColor:E.string().optional()}).optional(),marker:E.object({size:E.number().optional(),foregroundColor:E.object({active:E.string().optional(),inactive:E.string().optional()}).optional(),backgroundColor:E.object({active:E.string().optional(),inactive:E.string().optional()}).optional()}).optional()}).optional()});function a5(r,t,e){E.array(E.number()).length(2).parse(r),E.string().parse(t),D1.parse(e||{})}var Bs={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},I_={lightOnDark:{...Bs,text:{...Bs.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Bs.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Bs,text:{...Bs.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Bs.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},w_="LOW_PRIORITY",r5=4,E_=6,__=20,D_=2.5,O_=2,L_="cover",i5=.5,n5=6.5,o5={heightAbovePolygon:0,appearance:I_.darkOnLight};var Rs=class Rs{constructor(t,e,i){p(this,"lines",0);p(this,"id");p(this,"rank");p(this,"type","label");p(this,"initialRank");p(this,"contextConfigured",!1);p(this,"fillText");p(this,"newStyle",{});p(this,"opacity",0);p(this,"visibilityNeedsUpdate",!1);p(this,"activeStrategyIndex",-1);p(this,"text");p(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});p(this,"projection",new te);p(this,"_cache",{});p(this,"appearance");p(this,"options");p(this,"visible",!1);p(this,"enabled",!0);p(this,"offscreen",!1);p(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});p(this,"dimensions",{width:0,height:0});p(this,"currentStrategyIndex",-1);p(this,"totalMarkerSize",0);p(this,"dirty",!0);p(this,"collisionDirty",!0);p(this,"lastTextAlign");p(this,"imageHash");p(this,"markerSize",0);p(this,"iconVisible",!1);p(this,"zoomProportion",0);p(this,"dp");p(this,"animate",!0);p(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;let e=this.strategies[t];e&&e.onStrategySelected(this),this.currentStrategyIndex=t;let i=this.style;this.style=this.newStyle,this.newStyle=i});p(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=e.id)!=null?o:ce(),this.options=(0,E1.default)({},e,o5),this.text=t,this.dp=(l=1)=>l*i.pixelRatio,typeof e.rank=="string")this.rank=Os(e.rank),this.initialRank=this.rank;else if(e.rank!=null&&e.rank>0)this.rank=e.rank,this.initialRank=e.rank;else{let l=Math.trunc(S.env.NODE_ENV==="test"?Rs.testId:Rs.testId*10)/10;Rs.testId+=.001,this.rank=l,this.initialRank=l}let n=(0,E1.default)({},this.options.appearance,o5.appearance);this.appearance={margin:n.margin,text:{lineHeight:n.text.lineHeight,numLines:n.text.numLines,size:n.text.size,maxWidth:n.text.maxWidth,foregroundColor:n.text.foregroundColor,backgroundColor:n.text.backgroundColor},marker:{foregroundColor:{active:n.marker.foregroundColor.active,inactive:n.marker.foregroundColor.inactive||W(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||W(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||__,iconPadding:(a=n.marker.iconPadding)!=null?a:O_,iconFit:n.marker.iconFit||L_,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?i5:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:t=i5}=this.appearance.marker,e=this.dp();this.zoomProportion<=t&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(n5)),this.totalMarkerSize=Math.ceil((this.markerSize+D_)/e)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(E_,i),o=this.iconVisible?n/2:0,a=this.iconVisible?this.totalMarkerSize:n5*2,l=[{name:"RIGHT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+t+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=this.totalMarkerSize/2+r5,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,e);return[c/2+n,c/2+n,this.totalMarkerSize/2+t+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=-t-this.totalMarkerSize/2-r5,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let c=this.dp();return[e+this.totalMarkerSize/2/c+n,this.totalMarkerSize/2+n,t/2+n,t/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-e-this.totalMarkerSize/2,this.newStyle.left=-t/2}},{name:w_,getBoundingBox:()=>[a/2+o,a/2+o,a/2+o,a/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:l}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){return this.visible&&t&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((e,i)=>[...e.getBoundingBox(),i]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};p(Rs,"testId",0);var _1=Rs,eo=_1;f();f();var $h=class extends z{constructor(e,i){super();p(this,"rendererState");p(this,"convertTo3DMapPosition");p(this,"textSet",new Set);p(this,"batchedTextMap",new Map);p(this,"debugTextAreaMesh",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}remove(e){this.textSet.delete(e)}update(e){var l,c,u;let i,n,o,a=[];for(let d of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(d),(i==null?void 0:i.type)==="text3d"){n=i.components[0],o=i.components[1];let m=(l=n.mesh)==null?void 0:l.parent;if(!m||!(m instanceof Re)||!(n instanceof Ns))continue;if((c=n.feature.properties)!=null&&c.textArea&&n.mesh!=null&&n.polygonEntityId!=null&&n.textMesh==null&&n.mesh.parent!=null&&((u=n.feature.properties)==null?void 0:u.textArea.position)!=null){if(this.textSet.has(n.polygonEntityId))continue;this.textSet.add(n.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,A1().then(({BatchedText:x})=>{let T=new x;return T.type="batchedtext",m.add(T),T}));let g=this.batchedTextMap.get(m);if(!g)throw new Error("batched text required");a.push(A_({entityId:d,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:g,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let y=this.batchedTextMap.get(m);n.textMesh&&y&&Promise.all([y,Promise.resolve({meshComponent:n,styleComponent:o})]).then(([g,{meshComponent:x,styleComponent:T}])=>{let{textMesh:v}=x;if(g&&v){let b=k1(g,v);x.visible&&!b?g.add(v):!x.visible&&b&&g.remove(v)}T.flipToFaceCamera&&this.flipIfNeeded(x,e)})}return Promise.all(a)}flipIfNeeded(e,i){let n=e.textMesh;if(!n)return!1;let o=n.rotation.z,a=wm(o+i);a>Math.PI/2&&a<3*Math.PI/2&&(n.rotation.z=wm(o+Math.PI))}showTextAreaMesh(){let e,i;for(let n of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(n),(e==null?void 0:e.type)==="text3d"){i=e.components[0];let o=i.feature.properties.textArea;if(!o)continue;let a=new vr(o.maxWidth,o.maxHeight),l=new Se(a,new Yt({color:"pink"})),{textMesh:c}=i;if(!c)continue;let u=this.convertTo3DMapPosition(o.position,$c);l.position.copy(u),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,O1.identity(),O1.makeRotationAxis(new $(0,0,1),c.userData.rotationZ),$c.set(o.maxWidth/2,0,0),$c.applyMatrix4(O1),l.position.x-=$c.x,l.position.y-=$c.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(n,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(e=>{this.rendererState.entityScene.remove(e)}),this.debugTextAreaMesh.clear(),this.publish("render")}},O1=new In,$c=new $,L1;async function s5(r){let{preloadFont:t}=await A1();return t(r)}function A1(){return L1||(L1=import("./text3d-XRL4YUO2.js").then(r=>r)),L1}async function A_({entityId:r,textComponent:t,styleComponent:e,convertTo3DMapPosition:i,batchedMeshPromise:n,rendererState:o}){return Promise.all([A1(),Promise.resolve({entityId:r,meshComponent:t,styleComponent:e})]).then(([{createTroikaText:a},l])=>a(l.entityId,l.meshComponent,l.styleComponent,i)).catch(a=>{O.warn("Trouble creating text: ",a)}).then(a=>{if(a!=null&&a.text){if(t.polygonEntityId){let l=o.geometry3DMap.get(t.polygonEntityId);if((l==null?void 0:l.type)==="geometry"){let c=l.components[0],u=l.components[1];c.textMesh=a.text,c.mesh!=null&&(a.text.position.z=u.altitude+u.height+k_)}}return Promise.all([Promise.resolve(a.text),n])}}).then(a=>{if(!a)return;let[l,c]=a;c.add(l),t.batchedText||(t.batchedText=c)})}function k1(r,t){return r._members.has(t)}var k_=.5;var F_=E.object({visible:E.boolean(),color:E.string(),flipToFaceCamera:E.boolean(),font:E.string().optional(),fontSize:E.number(),margin:E.union([E.number(),E.tuple([E.number(),E.number(),E.number(),E.number()])]),outlineColor:E.string(),outlineOpacity:E.number(),outlineBlur:E.union([E.number(),E.string()]),outlineWidth:E.number(),outlineOffsetX:E.number(),outlineOffsetY:E.number(),strokeWidth:E.number(),maxWidth:E.number().optional(),maxHeight:E.number().optional(),strokeOpacity:E.number(),strokeColor:E.string(),fillOpacity:E.number(),hoverColor:E.string().optional(),id:E.union([E.string(),E.number()]),type:E.literal("text3d"),position:E.tuple([E.number(),E.number(),E.number()]),content:E.string()}),l5=F_.partial().omit({id:!0,type:!0}).strict(),c5=l5.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),u5=E.object({appearance:l5.optional(),parentId:E.string().optional()}).strict(),Ns=class{constructor(t){p(this,"mesh",new Jr);p(this,"textMesh");p(this,"type","text3d");p(this,"feature");p(this,"parent");p(this,"batchedText");p(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?k1(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};function Mt(r,t,e){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return t===!0?(r instanceof $r&&r.components[1]===void 0?(r.components[1]=new Ds,r.components[1].dirty=!0):r instanceof Te&&r.components[2]===void 0?(r.components[2]=new Ds,r.components[2].dirty=!0):r instanceof Re&&r.components[1]===void 0&&(r.components[1]=new Ds,r.components[1].dirty=!0),!0):(r instanceof $r?r.components[1]=void 0:r instanceof Te?r.components[2]=void 0:r instanceof Re&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=e.geometry3DMap.get(n),Mt(i,t,e);return!0}}return!1}function p5(r,t,e){if(!(!(e!=null&&e.color)&&!(e!=null&&e.topColor))){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let i,n,o=r.components[0];for(let a of r.userData.entities3D.values())i=t.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=e.color||o.color,n.color=e.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=e.topColor||o.topColor,n.dirty=!0));return e.color!==void 0&&(o.color=e.color,o.dirty=!0),e.topColor!==void 0&&(o.topColor=e.topColor,o.dirty=!0),!0}return!1}}function d5(r,t){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let e=r.components[0];return e.shading=e.shading||{},e.shading&&(t.start!==e.shading.start||t.end!==e.shading.end||t.intensity!==e.shading.intensity)&&(Object.assign(e.shading,t),r.userData.shadingDirty=!0),!0}return!1}function h5(r,t){t!==void 0&&r.type==="geometry"&&(t.showImage!==void 0&&(r.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}function F1(r,t,e){var i;if(e!==void 0){if(r.type==="geometry"){let n=r.components[1];if(n.height!==e)return n.height=e,n.dirty=!0,((i=r.parent)==null?void 0:i.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){let n=r.components[0];for(let o of r.userData.entities3D.values()){let a=t.geometry3DMap.get(o),l;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(l=a.components[1],l.height===n.height&&(a.components[1].height=e,a.components[1].dirty=!0))}return r.components[0].height=e,r.userData.outlineDirty=!0,!0}}return!1}function B1(r,t){t!==void 0&&(r.type==="path"||r.type==="geometry")&&(t.initialColor!==void 0&&(r.components[1].initialColor=t.initialColor),t.color!==void 0&&(r.components[1].color=t.color),t.topColor!==void 0&&(r.components[1].topColor=t.topColor),r.components[1].dirty=!0)}function R1(r,t,e){t!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(e(t[1],t[0],t[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(e(t[1],t[0],t[2]||0)))}function N1(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==t&&r.parent instanceof Re?((e=r.parent)==null||e.removeEntity(r),t.addEntity(r),!0):!1}function f5(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=t)}function m5(r,t,e){if(t!==void 0&&r.type==="marker"){let i=r.components[0];if(t.contentHTML!==void 0)return i.containerEl.innerHTML=t.contentHTML,!0;if(t.options!=null){try{f1.parse(t.options||{})}catch(n){return O.error(n),!1}return t.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",Mt(r,!1,e)):(i.pointerEvents="none",Mt(r,t.options.interactive,e)),y5(r,t.options.rank),!0}}return!1}function y5(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Os(t),!0):!1}function g5(r,t,e){var i,n,o,a,l;if(t!==void 0&&r.type==="label"){let c=r.components[0];t.text!==void 0&&(c.text=t.text,c.dirty=!0);try{D1.parse(t.options||{})}catch(u){O.error(u);return}((i=t.options)==null?void 0:i.appearance)!==void 0&&Object.keys((n=t.options)==null?void 0:n.appearance).length>0&&(mv(c.appearance,((o=t.options)==null?void 0:o.appearance)||{}),c.dirty=!0),Mt(r,(a=t.options)==null?void 0:a.interactive,e),y5(r,(l=t.options)==null?void 0:l.rank)}}function v5(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}function b5(r,t){if(t!==void 0){let e=r.components[2];if(r.type==="geometry"&&e!=null)return e.hover=t,e.dirty=!0,!0}return!1}function G1(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}function to(r,t){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=t,r.components[1].dirty=!0;let e=r.parent;e instanceof et&&(e.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(t);return!0}return!1}function x5(r,t,e){if(e!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=t.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===i.opacity&&(o.components[1].opacity=e,o.components[1].dirty=!0))}return r.setOpacity(e),i.opacity=e,!0}return!1}function C5(r,t){if(t!==void 0&&r.type==="geometry-group"){let e=r.components[0];(t==null?void 0:t.texture)!=null&&e.texture!==(t==null?void 0:t.texture)&&(e.texture=t.texture,e.dirty=!0),(t==null?void 0:t.topTexture)!=null&&e.topTexture!==(t==null?void 0:t.topTexture)&&(e.topTexture=t.topTexture,e.dirty=!0)}}function S5(r,t){if(r.type==="geometry"){let e=!1,i=r.components[1];if((t==null?void 0:t.texture)!=null&&i.texture!==(t==null?void 0:t.texture)&&(i.texture=t.texture,e=!0),(t==null?void 0:t.topTexture)!=null&&i.topTexture!==(t==null?void 0:t.topTexture)&&(i.topTexture=t.topTexture,e=!0),e&&r.components[0]instanceof Be){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}function T5(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.opacity!==t){e.opacity=t;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let n=r.parent;return(n==null?void 0:n.type)==="geometry-group"&&(n.userData.outlineDirty=!0,n.userData.shadingDirty=!0),!0}}return!1}function Jh(r,t){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=t,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==t)return r.setAltitude(t),!0}return!1}function V1(r,t){if(t!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=t,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=t,r.components[1].dirty=!0;let e=r.parent;e instanceof et&&(e.userData.outlineDirty=!0)}return!0}return!1}function M5(r,t){return t!==void 0&&r.type==="geometry"&&r.components[0]&&r.components[0]instanceof Be?(r.components[0].focusable=t,!0):!1}function P5(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.renderOrder!==t){e.renderOrder=t;let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.dirty=!0,!0}}return!1}function I5(r,t){let{visible:e,color:i}=t;if(r.type!=="path")return;let n=r.components[0];e!=null&&to(r,e),i!=null&&B1(r,{color:i}),Object.assign(n,j1(t)),pv(t)||(n.materialDirty=!0,(t.nearRadius!=null||t.farRadius!=null)&&(n.dirty=!0))}function j1(r){return Ya(r,B_)}var B_=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function w5(r){if(!(r instanceof Te&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var Qh=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function E5(r,t){to(r,t.visible);let e=r.components[1],i=Ya(t,Qh);"margin"in t&&O.warn("update to margin is not supported atm"),"content"in t&&O.warn("content update is not supported atm");try{c5.parse(i)}catch(n){O.error(n);return}Object.keys(i).length>0&&(Object.assign(e,i),e.dirty=!0)}f();f();f();f();var Kh=class extends Q0{constructor(e){let i=e,n=3,o=n*4;super(new Float32Array(e*o),n,e,H0,j0);p(this,"_width");p(this,"_height");p(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(e,i,n){let o=this.image.data,a=e*this._width;o[a]=i.r,o[a+1]=i.g,o[a+2]=i.b,o[a+3]=0,o[a+4]=n.r,o[a+5]=n.g,o[a+6]=n.b,o[a+7]=0,this.needsUpdate=!0}getColor(e){let i=this.image.data,n=e*this._width,o=new Ie(i[n],i[n+1],i[n+2]),a=new Ie(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(e,i,n){let o=this.image.data,a=e*this._width;o[a+8]=i?1:0,o[a+9]=n?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};var _5="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var D5="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var G_=-.05,V_=1,ha=class extends zr{constructor(e,i,n=1){super(e);p(this,"propertiesTexture");p(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});p(this,"showTextures",e=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,i,n),this.needsUpdate=!0)});this.propertiesTexture=new Kh(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,d=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=_5,o.fragmentShader=D5,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:G_},uMaxSideAlpha:{value:V_},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:d,uRepeatYFactor:m})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(e){e!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=e,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(e){e.wrapS=Zr,e.wrapT=Zr,e.colorSpace=Ai,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=Zr,e.wrapT=Zr,e.colorSpace=Ai,this.uniforms.uTopTexture.value=e}setGradientShading(e,i,n){this.uniforms.uGradientStart.value=e,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(e,i,n){this.propertiesTexture.setColor(e,i,n)}getColor(e){return this.propertiesTexture.getColor(e)}hideTextures(e){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,!1,!1),this.needsUpdate=!0)}removeSideTexture(e){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(e,!1,i),this.needsUpdate=!0}}removeTopTexture(e){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(e,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};var U_=80;function O5(r,t){var l,c,u;let e=0;for(let d of r)e+=((c=(l=d.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let i=new Ie(t.color),n;n=new ha({color:i,side:t.side==="back"?V0:t.side==="front"?G0:Li,opacity:(u=t.opacity)!=null?u:1,transparent:t.opacity!==void 0?t.opacity<1:!1},r.length);let o=new mi(r.length,e,0,n),a;for(let d of r)a=d.components[0],!(!(a instanceof Be)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=d.id,n instanceof ha&&n.setColor(a.instanceIndex,i,t.topColor?new Ie(t.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}function W1(r,t){t.polygonOffset=!0,t.polygonOffsetFactor=1,t.polygonOffsetUnits=1;let e=new ev(r,U_),i=Z1(t.color.getHexString()),n=new Xp({linewidth:2,color:i,transparent:!0}),o=new So(e,n);return o.layers.set(1),o}function Z1(r){return W(r).darken(30).toRgbString()}f();function L5(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}function Ue(r){for(let t=r.children.length-1;t>=0;t--)Ue(r.children[t]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(t){L5(t)}):"material"in r&&typeof r.material<"u"&&L5(r.material)}var Qc,Gs,Jc=class{constructor(t){p(this,"rendererState");p(this,"dirty",!0);C(this,Qc,!0);C(this,Gs,0);this.rendererState=t}get geometries3DDirty(){return s(this,Qc)}set geometries3DDirty(t){M(this,Qc,t)}update(t,e=!1){var o,a;let i;if(this.geometries3DDirty){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(c),i&&i.type==="geometry-group"&&i.userData.modelURL===void 0&&i.userData.dirty===!1&&i.userData.outlineDirty===!0){let u=i.children[0];i.userData.outlineDirty=!1;let d=Kn(i);if(d&&Ue(d),!i.components[0].outline||!i.visible)continue;if(i.children.length>0){let m;if(u instanceof mi){let x=[],T,v,b,P;for(let I of i.userData.entities3D)P=this.rendererState.geometry3DMap.get(I),(P==null?void 0:P.type)==="geometry"&&(v=P.components[0],b=P.components[1],v instanceof Be&&b.visible&&b.opacity>0&&b.outline&&!v.detached&&(T=v==null?void 0:v.geometry,T&&x.push(T)));x.length>0&&(m=Kr(x))}else m=u.geometry;m&&(l=W1(m,u.material),l.position.z=i.altitude,l.userData.outlineOfEntityId=i.userData.entityId);let y,g;for(let x of i.userData.entities3D.values()){let T=this.rendererState.geometry3DMap.get(x);(T==null?void 0:T.type)==="geometry"&&(y=T.components[0],g=T.components[1],l&&(T==null?void 0:T.type)==="geometry"&&!y.detached?(T.components[0].outline=l,(o=i.parent)==null||o.add(l)):(T==null?void 0:T.type)==="geometry"&&y.geometry!=null&&y.material!=null&&y.detached&&(y.outline&&Ue(y.outline),g&&g.opacity>0&&g.visible&&g.outline&&(y.outline=W1(y.geometry,y.material),(a=i.parent)==null||a.add(y.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let n=e?Qr(t,16,19,0,1):s(this,Gs);if((n!==s(this,Gs)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(c),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let u=Kn(l);if(u&&u.visible){let d=Array.isArray(u.material)?u.material:[u.material];for(let m of d)m.opacity=Math.min(n,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof Be&&l.components[0].detached){let u=l.components[0].outline;if(u){let d=Array.isArray(u.material)?u.material:[u.material];for(let m of d)m.opacity=Math.min(n,l.components[1].opacity)}}}M(this,Gs,n),this.dirty=!1}};Qc=new WeakMap,Gs=new WeakMap;var et=class extends Fi{constructor(e,i=new ua){super();p(this,"visible",!0);p(this,"type","geometry-group");p(this,"components");p(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=e}setVisible(e){this.visible=e;let i=Kn(this);i&&(i.visible=e),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(e){this.userData.opacity=e}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let e;for(let n of this.children)if(!n.userData.detached){e=n;break}return e instanceof mi?Object.values(e.userData.entities)[0]:void 0}setAltitude(e){this.position.z=e,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};var Re=class r extends Fi{constructor(e){super();p(this,"childrenIds",new Set);p(this,"children",[]);p(this,"type","group-container");p(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});p(this,"components",[]);this.userData.entityId=e}addEntity(e){e instanceof r?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof $r?(this.childrenIds.add(e.id),this.add(e.object3d),this.userData.entities2D.add(e.id)):e instanceof et?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof Te&&e.object3d&&(this.childrenIds.add(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(e){e instanceof r?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof $r?(this.childrenIds.delete(e.id),this.userData.entities2D.delete(e.id),this.remove(e.object3d)):e instanceof et?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof Te&&e.object3d&&(this.childrenIds.delete(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(e){this.visible=e,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(e){this.position.z=e,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};f();f();var A5=!1;function k5(){A5=!0}function F5(){return A5}var ef=class{constructor(t,e=2){p(this,"backgroundAlpha",1);p(this,"backgroundColor",new Ie);p(this,"width",0);p(this,"height",0);p(this,"options",{});p(this,"renderer");var i,n;try{this.options=t;let o={canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,outputColorSpace:Ai,powerPreference:"high-performance",preserveDrawingBuffer:!0};F5()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Ie,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=e===2?new $0(o):new J0(o),this.backgroundColor=new Ie((i=t.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(o){O.error(o),t.onWebGLRendererError&&t.onWebGLRendererError(o)}}destroy(){var t,e;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t))}render(t,e){this.renderer&&(this.renderer.state.reset(),e.layers.enable(0),e.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){S.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=e,this.renderer.setSize(t,e,!1))}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};f();f();var B5='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),Q=new s(0,t-5,e,t+S),Y=Z(e,t,i,o,h),F=[O,K,W,Q],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,V,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,_=U-D,A=V-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+_)+d,P=Math.max(P,L+A)+d,r.bboxes[u].boundingRect=new s(B,L,_,A)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabled){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&F.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Y)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabled:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';f();f();f();f();f();function R5(r,t){return t.x+t.w<r.x+r.w&&t.x>r.x&&t.y>r.y&&t.y+t.h<r.y+r.h}f();function N5(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}f();function G5(r,t){let e=t.x,i=t.y,n=t.x+t.w,o=t.y+t.h,a=r.x,l=r.y,c=r.x+r.w,u=r.y+r.h;return e<c&&a<n&&i<u&&l<o}f();function sn(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}f();var tt=class{constructor(t,e,i,n,o){p(this,"x");p(this,"y");p(this,"w");p(this,"h");p(this,"userData");this.userData=typeof o>"u"?null:o,this.x=t,this.y=e,this.w=i,this.h=n}contains(t){return t===this?!1:R5(this,t)}intersects(t){return G5(this,t)}intersectsPoint(t){return N5(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var gi=class r{constructor(t,e){p(this,"topLeft");p(this,"topRight");p(this,"bottomLeft");p(this,"bottomRight");p(this,"divided",!1);p(this,"boundary");p(this,"capacity",16);p(this,"objects",[]);p(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:n}=this.boundary;this.topLeft=new r(new tt(t,e,i/2,n/2),this),this.topRight=new r(new tt(t+i/2,e,i/2,n/2),this),this.bottomLeft=new r(new tt(t,e+n/2,i/2,n/2),this),this.bottomRight=new r(new tt(t+i/2,e+n/2,i/2,n/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(sn(e,this.topLeft.queryRect(t)),sn(e,this.topRight.queryRect(t)),sn(e,this.bottomLeft.queryRect(t)),sn(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(sn(e,this.topLeft.queryPoint(t)),sn(e,this.topRight.queryPoint(t)),sn(e,this.bottomLeft.queryPoint(t)),sn(e,this.bottomRight.queryPoint(t))),e}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(e=>e.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};f();function j5(r,t,e){let i,n,o,a=null,l=0;e||(e={});let c=function(){l=e.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)};return function(){let u=Date.now();!l&&e.leading===!1&&(l=u);let d=t-(u-l);return i=globalThis,n=arguments,d<=0||d>t?(a&&(clearTimeout(a),a=null),l=u,o=r.apply(i,n),a||(i=n=null)):!a&&e.trailing!==!1&&(a=setTimeout(c,d)),o}}var fa=!1,X_=150,tf=class extends z{constructor(e,i,n=new Worker(URL.createObjectURL(new Blob([B5],{type:"text/javascript"})))){super();p(this,"worker");p(this,"debugContext");p(this,"debugCanvas");p(this,"collidersDirty",!0);p(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);p(this,"visibleCollidersQTree",new gi(new tt(0,0,0,0)));p(this,"interactiveCollidersQTree",new gi(new tt(0,0,0,0)));p(this,"coreState");p(this,"postMessage");p(this,"showCollisionBoxes",()=>{fa=!0,this.debugCanvas.style.display="block"});p(this,"hideCollisionBoxes",()=>{fa=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});p(this,"currentMsgId","");p(this,"working",!1);p(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});p(this,"componentArray",[]);p(this,"update",(e,i,n="bottom-left",o=!0)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let l;for(let c of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(c);u&&(l=u.components[0],this.componentArray.push(l))}this.resize(e,i,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(l=>l.collisionDirty===!0);a&&this.componentArray.sort((l,c)=>c.rank-l.rank);for(let l=0;l<this.componentArray.length;l++)if(this.packedMessage){let c=this.componentArray[l].toPackedMessage(!o&&!a);this.packedMessage[0][l]==null&&(this.packedMessage[0][l]=[]),this.packedMessage[0][l][0]==null&&(this.packedMessage[0][l][0]=[]),this.packedMessage[0][l][0]=c.bboxes,this.packedMessage[0][l][1]=c.enabled?1:0,this.packedMessage[0][l][2]=c.rank===5?1:0,this.packedMessage[0][l][3]=c.x,this.packedMessage[0][l][4]=c.y,this.packedMessage[0][l][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][l][6]=c.lockedToStrategyIndex}this.working||this.postMessage()});p(this,"resolve",e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,n=-1,o,a,l;fa&&(this.visibleCollidersQTree=new gi(new tt(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new gi(new tt(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let u=this.componentArray[c];i[c]!=null&&(n=i[c][0],o=i[c][2],u.offscreen=i[c][1]===1,n!==-1&&o!=null?(l=new tt(o.x,o.y,o.w,o.h,{entityId:u.id}),fa&&this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(u.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new tt(o.x,o.y,o.w,o.h,{entityId:u.id})),(u.visible===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),n!==-1&&n!==u.activeStrategyIndex&&(u.activeBoundingBox=l,u.onStrategySelected(n))):((u.visible===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),n!==-1&&n!==u.activeStrategyIndex&&u.onStrategySelected(n)))}fa&&this.drawDebug(),this.publish("visibility-changed")});p(this,"drawDebug",()=>{fa&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});p(this,"destroy",()=>{this.worker.terminate()});this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=j5(this._postMessage,X_,!1),fa?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};f();f();f();f();var rf=class{constructor(t){p(this,"type");p(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},nf=class{constructor(){p(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};f();function H5(r){let t=new Set;for(let e of r){let i=e.object;for(;i.parent&&!t.has(i.parent);)i=i.parent,i instanceof Re&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}function U5(r,t){if(r==null||t==null)return r===t;if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}var Vs,Kc=class extends z{constructor(e,i,n,o,a){super();p(this,"raycaster",new qr);p(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});p(this,"coreState");p(this,"camera");p(this,"cameraPlane");p(this,"_quadtree",new gi(new tt(0,0,0,0)));p(this,"_container");p(this,"lastPointerEvent");p(this,"cursor","grab");p(this,"touchesCount",0);p(this,"isUserInteracting");p(this,"hasTouched",!1);C(this,Vs,void 0);p(this,"onPointerMoveRaf",e=>{this.lastPointerEvent=e,s(this,Vs)&&cancelAnimationFrame(s(this,Vs)),M(this,Vs,requestAnimationFrame(()=>{this.onPointerMove(e)}))});p(this,"onPointerMove",e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()});p(this,"tapsControl",new nf);p(this,"onPointerDown",e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new rf(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))});p(this,"clickTimeout");p(this,"onPointerUp",e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});p(this,"dirty3D",!0);p(this,"cachedHitBoxes",{entities:[],groups:[]});p(this,"ndcPoint",new te);p(this,"debugPanel");p(this,"resize",()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]});this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=e,this.coreState=i,this.cameraPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:n,entity2D:o,position:a,groupContainers:l}=this.intersect(i);(this.detect3DEntityHover(n)||this.detect2DEntityHover(o)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=o,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){let e=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=q_(e,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),((e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path")&&e.components[2]?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var x,T;let i=[e.offsetX,e.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(v=>v.intersectsPoint(i)),a=this.state.containerOffset[0],l=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-l)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-a)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[c]=this.getMouseRayIntersects(),u=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(v=>v.object.visible),[d]=u,m=(x=d==null?void 0:d.instanceId)!=null?x:d==null?void 0:d.batchId,y=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(v=>v.object.visible),g;return y!=null&&y.length>0&&(g=H5(y)),{entity2D:((T=o==null?void 0:o.userData)==null?void 0:T.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:m!=null?this.coreState.geometry3DMap.get(d==null?void 0:d.object.userData.entities[m]):this.coreState.geometry3DMap.get(d==null?void 0:d.object.userData.entityId),position:Array.isArray(y)&&(y==null?void 0:y.length)>0?y[0].point:c==null?void 0:c.point,groupContainers:g}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&Z5(this.state.lastHover,!1,this.coreState),e&&Z5(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!U5(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.cameraPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var n,o,a;this.queueDebugMessage("CLICK \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var n,o,a;this.queueDebugMessage("HOVER \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var o;let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=i,n.textContent=e,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};Vs=new WeakMap;function Z5(r,t,e){var a;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let n=(a=r.components[0].textMesh)==null?void 0:a.userData.entityId;if(!n)return;let o=e.geometry3DMap.get(n);(o==null?void 0:o.type)==="text3d"&&(o.components[1].hoverByPolygon=t,o.components[1].dirty=!0)}function q_(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}f();f();var ma,vi,of,af,X5,tu,sf,lf,Y5,cf,z5,ru,uf,iu,nu,pf,eu=class{constructor(t){C(this,af);C(this,lf);C(this,cf);C(this,ma,null);C(this,vi,void 0);p(this,"getCurrentSceneGLTF",async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await V(this,af,X5).call(this),n=s(this,of).call(this,e),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let l=JSON.stringify(o,null,2);a=new Blob([l],{type:"text/plain"})}return a});C(this,of,t=>{let{scale:e,light:i,onlyVisible:n}=t,o=new Ua,a=new ki().setFromObject(s(this,vi).entityScene);if(s(this,tu).call(this,s(this,vi).entityScene,o,n),i){let l=new zp(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*e*.5,a.max.y*e*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),o.add(l)}return o});C(this,tu,(t,e,i)=>{t.material&&(t instanceof Wa?V(this,lf,Y5).call(this,t).forEach(n=>e.add(n)):t instanceof So&&e.add(V(this,cf,z5).call(this,t))),t.children.forEach(n=>{(!i||n.visible)&&s(this,tu).call(this,n,e,i)})});C(this,sf,(t,e,i)=>{let n=new iv({color:new Ie(t),metalness:0});return n.opacity=e,n.transparent=i,n});C(this,ru,t=>{let{geometry:e,material:i,position:n,rotation:o,quaternion:a,scale:l}=t;if(!(e!=null&&e.isBufferGeometry))return t;let c=e.attributes.position,u=e.attributes.normal,d=e.attributes.uv;return s(this,uf).call(this,c,u),s(this,nu).call(this,n,l,o,a),d&&s(this,pf).call(this,d),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=Li),t});C(this,uf,(t,e)=>{let i=new $,n=new $;for(let o=0;o<t.count;o++)i.fromBufferAttribute(t,o),s(this,iu).call(this,i),t.setXYZ(o,i.x,i.y,i.z),e&&(n.fromBufferAttribute(e,o),s(this,iu).call(this,n),e.setXYZ(o,n.x,n.y,n.z))});C(this,iu,t=>{let e=t.y;t.y=t.z,t.z=-e});C(this,nu,(t,e,i,n)=>{let o=t.y;t.y=t.z,t.z=-o;let a=e.y;if(e.y=e.z,e.z=a,i instanceof Ha)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let l=n.y;n.set(n.x,n.z,-l,n.w)}});C(this,pf,t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),n=t.getY(e);t.setXY(e,i,n)}});M(this,vi,t),s(this,vi).entityScene=t.entityScene,s(this,vi).geometry3DMap=t.geometry3DMap}destroy(){M(this,ma,null)}};ma=new WeakMap,vi=new WeakMap,of=new WeakMap,af=new WeakSet,X5=async function(){if(!s(this,ma)){let{GLTFExporter:t}=await import("./GLTFExporter-MHPZU3XO.js");M(this,ma,new t)}return s(this,ma)},tu=new WeakMap,sf=new WeakMap,lf=new WeakSet,Y5=function(t){var a,l;let e=[],n=((a=t.userData)!=null&&a.entities?Object.values((l=t.userData)==null?void 0:l.entities):[]).map(c=>s(this,vi).geometry3DMap.get(c)),o=new Map;return n.forEach(c=>{var g;if(!c||!(c instanceof Te))return;let u=c.components[1],d=c.components[2];if(!u.visible||u instanceof br&&u.opacity===0||u instanceof Qp)return;let m=d!=null&&d.hover?u.hoverColor||s(this,vi).hoverColor:u.color,y="".concat(m,"-").concat(u.opacity,"-").concat(Number(u.visible));o.has(y)||o.set(y,[]),(g=o.get(y))==null||g.push(c)}),o.forEach((c,u)=>{let[d,m,y]=u.split("-"),g=c.reduce((b,P)=>{if(P.type==="custom-geometry")return b;let I=P.components[0];return"geometry"in I&&I.geometry instanceof Y0&&b.push(I.geometry),b},[]),x=s(this,sf).call(this,d,Number(m),t.material.transparent),T=Kr(g,!0),v=new Se(T,x);v.position.copy(t.position),v.rotation.copy(t.rotation),v.scale.copy(t.scale),v.visible=!!y,s(this,nu).call(this,v.position,v.scale,v.rotation,v.quaternion),e.push(s(this,ru).call(this,v))}),e},cf=new WeakSet,z5=function(t){let e=t.geometry.clone(),i=t.material,n=new Yt({color:i.color,side:Li});n.opacity=i.opacity,n.transparent=i.transparent;let o=new So(e,n);return o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o.visible=t.visible,s(this,ru).call(this,o)},ru=new WeakMap,uf=new WeakMap,iu=new WeakMap,nu=new WeakMap,pf=new WeakMap;f();f();f();f();var ou={top:0,bottom:0,left:0,right:0,type:"pixel"};f();f();var $_="gray",J_=.1;function q5(r,t,e){let{color:i=$_,opacity:n=1,altitude:o=0,height:a=J_}=e||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},c=new Xr,u=r.geometry.coordinates[0].map(g=>{let x=t(g[1],g[0]);return l.min.x=Math.min(l.min.x,x.x),l.min.y=Math.min(l.min.y,x.y),l.max.x=Math.max(l.max.x,x.x),l.max.y=Math.max(l.max.y,x.y),x});c.moveTo(u[0].x,u[0].y),u.slice(1).forEach(g=>c.lineTo(g.x,g.y)),c.lineTo(u[0].x,u[0].y);let d=r.geometry.coordinates.slice(1);c.holes=d.map(g=>{let x=g.map(v=>t(v[1],v[0])),T=new wn;return T.moveTo(x[0].x,x[0].y),x.slice(1).forEach(v=>T.lineTo(v.x,v.y)),T.lineTo(x[0].x,x[0].y),T});let m={bevelEnabled:!1,depth:a},y=new Yr(c,m);return y.translate(0,0,o||0),y.userData={style:{color:i,opacity:n}},y}f();var Q_="gray",K_=.1;function $5(r,t,e){let{color:i=Q_,opacity:n=1,altitude:o=0,height:a=K_}=e||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},c={bevelEnabled:!1,depth:a},u=[];r.geometry.coordinates.forEach(m=>{let y=new Xr,g=m[0].map(v=>{let b=t(v[1],v[0]);return l.min.x=Math.min(l.min.x,b.x),l.min.y=Math.min(l.min.y,b.y),l.max.x=Math.max(l.max.x,b.x),l.max.y=Math.max(l.max.y,b.y),b});y.moveTo(g[0].x,g[0].y),g.slice(1).forEach(v=>y.lineTo(v.x,v.y)),y.lineTo(g[0].x,g[0].y);let x=m.slice(1);y.holes=x.map(v=>{let b=v.map(I=>t(I[1],I[0])),P=new wn;return P.moveTo(b[0].x,b[0].y),b.slice(1).forEach(I=>P.lineTo(I.x,I.y)),P.lineTo(b[0].x,b[0].y),P});let T=new Yr(y,c);u.push(T)});let d=Kr(u);return d.translate(0,0,o||0),d.userData={style:{color:i,opacity:n}},d}f();f();var $1=Ml(a7());function s7(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}s7.prototype=Error.prototype;$1.default.Error=function(r){throw new s7(r)};var Vt=$1.default;var XO="gray",J1=new Vt.ClipperOffset,It=100;function l7(r,t,e){let{color:i=XO,opacity:n=1,width:o=1,join:a="round",cap:l="round",height:c=.01,altitude:u=0}=e||{};Array.isArray(n)&&(n=0);let d=[];for(let T=0;T<r.geometry.coordinates.length-1;T++){let v=t(r.geometry.coordinates[T][1],r.geometry.coordinates[T][0]),b=t(r.geometry.coordinates[T+1][1],r.geometry.coordinates[T+1][0]);d.push([v,b])}J1.AddPaths(d.map(T=>T.map(v=>({X:v.x*It,Y:v.y*It}))),a==="round"?Vt.JoinType.jsRound:a==="miter"?Vt.JoinType.jsMiter:Vt.JoinType.jsSquare,l==="round"?Vt.EndType.etOpenRound:l==="butt"?Vt.EndType.etOpenButt:Vt.EndType.etOpenSquare);let m=new Vt.PolyTree;J1.Execute(m,o/2*It);let y=[],g={bevelEnabled:!1,depth:c};for(let T of m.m_AllPolys){let v=new Xr;if(T.IsHole())continue;let b=T.m_polygon;v.moveTo(b[0].X/It,b[0].Y/It),b.slice(1).forEach(P=>v.lineTo(P.X/It,P.Y/It)),v.lineTo(b[0].X/It,b[0].Y/It),v.holes=T.m_Childs.map(P=>{let I=new wn,w=P.m_polygon;return I.moveTo(w[0].X/It,w[0].Y/It),w.slice(1).forEach(_=>I.lineTo(_.X/It,_.Y/It)),I.lineTo(w[0].X/It,w[0].Y/It),I}),y.push(new Yr(v,g))}let x=Kr(y);return x.translate(0,0,u||0),x.userData={style:{color:i,opacity:n}},J1.Clear(),x}f();var wt=100,YO=.22,zO=.01;function c7(r,t,e={}){let{width:i=YO,height:n=zO,color:o="gray",opacity:a=1,altitude:l=0}=e,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+n}},u={bevelEnabled:!1,depth:n},d=new Vt.ClipperOffset,m=r.geometry.coordinates.map(T=>T.map(v=>t(v[1],v[0])));d.AddPaths(m.map(T=>T.map(v=>({X:v.x*wt,Y:v.y*wt}))),Vt.JoinType.jsMiter,Vt.EndType.etOpenRound);let y=new Vt.PolyTree;d.Execute(y,i/2*wt);let g=[];for(let T of y.m_AllPolys){let v=new Xr;if(T.IsHole())continue;c.min.x=Math.min(c.min.x,T.m_polygon[0].X),c.min.y=Math.min(c.min.y,T.m_polygon[0].Y),c.max.x=Math.max(c.max.x,T.m_polygon[0].X),c.max.y=Math.max(c.max.y,T.m_polygon[0].Y);let b=T.m_polygon;v.moveTo(b[0].X/wt,b[0].Y/wt),b.slice(1).forEach(P=>v.lineTo(P.X/wt,P.Y/wt)),v.lineTo(b[0].X/wt,b[0].Y/wt),v.holes=T.m_Childs.map(P=>{let I=new wn,w=P.m_polygon;return I.moveTo(w[0].X/wt,w[0].Y/wt),w.slice(1).forEach(_=>I.lineTo(_.X/wt,_.Y/wt)),I.lineTo(w[0].X/wt,w[0].Y/wt),I}),g.push(new Yr(v,u))}let x=Kr(g);return x.translate(0,0,l||0),x.userData={style:{color:o,opacity:a}},d.Clear(),x}f();f();var Us=E.object({type:E.enum(["Point"]),coordinates:E.array(E.number()).length(2)});var qO=E.object({rotation:E.array(E.number()).length(3).optional(),altitude:E.number().optional(),scale:E.array(E.number()).length(3).optional(),interactive:E.boolean().optional(),id:E.union([E.number(),E.string()]).optional()}),$O=E.object({type:E.enum(["Feature"]),geometry:Us,properties:qO}),JO=E.object({type:E.enum(["FeatureCollection"]),features:E.array($O)}),QO=E.object({url:E.string(),color:E.string().optional(),opacity:E.number().optional()});function u7(r,t,e){E.union([E.number(),E.string()]).parse(r),JO.parse(t),QO.parse(e)}var lu,cu,no=class{constructor(t){p(this,"mesh");p(this,"type","model");p(this,"outline");p(this,"geometry");p(this,"material");p(this,"feature");p(this,"instanceIndex",-1);p(this,"visible",!0);p(this,"color",new Ie);p(this,"position",new $);C(this,lu,0);C(this,cu,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return s(this,lu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,lu,t))}get opacity(){return s(this,cu)}set opacity(t){var e,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof Zp){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=Qr(t,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}M(this,cu,t)}};lu=new WeakMap,cu=new WeakMap;function KO(r){let{color:t,opacity:e,topColor:i,texture:n,topTexture:o}=r;return"".concat(t).concat(e).concat(i||"").concat(n||"").concat(o||"")}var eL=1e4,yf=class extends z{constructor(e,i){super();p(this,"state");p(this,"convertTo3DMapPosition");p(this,"loader");this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:e}=await import("./GLTFLoader-U7AA3ANF.js");this.loader=new e}createEntityFromFeature(e,i,n){let o=new Be(i),a=new Te(o,new br(n));return a.id=e,a}createModelFromFeature(e,i,n){let o=new no(i),a=new Te(o,new br(n));return a.id=e,a}populateEntityMesh(e,i){let n=e.components[0];n.geometry=i,n.currentHeight=e.components[1].height,n.dirty=!1}async populateModelGroup(e,i,n){let o=new In,a=new Ha,l=new Z0,c=new $,u=new Jr;return this.loader||await this.getGLTFLoader(),this.loader.load(i,d=>{var g,x,T,v,b,P;d.scene.traverse(I=>{let w=I;if("isMesh"in w&&w.isMesh===!0){let _=new Zp(w.geometry,w.material,e.size);_.userData={entities:{}},u.add(_),n.add(u)}});let m=0,y;for(let I of e.values()){if(y=this.state.geometry3DMap.get(I),!y||(y==null?void 0:y.type)!=="model")continue;let w=y.components[0],_=y.components[0].feature;w.mesh=u,w.instanceIndex=m;let{x:D,y:k,z:N}=this.convertTo3DMapPosition(_.geometry.coordinates[1],_.geometry.coordinates[0],0);w.position.set(D,k,N),a.set(((g=_.properties.rotation)==null?void 0:g[0])||0,((x=_.properties.rotation)==null?void 0:x[1])||0,((T=_.properties.rotation)==null?void 0:T[2])||0),c.set(((v=_.properties.scale)==null?void 0:v[0])||1,((b=_.properties.scale)==null?void 0:b[1])||1,((P=_.properties.scale)==null?void 0:P[2])||1),l.setFromEuler(a),o.compose(w.position,l,c),u.children.forEach(R=>{if(!y||(y==null?void 0:y.type)!=="model")return;let j=R;j.setMatrixAt(m,o),j.userData.entities[m]=y.id}),m++}this.publish("model-loaded")}),u}populateEntityGroup(e){let i,n,o,a;for(let l of e.values())a=this.state.geometry3DMap.get(l),a.components[0]instanceof Be&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=q5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=$5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=l7(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=c7(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof et||e instanceof Re)){for(let a of e.children)this.optimize(a);if(e instanceof Re||e.userData.dirty===!1)return;let n={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(a){O.warn(a)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let o=0;if(e.userData.dirty){let a=0,l;for(let c of e.userData.entities3D.values()){l=this.state.geometry3DMap.get(c);let u=l==null?void 0:l.components[0];if((l==null?void 0:l.type)==="geometry"){let d=l.components[1];a++,a>=eL&&(a=0,o++);let m=KO(d)+o;n[m]===void 0&&(n[m]={style:d,entities:[]}),n[m].entities.push(l)}else u&&"mesh"in u&&u.mesh&&((i=u.mesh)==null?void 0:i.parent)!==e&&e.add(u.mesh)}for(let c in n){let u=O5(n[c].entities,n[c].style);e.add(u),e.userData.outlineDirty=!0,e.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};f();var gf=class{constructor(t,e){p(this,"state");p(this,"dirty",!0);p(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof yi&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:t.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};f();var vf=class{constructor(t,e){p(this,"state");p(this,"project");this.state=t,this.project=e}update(){let t;for(let e of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(e),t&&this.project(t.components[0].projection,t.position)}};f();f();var tL=function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}}(),p7=({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let l="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=tL(i);c.font=l;let u=[],d=r.split(" "),m=0,y=0,g=0;for(;y<d.length;){let b=d[y];if(m===n&&m>0){u[m-1]+="...";break}if(u[m]==null&&(u[m]=b,y++),d.length===1){u[m]=b;break}if(d[y]==null)break;let{width:P}=c.measureText(u[m]+" "+d[y]);P<=e*i?(u[m]+=" "+d[y],y++):m++}u.forEach(b=>{let{width:P}=c.measureText(b);g=Math.max(P,g)});let x=t*i*o,T=u.length*x;return{maxWidth:g,maxHeight:T,lines:u.length,draw:(b,P,I)=>{u.length===1?(a.strokeText&&b.strokeText(u[0],P,I),b.fillText(u[0],P,I)):(a.strokeText&&(b.strokeText(u[0],P,I-x/2),b.strokeText(u[1],P,I+x/2)),b.fillText(u[0],P,I-x/2),b.fillText(u[1],P,I+x/2))}}};f();function d7(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}var rL=3.5,iL=2.5,nL=2,oL=5,uu=2.5;var bf=class{constructor(t,e){p(this,"dirty",!1);p(this,"state");p(this,"colliderContext");p(this,"colliderCanvas");p(this,"pinCache",{});p(this,"imagePromiseCache",{});p(this,"imageDimensionsCache",{});p(this,"textCache",{});p(this,"update",(t,e,i)=>{let n=(t-e)/(i-e),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,l,c,u,d,m;for(let y of this.state.geometry2DIdsInScene)if(m=this.state.geometry2DMap.get(y),m!=null&&m.components[0]instanceof eo&&!m.disposed){if(d=m.components[0],l=d.appearance.marker.foregroundColor,c=d.appearance.marker.backgroundColor,u=d.markerSize,a="".concat(l.active,"-").concat(l.inactive,"-").concat(c.active,"-").concat(c.inactive,"-").concat(u),this.pinCache[a]||this.prepare(d,a,this.colliderContext),d.appearance.marker.icon&&(!d.imageHash||d.dirty)&&this.cacheImage(d),this.textCache[d.id]==null||d.dirty||this.dirty){d.dirty=!1,d.collisionDirty=!0,this.textCache[d.id]={};let{textDrawFn:g,width:x,height:T}=this.processText(d.text,d.appearance.text.size,d.appearance.text.maxWidth,d.appearance.text.numLines,d.appearance.text.lineHeight);["left","center","right"].forEach(b=>{this.textCache[d.id][b]=this.textToCanvas(g,d.appearance.text.size,b,x,T,d.appearance.text.foregroundColor,d.appearance.text.backgroundColor)}),d.dimensions={width:Math.ceil(x/o),height:Math.ceil(T/o)},d.currentStrategyIndex===-1&&(d.currentStrategyIndex=0);let v=d.strategies[d.currentStrategyIndex];if(v){v.onStrategySelected(d);let b=d.style;d.style=d.newStyle,d.newStyle=b}}d.visible&&(d.enabled||d.visibilityNeedsUpdate!==!1)&&(d.zoomProportion=n,this.draw(d,a,this.colliderContext))}this.dirty=!1});p(this,"processText",(t,e,i,n,o)=>{let a=this.state.pixelRatio,{draw:l,maxWidth:c,maxHeight:u}=p7({text:t,size:e,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:l,width:c+uu*a*2,height:u+uu*a*2}});p(this,"textToCanvas",(t,e,i,n,o,a,l)=>{let c=this.state.pixelRatio,u,d=n,m=o;window.OffscreenCanvas!=null&&!uv()?u=new OffscreenCanvas(d,m):(u=document.createElement("canvas"),u.width=d,u.height=m,u.style.width=d+"px",u.style.height=m+"px");let y=u.getContext("2d",{willReadFrequently:!0});if(!y)return;y.textAlign=i,y.font="bold ".concat(e*c,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),y.textBaseline="middle",y.lineJoin="miter",y.miterLimit=2,y.strokeStyle="white",y.lineWidth=uu*c,y.fillStyle=a,y.strokeStyle=l;let g=i==="left"?0:i==="center"?d/2:d-uu*c/2;return t(y,g,(m+uu*c/2)/2),u});p(this,"cacheImage",t=>{if(!t.appearance.marker.icon)return;let e=gv(t.appearance.marker.icon);if(t.imageHash=e,!this.imagePromiseCache[e]){let i=d7(t.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[e]=i}}});p(this,"createPinCanvas",(t,e,i,n)=>{let o,a=this.state.pixelRatio,l=t.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(l,l):(o=document.createElement("canvas"),o.width=l,o.height=l,o.style.width=l/a+"px",o.style.height=l/a+"px");let c=o.getContext("2d");return c.shadowColor="rgba(0,0,0,0.3)",c.shadowOffsetY=nL*a,c.shadowBlur=oL*a,c.beginPath(),c.arc(l/2,l/2,e/2+iL*a/2,0,2*Math.PI),c.fillStyle=i,c.fill(),c.beginPath(),c.arc(l/2,l/2,e/2,0,2*Math.PI),c.shadowColor="transparent",c.fillStyle=n,c.fill(),o});p(this,"prepare",(t,e,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active),a=this.createPinCanvas(t,t.iconVisible?t.markerSize:rL*n,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive);this.pinCache[e]=[o,a]});this.state=t,this.colliderCanvas=e,this.colliderContext=e.getContext("2d")}draw(t,e,i){if(!t.visible)return;i.save(),i.globalAlpha=t.opacity;let n=this.state.pixelRatio,o=t.projection.x*n,a=t.projection.y*n,l=t.style.pinVisibility===1?this.pinCache[e][0]:this.pinCache[e][1];if(i.drawImage(l,o-t.totalMarkerSize*n,a-t.totalMarkerSize*n),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imagePromiseCache[t.imageHash]){let c=this.imagePromiseCache[t.imageHash],u=(t.appearance.marker.iconSize-t.appearance.marker.iconPadding)*n,d=t.appearance.marker.iconFit,m=u,y=u,g="".concat(t.imageHash,"_").concat(d);if(this.imageDimensionsCache[g])m=this.imageDimensionsCache[g].width,y=this.imageDimensionsCache[g].height;else{let x=c.width*n,T=c.height*n;if(d==="contain"){let v=Math.sqrt(x**2+T**2),b=u/v;m=x*b,y=T*b}if(d==="cover"){let v=u/x,b=u/T,P=Math.max(v,b);m=x*P,y=T*P}}i.save(),i.beginPath(),i.arc(o,a,u/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(c,o-m/2,a-y/2,m,y),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left&&t.style.top&&i.drawImage(this.textCache[t.id][t.style.textAlign],o+t.style.left*n,a+t.style.top*n),i.restore()}};f();f();var ba=class ba{constructor(){p(this,"loader");this.loader=new Za}static getInstance(){return ba.instance||(ba.instance=new ba),ba.instance}getLoader(){return this.loader}};p(ba,"instance");var Q1=ba,Ws=Q1.getInstance();function aL(r,t){let e=r.components[2],i=r.components[1];return e!=null&&e.hover?[i.hoverColor||t,i.hoverColor||t]:[i.color,i.topColor||i.color]}var pu,K1,xf=class extends z{constructor(e){super();C(this,pu);p(this,"state");p(this,"textureLoadingCache",new Map);this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,n){i.texture!==e.texture&&i.texture!==""&&V(this,pu,K1).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&V(this,pu,K1).call(this,i.topTexture,e,"topTexture"),(e.texture!=null||e.topTexture!=null)&&(n!=null&&n.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var a,l,c,u,d,m,y,g,x;let e,i,n,o;for(let T of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(T),o instanceof et&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let v=o.userData.entities3D.values().next().value;if(v==null)continue;let b=this.state.geometry3DMap.get(v);b instanceof Te&&(b.type==="geometry"||b.type==="custom-geometry")&&(e=b.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(e,i.shading));let P,I;for(let w of o.userData.entities3D.values())P=this.state.geometry3DMap.get(w),I=P.components[0],P.type==="geometry"&&I.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(I,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let v=Kn(o);v&&v.material instanceof Xp&&(v.material.color.set(Z1(i.color)),v.material.needsUpdate=!0);let b=o.getfirstChildEntityId();if(b){let P=this.state.geometry3DMap.get(b),I=P==null?void 0:P.components[0];I instanceof Be&&this.processTextures(I,i)}i.dirty=!1}}else if(o instanceof Te&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(l=o.components[2])!=null&&l.dirty)){e=o.components[0],i=o.components[1],n=o.components[2];let v=aL(o,this.state.hoverColor);if(e.setColor(v[0],v[1]),i.visible!==e.visible&&(e.visible=i.visible,e.textMesh)){let b=this.state.geometry3DMap.get(e.textMesh.userData.entityId);(b==null?void 0:b.type)==="text3d"&&(b.components[0].visible=i.visible)}i.altitude!==e.altitude&&(e.altitude=i.altitude),i.opacity!==e.opacity&&(e.opacity=i.opacity),i.renderOrder!==e.renderOrder&&(e.renderOrder=i.renderOrder),i.dirty=!1,this.processTextures(e,i,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty))e=o.components[0],i=o.components[1],i.opacity!==e.opacity&&(e.opacity=i.opacity),i.dirty=!1;else if((o==null?void 0:o.type)==="image"&&((u=o.components[1])!=null&&u.dirty))e=o.components[0],i=o.components[1],i.visible!==e.visible&&(e.visible=i.visible),i.dirty=!1;else if((o==null?void 0:o.type)==="text3d"&&((d=o.components[1])!=null&&d.dirty)){e=o.components[0],i=o.components[1],i.visible!=null&&i.visible!==e.visible&&(e.visible=i.visible);let{textMesh:v}=e;if(v){Object.assign(v,i.getState());let b=(m=i.hoverColor)!=null?m:this.state.text3dHoverColor;v.color=i.hoverByPolygon?b:(y=i.color)!=null?y:za.color,v.outlineColor=i.hoverByPolygon?b:(g=i.outlineColor)!=null?g:za.outlineColor,v.strokeColor=i.hoverByPolygon?b:(x=i.strokeColor)!=null?x:za.strokeColor}i.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};pu=new WeakSet,K1=async function(e,i,n){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){n==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let o=new Promise((a,l)=>{Ws.getLoader().load(e,c=>{n==="topTexture"?i.topTexture=c:i.texture=c,i.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{O.error("Failed to load texture: ".concat(e)),l("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,o)}};f();var Cf=class extends z{constructor(e){super();p(this,"state");p(this,"animating",new Map);p(this,"isAnimating",!1);p(this,"startTime",-1);p(this,"showDuration",300);p(this,"hideDuration",250);p(this,"update",()=>{this.animating.clear();let e,i;for(let n of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i instanceof eo&&(i.visibilityNeedsUpdate==="show"?(i.visible=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});p(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[n,o]]of this.animating.entries()){let a=o===1?this.showDuration:this.hideDuration,l=(e-this.startTime)/a;i.opacity=Qr(l,0,1,n,o,o===0?vv:bv),e-this.startTime>=a&&(o===1?i.visible=!0:o===0&&(i.visible=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};f();var Sf=class extends z{constructor(e,i,n,o,a,l,c){super();p(this,"state");p(this,"renderer");p(this,"mode");p(this,"scene");p(this,"cameraObject");p(this,"viewCamera");p(this,"systems");p(this,"twoDdirty",!0);p(this,"threeDdirty",!0);p(this,"frameId",null);p(this,"twoDFrameId",null);p(this,"animationFrameId",null);p(this,"nextFrame",null);p(this,"update",(e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let n=this.commitRenderState();return this.paint(),n}else return this.frameId?Promise.resolve():new Promise((n,o)=>{this.frameId=requestAnimationFrame(()=>{var a;return((a=this.renderer)==null?void 0:a.renderer)==null?n():this.mode==="standalone"?this.commitRenderState().then(()=>{this.paint(),n()}).catch(l=>{O.error("render loop error:",l),o(l)}):n()})})});p(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});p(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))});p(this,"updateEntities2D",()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})});p(this,"commitRenderState",()=>{let e=[];return this.frameId=null,this.systems.preRenderSystem.update(),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),fv(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),hv(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0),this.systems.meshOptimizationSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.drawSystem.update(),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,this.systems.cameraSystem.rotationDirty)}),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,Promise.all(e)});this.renderer=e,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=l,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};f();var sL=E.object({interactive:E.boolean().optional(),id:E.string().optional(),nearRadius:E.number().optional(),farRadius:E.number().optional(),accentColor:E.string().optional(),displayArrowsOnPath:E.boolean().optional(),animateArrowsOnPath:E.boolean().optional()}),lL=E.object({type:E.enum(["Feature"]),geometry:Us,properties:E.object({parentId:E.any().optional()})});function h7(r,t){E.object({features:E.array(lL)}).parse(r),sL.parse(t)}var du,oo=class{constructor(t,e){p(this,"type","path");p(this,"mesh",new Jr);p(this,"material");p(this,"geometry");p(this,"outline");p(this,"feature");p(this,"options");p(this,"nearRadius",.2);p(this,"farRadius",.4);p(this,"accentColor","blue");p(this,"completeFraction",1);p(this,"altitudeAdjustment",1);p(this,"displayArrowsOnPath",!1);p(this,"animateArrowsOnPath",!1);p(this,"isVertical",!1);p(this,"dirty",!0);p(this,"materialDirty",!0);p(this,"position",new $);C(this,du,0);var i,n,o,a,l;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(n=e==null?void 0:e.nearRadius)!=null?n:this.nearRadius,this.farRadius=(o=e==null?void 0:e.farRadius)!=null?o:this.farRadius,this.displayArrowsOnPath=(a=e==null?void 0:e.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(l=e==null?void 0:e.animateArrowsOnPath)!=null?l:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,du)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,du,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};du=new WeakMap;f();var Tf=class{constructor(t){p(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Re&&t.components[0]){let i=t.components[0];if(i.dirty){for(let n of t.children)(n instanceof et||n instanceof Re)&&(n.userData.entityId!==t.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};f();f();f();var Ne=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-Ne.Bounce.Out(1-r)},Out:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},InOut:function(r){return r<.5?Ne.Bounce.In(r*2)*.5:Ne.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),hu=function(){return performance.now()},t0=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,o=e;n<o.length;n++){var a=o[n];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var o=n[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=hu()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var o=this._tweens[i[n]],a=!e;o&&o.update(t,a)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),Zs={Linear:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=Zs.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[n],r[n+1>e?e:n+1],i-n)},Bezier:function(r,t){for(var e=0,i=r.length-1,n=Math.pow,o=Zs.Utils.Bernstein,a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*r[a]*o(i,a);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=Zs.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(n=Math.floor(i=e*(1+t))),o(r[(n-1+e)%e],r[n],r[(n+1)%e],r[(n+2)%e],i-n)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[n?n-1:0],r[n],r[e<n+1?e:n+1],r[e<n+2?e:n+2],i-n)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=Zs.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,n){var o=(e-r)*.5,a=(i-t)*.5,l=n*n,c=n*l;return(2*t-2*e+o+a)*c+(-3*t+3*e-2*o-a)*l+o*n+t}}},f7=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),e0=new t0,dt=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ne.Linear.None,this._interpolationFunction=Zs.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=f7.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=e0,e0.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=hu()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var o in this._valuesEnd)n[o]=this._valuesEnd[o];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,n,o){for(var a in i){var l=t[a],c=Array.isArray(l),u=c?"array":typeof l,d=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(d){var m=i[a];if(m.length===0)continue;for(var y=[l],g=0,x=m.length;g<x;g+=1){var T=this._handleRelativeValue(l,m[g]);if(isNaN(T)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(T)}d&&(i[a]=y)}if((u==="object"||c)&&l&&!d){e[a]=c?[]:{};var v=l;for(var b in v)e[a][b]=v[b];n[a]=c?[]:{};var m=i[a];if(!this._isDynamic){var P={};for(var b in m)P[b]=m[b];i[a]=m=P}this._setupProperties(v,e[a],m,n[a],o)}else(typeof e[a]>"u"||o)&&(e[a]=l),c||(e[a]*=1),d?n[a]=i[a].slice().reverse():n[a]=e[a]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=hu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=hu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=Ne.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=Zs.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,n;if(t===void 0&&(t=hu()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,l=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*l,u=function(){if(i._duration===0||a>c)return 1;var T=Math.trunc(a/l),v=a-T*l,b=Math.min(v/i._duration,1);return b===0&&a===i._duration?1:b},d=u(),m=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||a>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,x=this._chainedTweens.length;g<x;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,n){for(var o in i)if(e[o]!==void 0){var a=e[o]||0,l=i[o],c=Array.isArray(t[o]),u=Array.isArray(l),d=!c&&u;d?t[o]=this._interpolationFunction(l,n):typeof l=="object"&&l?this._updateProperties(t[o],a,l,n):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(t[o]=a+(l-a)*n))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var s$=f7.nextId,bi=e0,l$=bi.getAll.bind(bi),c$=bi.removeAll.bind(bi),u$=bi.add.bind(bi),p$=bi.remove.bind(bi),d$=bi.update.bind(bi);f();f();f();var m7=(r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,y7=(r,t)=>new te(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),r0=(r,t)=>Math.atan2(t.y-r.y,t.x-r.x),fu=(r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),i0=(r,t)=>new te((r.x+t.x)/2,(r.y+t.y)/2),n0=r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t};var Mf=class{constructor(t,e){p(this,"input1");p(this,"input2");p(this,"lastAngle");p(this,"lastDistance");p(this,"totalDistance");p(this,"first");p(this,"second");this.input1=t,this.input2=e,this.lastAngle=r0(t,e),this.lastDistance=fu(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=fu(t,e);this.input1=t,this.input2=e;let n=r0(t,e);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(fu(this.first,t)+fu(this.second,e))/2,this.first=i0(this.first,t),this.second=i0(this.second,e)}};f();var mu=class{constructor(t,e,i){p(this,"touch");p(this,"camera");p(this,"cameraPlane");p(this,"viewCoordinate");p(this,"snapHolderMatrix");p(this,"snapCamera");p(this,"cameraPosition");p(this,"raycaster");p(this,"worldCoordinate");p(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new te(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new qr,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var i,n;let t=new te(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};var Br={};O6(Br,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>cL,CLIPPING_RADIUS:()=>yu,CONTROL_OPTIONS:()=>If,DEFAULT_BEARING:()=>fL,DEFAULT_MAX_ZOOM_LEVEL:()=>dL,DEFAULT_MIN_ZOOM_LEVEL:()=>c0,DEFAULT_PITCH:()=>hL,DEFAULT_ZOOM_LEVEL:()=>pL,EVENTS:()=>_f,MAPLIBRE_TILE_SIZE:()=>Pf,MAX_LAT:()=>a0,MAX_MERCATOR_ZOOM_LEVEL:()=>Ef,MIN_LAT:()=>o0,MIN_MERCATOR_ZOOM_LEVEL:()=>wf,ROOM_MERCATOR_ZOOM_LEVEL:()=>uL,TWO_PI:()=>s0,WHEEL_ZOOM_MULTIPLIER:()=>l0,ZRANGE:()=>Xs});f();var Pf=512,o0=-85.051129,a0=85.051129,yu=1e4,If={chain:"chain",cancel:"cancel"},s0=Math.PI*2,Xs=100,l0=1e4,wf=0,Ef=24,cL=17,uL=20,_f=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],pL=18,c0=12,dL=22,hL=0,fL=0;var Df=!1,mL=!1;var Of,xa=class extends z{constructor(e,i,n,o,a){super();p(this,"dirty",!1);p(this,"zoomDirty",!1);p(this,"rotationDirty",!1);C(this,Of,c0);p(this,"zoomSpeed",5);p(this,"rotateSpeed",100);p(this,"enabled",!0);p(this,"enableZoom",!0);p(this,"enablePan",!0);p(this,"enablePedestal",!1);p(this,"maxPedestal",1/0);p(this,"minPedestal",0);p(this,"enableRotate",!0);p(this,"minZoomAltitude",0);p(this,"maxZoomAltitude",1/0);p(this,"ignoreZoomLimits",!1);p(this,"zoomFactor",1);p(this,"panBounds",{min:new $(1/0,1/0),max:new $(-1/0,-1/0),center:new $(0,0,0),radius:1/0});p(this,"minTilt",0);p(this,"maxTilt",1.2);p(this,"MOUSE_BUTTONS",{ORBIT:Up.RIGHT,ZOOM:Up.MIDDLE,PAN:Up.LEFT});p(this,"camera");p(this,"scene");p(this,"renderer");p(this,"elevation");p(this,"orbit");p(this,"cameraPlane");p(this,"raycaster",new qr);p(this,"rendererState");p(this,"options");p(this,"state",-1);p(this,"intersection");p(this,"viewState",null);p(this,"tweens",new Map);p(this,"clock",new ov(!0));p(this,"coords",{mouse:new te,rotateStart:new te,rotateEnd:new te,rotateDelta:new te,panStart:new $,panCameraStart:new $,panEnd:new $,panDelta:new $,initialShiftPos:new te,initialPedestal:0,floorAnchor:new $});p(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});p(this,"scrollTimer",null);p(this,"lastWheelTime",0);p(this,"resetZoom",!1);p(this,"zoomStart");p(this,"pedestalScaleFactor",1);p(this,"isUserZooming",!1);p(this,"stayInsideBounds",!0);p(this,"userInteracting",!1);p(this,"raycastToFloor",e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new $});p(this,"isUserInteracting",()=>this.userInteracting);p(this,"getPosition",()=>new $(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));p(this,"getPedestal",()=>this.orbit.position.z);p(this,"pan",(e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))});p(this,"postRender",()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))});p(this,"isCameraMoving",()=>this.state!==-1);p(this,"setPosition",(e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)});p(this,"updateCameraPosition",(e,i)=>{let n=e-this.panBounds.center.x,o=i-this.panBounds.center.y,a=Math.sqrt(n*n+o*o);if(this.stayInsideBounds&&a>this.panBounds.radius){let l=Math.atan2(o,n),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=e,this.orbit.position.y=i});p(this,"tilt",e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")});p(this,"zoomIn",(e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},e,i,n)});p(this,"zoomOut",(e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},e,i,n)});p(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));p(this,"cancelAnimation",()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)});p(this,"animateCamera",(e,i,n,o,a,l)=>{let c={mode:If.cancel,...l},u={},d={},m=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=m.x,d.x=e.position.x),e.position.y!==void 0&&(u.y=m.y,d.y=e.position.y),e.position.z!==void 0&&(u.z=m.z,d.z=e.position.z)),e.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=e.zoom:d.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:I,end:w}=rd(this.getRotation(),e.rotation);u.rotation=I,d.rotation=w}e.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=e.tilt:d.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let y=u.zoom!==d.zoom,g=u.rotation!==d.rotation,x=u.tilt!==d.tilt,T=new dt(u).to(d,S.env.TESTING?0:i).onUpdate(I=>{this.setMulti({x:I.x,y:I.y,z:I.z},I.zoom,I.rotation,I.tilt)}).onComplete(()=>{this.completeTween(T),this.publish("multi-end",{zooming:y,rotating:g,tilting:x}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,T.state=7,this.publish("multi-start",{zooming:y,rotating:g,tilting:x})),this.publish("change")});this.rendererState.tweenGroup.add(T);let v=Array.from(this.tweens.entries()),b=v[v.length-1],P=!1;return b!=null&&(c.mode===If.chain?(P=!0,b[0].chain(T)):(typeof b[1]=="function"&&b[1](),this.completeTween(b[0]))),this.tweens.set(T,a),n?T.easing(n):T.easing(Ne.Quadratic.In),!e.doNotAutoStart&&!P&&(T.start(),this.publish("change")),T.cameraAnimation=!0,T});p(this,"setMulti",(e,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),l=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),l=!0)),l&&this.publish("position-updated");let c={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;u!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>yu&&(this.camera.near=i-yu,this.camera.far=i+yu):(this.camera.near=i/Xs,this.camera.far=i*Xs),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let u=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;u!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)});p(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);p(this,"getZoomScaledMax",()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)});p(this,"setRotation",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(e%s0);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0});p(this,"setZoomAltitude",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/Xs,this.camera.far=i*Xs,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});p(this,"setZoomLevel",e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))});p(this,"getZoomAltitude",()=>this.camera.position.z);p(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));p(this,"setTilt",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0});p(this,"getTilt",()=>this.elevation.rotation.x);p(this,"setCameraPlaneElevation",e=>{this.cameraPlane.position.z=e});p(this,"zoom",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")});p(this,"getProjectionScaleFactor",(e,i,n)=>Em(e,i,n));p(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});p(this,"setPedestal",(e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)});p(this,"dispose",()=>{for(let e of _f)e.endsWith("start")?this.off(e,this.setUserInteracting):e.endsWith("end")&&this.off(e,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)});p(this,"createCameraPlane",()=>{let e=Df?2e3:1e10,i=Df?100:1,n=new vr(e,e,i,i),o=new Yt({color:0,wireframe:Df,visible:Df}),a=new Se(n,o);return this.scene.add(a),a});p(this,"addEventListeners",()=>{let{domElement:e}=this.renderer;for(let i of _f)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)});p(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});p(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});p(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});p(this,"removeEventListeners",()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});p(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});p(this,"onContextMenu",e=>{e.preventDefault()});p(this,"onMouseUp",()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}});p(this,"onMouseMove",e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)});p(this,"onTouchStart",e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new Mf(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});p(this,"onTouchMove",e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},n={...this.touch.inputs.second},o=new te(this.touch.touches[0].x,this.touch.touches[0].y),a=new te(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(e);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let l=i.y<o.y&&n.y<a.y,c=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}});p(this,"onTouchEnd",e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}});p(this,"handleTouchMovePan",e=>{let i=Object.hasOwn(e,"x")?new te(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")});p(this,"handleTouchStartDolly",()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,i=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let n=new te(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new mu(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new mu(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")});p(this,"handleMouseMovePan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")});p(this,"handleTouchStartTilt",e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});p(this,"handleTouchMovePedestal",e=>{this.handleMouseMovePedestal(e.touches[0])});p(this,"handleTouchMoveTilt",e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});p(this,"handleTouchMoveDolly",()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)});p(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")});p(this,"handleTouchStartPan",e=>{let i=Object.hasOwn(e,"x")?new te(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});p(this,"handleTouchStartPedestal",e=>{this.handleMouseDownPedestal(e.touches[0])});p(this,"onMouseDown",e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});p(this,"onMouseWheel",e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))});p(this,"handleMouseWheel",e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),n=i-n0(e)*i/l0*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")});p(this,"setCameraFromTransformMatrix",e=>{this.orbit.updateMatrixWorld();let i=new Ha;i.setFromRotationMatrix(e,"ZYX");let n=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new $(0,0,1);a.applyEuler(i),a.setLength(n);let l=new $;l.setFromMatrixPosition(e),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-o)});p(this,"makeTransformFromTouchAnchors",(e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=e.worldCoordinate,a=i.worldCoordinate,l=e.reUnproject(),c=i.reUnproject();if(!l||!c||!o||!a)return null;let u=e.viewCoordinate,d=i.viewCoordinate,m=a.x-o.x,y=a.y-o.y,g=Math.atan2(y,m),x=c.x-l.x,T=c.y-l.y,v=Math.atan2(T,x),b=m7(g,v),P=new In;P.makeRotationZ(-b);let I=P.clone();I.multiply(e.snapHolderMatrix);let w=(E6,_6,D6)=>E6.elements[(_6-1)*4+D6-1],_=w(n,1,1)*w(I,1,1)-u.x*w(n,3,4)*w(I,3,1),D=w(n,1,1)*w(I,1,2)-u.x*w(n,3,4)*w(I,3,2),k=w(n,1,1)*w(I,1,3)-u.x*w(n,3,4)*w(I,3,3),N=o.x*_+o.y*D+o.z*k,R=w(n,2,2)*w(I,2,1)-u.y*w(n,3,4)*w(I,3,1),j=w(n,2,2)*w(I,2,2)-u.y*w(n,3,4)*w(I,3,2),Z=w(n,2,2)*w(I,2,3)-u.y*w(n,3,4)*w(I,3,3),se=o.x*R+o.y*j+o.z*Z,me=w(n,1,1)*w(I,1,1)-d.x*w(n,3,4)*w(I,3,1),Pe=w(n,1,1)*w(I,1,2)-d.x*w(n,3,4)*w(I,3,2),De=w(n,1,1)*w(I,1,3)-d.x*w(n,3,4)*w(I,3,3),ze=a.x*me+a.y*Pe+a.z*De,Wt=w(n,2,2)*w(I,2,1)-d.y*w(n,3,4)*w(I,3,1),Oe=w(n,2,2)*w(I,2,2)-d.y*w(n,3,4)*w(I,3,2),qe=w(n,2,2)*w(I,2,3)-d.y*w(n,3,4)*w(I,3,3),je=a.x*Wt+a.y*Oe+a.z*qe,Zt=Math.abs(me-_),Oi=Math.abs(Pe-D),At=Math.abs(De-k),Xt=Math.abs(me-R),Co=Math.abs(Pe-j),Va=Math.abs(De-Z),pe=Math.abs(Wt-_),ve=Math.abs(Oe-D),Le=Math.abs(qe-k),cr=Math.abs(Wt-R),ja=Math.abs(Oe-j),Sl=Math.abs(qe-Z),Wr=Math.min(Zt+Oi+At,Xt+Co+Va),Pn=Math.min(pe+ve+Le,cr+ja+Sl);Wr<Pn&&(me=Wt,Pe=Oe,De=qe,ze=je);let Tl=R*k-_*Z,Sm=j*k-D*Z,k0=se*k-N*Z,Tm=me*Z-R*De,Mm=Pe*Z-j*De,F0=ze*Z-se*De,T6=(F0*Sm-k0*Mm)/(Tm*Sm-Tl*Mm),M6=(F0*Tl-k0*Tm)/(Mm*Tl-Sm*Tm),B0=j*_-D*R,P6=Z*_-k*R,I6=se*_-N*R,R0=Pe*R-j*me,w6=De*R-Z*me,N0=((ze*R-se*me)*B0-I6*R0)/(w6*B0-P6*R0),Hp=I.clone();return Hp.elements[12]=T6,Hp.elements[13]=M6,Hp.elements[14]=N0,N0>0?Hp:null});p(this,"updateTouchOrigin",()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top});p(this,"touchToScene",e=>{this.touch.touches=[];for(let i=0,n=e.touches.length;i<n;i++){let o=e.touches[i],a=y7(o,this.touch.origin);this.touch.touches.push(new te(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});p(this,"canScrollZoom",e=>{let i=n0(e),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())});p(this,"mouseToScene",e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});p(this,"getMousePos",e=>({x:e.offsetX,y:e.offsetY}));p(this,"handleMouseDownRotate",e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});p(this,"handleMouseDownPan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});p(this,"handleMouseDownPedestal",e=>{let i=new te(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Em(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});p(this,"handleMouseMovePedestal",e=>{let i={x:e.clientX,y:e.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)});p(this,"handleMouseMoveRotate",e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});p(this,"publishUserZoomDebounced",To(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));p(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});p(this,"setUserInteracting",()=>{this.userInteracting=!0});p(this,"unsetUserInteracting",()=>{this.userInteracting=!1});p(this,"publishPedestalChangeEvent",e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});p(this,"convertAltitudeToZoomLevel",e=>{let[,i]=this.center,o=e*2*Math.tan(ge.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ge.degToRad(i))*2*Math.PI*Pl/o;return ge.clamp(Math.log2(a/512),wf,Ef)});p(this,"convertZoomLevelToAltitude",e=>{let[,i]=this.center,n=ge.clamp(e,wf,Ef),o=Math.pow(2,n),a=ge.clamp(i,o0,a0),l=o*512;return Math.cos(ge.degToRad(a))*Math.PI*2*Pl/l*this.options.canvasHeight/2/Math.tan(ge.degToRad(this.camera.fov)/2)});p(this,"completeTween",e=>{e.isPlaying()?e.stop():e.end(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)});p(this,"debugContainer",new Fi);this.camera=e,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return s(this,Of)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,e),(n-e)/(i-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var o,a,l,c;let e=this.getPosition(),{lat:i,lon:n}=qp((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(c=(l=this.rendererState.center)==null?void 0:l[0])!=null?c:0,e.x,e.y);return[n,i]}setCenter(e,i){var a,l,c,u;let{x:n,y:o}=$p((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(u=(c=this.rendererState.center)==null?void 0:c[0])!=null?u:0,i,e);this.setPosition(n,o)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}focusOn(e,i){mL&&(this.debugContainer&&Ue(this.debugContainer),e.forEach(v=>{let b=new Se(new Wp(2,2,2),new Yt({color:65280}));b.position.copy(v),this.debugContainer.add(b),this.scene.add(this.debugContainer)}));let n=i.curve,o=i.callback,a=i.cancelledCallback,l=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,c=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,d=this.options.canvasHeight,m;i.duration!==void 0?m=i.duration:S.env.TESTING==="true"?m=0:m=200;let y=i.padding,g=this.getRotation(),x=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let T=yL(e,{canvasHeight:d,paddingOption:y,canvasWidth:u,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(g),this.setTilt(x),this.animateCamera({position:T.position,tilt:i.tilt,rotation:i.rotation,zoom:T.zoom},m,n,o,a)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};Of=new WeakMap,p(xa,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function yL(r,{canvasWidth:t,orbit:e,paddingOption:i,canvasHeight:n,minZoom:o,maxZoom:a,camera:l,position:c}){let u={zoom:o,position:c};if(r.length===0)return u;for(let Pn of xa.CAMERA_FRAME_PADDING_SIDES)typeof i[Pn]!="number"&&(i[Pn]=0);let d=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(d.left+d.right>=t||d.top+d.bottom>=n)return u;e.updateMatrixWorld();let m=l.matrixWorldInverse,y=l.fov*(Math.PI/180)/2,g=y,T=Math.atan(Math.tan(y)*(t/n)),v=new $(1/0,1/0,1/0),b=new $(-1/0,-1/0,-1/0),P=new ki().setFromPoints(r),I;for(let Pn=0,Tl=r.length;Pn<Tl;Pn++)I=r[Pn].clone(),I.applyMatrix4(m),v.min(I),b.max(I);let w=b.x-v.x,_=b.y-v.y,D=t-d.left-d.right,k=n-d.top-d.bottom,N=(b.x+v.x)/2,R=(b.y+v.y)/2,j=w/D,Z=_/k,se=o,me=a,Pe=se*Math.tan(T)*2,De=me*Math.tan(T)*2,ze=Pe/t,Wt=De/t,Oe=Math.max(j,Z);Oe=ge.clamp(Oe,ze,Wt);let qe=D*Oe,je=k*Oe,Zt={min:{x:N-qe/2-d.left*Oe,y:R-je/2-d.bottom*Oe},max:{x:N+qe/2+d.right*Oe,y:R+je/2+d.top*Oe}},Oi=(Zt.min.x+Zt.max.x)/2,At=(Zt.min.y+Zt.max.y)/2,Xt=P.getCenter(new $),Co=Math.abs(Oi-Zt.min.x),Va=Math.abs(At-Zt.min.y),pe=Co/Math.tan(T),ve=Va/Math.tan(g),Le=new $;Le.set(Oi,At,b.z+Math.max(pe,ve)),Le.applyMatrix4(l.matrixWorld);let cr=new $;cr.set(Oi,At,b.z),cr.applyMatrix4(l.matrixWorld);let ja=new $().subVectors(cr,Le),Sl=(Xt.z-Le.z)/ja.z,Wr=new $().copy(Le).add(ja.clone().multiplyScalar(Sl));return cr.set(Wr.x,Wr.y,Wr.z),Le.sub(cr),{position:Wr,zoom:Le.length()}}f();var gL=300,gu,vu,Lf=class{constructor(t){p(this,"state");C(this,gu,new $);C(this,vu,new $);this.state=t}update(t){var n;let e,i;this.state.cameraObject.getWorldPosition(s(this,vu));for(let o of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if((i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&!i.offscreen){e.object3d.getWorldPosition(s(this,gu));let a=s(this,vu).distanceTo(s(this,gu));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-a,"px)")}i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.visible=!0):i.visible=!1,i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:gL,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};gu=new WeakMap,vu=new WeakMap;f();var Af=class{constructor(){p(this,"percentExpanded",0);p(this,"activeId","");p(this,"gap",20);p(this,"dirty",!0)}};f();var kf=class extends z{constructor(e,i){super();p(this,"state");p(this,"dirty",!0);p(this,"domTree");p(this,"observers",new Map);p(this,"updateDimensions",e=>{e.forEach(i=>{let n=i.target,o=n.getAttribute("data-marker-id");if(o){let a=this.state.geometry2DMap.get(o);if(a&&a.components[0]instanceof yi&&n.firstElementChild){let{width:l,height:c}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(l,c)}}}),this.publish("dimensions-update")});this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let e;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(e=this.state.geometry2DMap.get(o),(i=e.components[0].options)!=null&&i.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};f();var vL=0,bL=90;function ln(r,t,e,i){return(r<t||r>e)&&O.warn(i),Math.min(e,Math.max(t,r))}var Ys={linear:Ne.Linear.None,"ease-in":Ne.Quadratic.In,"ease-out":Ne.Quadratic.Out,"ease-in-out":Ne.Quadratic.InOut},X,re,zs,bu,xi,Ff=class{constructor(t,e,i,n){C(this,X,void 0);C(this,re,void 0);C(this,zs,void 0);C(this,bu,void 0);C(this,xi,void 0);M(this,X,t),M(this,re,e),M(this,zs,i),M(this,bu,n),s(this,re).cameraSystem.on("pedestal-change",({pedestal:o})=>{s(this,X).map&&(s(this,X).map.transform.elevation=o,s(this,X).map.transform.minElevationForCurrentTile=o,s(this,X).map.triggerRepaint()),s(this,re).cameraSystem.setCameraPlaneElevation(o),s(this,bu).position.z=o})}get center(){return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?s(this,X).map.getCenter().toArray():s(this,re).cameraSystem.center}setCenter(t){var e;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(e=s(this,X).map)==null||e.setCenter(t),s(this,re).interactionSystem.handleHover();return}s(this,re).cameraSystem.setCenter(t[0],t[1]),s(this,re).interactionSystem.handleHover()}get zoomLevel(){var t;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t=s(this,X).map)==null?void 0:t.getZoom():s(this,re).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;s(this,X).mode==="outdoors-overlay"&&s(this,X).map&&((e=s(this,X).map)==null||e.setZoom(t)),s(this,re).cameraSystem.setZoomLevel(ln(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return s(this,re).cameraSystem.isAnimating}cancelAnimation(){s(this,re).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,re).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,re).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){s(this,re).panBoundsSystem.autoMinZoomLevel=t,t&&(s(this,re).panBoundsSystem.dirty=!0,s(this,re).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,re).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var n;e&&this.setAutoMinZoomLevel(!1);let i=ln(t,Br.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Br.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,re).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,X).map)==null||n.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=ln(t,this.minZoomLevel,Br.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Br.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,re).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=s(this,X).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t=s(this,X).map)==null?void 0:t.getMaxPitch():ge.radToDeg(s(this,re).cameraSystem.maxTilt)}get minPitch(){var t;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t=s(this,X).map)==null?void 0:t.getMinPitch():ge.radToDeg(s(this,re).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(vL,t);(i=s(this,X).map)==null||i.setMinPitch(e),s(this,re).cameraSystem.minTilt=ge.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(bL,t);(i=s(this,X).map)==null||i.setMaxPitch(e),s(this,re).cameraSystem.maxTilt=ge.degToRad(e)}get bearing(){var t;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t=s(this,X).map)==null?void 0:t.getBearing():ge.radToDeg(s(this,re).cameraSystem.getRotation())}setBearing(t){var e;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(e=s(this,X).map)==null||e.setBearing(t);return}s(this,re).cameraSystem.setRotation(ge.degToRad(t))}get pitch(){var t;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t=s(this,X).map)==null?void 0:t.getPitch():ge.radToDeg(s(this,re).cameraSystem.getTilt())}setPitch(t){var e;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(e=s(this,X).map)==null||e.setPitch(t);return}s(this,re).cameraSystem.setTilt(ge.degToRad(ln(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return s(this,re).cameraSystem.getPedestal()}setElevation(t){s(this,re).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return s(this,xi)&&s(this,xi).stop(),new Promise(i=>{M(this,xi,new dt({elevation:this.elevation}).to({elevation:t},(e==null?void 0:e.duration)||300).easing(Ys[(e==null?void 0:e.easing)||"ease-in-out"]).onUpdate(({elevation:n})=>{this.setElevation(n)}).onComplete(()=>{s(this,xi)&&s(this,X).getTweenGroup().remove(s(this,xi)),i()}).start()),s(this,xi).cameraAnimation=!0,s(this,X).getTweenGroup().add(s(this,xi)),s(this,X).render()})}get insetsPadding(){return s(this,zs).insetsPadding}get panMode(){return s(this,re).cameraSystem.enablePan===!1&&s(this,re).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(s(this,re).cameraSystem.enablePan=!0,s(this,re).cameraSystem.enablePedestal=!1):(s(this,re).cameraSystem.enablePan=!1,s(this,re).cameraSystem.enablePedestal=!0))}setInsetPadding(t){s(this,zs).insetsPadding=Object.assign({},ou,t)}animateTo(t){var a;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map)return(a=s(this,X).map)==null||a.flyTo({center:t.center,zoom:t.zoomLevel,bearing:t.bearing,pitch:t.pitch,duration:t.duration}),Promise.resolve();let e=t.center?s(this,X).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?s(this,re).cameraSystem.convertZoomLevelToAltitude(ln(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,n=t.bearing!==void 0?ge.degToRad(t.bearing):void 0,o=t.pitch!==void 0?ge.degToRad(ln(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(l=>{s(this,re).cameraSystem.animateCamera({position:e,zoom:i,rotation:n,tilt:o},t.duration||0,Ys[t.easing||"ease-in-out"],()=>{s(this,re).interactionSystem.handleHover(),l()},l)})}focusOn(t,e){var i,n;return t==null||!Array.isArray(t)||t.length<=0?(O.error("focusOn coordinates are invalid:",t),Promise.resolve()):s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(t.length===1?(i=s(this,X).map)==null||i.flyTo({center:t[0],duration:(e==null?void 0:e.duration)||s(this,X).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,X).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,X).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,X).map.getMaxZoom()}):(n=s(this,X).map)==null||n.fitBounds(t,{duration:e==null?void 0:e.duration,animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?s(this,X).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?s(this,X).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||s(this,X).map.getMaxZoom()}),s(this,re).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{s(this,re).cameraSystem.focusOn(t.map(a=>s(this,X).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{minZoom:(e==null?void 0:e.maxZoomLevel)===void 0?void 0:s(this,re).cameraSystem.convertZoomLevelToAltitude(ln(e.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(e==null?void 0:e.minZoomLevel)===void 0?void 0:s(this,re).cameraSystem.convertZoomLevelToAltitude(ln(e.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:e!=null&&e.padding?Object.assign({},ou,e==null?void 0:e.padding):this.insetsPadding,curve:Ys[(e==null?void 0:e.easing)||"ease-in-out"],rotation:(e==null?void 0:e.bearing)===void 0?void 0:ge.degToRad(e.bearing),tilt:(e==null?void 0:e.pitch)!==void 0?ge.degToRad(ln(e.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:e==null?void 0:e.duration,callback:()=>{s(this,re).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};X=new WeakMap,re=new WeakMap,zs=new WeakMap,bu=new WeakMap,xi=new WeakMap;f();var g7="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";var v7="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";f();var b7=4.291666666666667,x7=15,C7=25,S7=43/60;f();var T7=["horizontal","icon"],SL=new Map([[T7[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[T7[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),TL=/<svg([^>]*)>/g;function M7(r,t,e,i){let n=SL.get(r);return n?n.replace(TL,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var P7=!1,xe,qs,$s,ht,Et,Ca,Rr,Ci,Nr,Si,Bf=class extends z{constructor(e,i,n){super();C(this,xe,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});C(this,qs,void 0);C(this,$s,void 0);C(this,ht,void 0);C(this,Et,void 0);C(this,Ca,void 0);C(this,Rr,0);C(this,Ci,0);C(this,Nr,0);C(this,Si,0);p(this,"dirty",!0);p(this,"getPositionAlignedCanvasCoordinates",(e,i)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:e,y:i},center:{x:e/2,y:i/2},top:{x:e/2,y:0},bottom:{x:e/2,y:i},left:{x:0,y:i/2},right:{x:e,y:i/2}})[s(this,xe).position]);p(this,"getPositionAlignedPadding",()=>{var n,o,a,l;let e=s(this,xe).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[s(this,xe).position];let i={top:(n=e.top)!=null?n:0,right:(o=e.right)!=null?o:0,bottom:(a=e.bottom)!=null?a:0,left:(l=e.left)!=null?l:0};return{x:i.left-i.right,y:i.top-i.bottom}});M(this,xe,Object.assign({},s(this,xe),n)),M(this,$s,e),M(this,qs,i),M(this,Nr,i.canvasWidth),M(this,Si,i.canvasHeight)}get color(){return s(this,xe).color==="light"?"white":"#293136"}get iconName(){return s(this,xe).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,xe).iconOnly?x7:75}get defaultWidth(){return s(this,xe).iconOnly?C7:150}get aspectRatio(){return s(this,xe).iconOnly?S7:b7}get options(){return{...s(this,xe)}}set options(e){M(this,xe,{padding:e.padding||s(this,xe).padding,position:e.position||s(this,xe).position,iconOnly:e.iconOnly||s(this,xe).iconOnly,color:e.color||s(this,xe).color,scale:e.scale||s(this,xe).scale,onClick:s(this,xe).onClick,visible:s(this,xe).visible})}get icon(){return M7(this.iconName,this.color,s(this,Rr)*s(this,qs).pixelRatio,s(this,Ci)*s(this,qs).pixelRatio)}setSize(e,i){s(this,Et)&&(s(this,Et).uniforms.uSize.value.x=e,s(this,Et).uniforms.uSize.value.y=i)}setXY(e,i){s(this,Et)&&(s(this,Et).uniforms.uSize.value.w=e,s(this,Et).uniforms.uSize.value.z=i)}get width(){return s(this,Rr)}get height(){return s(this,Ci)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[s(this,xe).position]}show(){s(this,xe).visible=!0,this.dirty=!0}hide(){s(this,xe).visible=!1,s(this,ht)&&(s(this,$s).remove(s(this,ht)),Ue(s(this,ht))),M(this,ht,void 0),s(this,Et)&&s(this,Et).dispose(),M(this,Et,void 0),M(this,Ca,void 0)}insertIntoQuadTree(e){s(this,Ca)!=null&&typeof s(this,xe).onClick=="function"&&e.insert(s(this,Ca))}resize(e,i){if(s(this,xe).visible!==!0)return;M(this,Nr,e),M(this,Si,i);let n=this.getPositionAlignedCanvasCoordinates(s(this,Nr),s(this,Si)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,Rr),s(this,Ci)),l=Math.min(s(this,Nr)-s(this,Rr),Math.max(0,n.x+o.x+a.x)),c=Math.min(s(this,Si)-s(this,Ci),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,Rr)/s(this,Nr),s(this,Ci)/s(this,Si)),this.setXY(l/s(this,Nr),c/s(this,Si)),M(this,Ca,new tt(l,c,s(this,Rr),s(this,Ci),{entityId:"watermark"}))}update(){this.dirty&&s(this,xe).visible===!0&&(M(this,Rr,Math.min(s(this,Nr),Math.max(this.minWidth,this.defaultWidth*s(this,xe).scale))),M(this,Ci,s(this,Rr)/this.aspectRatio),Ws.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(M(this,Et,new wl({uniforms:{uTexture:{value:e},uSize:{value:new W0(0,0,0,0)},uOpacity:{value:.7}},vertexShader:g7,fragmentShader:v7,depthWrite:!1,depthTest:!1,defines:{debug:P7},wireframe:P7,transparent:!0,visible:!0})),s(this,ht))s(this,ht).material=s(this,Et),s(this,ht).material.needsUpdate=!0;else{let i=new vr(2,2,1,1);M(this,ht,new Se(i,s(this,Et))),s(this,ht).position.set(0,0,-1),s(this,ht).frustumCulled=!1,s(this,ht).renderOrder=999;let n=new Wp(1,1,1),o=new Se(n,new Yt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.layers.set(1),s(this,ht).add(o),s(this,$s).add(s(this,ht))}this.resize(s(this,Nr),s(this,Si)),this.publish("texture-loaded")})),this.dirty=!1}destroy(){this.hide()}};xe=new WeakMap,qs=new WeakMap,$s=new WeakMap,ht=new WeakMap,Et=new WeakMap,Ca=new WeakMap,Rr=new WeakMap,Ci=new WeakMap,Nr=new WeakMap,Si=new WeakMap;f();var u0=100,IL=!1,Rf=class extends z{constructor(e,i){super();p(this,"currentTotalBoundingBox");p(this,"state");p(this,"cameraSystem");p(this,"debugMesh",null);p(this,"dirty",!1);p(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new ki,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new $(0,0,0),new $(u0*2,u0*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(u0))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new $),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new X0).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,IL&&this.state.entityScene.parent instanceof Ua&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Se(new tv(this.cameraSystem.panBounds.radius),new Yt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};f();var I7="\xA9 Mappedin",wL="https://info.mappedin.com/feedback",p0=["top-left","top-right","bottom-left","bottom-right"],EL=640,_L=()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>",w7={custom:[],position:"bottom-right"},Nf=class{constructor(t){p(this,"controlContainerEl");p(this,"controlPositions");p(this,"compact");p(this,"attribContainerEl");p(this,"attribInnerEl");p(this,"attribButtonEl");p(this,"feedbackLinkEl");p(this,"attribHTML",I7);p(this,"customAttributions",[]);p(this,"toggleAttribution",t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=p0.reduce((e,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),e[i]=n,e},{})}addAttributionControl(t=w7){let e=t.position&&p0.includes(t.position)?t.position:w7.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(e)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[e].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=_L(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=wL,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let e=[I7],i=t.style.sourceCaches;for(let n in i){let o=i[n];if(o.used||o.usedForTerrain){let a=o.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}e=e.filter(n=>String(n).trim()),e=e.filter((n,o)=>{for(let a=o+1;a<e.length;a++)if(e[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=e.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=EL||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};f();var xu,Js=class{constructor(t,e){p(this,"mesh");p(this,"type","custom-geometry");p(this,"dirty",!0);p(this,"feature");p(this,"builder");p(this,"outline");p(this,"color",new Ie);C(this,xu,0);this.mesh=new Jr,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}setOpacity(){}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return s(this,xu)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,xu,t))}};xu=new WeakMap;f();var Gf=class{constructor(t,e){p(this,"state");p(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(t=n.components[0],e=n.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};f();f();var Vf=class extends Se{constructor(){super(...arguments);p(this,"userData",{entityId:""})}},DL=E.object({flipImageToFaceCamera:E.boolean().optional(),url:E.string()}),OL=E.object({type:E.enum(["Feature"]),properties:E.object({width:E.number(),height:E.number(),rotation:E.number().min(0).max(360).optional(),verticalOffset:E.number().optional()}),geometry:Us});function E7(r,t,e){E.union([E.number(),E.string()]).parse(r),OL.parse(t),DL.parse(e)}var jf=class{constructor(t){p(this,"mesh",new Jr);p(this,"imageMesh");p(this,"outline");p(this,"type","image");p(this,"instanceIndex",-1);p(this,"geometry");p(this,"material");p(this,"feature");p(this,"position",new $);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};var _7=Math.PI*2,D7=Math.PI/2,O7=Math.PI*1.5,LL=.01,AL=!1,Hf=class extends z{constructor(e,i){super();p(this,"rendererState");p(this,"convertTo3DMapPosition");p(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}createImageMesh(e,i,n,o=0,a){var m,y;let l=new zr({transparent:!0,depthWrite:!1,side:Li}),c=new vr(n.width,n.height),u=new Vf(c);u.visible=!1,(m=this.getOrDownloadImage(i))==null||m.then(g=>{l.map=g,l.needsUpdate=!0,l.map.colorSpace=Ai,u.visible=!0,this.publish("image-loaded")}),u.userData.entityId=e,u.material=l;let d=this.convertTo3DMapPosition(a);if(AL){let g=new Se(new vr(n.width,n.height),new zr({color:"gray"}));u.add(g);let x=new av;u.add(x),x.scale.set(10,10,10)}return u.renderOrder=1,u.position.set(d.x,d.y,o+LL),u.rotation.z=-ge.degToRad((y=n.rotation)!=null?y:0),u}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(n=>{Ws.getLoader().load(e,o=>{n(o)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){let o=(e.imageMesh.rotation.z-i+_7)%_7;(o>D7&&o<O7||o<-D7&&o>-O7)&&(e.imageMesh.rotation.z=e.imageMesh.rotation.z-Math.PI)}update(e){var a,l,c,u,d;let i,n,o;for(let m of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(m),(i==null?void 0:i.type)==="image")n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null&&(n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)),n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,e);else if((i==null?void 0:i.type)==="geometry"){if(n=i.components[0],o=i.components[1],o.showImage&&((a=n.feature.properties)!=null&&a.image)&&n.imageMesh==null&&n.mesh!=null&&n.mesh.parent!=null&&((l=n.feature.properties)==null?void 0:l.image.position)!=null){let y=this.createImageMesh(m,(c=n.feature.properties)==null?void 0:c.image.path,(u=n.feature.properties)==null?void 0:u.image,o.height,(d=n.feature.properties)==null?void 0:d.image.position);n.mesh.parent.add(y),n.imageMesh=y}n.imageMesh&&(o.showImage&&!n.imageMesh.visible?n.imageMesh.visible=!0:!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1),o.flipImageToFaceCamera&&this.flipIfNeeded(n,e))}}};f();var kL=!1,ao,Uf=class extends z{constructor(e,i){super();p(this,"cameraDirty",!0);p(this,"focusablesDirty",!0);p(this,"state");p(this,"camera");p(this,"debugEl",null);p(this,"raycasters",[]);p(this,"collisions",new Map);p(this,"focusableEntities",new Set);C(this,ao,void 0);p(this,"update",()=>{s(this,ao)&&cancelAnimationFrame(s(this,ao)),M(this,ao,requestAnimationFrame(()=>{this.updateRaf()}))});this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new te(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new te(e.x/1.2,e.y/1.2),n=new te(e.x+(e.x-i.x),i.y),o=new te(i.x,e.y+(e.y-i.y)),a=new te(n.x,o.y),l=new te(e.x,e.y/1.5),c=new te(e.x,e.y+(e.y-l.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[e,l,c,i,n,o,a].map((u,d)=>{if(kL){let T=document.createElement("div");T.style.position="absolute",T.style.top=u.y+"px",T.style.left=u.x+"px",T.style.width="10px",T.style.height="10px",T.style.backgroundColor="red",this.debugEl.append(T)}let m=u.x/this.state.canvasWidth*2-1,y=-(u.y/this.state.canvasHeight)*2+1,g=new te(m,y),x=new qr;return x.setFromCamera(g,this.camera),[x,g,d===0?10:d<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(e=i.components[0],e instanceof Be&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let o=new Se(e.geometry);o.userData={entityId:i.id},e.focusMesh=o}this.focusableEntities.add(e.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.collisions.clear();for(let[i,n]of this.raycasters)i.setFromCamera(n,this.camera);for(let[i,n,o]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(l=>{var c;if((l==null?void 0:l.object)!=null&&"isMesh"in l.object&&(l!=null&&l.object.isMesh)){let u=l.object.userData.entityId,d=(c=this.collisions.get(u))!=null?c:0;this.collisions.set(u,d+o)}});let e=Array.from(this.collisions,([i,n])=>({entityId:i,weight:n})).sort((i,n)=>n.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}destroy(){s(this,ao)&&cancelAnimationFrame(s(this,ao)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};ao=new WeakMap;f();var Wf=class{constructor(t){p(this,"dirty",!0);p(this,"map");p(this,"stylesheetId","");p(this,"userHiddenLayers",new Set);p(this,"hiddenLayersInStyle",new Set);p(this,"centerPoint");p(this,"handleRender",async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[],e=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(e,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)t.push(["!=",["id"],n.id]);t.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...t])}),this.dirty=!1)});p(this,"handleStyleChange",t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}});t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};f();f();f();var d0="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // `nearRadius` to `farRadius` when the camera is at `farZoom`.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";var h0='#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the `complete` value as it varies from 0.0 to 1.0.\n // Fragments that are at the `complete` value or past it will be fully\n // transparent, while fragments that are at `complete - completeLength`\n // or before it will be fully opaque. However, we adjust the `complete`\n // value here so that it overshoots by one full `completeLength`, so that\n // the entire path will be opaque when the `complete` value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at `arrowMargin` instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // "zooming off" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as `arrowAnimationTimer` goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a "looping sawtooth" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the "looping" design is preferred is because\n // it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from `pulse`\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like "holes" when they\'re overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}';var L7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var NL=new Za;function A7(r,t,e){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:l}=t,{color:c}=e,u=!0,d=0,m=1/0,y=t.displayArrowsOnPath,g=!l,x=!0,T=y,v=i/2+GL,b=0;r[0].z+=v;for(let pe=1;pe<r.length;++pe){r[pe].z+=v;let ve=r[pe].x-r[pe-1].x,Le=r[pe].z-r[pe-1].z;if(l)b+=Math.sqrt(ve*ve+Le*Le);else{let cr=r[pe].y-r[pe-1].y;b+=Math.sqrt(ve*ve+cr*cr+Le*Le)}}if(!l){let pe=v-.01;r.push(r[r.length-1].clone().setZ(pe)),r.unshift(r[0].clone().setZ(pe))}let P=new U0;T&&(P=NL.load(L7),P.colorSpace=Ai);let I=new Ie(c),w=new Ie(o),_={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new te(1,1)},cameraParameters:{type:"v2",value:new te(d,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:I},pathLength:{type:"f",value:b},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:d},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:P},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:g?.05:1},showPulse:{type:"b",value:x},opacityMultiplier:{type:"f",value:1}},D=new K0(r);D.curveType="catmullrom",D.tension=0;let k=30,N=8,R=k*r.length,j=new rv(D,R,i,N,!1),Z=new Float32Array(j.attributes.position.count);for(let pe=r.length;pe<Z.length;pe++)Z[pe]=pe;j.setAttribute("vertexIndex",new Il(Z,1));let se=new Float32Array(j.attributes.position.count),me=new Il(se,1);for(let pe=0;pe<=R;pe++)for(let ve=0;ve<=N;++ve)me.setX(pe*(N+1)+ve,pe/R);j.setAttribute("pathDistance",me);let Pe=new Float32Array(j.attributes.normal.count*3),De=new Il(Pe,3);for(let pe=0;pe<R;pe++){let ve=j.tangents[pe];for(let Le=0;Le<=N;++Le)De.setXYZ(pe*(N+1)+Le,ve.x,ve.y,ve.z)}j.setAttribute("pathTangent",De);let ze=new Float32Array(j.attributes.normal.count*3),Wt=new Il(ze,3);for(let pe=0;pe<R;pe++){let ve=j.tangents[pe];var Oe,qe,je;l?(Oe=ve.x*ve.y,qe=-1+ve.y*ve.y,je=ve.z*ve.y):(Oe=-ve.x*ve.z,qe=-ve.y*ve.z,je=1-ve.z*ve.z);let Le=Math.sqrt(Oe*Oe+qe*qe+je*je);Le===0&&(Le=1);let cr=Oe/Le,ja=qe/Le,Sl=je/Le;for(let Wr=0;Wr<=N;++Wr)Wt.setXYZ(pe*(N+1)+Wr,cr,ja,Sl)}j.setAttribute("pathNormal",Wt);let Zt=new wl({uniforms:_,vertexShader:d0,fragmentShader:h0});Zt.transparent=!0,Zt.alphaTest=.5,_.resolution.value.x=1,_.resolution.value.y=1,_.vertexes.value=Z.length,_.arrowTexture.value.wrapS=Zr,_.arrowTexture.value.wrapT=Zr,_.arrowTexture.value.anisotropy=16,_.complete.value=a;let Oi=new Se(j,Zt),At=Oi.clone(),Xt={..._,opacityMultiplier:{type:"f",value:.25}};Xt.complete.value=1,At.material=new wl({uniforms:Xt,vertexShader:d0,fragmentShader:h0}),At.material.transparent=!0,At.material.alphaTest=.5,At.material.depthWrite=!1,At.material.depthTest=!1,At.renderOrder=1,Xt.resolution.value.x=1,Xt.resolution.value.y=1,Xt.vertexes.value=Z.length,Xt.arrowTexture.value.wrapS=Zr,Xt.arrowTexture.value.wrapT=Zr,Xt.arrowTexture.value.anisotropy=16,Xt.complete.value=a,Oi.userData=At.userData=t.mesh.userData;let Co=t.mesh;Co.add(Oi),Co.add(At),j.computeBoundingBox();let Va=new $;return j.boundingBox.getCenter(Va),{mesh:Co,material:Zt,center:Va}}var GL=.15;var Cu=class extends z{constructor(e,i,n){super();p(this,"rendererState");p(this,"altitudeDirty",!0);p(this,"convertTo3DMapPosition");p(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=n}update(e,i,n){let o,a=!1;for(let l of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(l),o&&o.type==="path"&&o.components[0].type==="path"){let c=o.components[0],u=o.components[1],d=c.isVertical&&this.altitudeDirty;if(!(c instanceof oo))continue;if(c.dirty||d){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)Ue(c.mesh.children[0]);let m=[];if(c.feature.features.forEach(y=>{let g=y.geometry.coordinates[2]||0,x;if(y.properties.parentId&&(x=this.getParentContainer(y.properties.parentId,!0),x!=null&&x.altitude!=null&&(g+=x.altitude,c.isVertical=!0)),!y.properties.parentId||x!=null&&x.visible){let T=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],g);m.push(T)}}),m.length>1){let{mesh:y,material:g,center:x}=A7(m,c,{color:u.color});c.mesh=y,c.material=g,c.position=x}c.dirty=!1}u.dirty&&(c.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(u.color),m.material.needsUpdate=!0}),c.mesh.position.z=u.altitude,u.dirty=!1),c.material&&(c.mesh.children.forEach(m=>{let y=m.material.uniforms;y.nearZoom.value=e,y.farZoom.value=i,y.cameraParameters.value.x=n,c.materialDirty&&(y.nearRadius.value=c.nearRadius,y.displayArrowsOnPath.value=c.displayArrowsOnPath,y.farRadius.value=c.farRadius,y.pulseColor.value.set(c.accentColor),y.complete.value=c.completeFraction),m.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,m.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};f();var Xe,Qs,Gr,Zf=class{constructor(t){p(this,"rendererState");p(this,"dirty",!1);C(this,Xe,void 0);C(this,Qs,void 0);C(this,Gr,void 0);this.rendererState=t}updateOne(t){var e;if(t instanceof Te&&t.components[0]instanceof Be&&t.components[1]instanceof br&&t.parent instanceof et&&(M(this,Xe,t.components[0]),M(this,Gr,t.components[1]),s(this,Xe).detached&&s(this,Xe).dirty&&s(this,Xe).geometry!=null&&s(this,Xe).material!=null)){M(this,Qs,t.parent),(e=s(this,Xe).mesh)==null||e.setVisibleAt(s(this,Xe).instanceIndex,!1);let i=new Ie(s(this,Gr).color),n=new ha({color:i,side:Li,opacity:s(this,Gr).opacity||1,transparent:s(this,Gr).opacity!==void 0?s(this,Gr).opacity<1:!1},1,s(this,Xe).material.repeatYFactor),o=new mi(1,s(this,Xe).geometry.attributes.position.count||0,0,n);o.addGeometry(s(this,Xe).geometry),o.userData={entities:{0:t.id},detached:!0},s(this,Xe).instanceIndex=0,s(this,Xe).material.setColor(s(this,Xe).instanceIndex,i,s(this,Gr).topColor?new Ie(s(this,Gr).topColor):i),s(this,Xe).mesh=o,s(this,Xe).material=n,s(this,Qs).add(o),s(this,Xe).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){M(this,Xe,void 0),M(this,Qs,void 0),M(this,Gr,void 0)}};Xe=new WeakMap,Qs=new WeakMap,Gr=new WeakMap;f();f();function k7(r,t,e){var i;if(r.geometry!=null){let n=t||1e-4,o=n/r.currentHeight,a=n/e;r.geometry.scale(1,1,o),r.material&&(r.material.repeatYFactor=a),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=n}}var Sa,so,Xf=class{constructor(t){p(this,"rendererState");p(this,"dirty",!1);C(this,Sa,void 0);C(this,so,void 0);this.rendererState=t}updateOne(t){var e;t instanceof Te&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(M(this,Sa,t.components[0]),M(this,so,t.components[1]),t.type==="geometry"&&s(this,so).height!==s(this,Sa).currentHeight&&k7(s(this,Sa),s(this,so).height,s(this,so).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){M(this,Sa,void 0),M(this,so,void 0)}};Sa=new WeakMap,so=new WeakMap;f();var Su,Yf=class{constructor(t){C(this,Su,void 0);M(this,Su,t)}update(){var t;(t=s(this,Su)._subscribers["pre-render"])==null||t.forEach(e=>e())}};Su=new WeakMap;f();var VL={showPolygonLabelTextAreaMesh:!1},zf=class{constructor(t){p(this,"state",VL);p(this,"core");this.core=t}update(t){let e={};for(let[i,n]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=n,e[i]=n);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh())}};var F7=new qr;var{DEFAULT_PITCH:g0,DEFAULT_BEARING:v0,DEFAULT_ZOOM_LEVEL:b0,DEFAULT_MIN_ZOOM_LEVEL:jL,DEFAULT_MAX_ZOOM_LEVEL:HL}=Br,UL=ge.radToDeg(.698132),jt,We,Tu,Ks,lo,Ta,el,Mu,m0,A,Ce,Vr,Ge,Ti,Ht,L,Pu,Ye,Ee,qf,B7,$f,R7,Jf,N7,co,Iu,wu,tl,Qf,Eu,_u,Du,rl,Ou,y0,Ma,Lu,_t,Dt,il,Au,f0=class extends z{constructor(e,i={}){var y,g,x,T,v,b,P,I,w,_;super();C(this,Mu);C(this,qf);C(this,$f);C(this,Jf);C(this,Ou);p(this,"options");p(this,"container");p(this,"Debug");C(this,jt,void 0);C(this,We,void 0);C(this,Tu,void 0);C(this,Ks,void 0);C(this,lo,void 0);C(this,Ta,void 0);C(this,el,void 0);p(this,"rendererDomElement");C(this,A,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Re("__scene"),hoverColor:"red",text3dHoverColor:"white",insetsPadding:ou,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new t0,cameraObject:new Pm});p(this,"camera");C(this,Ce,void 0);C(this,Vr,void 0);C(this,Ge,void 0);C(this,Ti,void 0);C(this,Ht,void 0);C(this,L,{});C(this,Pu,window.matchMedia("screen and (min-resolution: 2dppx)"));p(this,"map");C(this,Ye,()=>{s(this,L).renderSystem.twoDdirty=!0});C(this,Ee,()=>{s(this,L).renderSystem.threeDdirty=!0});C(this,co,"standalone");C(this,Iu,e=>Math.trunc(e*10)/10);C(this,wu,()=>{s(this,L).twoDDrawSystem.dirty=!0,V(this,Mu,m0).call(this,Xa()),s(this,L).watermarkSystem.dirty=!0,this.render()});C(this,tl,()=>{s(this,A).canvasWidth=this.rendererDomElement.clientWidth,s(this,A).canvasHeight=this.rendererDomElement.clientHeight,V(this,Mu,m0).call(this,Xa()),s(this,rl).call(this),V(this,Jf,N7).call(this),s(this,L).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,L).cameraSystem.dirty=!0,s(this,L).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,L).htmlControlsSystem.resize(this.canvasWidth),s(this,L).geometryInFocusSystem.resize(),s(this,L).interactionSystem.resize(),this.render()});C(this,Qf,()=>{this.renderSync()});C(this,Eu,new $);C(this,_u,(e,i)=>{let n=this.mode==="standalone"?s(this,We):this.viewCamera;if(s(this,We).position.z+this.camera.elevation>i.z){s(this,Eu).copy(i);let o=s(this,Eu).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,l=(-o.y+1)/2*this.canvasHeight-0/2,c=s(this,Iu).call(this,a),u=s(this,Iu).call(this,l);e.x=c,e.y=u}else e.x=-1e3,e.y=-1e3});C(this,Du,(e,i)=>{s(this,Ht).setBufferSize(e,i),s(this,We).aspect=e/i,s(this,We).updateProjectionMatrix(),s(this,We).updateMatrixWorld(!0),s(this,Ks).x=e,s(this,Ks).y=i});C(this,rl,()=>{var a;let e=s(this,A).canvasWidth=this.rendererDomElement.clientWidth,i=s(this,A).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(e*this.resolutionScale),o=Math.floor(i*this.resolutionScale);s(this,Du).call(this,n,o),(a=this.map)==null||a.resize(),s(this,A).shouldMeasureCanvas=!1});p(this,"getParentContainer",(e,i=!0)=>{if(!e)return i?s(this,A).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let n=s(this,A).geometry3DMap.get(e);return n instanceof Re?n:(O.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?s(this,A).entityScene:void 0)}else if(e.type==="group-container"){let n=s(this,A).geometry3DMap.get(e.id);if(n instanceof Re)return n}return i?s(this,A).entityScene:void 0});p(this,"showCollisionBoxes",()=>{s(this,L).collisionSystem.showCollisionBoxes(),this.render()});p(this,"hideCollisionBoxes",()=>{s(this,L).collisionSystem.hideCollisionBoxes(),this.render()});p(this,"projectScreenXYToCoordinate",(e,i)=>{var c;let n=e/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new te(n,o);F7.setFromCamera(a,s(this,We).clone());let l=(c=F7.intersectObject(s(this,lo),!1)[0])==null?void 0:c.point;return l!=null?this.convert3DMapPositionToCoordinate(l):void 0});p(this,"projectCoordinateToScreenXY",e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n=new te;return s(this,_u).call(this,n,i),{x:n.x,y:n.y}});p(this,"convert3DMapPositionToCoordinate",e=>{var o,a,l,c;let{lat:i,lon:n}=qp((a=(o=s(this,A).center)==null?void 0:o[1])!=null?a:0,(c=(l=s(this,A).center)==null?void 0:l[0])!=null?c:0,e.x,e.y);return[n,i,e.z]});p(this,"setBackgroundColor",(e,i)=>{s(this,Ht).setBackgroundColor(e,i)});p(this,"getMetresPerPixel",()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(e,i);return n==null||o==null?void 0:td(n,o)/e});p(this,"hideOutdoorLayersUnderPoint",(e,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,L).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())});C(this,Ma,new q0);C(this,Lu,new In);p(this,"render",()=>{if(s(this,L).renderSystem!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,L).renderSystem.update()});p(this,"renderSync",()=>s(this,L).renderSystem.update(!0));C(this,_t,To(()=>{this.publish("user-interaction-start",void 0)},0,!0));C(this,Dt,To(()=>{this.publish("user-interaction-end",void 0)},0,!0));p(this,"on",(e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&S.env.NODE_ENV!=="test"&&(O.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))});p(this,"off",(e,i)=>{super.off(e,i)});p(this,"getCursor",()=>s(this,L).interactionSystem.getCursor());p(this,"destroy",()=>{s(this,L).cameraSystem.off("user-dolly-start",s(this,_t)),s(this,L).cameraSystem.off("user-pan-start",s(this,_t)),s(this,L).cameraSystem.off("user-rotate-start",s(this,_t)),s(this,L).cameraSystem.off("user-zoom-start",s(this,_t)),s(this,L).cameraSystem.off("user-tilt-start",s(this,_t)),s(this,L).cameraSystem.off("user-pedestal-start",s(this,_t)),s(this,L).cameraSystem.off("user-dolly-end",s(this,Dt)),s(this,L).cameraSystem.off("user-pan-end",s(this,Dt)),s(this,L).cameraSystem.off("user-rotate-end",s(this,Dt)),s(this,L).cameraSystem.off("user-zoom-end",s(this,Dt)),s(this,L).cameraSystem.off("user-tilt-end",s(this,Dt)),s(this,L).cameraSystem.off("user-pedestal-end",s(this,Dt)),s(this,L).renderSystem.off("measure-canvas",s(this,rl)),this.remove("__scene"),s(this,Ye).call(this),s(this,Ee).call(this),this.renderSync(),s(this,L).renderSystem.destroy(),s(this,L).cameraSystem.off("change",this.render),s(this,L).pathSystem.off("animate:path",this.render),s(this,L).cameraSystem.dispose(),s(this,L).exporterSystem.destroy(),s(this,L).outdoorLayersSystem.destroy(),s(this,L).drawSystem.destroy(),window.removeEventListener("resize",s(this,tl),!1),s(this,Pu).removeEventListener("change",s(this,wu)),s(this,Ta)&&s(this,Ta).disconnect(),this._subscribers={},s(this,Ht).destroy(),s(this,jt).traverse(e=>{Ue(e),"dispose"in e&&typeof e.dispose=="function"&&e.dispose()}),M(this,jt,void 0),s(this,L).htmlControlsSystem.destroy(),s(this,L).collisionSystem.destroy(),s(this,L).domMutationSystem.destroy(),s(this,L).geometryInFocusSystem.destroy(),M(this,L,void 0),s(this,co)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(s(this,Ti)),this.container.removeChild(s(this,Ce)),M(this,Ht,void 0)});C(this,il,new $);C(this,Au,new $);if(this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(M(this,co,i.mode),this.map=i.map),s(this,A).entityScene.addEventListener("childadded",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),s(this,A).entityScene.addEventListener("childremoved",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),s(this,A).geometry3DMap.set(s(this,A).entityScene.userData.entityId,s(this,A).entityScene),i.center&&(s(this,A).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,V(this,qf,B7).call(this),V(this,$f,R7).call(this),s(this,L).htmlControlsSystem=new Nf(this.container),s(this,co)!=="outdoors-overlay"&&s(this,L).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),S.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),M(this,Ht,new ef({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(y=i.gl)==null?void 0:y.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),s(this,Ye).call(this),s(this,Ee).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(g=i.backgroundAlpha)!=null?g:1})),M(this,jt,new Ua),s(this,jt).add(s(this,A).entityScene);let n=window.__THREE_DEVTOOLS__;S.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,jt)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Ht)}))),M(this,We,new Pm(UL,this.aspect,50,1e5)),s(this,A).cameraObject=s(this,We),M(this,Tu,new z0),s(this,We).renderOrder=999;let o=new Fi;o.add(s(this,We)),M(this,el,new Fi),s(this,el).add(o),s(this,jt).add(s(this,el)),s(this,We).updateProjectionMatrix(),s(this,We).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=s(this,Ht).domElement(),M(this,Ks,new te);let a=new vr(1e6,1e6),l=new Yt({color:0,visible:!1});M(this,lo,new Se(a,l)),s(this,jt).add(s(this,lo)),(x=i.gl)!=null&&x.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,tl),!1),s(this,Pu).addEventListener("change",s(this,wu)),typeof ResizeObserver=="function"&&((T=S.env)==null?void 0:T.NODE_ENV)!=="test"&&(M(this,Ta,new ResizeObserver(To(()=>{s(this,tl).call(this)},0))),(v=s(this,Ta))==null||v.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(b=globalThis.MappedinDebug)!=null&&b.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(P=globalThis.MappedinDebug)!=null&&P.TEST_IOS?"1920px":"100%",S.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),s(this,A).canvasWidth=this.rendererDomElement.clientWidth,s(this,A).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,u=this.canvasHeight;s(this,L).watermarkSystem=new Bf(s(this,We),s(this,A),i==null?void 0:i.watermark),s(this,L).watermarkSystem.on("texture-loaded",this.render),s(this,A).shouldMeasureCanvas=!0,s(this,A).pixelRatio=this.resolutionScale,s(this,Du).call(this,Math.floor(c*this.resolutionScale),Math.floor(u*this.resolutionScale));let d=new zp(16777215,.3*Math.PI);d.position.set(-150,-150,350),s(this,jt).add(d);let m=new nv(16777215,.741*Math.PI);s(this,jt).add(m),s(this,L).cameraSystem=new xa(s(this,We),s(this,jt),s(this,Ht).renderer,s(this,A),{mode:this.mode,canvasHeight:u,canvasWidth:c}),s(this,L).cameraSystem.on("user-dolly-start",s(this,_t)),s(this,L).cameraSystem.on("user-pan-start",s(this,_t)),s(this,L).cameraSystem.on("user-rotate-start",s(this,_t)),s(this,L).cameraSystem.on("user-zoom-start",s(this,_t)),s(this,L).cameraSystem.on("user-tilt-start",s(this,_t)),s(this,L).cameraSystem.on("user-pedestal-start",s(this,_t)),s(this,L).cameraSystem.on("user-dolly-end",s(this,Dt)),s(this,L).cameraSystem.on("user-pan-end",s(this,Dt)),s(this,L).cameraSystem.on("user-rotate-end",s(this,Dt)),s(this,L).cameraSystem.on("user-zoom-end",s(this,Dt)),s(this,L).cameraSystem.on("user-tilt-end",s(this,Dt)),s(this,L).cameraSystem.on("user-pedestal-end",s(this,Dt)),s(this,L).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,L).geometryInFocusSystem&&(s(this,L).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,L).pathSystem=new Cu(s(this,A),this.convertTo3DMapPosition,this.getParentContainer),s(this,L).pathSystem.on("animate:path",this.render),s(this,L).panBoundsSystem=new Rf(s(this,A),s(this,L).cameraSystem),s(this,L).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:k,convertAltitudeToZoomLevel:N}=s(this,L).cameraSystem;if(s(this,L).panBoundsSystem.autoMinZoomLevel){let R=k*Math.PI/180,j=Math.tan(R/2);if(D.radius<=0)return;let Z=N(D.radius/j);this.camera.setMinZoomLevel(Z)}}),this.camera=new Ff(this,s(this,L),s(this,A),s(this,lo)),this.camera.setZoomLevel((I=i.zoomLevel)!=null?I:b0),this.camera.setBearing((w=i.bearing)!=null?w:v0),this.camera.setPitch((_=i.pitch)!=null?_:g0),this.camera.setMaxZoomLevel(HL),this.camera.setMinZoomLevel(jL),s(this,L).domVisiblitySystem=new gf(s(this,A),s(this,Ti)),s(this,L).domMutationSystem=new kf(s(this,A),s(this,Ti)),s(this,L).domMutationSystem.on("dimensions-update",()=>{s(this,L).collisionSystem.collidersDirty=!0,this.render()}),s(this,L).domDrawSystem=new Lf(s(this,A)),s(this,L).collisionSystem=new tf(s(this,Vr),s(this,A)),s(this,L).twoDDrawSystem=new bf(s(this,A),s(this,Ge)),s(this,L).interactionSystem=new Kc(this.rendererDomElement,s(this,A),s(this,We),s(this,lo),s(this,L).cameraSystem.isUserInteracting),s(this,L).interactionSystem.on("hover",this.render),s(this,L).interactionSystem.on("click",D=>{var k,N,R,j,Z,se;if(((k=D.entity2D)==null?void 0:k.id)==="watermark"&&typeof s(this,L).watermarkSystem.options.onClick=="function"){s(this,L).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(N=D.entity3D)==null?void 0:N.id]:[],paths:((R=D.entity3D)==null?void 0:R.components[0])instanceof oo?[D.entity3D.id]:[],markers:((j=D.entity2D)==null?void 0:j.components[0])instanceof yi?[D.entity2D.id]:[],models:((Z=D.entity3D)==null?void 0:Z.components[0])instanceof no?[D.entity3D.id]:[],labels:((se=D.entity2D)==null?void 0:se.components[0])instanceof eo?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(me=>me.userData.entityId):[],pointerEvent:D.pointerEvent})}),s(this,L).interactionSystem.on("hover",D=>{var k,N,R,j,Z,se;D.position&&((k=D.entity2D)==null?void 0:k.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(N=D.entity3D)==null?void 0:N.id]:[],paths:((R=D.entity3D)==null?void 0:R.components[0])instanceof oo?[D.entity3D.id]:[],markers:((j=D.entity2D)==null?void 0:j.components[0])instanceof yi?[D.entity2D.id]:[],models:((Z=D.entity3D)==null?void 0:Z.components[0])instanceof no?[D.entity3D.id]:[],labels:((se=D.entity2D)==null?void 0:se.components[0])instanceof eo?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(me=>me.userData.entityId):[]})}),s(this,L).geometryInFocusSystem=new Uf(s(this,A),s(this,We)),s(this,L).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),s(this,L).twoDVisiblitySystem=new Cf(s(this,A)),s(this,L).drawSystem=new xf(s(this,A)),s(this,L).drawSystem.on("texture-loaded",this.render),s(this,L).stackSystem=new Tf(s(this,A)),s(this,L).twoDProjectionSystem=new vf(s(this,A),s(this,_u)),s(this,L).exporterSystem=new eu(s(this,A)),s(this,L).meshOptimizationSystem=new yf(s(this,A),this.convertTo3DMapPosition),s(this,L).meshOptimizationSystem.on("model-loaded",this.render),s(this,L).meshDetachmentSystem=new Zf(s(this,A)),s(this,L).meshModificationSystem=new Xf(s(this,A)),s(this,L).customGeometrySystem=new Gf(s(this,A),this.convertTo3DMapPosition),s(this,L).outlineInterpolationSystem=new Jc(s(this,A)),s(this,L).renderSystem=new Sf(s(this,Ht),s(this,A),this.mode,s(this,jt),s(this,We),this.viewCamera,s(this,L)),s(this,L).preRenderSystem=new Yf(this),s(this,L).imageSystem=new Hf(s(this,A),this.convertTo3DMapPosition),s(this,L).text3DSystem=new $h(s(this,A),this.convertTo3DMapPosition),s(this,L).text3DSystem.on("render",this.render),s(this,L).imageSystem.on("image-loaded",this.render),s(this,L).renderSystem.on("measure-canvas",s(this,rl)),s(this,L).outdoorLayersSystem=new Wf(this.map),this.Debug=new zf(this),s(this,Qf).call(this)}get viewCamera(){return s(this,Tu)}get canvasWidth(){return s(this,A).canvasWidth}get canvasHeight(){return s(this,A).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:Xa()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,co)}addGroupContainer(e,i,n){var o;if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let a=new Re(e);a.addEventListener("childadded",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),a.addEventListener("childremoved",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&a.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&Mt(a,i.interactive,s(this,A)),s(this,A).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a),s(this,Ee).call(this),this.render()}else O.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,n){var o;if(s(this,A).geometry3DMap.has(e))O.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let a=new Re(e);a.addEventListener("childadded",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),a.addEventListener("childremoved",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),a.components[0]=new Af,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),s(this,A).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,n,o,a){var l;if(s(this,A).geometry3DMap.has(e))O.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new Js(i,n),u=new Te(c,new br(o));u.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},s(this,A).geometry3DMap.set(u.id,u),(l=this.getParentContainer(a))==null||l.addEntity(u),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,n,o){var a,l;if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let c=new et(e,new ua(n));c.addEventListener("childadded",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),c.addEventListener("childremoved",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),c.userData.dirty=!0,s(this,A).geometry3DMap.set(e,c);for(let u of i.features){if(u.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(u.geometry.type))continue;let d=u.id||u.properties.id||ce(),{visible:m,...y}=n||{color:sv},g=s(this,L).meshOptimizationSystem.createEntityFromFeature(d,u,y);s(this,A).geometry3DMap.set(d,g),c.userData.entities3D.add(d)}c.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(n==null?void 0:n.altitude)!=null&&c.setAltitude(n.altitude),(l=this.getParentContainer(o))==null||l.addEntity(c),s(this,Ee).call(this),this.render()}else O.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return s(this,L).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addImage(e,i,n,o){var a;try{E7(e,i,n)}catch(l){O.error(l);return}if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let l=new jf(i),c=new Te(l,new br(n));c.id=e||ce(),l.mesh.userData={entityId:c.id,type:"path"},s(this,A).geometry3DMap.set(c.id,c),(a=this.getParentContainer(o))==null||a.addEntity(c),s(this,Ee).call(this),this.render()}else O.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,n,o){var a;try{u7(e,i,n)}catch(l){O.error(l);return}if(!s(this,A).geometry3DMap.has(e)&&!s(this,A).geometry2DMap.has(e)){let l=new et(e,new ua(n));l.addEventListener("childadded",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),l.addEventListener("childremoved",()=>{s(this,Ee).call(this),s(this,Ye).call(this)}),s(this,A).geometry3DMap.set(e,l),l.userData.dirty=!0,l.userData.modelURL=n.url;for(let c of i.features){let u=c.id||c.properties.id||ce(),d=s(this,L).meshOptimizationSystem.createModelFromFeature(u,c,n);c.properties.interactive!==void 0&&Mt(d,c.properties.interactive,s(this,A)),s(this,A).geometry3DMap.set(u,d),l.userData.entities3D.add(u)}(a=this.getParentContainer(o))==null||a.addEntity(l),s(this,Ee).call(this),this.render()}else O.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,n,o){var l;let a=n==null?void 0:n.id;try{gS(e,i,n||{})}catch(c){O.error(c);return}if(a===void 0||!s(this,A).geometry2DMap.has(a)&&!s(this,A).geometry3DMap.has(a)){let c=V(this,Ou,y0).call(this,e,new yi(i,n));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&Mt(c,n==null?void 0:n.interactive,s(this,A)),(l=this.getParentContainer(o))==null||l.addEntity(c),this.render()}else O.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}labelText3D(e,i,n={}){var u,d;try{if(!i||!e)throw new Error("content and meshGeometryId are required");u5.parse(n)}catch(m){O.error(m);return}let o=s(this,A).geometry3DMap.get(e);if((o==null?void 0:o.type)!=="geometry"){O.error(".labelText3D failed: target incorrect");return}let a=o==null?void 0:o.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let m=s(this,A).geometry3DMap.get(a.textEntityId);if((m==null?void 0:m.type)!=="text3d"){O.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let l=new Ns({type:"Feature",geometry:{coordinates:(u=a.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:i,id:ce()}});l.polygonEntityId=e;let c=new Te(l,new Qp(n==null?void 0:n.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",s(this,A).geometry3DMap.set(c.id.toString(),c),n.parentId&&((d=this.getParentContainer(n.parentId))==null||d.addEntity(c)),this.render(),{id:c.id,type:"text3d"}}addLabel2D(e,i,n,o){var l;let a=n==null?void 0:n.id;try{a5(e,i,n||{})}catch(c){O.error(c);return}if(a===void 0||!s(this,A).geometry2DMap.has(a)&&!s(this,A).geometry3DMap.has(a)){let c=V(this,Ou,y0).call(this,e,new eo(i,n||{},s(this,A)));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&Mt(c,n==null?void 0:n.interactive,s(this,A)),(l=this.getParentContainer(o))==null||l.addEntity(c),s(this,Ye).call(this),this.render()}else O.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(e,i={},n){var l,c;try{h7(e,i||{})}catch(u){O.error(u);return}let o=new oo(e,j1(i)),a=new Te(o,new br({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));return a.id=(i==null?void 0:i.id)||ce(),o.mesh.userData={entityId:a.id,type:"path"},s(this,A).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&Mt(a,i==null?void 0:i.interactive,s(this,A)),(c=this.getParentContainer(n))==null||c.addEntity(a),s(this,Ee).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(e){s(this,L).watermarkSystem.options=e,s(this,L).watermarkSystem.dirty=!0,s(this,L).collisionSystem.collidersDirty=!0,this.render()}remove(e){var n;let i;if(typeof e=="string"||typeof e=="number"?(i=s(this,A).geometry2DMap.get(e),i==null&&(i=s(this,A).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=s(this,A).geometry2DMap.get(e.id),i==null&&(i=s(this,A).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")s(this,A).geometry3DMap.delete(i.id),i.object3d&&Ue(i.object3d);else if(i.type==="group-container"){s(this,A).geometry3DMap.delete(i.userData.entityId);for(let o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);Ue(i)}else if(i.type==="geometry-group"){s(this,A).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);Ue(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];i.object3d&&(((n=i.parent)==null?void 0:n.type)==="geometry-group"&&i.parent.userData.entities3D.delete(i.id),Ue(i.object3d)),"outline"in o&&o.outline&&Ue(o.outline),"focusMesh"in o&&o.focusMesh!=null&&Ue(o.focusMesh),"textMesh"in o&&o.textMesh!=null&&this.remove(o.textMesh.userData.entityId),s(this,A).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label")i.object3d&&Ue(i.object3d),i.type==="label"&&delete s(this,L).twoDDrawSystem.textCache[i.id],s(this,A).geometry2DMap.delete(i.id);else if(i.type==="image")i.object3d&&Ue(i.object3d),s(this,A).geometry3DMap.delete(i.id);else if(i.type==="text3d"){Ue(i.object3d);let{batchedText:o,textMesh:a,polygonEntityId:l}=i.components[0];if(a&&(o&&o.removeText(a),Ue(a)),l){s(this,L).text3DSystem.remove(l);let c=s(this,A).geometry3DMap.get(l);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}s(this,A).geometry3DMap.delete(i.id)}s(this,Ee).call(this),s(this,Ye).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(e){return s(this,L).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(s(this,L).renderSystem.threeDdirty||s(this,L).renderSystem.twoDdirty)&&this.renderSync();let i=new ki;if(e==null)i.setFromObject(s(this,A).entityScene);else{let n=El(s(this,A),e);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Be?o.geometry:void 0;o.mesh instanceof Wa&&a?(a.computeBoundingBox(),a.boundingBox&&i.union(a.boundingBox)):i.setFromObject(n.object3d)}else((n==null?void 0:n.type)==="geometry-group"||(n==null?void 0:n.type)==="group-container")&&(n==null?void 0:n.userData.entityId)!=null&&i.setFromObject(n)}if(Cv(i))return cv(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var n,o,a,l,c;if(e==null)return{type:"map-view",hoverColor:s(this,A).hoverColor,text3dHoverColor:s(this,A).text3dHoverColor};let i=El(s(this,A),e);if((i==null?void 0:i.type)==="custom-geometry"){let u=i.components[0],d=i.components[1];return{id:i.id,type:"custom-geometry",visible:d.visible,altitude:d.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(u.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let u=[];for(let m of i.userData.entities3D.values()){let y=this.getState(m);((y==null?void 0:y.type)==="geometry"||(y==null?void 0:y.type)==="model")&&u.push(y)}let d=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:d.opacity,color:d.color,height:d.height,altitude:i.altitude,topColor:d.topColor,outline:d.outline,shading:d.shading,texture:d.texture,topTexture:d.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(m=>s(this,A).geometry3DMap.get(m)).every(m=>m&&m.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(m=>this.getState(m)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(u=>this.getState(u)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let u=i.components[0],d=i.object3d.parent,m=d==null?void 0:d.userData.entityId;return{id:i.id,type:"label",text:u.text||"",parent:{id:m,type:d==null?void 0:d.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:u.enabled,initialRank:Uc(u.initialRank),options:{rank:Uc(u.rank),appearance:u.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let u=i.components[0],d=i.object3d.parent,m=d==null?void 0:d.userData.entityId;return{id:i.id,type:"marker",enabled:u.enabled,parent:{id:m,type:d==null?void 0:d.type},position:this.convert3DMapPositionToCoordinate(i.position),element:u.containerEl,initialRank:Uc(u.initialRank),options:{rank:Uc(u.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:u,hoverColor:d,initialColor:m,topColor:y}=i.components[1],g=i.components[0],x=i.components[1],T=i.components[2];return{id:i.id,type:"geometry",opacity:x.opacity,color:u,focusable:g.focusable,topColor:y,initialColor:m,hoverColor:d,hovered:!!(T!=null&&T.hover),height:x.height,visible:x.visible,outline:x.outline,showImage:x.showImage,texture:x.texture,topTexture:x.topTexture,flipImageToFaceCamera:x.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(g.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let u=i.components[0],d=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(u.position),interactive:d!=null}}else if((i==null?void 0:i.type)==="path"){let u=i.components[0],d=i.components[2],m=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(u.position),visible:m.visible,interactive:d!=null,completeFraction:u.completeFraction,color:m.color,accentColor:u.accentColor,nearRadius:u.nearRadius,farRadius:u.farRadius,animateArrowsOnPath:u.animateArrowsOnPath,displayArrowsOnPath:u.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let u=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(u.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"){w5(i);let u=i.components[0],d=i.components[1],{textMesh:m}=u,y=(o=u.mesh)==null?void 0:o.parent;y instanceof Re&&((a=y.children.find(T=>T.type==="batchedtext"))==null||a.getWorldPosition(s(this,Au))),s(this,il).set(0,0,0);let g=m?m.getWorldPosition(s(this,il)):s(this,il);return Object.assign({},za,d.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(g.add(s(this,Au))),visible:(l=u.visible)!=null?l:!1,content:(c=u.feature.properties.content)!=null?c:""})}else return}}setState(e,i){var o,a;if(typeof e=="object"&&i==null){"hoverColor"in e&&(s(this,A).hoverColor=(o=e.hoverColor)!=null?o:s(this,A).hoverColor),"text3dHoverColor"in e&&(s(this,A).text3dHoverColor=(a=e.text3dHoverColor)!=null?a:s(this,A).text3dHoverColor);return}let n=El(s(this,A),e);if(n!=null){if(n.type==="custom-geometry"){let l=s(this,A).geometry3DMap.get(n.id);if(l instanceof Te&&l.components[0]instanceof Js){let c=i;to(n,c.visible),Jh(n,c.altitude),R1(n,c.position,this.convertTo3DMapPosition),N1(n,this.getParentContainer(c.parent,!1))}}else if(n.type==="model"||n.type==="path"){let l=i;Mt(n,l.interactive,s(this,A))&&s(this,Ee).call(this),n.type==="path"&&(Jh(n,l.altitude),I5(n,l))}else if(n.type==="group-container"){let l=i;to(n,l.visible)&&(s(this,L).outlineInterpolationSystem.dirty=!0,s(this,L).pathSystem.altitudeDirty=!0),Jh(n,l.altitude)&&(s(this,L).pathSystem.altitudeDirty=!0),Mt(n,l.interactive,s(this,A))&&s(this,Ee).call(this)}else if(n.type==="geometry-group"){let l=i;to(n,l.visible)&&(s(this,L).outlineInterpolationSystem.dirty=!0),p5(n,s(this,A),l)&&(s(this,L).outlineInterpolationSystem.dirty=!0),V1(n,l.outline)&&(s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),l.height!=null&&(F1(n,s(this,A),l.height),s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),l.altitude!=null&&(n.setAltitude(l.altitude),n.userData.outlineDirty=!0),C5(n,l),d5(n,l.shading),x5(n,s(this,A),l.opacity)&&(n.userData.outlineDirty=!0,s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Mt(n,l.interactive,s(this,A))&&(s(this,Ee).call(this),s(this,Ye).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Be){let l=i;to(n,l.visible)&&(s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),V1(n,l.outline)&&(s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),h5(n,l),M5(n,l.focusable)&&(s(this,L).geometryInFocusSystem.focusablesDirty=!0),P5(n,l.renderOrder)&&(s(this,L).meshDetachmentSystem.dirty=!0),T5(n,l.opacity)&&(s(this,L).meshDetachmentSystem.dirty=!0,s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),G1(n,l.flipImageToFaceCamera),l.height!=null&&(F1(n,s(this,A),l.height),s(this,L).outlineInterpolationSystem.geometries3DDirty=!0),S5(n,l)&&(s(this,L).meshDetachmentSystem.dirty=!0),B1(n,l),v5(n,l.hoverColor),Mt(n,l.interactive,s(this,A)),b5(n,l.hovered)}s(this,Ee).call(this)}else if(n.type==="label"||n.type==="marker"){let l=i;g5(n,i,s(this,A)),m5(n,i,s(this,A))&&s(this,Ye).call(this),R1(n,l.position,this.convertTo3DMapPosition),N1(n,this.getParentContainer(l.parent,!1))&&(s(this,Ye).call(this),s(this,L).panBoundsSystem.dirty=!0),f5(n,l.enabled)}else if(n.type==="image"){let l=i;to(n,l.visible),G1(n,l.flipImageToFaceCamera)}else n.type==="text3d"&&E5(n,i);this.render()}}convertTo3DMapPosition(e,i,n=0,o){var c,u,d,m,y;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(c=e[2])!=null?c:n,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=$p((d=(u=s(this,A).center)==null?void 0:u[1])!=null?d:0,(y=(m=s(this,A).center)==null?void 0:m[0])!=null?y:0,e,i);return o?(o.set(a,l,n),o):new $(a,l,n)}get backgroundColor(){return s(this,Ht).backgroundColor}getThreeRenderer(){return s(this,Ht)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?xv(i):void 0}isInView(e){let i=El(s(this,A),e);if(s(this,Lu).identity().multiply(s(this,We).projectionMatrix).multiply(s(this,We).matrixWorldInverse),s(this,Ma).setFromProjectionMatrix(s(this,Lu)),i instanceof $r)return s(this,Ma).containsPoint(i.position);if(i instanceof Te){let n=i==null?void 0:i.components[0];if(n instanceof Js||n instanceof no)return s(this,Ma).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Be){let o=new ki(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,Ma).intersectsBox(o)}}return!1}getSystems(){return s(this,L)}getInternalState(){return s(this,A)}getTweenGroup(){return s(this,A).tweenGroup}};jt=new WeakMap,We=new WeakMap,Tu=new WeakMap,Ks=new WeakMap,lo=new WeakMap,Ta=new WeakMap,el=new WeakMap,Mu=new WeakSet,m0=function(e){var i;s(this,co)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),s(this,A).pixelRatio=this.resolutionScale},A=new WeakMap,Ce=new WeakMap,Vr=new WeakMap,Ge=new WeakMap,Ti=new WeakMap,Ht=new WeakMap,L=new WeakMap,Pu=new WeakMap,Ye=new WeakMap,Ee=new WeakMap,qf=new WeakSet,B7=function(){M(this,Ce,document.createElement("div")),s(this,Ce).classList.add("mappedin__smart-collision-engine__container"),M(this,Vr,document.createElement("canvas")),s(this,Vr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,Ce)),M(this,Ge,document.createElement("canvas")),s(this,Ge).classList.add("mappedin__smart-collision-engine__container"),s(this,Ge).width=s(this,Ce).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Ce).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Ce).clientWidth+"px",s(this,Ge).style.height=s(this,Ce).clientHeight+"px",s(this,Ce).appendChild(s(this,Vr)),s(this,Ce).appendChild(s(this,Ge)),s(this,Vr).width=s(this,Ce).clientWidth,s(this,Vr).height=s(this,Ce).clientHeight,s(this,Ge).width=s(this,Ce).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Ce).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Ce).clientWidth+"px",s(this,Ge).style.height=s(this,Ce).clientHeight+"px"},$f=new WeakSet,R7=function(){M(this,Ti,document.createElement("div")),s(this,Ti).classList.add("mappedin-2d-entities"),Object.assign(s(this,Ti).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Ti))},Jf=new WeakSet,N7=function(){s(this,Ge).width=s(this,Ce).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Ce).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Ce).clientWidth+"px",s(this,Ge).style.height=s(this,Ce).clientHeight+"px",s(this,Vr).width=s(this,Ce).clientWidth,s(this,Vr).height=s(this,Ce).clientHeight,s(this,Ge).width=s(this,Ce).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Ce).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Ce).clientWidth+"px",s(this,Ge).style.height=s(this,Ce).clientHeight+"px",s(this,L).collisionSystem.collidersDirty=!0},co=new WeakMap,Iu=new WeakMap,wu=new WeakMap,tl=new WeakMap,Qf=new WeakMap,Eu=new WeakMap,_u=new WeakMap,Du=new WeakMap,rl=new WeakMap,Ou=new WeakSet,y0=function(e,i,n){let o=new $r(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||n||0));return s(this,A).geometry2DMap.set(o.id,o),o},Ma=new WeakMap,Lu=new WeakMap,_t=new WeakMap,Dt=new WeakMap,il=new WeakMap,Au=new WeakMap;var ku=f0;f();function WL(r,t){ZL(r,t)(r.getScene(),t),XL(r,t),t.addFolder("Export").add({export:async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let u=window.URL.createObjectURL(l);c.href=u,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(u)}},"export");let n=t.addFolder("Camera"),o={get bearing(){return r.camera.bearing},set bearing(a){r.camera.setBearing(a)},get pitch(){return r.camera.pitch},set pitch(a){r.camera.setPitch(a)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(a){r.camera.setZoomLevel(a)}};n.add(o,"bearing",-359,359,1),n.add(o,"pitch",r.camera.minPitch,r.camera.maxPitch,1),n.add(o,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}function ZL(r,t){let e=t;return function i(n,o){let a=o.addFolder("".concat([n.type]," ").concat(n.id.slice(0,16)));if(o.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let l={get height(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(n,{height:c})},set flipImageToFaceCamera(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="image"&&r.setState(n,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="image"?c.flipImageToFaceCamera:!1},set visible(c){let u=r.getState(n.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?c.visible:!1},set outline(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.outline:!1},get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.opacity:1},set opacity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{opacity:c})},get color(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"&&c.color?W(c.color).toHexString():"#ffffff"},set color(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{color:c})},set interactive(c){let u=r.getState(n.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(r.setState(n,{interactive:c}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"?c.interactive:!1},get completeFraction(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="path"?c.completeFraction:1},set completeFraction(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="path"&&r.setState(u,{completeFraction:c})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?r.camera.focusOn([c.position]):(c==null?void 0:c.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(c))}),a.add(l,"visible"),n.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),n.type==="path"&&a.add(l,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),n.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(n.type==="marker"){let l={get interactive(){var u;let c=r.getState(n.id);return(c==null?void 0:c.type)==="marker"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="marker"&&(r.setState(u,{options:{interactive:c}}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="marker"&&r.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(n.type==="label"){let l={get interactive(){var u;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&(r.setState(u,{options:{interactive:c}}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c})},get"Text Color"(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(n.id,{text:l.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:d.size:10},set"Text Size"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.iconSize:10},set"Icon Size"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var u,d,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(c){var d,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:m.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var u,d,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(c){var d,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:m.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var u,d,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(c){var d,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:m.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var u,d,m;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(m=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(c){var d,m;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:m.backgroundColor,inactive:c}}}}})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="label"&&r.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let l={get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{opacity:c})},set visible(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.visible:!1},set outline(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.outline:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&(r.setState(n,{interactive:c}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.start)!=null?d:0},set shadingStart(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{start:c}})},get shadingEnd(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.end)!=null?d:0},set shadingEnd(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{end:c}})},get shadingIntensity(){var u,d;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.intensity)!=null?d:0},set shadingIntensity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let l={set visible(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="group-container"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.visible:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="group-container"&&(r.setState(u,{interactive:c}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),n.children)for(let l of n.children.values())i(l,a)}}function XL(r,t){let e=t.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(i,"padding",0,100,1),e.add(i,"scale",.5,1.5,.1),e.add(i,"color",["dark","light"]),e.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(i,"iconOnly"),e.onChange(()=>{r.updateWatermark(i)})}var G7="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",YL="https://auth.mappedin.com/oauth2/token";async function V7(r,t){var e,i,n,o,a;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled&&((i=t==null?void 0:t.outdoorView)!=null&&i.headers)){let{Map:l,MercatorCoordinate:c}=await import("./outdoor-context-v4-OB4C7C4T.js"),u=t.outdoorView.headers;u==null&&(u=await yv(YL));let d=t.center||[0,0],m=new l({container:r,style:t.outdoorView.style||G7,center:d,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:b0,pitch:(o=t.pitch)!=null?o:g0,bearing:(a=t.bearing)!=null?a:v0,transformRequest:dv(u),trackResize:!1,pixelRatio:Xa(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=m.painter.context.gl,g=new ku(r,{center:d,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:y,map:m,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias}),x={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(g.camera.minZoomLevel),m.setMaxZoom(g.camera.maxZoomLevel),g.on("camera-change",w=>{x.center=w.center,x.zoom=w.zoomLevel,x.bearing=w.bearing,x.pitch=w.pitch,m.jumpTo(x)});let T=c.fromLngLat(d,0),v=Jp(T,g.viewCamera,g.camera,()=>{g.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(v),g.renderSync())});let b=!1,P=!1;m.on("idle",()=>{m&&(b||(g.publish("outdoor-view-loaded"),b=!0),P||(P=!0,g.publish("outdoor-style-loaded")))});let I=w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&g.getSystems().htmlControlsSystem.updateData(m)};return m.on("styledata",w=>{m&&w&&w.dataType==="style"&&w.type==="styledata"&&(P=!1),I(w)}),m.on("sourcedata",I),m.on("terrain",I),m.on("error",w=>{var _;if(((_=w.error)==null?void 0:_.url)===G7){O.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}O.warn(w)}),g}else return new ku(r,t)}f();var Ih=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Ih||{}),wh=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(wh||{});f();f();var Fu=class Fu{constructor(t,e,i){p(this,"id");p(this,"text");p(this,"target");p(this,"__type",Fu.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Fu.__type}};p(Fu,"__type","Label");var uo=Fu;f();var nl,Bu=class Bu{constructor(t,e,i){p(this,"id");C(this,nl,void 0);p(this,"__type",Bu.__type);p(this,"contentEl");this.id=t,this.contentEl=e,M(this,nl,i)}get target(){return s(this,nl)}static is(t){return t.__type===Bu.__type}updateTarget(t){M(this,nl,t)}};nl=new WeakMap,p(Bu,"__type","Marker");var cn=Bu;f();var Gu,Vu,Ru=class Ru{constructor(t,e,i){C(this,Gu,void 0);C(this,Vu,void 0);p(this,"target");p(this,"__type",Ru.__type);M(this,Gu,t),M(this,Vu,e),this.target=i}static is(t){return t.__type===Ru.__type}get id(){return s(this,Gu)}get url(){return s(this,Vu)}};Gu=new WeakMap,Vu=new WeakMap,p(Ru,"__type","Image");var Nu=Ru;f();var ju=class ju{constructor(t,e){p(this,"id");p(this,"groupId");p(this,"__type",ju.__type);this.id=t,this.groupId=e}static is(t){return t.__type===ju.__type}};p(ju,"__type","Model");var Hu=ju;f();var Pa=class{constructor(t,e,i){p(this,"id");p(this,"animation");p(this,"coordinates");p(this,"__type");this.id=t,this.__type="Path",this.animation=e,this.coordinates=i}};f();var po,Uu=class{constructor(t){C(this,po,void 0);M(this,po,t)}get center(){return s(this,po).center}get bearing(){return s(this,po).bearing}get pitch(){return s(this,po).pitch}get zoomLevel(){return s(this,po).zoomLevel}};po=new WeakMap;f();var Wu=class Wu{constructor(t){p(this,"id");p(this,"__type",Wu.__type);this.id=t}static is(t){return t.__type===Wu.__type}};p(Wu,"__type","Shape");var ho=Wu;f();var Kf=class Kf{constructor(t,e){p(this,"id");p(this,"target");p(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===Kf.__type}};p(Kf,"__type","Text3D");var fo=Kf;f();f();f();var zL=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),qL=/<svg([^>]*)>/g;function j7(r,t,e){let i=zL.get(r);return i?i.replace(qL,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var $L=r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),JL=r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),x0="#722ED1",C0="#1890FF",H7=({type:r="departure",color:t=C0})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?$L(t):JL(t),"\n </div>"),QL=r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},U7=({type:r="stairs",color:t=x0,direction:e="up"})=>{let i=QL("default"),n=i/2+2,o=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(j7("connection-"+r+"-16x16","white",n)||"","\n </div>\n ").concat(o?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(n,"px; height: ").concat(n,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")};f();var W7=async r=>new Promise(t=>setTimeout(t,r));var ol={setMapOnConnectionClick:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},inactivePathOptions:{drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:C0,destinationColor:x0}},un,pn,mo,_e,Xu,dn,ot,Mi,gr,hn,Ia,rm,Z7,al,em,sl,tm,im,X7,Yu,Zu=class{constructor(t,e,i){C(this,rm);C(this,al);C(this,sl);C(this,im);C(this,un,new Map);C(this,pn,void 0);C(this,mo,void 0);C(this,_e,ol);C(this,Xu,void 0);C(this,dn,void 0);C(this,ot,[]);C(this,Mi,void 0);C(this,gr,new Map);C(this,hn,new Map);C(this,Ia,new Map);C(this,Yu,t=>{var e;if((e=s(this,_e).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=s(this,un).get(t.markers[0]);i!=null&&i.action.toFloor&&(s(this,_e).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}});M(this,pn,t),M(this,Xu,i),M(this,mo,e)}get currentMap(){return s(this,Xu).call(this)}get isMultiFloor(){if(!s(this,ot).length)return!1;let t=new Set;for(let e of s(this,ot))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return s(this,gr).get(t)}getMarkerById(t){return s(this,un).get(t)}get paths(){let t=[];return s(this,gr).forEach(({path:e})=>t.push(e)),t}get activeDirections(){return s(this,Ia).get(s(this,Mi))}get activePath(){var t;if(s(this,Mi))return(t=s(this,gr).get(s(this,Mi).id))==null?void 0:t.path}get floorStacks(){let t=s(this,mo).getMapData();if(!s(this,ot).length||!t)return[];let e=new Set;for(let i of s(this,ot))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o.floorStack)}return Array.from(e)}get floors(){let t=s(this,mo).getMapData();if(!s(this,ot).length||!t)return[];let e=new Set;for(let i of s(this,ot))for(let n of i.coordinates)if(n.floorId){let o=t.getById("floor",n.floorId);o&&e.add(o)}return Array.from(e)}setActivePathByIndex(t){let e=s(this,ot)[t];if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,ot)[t]){O.warn("Direction #".concat(t," does not exist"));return}let i=s(this,hn).get(e);if(!i){O.warn("The direction is not a part of muli-direcional path");return}V(this,al,em).call(this,i)}setActivePath(t){if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Ia).get(t)){O.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}V(this,al,em).call(this,t)}setActivePathByDirections(t){if(!s(this,ot).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=s(this,hn).get(t);if(!e){O.warn("The direction is not a part of muli-direcional path");return}V(this,al,em).call(this,e)}async draw(t,e={}){var c;let i=Array.isArray(t)?t:[t],n=i[0],o=i[i.length-1],a=n.coordinates[0];M(this,ot,i),a.floorId&&this.currentMap.setFloor(a.floorId),s(this,dn)&&this.clear(),M(this,_e,{setMapOnConnectionClick:(c=e.setMapOnConnectionClick)!=null?c:ol.setMapOnConnectionClick,pathOptions:{...ol.pathOptions,...e.pathOptions},inactivePathOptions:{...ol.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...ol.createMarkers,...e.createMarkers},markerOptions:{...ol.markerOptions,...e.markerOptions}});let l=!1;return M(this,dn,{promise:new Promise(async u=>{var d,m,y;if(S.env.NODE_ENV!=="test"&&await W7(500),l||!i.length){u();return}(d=s(this,_e).createMarkers)!=null&&d.departure&&V(this,sl,tm).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let g=0;g<i.length;g++){let x=i[g],T=g?{...s(this,_e).inactivePathOptions}:{...s(this,_e).pathOptions};if(x.coordinates.length<2){O.warn("Directions must have at least 2 coordinates"),u();return}let v=this.currentMap.Paths.add(x.coordinates,T),b=v.paths.map(I=>I.id.toString()),P=new Pa(ce(),v.animation,x.coordinates);for(let I of b){s(this,gr).set(I,{path:P,entityIds:b});let w=g?{...s(this,_e).inactivePathOptions,altitude:0}:{...s(this,_e).pathOptions,altitude:.05};s(this,pn).setState(I,w)}if(s(this,gr).set(P.id,{path:P,entityIds:b}),s(this,hn).set(x,P),s(this,Ia).set(P,x),S.env.NODE_ENV!=="test"&&await v.animation,l){u();return}(m=s(this,_e).createMarkers)!=null&&m.connection&&V(this,im,X7).call(this,x.instructions,"connection"),g===0&&(M(this,Mi,s(this,hn).get(s(this,ot)[0])),s(this,pn).on("click",s(this,Yu)))}if((y=s(this,_e).createMarkers)!=null&&y.destination&&V(this,sl,tm).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),l){u();return}s(this,mo).mapObjects.forEach(g=>{g.processFloorChange(g.currentFloorId)}),u()}),cancel:()=>{l=!0}}),s(this,dn).promise}clear(){s(this,un).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),s(this,un).clear(),s(this,gr).forEach(({path:t,entityIds:e})=>{s(this,gr).delete(t.id),e.forEach(i=>s(this,gr).delete(i)),this.currentMap.Paths.remove(e)}),s(this,dn)&&(s(this,dn).cancel(),M(this,dn,void 0)),M(this,ot,[]),s(this,hn).clear(),s(this,Ia).clear(),M(this,Mi,void 0),s(this,pn).off("click",s(this,Yu)),s(this,mo).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};un=new WeakMap,pn=new WeakMap,mo=new WeakMap,_e=new WeakMap,Xu=new WeakMap,dn=new WeakMap,ot=new WeakMap,Mi=new WeakMap,gr=new WeakMap,hn=new WeakMap,Ia=new WeakMap,rm=new WeakSet,Z7=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},al=new WeakSet,em=function(t){M(this,Mi,t),s(this,ot).forEach(e=>{let i=s(this,hn).get(e);if(i){let n=s(this,gr).get(i.id),o=n.path.id===s(this,Mi).id?{...s(this,_e).pathOptions,altitude:.05}:{...s(this,_e).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,pn).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},sl=new WeakSet,tm=function(t,e,i){var n,o,a,l,c;if(e==="connection"&&i){let u=i.action.type==="ExitConnection"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,d;if(typeof((n=s(this,_e).createMarkers)==null?void 0:n.connection)=="function"){let y=s(this,_e).createMarkers.connection(i);s(this,pn).setState(y.id.toString(),{options:{interactive:!0}}),d={id:y.id,type:"marker"}}else d=this.currentMap.Markers.add(i.coordinate,U7({type:(a=(o=i.action.connection)==null?void 0:o.type)!=null?a:i.action.connectionType,color:u,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(d.id.toString());if(!m)throw new Error("marker component should exist");s(this,un).set(d.id,{instruction:i,marker:new cn(d.id.toString(),m,i.coordinate)})}else{let u=e==="departure"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,d;typeof((l=s(this,_e).createMarkers)==null?void 0:l.departure)=="function"&&e==="departure"?d={id:s(this,_e).createMarkers.departure(i).id,type:"marker"}:typeof((c=s(this,_e).createMarkers)==null?void 0:c.destination)=="function"&&e==="destination"?d={id:s(this,_e).createMarkers.destination(i).id,type:"marker"}:d=this.currentMap.Markers.add(t,H7({type:e,color:u}),{anchor:"top",rank:"always-visible"}),s(this,un).set(d.id,void 0)}},im=new WeakSet,X7=function(t,e){t.filter(n=>V(this,rm,Z7).call(this,n.action)).forEach(n=>{V(this,sl,tm).call(this,n.coordinate,e,n)})},Yu=new WeakMap;f();f();f();var KL=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),eA=/<svg([^>]*)>/g;function Y7(r,t,e){let i=KL.get(r);return i?i.replace(eA,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var wa,ll,zu,S0,om,z7,am,q7,qu,T0,sm,$7,nm=class{constructor(t,e){C(this,zu);C(this,om);C(this,am);C(this,qu);C(this,sm);C(this,wa,void 0);C(this,ll,void 0);p(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});M(this,wa,t),M(this,ll,e)}auto(){let t=s(this,ll)[Object.keys(s(this,ll))[0]];[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(e=>{if(e.__type==="connection")e.coordinates.forEach(i=>{let n=e.name||e.externalId;n&&s(this,wa).Labels.add(i,n,V(this,zu,S0).call(this,e))});else{e.__type==="space"&&e.name!==""&&s(this,wa).updateState(e,{interactive:!0,hoverColor:"#F0F0F0"});let i=e.name||e.externalId;i&&s(this,wa).Labels.add(e,i,V(this,zu,S0).call(this,e))}})}};wa=new WeakMap,ll=new WeakMap,zu=new WeakSet,S0=function(t){let e=Y7(V(this,om,z7).call(this,t),"white",12);return{appearance:{text:{foregroundColor:V(this,qu,T0).call(this,t)},marker:{foregroundColor:{active:V(this,qu,T0).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:V(this,sm,$7).call(this,t)}},om=new WeakSet,z7=function(t){return t.__type==="connection"?V(this,am,q7).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},am=new WeakSet,q7=function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},qu=new WeakSet,T0=function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},sm=new WeakSet,$7=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var lm=class{constructor(t,e){p(this,"Labels");p(this,"auto",()=>{this.Labels.auto()});this.Labels=new nm(t,e)}};f();var oe,cm,J7,$u=class{constructor(t){C(this,cm);C(this,oe,void 0);p(this,"setMinPitch",t=>{s(this,oe).camera.setMinPitch(t)});p(this,"setMaxPitch",t=>{s(this,oe).camera.setMaxPitch(t)});p(this,"setMinZoomLevel",t=>{s(this,oe).camera.setMinZoomLevel(t,!0)});p(this,"setMaxZoomLevel",t=>{s(this,oe).camera.setMaxZoomLevel(t)});M(this,oe,t)}setScreenOffsets(t){s(this,oe).camera.setInsetPadding(t)}get screenOffsets(){return s(this,oe).camera.insetsPadding}get panMode(){return s(this,oe).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&s(this,oe).camera.setPanMode(t)}focusOn(t,e){var o,a,l;let i=[],n=Array.isArray(t)&&!Ng(t)?t:[t];for(let c of n)if(c!=null)if(qi.is(c)){let u;for(u of c.coordinates)if(u.floorId!=null){let d=s(this,oe).getBoundingArea(u.floorId);d&&i.push([u.longitude,u.latitude,(o=d[0][2])!=null?o:s(this,oe).camera.elevation])}else i.push([u.longitude,u.latitude,s(this,oe).camera.elevation])}else if(Yi.is(c)||st.is(c)||Rt.is(c)||Wi.is(c)){let u=s(this,oe).getBoundingArea(c.id),d=st.is(c)||Rt.is(c)?s(this,oe).getBoundingArea(c.floor.id):s(this,oe).getBoundingArea(c.id);u&&(d?i.push(...u.map(m=>{var y;return[m[0],m[1],(y=d[0][2])!=null?y:s(this,oe).camera.elevation]})):i.push(...u))}else if(ae.is(c)||ii.is(c)||oi.is(c)||Vn.is(c)||dr.is(c)){let u=Ke(c);if(u)if(u.floorId!=null){let d=s(this,oe).getBoundingArea(u.floorId);d&&i.push([u.longitude,u.latitude,(a=d[0][2])!=null?a:s(this,oe).camera.elevation])}else i.push([u.longitude,u.latitude,s(this,oe).camera.elevation])}else if(wr.is(c)||Jt.is(c))for(let u of c.spaces){let d=s(this,oe).getBoundingArea(u.id);d&&i.push(...d)}else Ng(c)&&i.push(c);return((l=e==null?void 0:e.axisAlignedPadding)==null?void 0:l.vertical)!==void 0&&(i=V(this,cm,J7).call(this,i,e.axisAlignedPadding)),s(this,oe).camera.focusOn(i,{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing})}animateTo(t,e){var u;let{center:i,zoomLevel:n,bearing:o,pitch:a}=t,l=i!=null?i:this.center,c=[l.longitude,l.latitude,this.elevation];return s(this,oe).camera.animateTo({center:c,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(u=e==null?void 0:e.duration)!=null?u:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:i=this.zoomLevel,bearing:n=this.bearing,pitch:o=this.pitch}=t,a=[e.longitude,e.latitude];s(this,oe).camera.setCenter(a),s(this,oe).camera.setZoomLevel(i),s(this,oe).camera.setBearing(n),s(this,oe).camera.setPitch(o)}get center(){let t=s(this,oe).camera.center;return new ae(t[1],t[0],void 0)}setAutoMinZoomLevel(t){s(this,oe).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return s(this,oe).camera.autoMinZoomLevel}get zoomLevel(){return s(this,oe).camera.zoomLevel}get pitch(){return s(this,oe).camera.pitch}get minPitch(){return s(this,oe).camera.minPitch}get maxPitch(){return s(this,oe).camera.maxPitch}get bearing(){let t=s(this,oe).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return s(this,oe).camera.minZoomLevel}get maxZoomLevel(){return s(this,oe).camera.maxZoomLevel}setElevation(t){s(this,oe).camera.setElevation(t)}get elevation(){return s(this,oe).camera.elevation}animateElevation(t,e){return s(this,oe).camera.animateElevation(t,e)}};oe=new WeakMap,cm=new WeakSet,J7=function(t,e){var o;let i=(o=e==null?void 0:e.vertical)!=null?o:0;return[t.map(a=>{var l;return[a[0],a[1],((l=a[2])!=null?l:0)-i]}),t.map(a=>{var l;return[a[0],a[1],(l=a[2])!=null?l:0]}),t.map(a=>{var l;return[a[0],a[1],((l=a[2])!=null?l:0)+i]})].flat()};f();var cl,Ju=class{constructor({currentMapGetter:t}){C(this,cl,void 0);M(this,cl,t)}get currentMap(){return s(this,cl).call(this)}async getCurrentSceneGLTF(t){let e=s(this,cl).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(O.error("There is no map to export. Please load a map first."),new Blob)}};cl=new WeakMap;f();var Pi,Ku,Qu=class{constructor({currentMapGetter:t}){C(this,Pi,new Map);C(this,Ku,void 0);M(this,Ku,t)}get currentMap(){return s(this,Ku).call(this)}getById(t){return s(this,Pi).get(t)}add(t,e,i){let n=Ke(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(pi(n),e,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),l=new uo(a.id.toString(),e,t);return s(this,Pi).set(l.id,{label:l,entityId:l.id}),l}all(){var e;let t=[];return(e=this.currentMap)==null||e.Labels.all({onCreate:(i,n,o)=>{let a=new uo(i.toString(),n,o);s(this,Pi).set(a.id,{label:a,entityId:a.id}),t.push(a)}}),t}remove(t){var i;let e=s(this,Pi).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e.entityId),s(this,Pi).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Pi).forEach(({label:e})=>{this.remove(e),t.push(e),s(this,Pi).delete(e.id.toString())}),t}};Pi=new WeakMap,Ku=new WeakMap;f();f();var Q7={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},K7={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},e6=.5,ul=class{constructor(t,e=new Map){p(this,"containerId");p(this,"layers");this.containerId=t,this.layers=e}},ep=class{constructor(t,e,i,n,o,a,l){p(this,"id");p(this,"name");p(this,"elevation");p(this,"containerId");p(this,"externalId");p(this,"metadata");p(this,"shortName");p(this,"subtitle");p(this,"loaded",!1);p(this,"styleMap",{});p(this,"obstructions");p(this,"entrances");p(this,"spaces");p(this,"floorImages");p(this,"renderer");p(this,"options");p(this,"layers",new Map);p(this,"footprint");p(this,"floorStackId");p(this,"multiFloorView");p(this,"load",()=>{var n,o,a,l;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Hn,"-").concat(this.id),{},this.id);this.layers.set(Hn,new ul(t.id.toString()));let e=this.renderer.addGroupContainer("".concat(si,"-").concat(this.id),{},this.id);this.layers.set(si,new ul(e.id.toString()));let i=this.renderer.addGroupContainer("".concat(He,"-").concat(this.id),{},this.id);if(this.layers.set(He,new ul(i.id.toString())),this.spaces!=null&&this.spaces.features.length>0){let c=this.spaces.features.filter(y=>{var g;return y.geometry.type==="Polygon"&&((g=y.properties.kind)==null?void 0:g.toLowerCase())!=="void"}),u=a1(c,this.styleMap),d=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),m=0;for(let[y,g]of u){let x=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(m),{features:g},Oc(y,this.options),d);m++;let T=d.id.toString();this.layers.get(He).layers.set(y.id||T,x.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let c=this.obstructions.features.filter(b=>b.geometry.type==="Polygon"&&b.properties.kind==="object"),u=a1(c,this.styleMap),d=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),m=0;for(let[b,P]of u){let I=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(m),{features:P},Oc(b,this.options),d);m++;let w=d.id.toString();this.layers.get(He).layers.set(b.id||w,I.id.toString())}let y=this.obstructions.features.filter(b=>b.geometry.type==="LineString"&&b.properties.kind==="Wall"&&b.properties.footprintComponent===!1),g=this.obstructions.features.filter(b=>b.geometry.type==="LineString"&&b.properties.kind==="Wall"&&b.properties.footprintComponent===!0),x=this.entrances,T=Q7,v=Q7;if(y!=null&&y.length>0){let b=this.styleMap[(n=y[0].properties)==null?void 0:n.id];b!=null&&(T={...b}),v=T;let{walls:P,entrances:I}=i1(y,(x==null?void 0:x.features)||[]),w=Math.max(T.height-.11,e6),_={...K7,height:w},D=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),I,_,i);this.layers.get(He).layers.set(ds,D.id.toString());let k=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[P]},Oc(T,this.options),i);this.layers.get(He).layers.set(jn,k.id.toString())}if(g!=null&&g.length>0){let b=this.styleMap[(o=g[0].properties)==null?void 0:o.id];b!=null&&(v={...b,id:ai});let{walls:P,entrances:I}=i1(g,(x==null?void 0:x.features)||[]),w=Math.max(v.height-.11,e6),_={...K7,height:w},D=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),I,_,i);this.layers.get(He).layers.set(hs,D.id.toString());let k=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[P]},Oc(v,this.options),i);this.layers.get(He).layers.set(ai,k.id.toString())}}if(this.floorImages!=null){let c=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let u of this.floorImages.features||[])"anchorId"in u.properties||"anchorId"in u.properties&&((a=u.properties)==null?void 0:a.anchorId)==null||this.renderer.addImage(ce(),u,{url:u.properties.path,flipImageToFaceCamera:!0},c);this.layers.set(m4,new ul(c.id.toString()))}return(l=this.multiFloorView)!=null&&l.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var u,d,m;this.id=e.id,this.options=o;let c=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);if(this.containerId=c.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,a!=null&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(u=a.floorImages)==null?void 0:u[this.id],this.footprint=(d=a["floor.geojson"])==null?void 0:d.features.find(y=>y.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=n,this.footprint&&(n!=null&&n.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let y=this.obstructions.features.filter(g=>g.geometry.type==="LineString"&&g.properties.kind==="Wall"&&g.properties.footprintComponent===!0);if(y!=null&&y.length>0){let g=this.styleMap[(m=y[0].properties)==null?void 0:m.id],x=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...g,height:-n.floorHeight,altitude:n.floorHeight/2,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":g.color},this.id);this.layers.set(fs,{containerId:x.id.toString(),layers:new Map})}}}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};f();var t6=50,tA=1e3,Ve,jr,pl,Ii,Hr,Ot,rp,dl,Ea,ip,M0,_a,np,op,ap,sp,fn,um,r6,lp,yo,cp,P0,tp=class extends z{constructor({currentMapGetter:e}){super();C(this,ip);C(this,um);C(this,cp);C(this,Ve,void 0);C(this,jr,t6);C(this,pl,0);C(this,Ii,void 0);C(this,Hr,!1);C(this,Ot,[]);C(this,rp,0);C(this,dl,!1);C(this,Ea,"collapsed");p(this,"expandedFactor",0);C(this,_a,"all-floors");C(this,np,()=>{let e=s(this,Ve).call(this);if(s(this,rp)===this.expandedFactor||e==null||!s(this,Hr))return;M(this,rp,this.expandedFactor);let i=Qr(this.expandedFactor,0,1,0,s(this,jr)),o=Qr(this.expandedFactor,0,.1,0,1)===0;s(this,Ot).forEach((a,l)=>{e.renderer.setState(a.containerId,{visible:o?a.id===e.currentFloorId:!0,altitude:i*l})}),this.expandedFactor===0?(M(this,Hr,!1),e.renderer.camera.setPanMode("default"),s(this,yo)&&s(this,yo).call(this)):this.expandedFactor===1&&(M(this,Hr,!1),s(this,yo)&&s(this,yo).call(this))});C(this,op,()=>{var e,i,n;this.expanded&&M(this,pl,(i=(e=s(this,Ve).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(n=s(this,Ve).call(this))==null||n.renderer.on("user-interaction-end",s(this,sp))});C(this,ap,()=>{var i;let e=s(this,Ve).call(this);if(e!=null&&this.expanded&&s(this,dl)&&!s(this,Hr)){let n=[1/0,e.currentFloorId];for(let o=0;o<s(this,Ot).length;o++){let a=s(this,Ot)[o],l=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-o*s(this,jr));l<s(this,jr)/3&&(n[0]=l,n[1]=a.id)}n[1]!==e.currentFloorId&&(e.currentFloorId=n[1],s(this,Ot).forEach(o=>{e.renderer.setState(o.containerId,{visible:s(this,_a)==="all-floors"?!0:e.currentFloor.id===o.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId}))}});C(this,sp,()=>{var i,n;let e=s(this,Ve).call(this);if(this.expanded&&e&&s(this,pl)!==((i=e.renderer.camera.elevation)!=null?i:0)){let o=[1/0,e.currentFloorId,0];for(let a=0;a<s(this,Ot).length;a++){let l=s(this,Ot)[a],c=Math.abs(((n=e.renderer.camera.elevation)!=null?n:0)-a*s(this,jr));c<o[0]&&(o[0]=c,o[1]=l.id,o[2]=a*s(this,jr))}s(this,dl)&&V(this,um,r6).call(this,o[2]),M(this,pl,0),e.renderer.off("user-interaction-end",s(this,sp))}});C(this,fn,null);C(this,lp,null);C(this,yo,void 0);M(this,Ve,e);let i=s(this,Ve).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,op)),i.renderer.on("camera-change",s(this,ap)),i.renderer.on("pre-render",s(this,np)))}get state(){return s(this,Ea)}get expanded(){return s(this,Ea)!=="collapsed"}get gapBelowFloors(){return s(this,jr)}get includedFloors(){var e;return(e=s(this,ip,M0))!=null&&e.api.mapData?s(this,Ot).map(i=>{var n,o;return(o=(n=s(this,ip,M0))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,_a)}setFloorVisiblityMode(e){M(this,_a,e);let i=s(this,Ve).call(this);i!=null&&s(this,Ot).forEach(n=>{i.renderer.setState(n.containerId,{visible:s(this,_a)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(e){M(this,dl,e)}async expand(e){var n,o,a;let i=s(this,Ve).call(this);if(i!=null)return M(this,jr,(n=e==null?void 0:e.distanceBetweenFloors)!=null?n:t6),M(this,Ot,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(l=>i.floorsById.get(l.id)).filter(Boolean):i.currentFloorStack.floorObjects),s(this,Ot).sort((l,c)=>l.elevation-c.elevation),s(this,Ot).length<=1||this.expanded===!0?Promise.resolve():(M(this,Hr,!0),i.api.Camera.setPanMode((o=e==null?void 0:e.cameraPanMode)!=null?o:"elevation"),this.changeFloorOnElevationChanges((a=e==null?void 0:e.changeFloorOnElevationChanges)!=null?a:!0),V(this,cp,P0).call(this,"expand",e).then(()=>{M(this,Ea,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{M(this,Hr,!1)}))}async collapse(e){let i=s(this,Ve).call(this);if(i!=null)return this.expanded===!0?(M(this,Hr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),V(this,cp,P0).call(this,"collapse",e).then(()=>{M(this,Ea,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{M(this,Hr,!1)})):Promise.resolve()}destroy(){let e=s(this,Ve).call(this);e!=null&&(e.renderer.off("user-interaction-start",s(this,op)),e.renderer.off("camera-change",s(this,ap)),e.renderer.off("pre-render",s(this,np)))}};Ve=new WeakMap,jr=new WeakMap,pl=new WeakMap,Ii=new WeakMap,Hr=new WeakMap,Ot=new WeakMap,rp=new WeakMap,dl=new WeakMap,Ea=new WeakMap,ip=new WeakSet,M0=function(){return s(this,Ve).call(this)},_a=new WeakMap,np=new WeakMap,op=new WeakMap,ap=new WeakMap,sp=new WeakMap,fn=new WeakMap,um=new WeakSet,r6=function(e){var n,o,a;s(this,fn)&&s(this,fn).stop();let i=s(this,Ve).call(this);i!=null&&(M(this,fn,new dt({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:e},150).easing(Ne.Quadratic.Out).onComplete(()=>{var l;s(this,fn)&&((l=s(this,Ve).call(this))==null||l.renderer.getTweenGroup().remove(s(this,fn)))}).onUpdate(({elevation:l})=>{i.renderer.camera.setElevation(l)}).start()),(o=s(this,Ve).call(this))==null||o.renderer.getTweenGroup().add(s(this,fn)),(a=s(this,Ve).call(this))==null||a.renderer.render())},lp=new WeakMap,yo=new WeakMap,cp=new WeakSet,P0=function(e,i){var l,c,u,d;s(this,Ii)&&s(this,Ii).stop();let n=s(this,Ve).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,Ot).indexOf(n.currentFloor)*s(this,jr),a=(l=n.renderer.camera.elevation)!=null?l:0;return M(this,lp,new Promise(m=>{M(this,yo,m)})),M(this,Ii,new dt({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(c=i==null?void 0:i.duration)!=null?c:tA).easing(Ys[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m,n.renderer.camera.setElevation(e==="expand"?o*m:a*m)}).onComplete(()=>{var m;s(this,Ii)&&((m=s(this,Ve).call(this))==null||m.renderer.getTweenGroup().remove(s(this,Ii)))}).start()),s(this,Ii).cameraAnimation=!0,(u=s(this,Ve).call(this))==null||u.renderer.getTweenGroup().add(s(this,Ii)),(d=s(this,Ve).call(this))==null||d.renderer.render(),s(this,lp)};f();var hl,up=class{constructor(t,e,i,n){p(this,"id");p(this,"externalId");p(this,"name");p(this,"type");p(this,"floorIds");p(this,"defaultFloorId");p(this,"floorObjects",[]);p(this,"floorObjectsByElevation",new Map);p(this,"metadata");p(this,"footprint");p(this,"containerId");p(this,"facade");p(this,"renderer");C(this,hl,void 0);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.footprint=t.footprint,this.floorIds=(a=t.floors)!=null?a:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=i;let o=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=o.id.toString(),this.facade=n}get defaultFloor(){if(s(this,hl)==null){this.floorObjects.length===0&&O.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),M(this,hl,t)}return s(this,hl)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){O.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(n=>{this.renderer.setState(n.spaceId,{visible:t})})}};hl=new WeakMap;f();function i6(r,t,e){let i=[];for(let n of r){let o={floor:n,visible:!1,visibleLayers:[],expandFootprint:!1};n.id===t.id?(o.visible=!0,o.visibleLayers=[si,He,Hn],n.elevation<0&&(o.expandFootprint=!0,o.visibleLayers.push(fs))):e.includes(n.id)&&n.elevation<t.elevation?(o.visible=!0,o.visibleLayers=[fs,si,He],n.elevation<0&&(o.expandFootprint=!0)):t.elevation>0&&n.elevation<t.elevation&&n.elevation>=0&&(o.visible=!0,o.visibleLayers=[fs]),i.push(o)}return i}f();f();var rA=300,n6=17,or,Da,dp,fl,hp,Oa,Lt,nr,fp,I0,mp,w0,dm,o6,ml,pm,mn,yp,E0,gp,_0,pp=class extends z{constructor(e,i,{currentMapGetter:n}){super();C(this,Lt);C(this,fp);C(this,mp);C(this,dm);C(this,ml);C(this,yp);C(this,gp);C(this,or,void 0);C(this,Da,!1);C(this,dp,n6);C(this,fl,{});C(this,hp,void 0);C(this,Oa,void 0);C(this,mn,new Set);M(this,or,e),M(this,hp,n),M(this,Oa,i)}enable(e){var i;M(this,dp,(i=e==null?void 0:e.minZoomLevel)!=null?i:n6),this.enabled||(s(this,or).on("geometry-in-focus",n=>V(this,yp,E0).call(this,n)),V(this,gp,_0).call(this,!0),M(this,Da,!0))}disable(){M(this,Da,!1),s(this,or).off("geometry-in-focus",e=>V(this,yp,E0).call(this,e)),V(this,gp,_0).call(this,!1)}get enabled(){return s(this,Da)}setDefaultFloorForStack(e,i){s(this,Lt,nr)==null&&O.throw("Current map does not exist.");let n=s(this,Lt,nr).floorsById.get(i.id);if(n==null){O.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(n.floorStackId!==e.id){O.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}s(this,fl)[e.id]=i.id}resetDefaultFloorForStack(e){delete s(this,fl)[e.id]}};or=new WeakMap,Da=new WeakMap,dp=new WeakMap,fl=new WeakMap,hp=new WeakMap,Oa=new WeakMap,Lt=new WeakSet,nr=function(){return s(this,hp).call(this)},fp=new WeakSet,I0=function(e){var a;let i=s(this,Lt,nr).floorStacksById.get(e);if(!i)return;let n=(a=s(this,fl)[i.id])!=null?a:i.defaultFloor.id,o=s(this,Lt,nr).floorsById.get(n);if(o)return o},mp=new WeakSet,w0=function(e){let i=s(this,Lt,nr).floorStacksById.get(e);if(!i)return;let n=V(this,fp,I0).call(this,i.id);n&&s(this,Lt,nr).setFloor(n.id)},dm=new WeakSet,o6=function(e){var i;return(i=s(this,Oa).getMapDataInternal())==null?void 0:i.facadesBySpaceId[e]},ml=new WeakSet,pm=function(e,i,n=rA){var c;let o=(c=s(this,Oa).getMapDataInternal())==null?void 0:c.getById("facade",e);if(!o)return;let a=s(this,Lt,nr).floorStacksById.get(o.floorStack.id);if(!a)return;if(i==="open"){let u=V(this,fp,I0).call(this,o.floorStack.id);if(!u)return;u.setVisible(!0)}let l=new dt({opacity:i==="open"?1:0}).easing(Ne.Quadratic.In).to({opacity:i==="open"?0:1},n).onUpdate(({opacity:u})=>{o.spaces.forEach(d=>{let m=s(this,or).getState(d.id);m&&s(this,or).setState(m,{opacity:u})})}).onComplete(()=>{s(this,or).getTweenGroup().remove(l),i==="close"&&a.floorObjects.forEach(u=>{u.setVisible(!1)})});l.start(),s(this,or).getTweenGroup().add(l)},mn=new WeakMap,yp=new WeakSet,E0=function(e){if(!s(this,Da)||e.length===0)return;if(s(this,or).camera.zoomLevel<s(this,dp)){for(let l of s(this,mn))V(this,ml,pm).call(this,l,"close");s(this,mn).clear(),s(this,Lt,nr).outdoorFloorStacks.size>0&&!s(this,Lt,nr).outdoorFloorStacks.has(s(this,Lt,nr).currentFloorStackId)&&(V(this,mp,w0).call(this,s(this,Lt,nr).outdoorFloorStacks.values().next().value),this.publish("focus-change",{facades:[],spaces:[]}));return}let i=-1/0,n,o=!1,a=new Set;e.forEach((l,c)=>{let u=V(this,dm,o6).call(this,l);if(!u)return;let d=(e.length-c)/e.length,y=(u.id===(n==null?void 0:n.id)?i:0)+d+1;y>i&&(i=y,n=u),s(this,mn).has(u.id)||(V(this,ml,pm).call(this,u.id,"open"),o=!0),a.add(u.id)});for(let l of s(this,mn))a.has(l)||(V(this,ml,pm).call(this,l,"close"),o=!0);n&&s(this,Lt,nr).currentFloorStackId!==n.floorStack.id&&(V(this,mp,w0).call(this,n.floorStack.id),o=!0),M(this,mn,a),o&&this.publish("focus-change",{facades:Array.from(s(this,mn)),spaces:e})},gp=new WeakSet,_0=function(e){var i;(i=s(this,Oa).getMapDataInternal())==null||i.facades.forEach(n=>{n.spaces.forEach(o=>{let a=s(this,or).getState(o.id);a&&s(this,or).setState(a,{focusable:e,renderOrder:e?1:0})})})};var iA=5,nA={linear:Ne.Linear.None,easeIn:Ne.Quadratic.In,easeOut:Ne.Quadratic.Out,easeInOut:Ne.Quadratic.InOut},ar,vp=class extends z{constructor(e,i,n,o){var u,d,m,y;super();p(this,"floorStacksById",new Map);p(this,"floorsById",new Map);p(this,"currentFloorId","");p(this,"currentFloorStackId","");p(this,"outdoorFloorStacks",new Set);p(this,"id");p(this,"renderer");p(this,"api");p(this,"mvf");p(this,"styleMap");p(this,"StackedMaps");p(this,"DynamicFocus");p(this,"animations",new Map);p(this,"Models",{add:(e,i,n)=>{let{floorId:o,...a}=n,l=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(u=>{var d;return{type:"Feature",properties:{id:ce(),rotation:(d=u.rotation)==null?void 0:d.map(m=>m*(Math.PI/180)),scale:u.scale,interactive:u.interactive},geometry:{type:"Point",coordinates:pi(u.target)}}})},{url:a.url},l.id);if(c==null)throw new Error("error creating model");return this.renderer.getState(c).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});p(this,"Images",{add:(e,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...l}=n,c=o?this.floorsById.get(o):this.currentFloor,u={type:"Feature",properties:l,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(ce(),u,{url:i,flipImageToFaceCamera:a!=null?a:!1},c.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});p(this,"Markers",{add:(e,i,n)=>{var a;let o=e.floorId?this.floorsById.get(e.floorId):this.currentFloor;return this.renderer.addMarker2D(pi(e),i,n,(a=o==null?void 0:o.layers.get(si))==null?void 0:a.containerId)},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,n)=>{var l;let o=this.renderer.getState(e),a=n?this.floorsById.get(n):this.currentFloor;if(!o){O.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(o.type!=="marker"){O.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:(l=a==null?void 0:a.layers.get(si))==null?void 0:l.containerId})},animateTo:(e,i,n,o)=>{let a=this.renderer.getState(e),l=n?this.floorsById.get(n):this.currentFloor;if(!a)return O.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(a.type!=="marker")return O.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(e);let u=new dt({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},c.duration).easing(nA[c.easing]).onUpdate(({lon:d,lat:m})=>{var g;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let x=(g=l==null?void 0:l.layers.get(si))==null?void 0:g.containerId;x&&this.Markers.setPosition(e,[d,m],x)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(e,u),s1(u).then(()=>{this.animations.delete(e)})}});p(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});p(this,"Shapes",{add:(e,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=ce();return this.renderer.addGeometryGroup(a,e,i,o.id),a},remove:e=>(this.renderer.remove(e.id),e.id)});p(this,"Text3D",{label:(e,i,n)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){O.warn("Enterprise mode is not enabled, skipping label creation");return}let o=a6(this.renderer,e,i,n);if(o)return{textInfo:o,target:e}},labelAll:(e={})=>{var o;if(!((o=this.api.getMapDataInternal())!=null&&o.enterpriseMode))return O.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let n=[];return i.getByType("space").forEach(a=>{var l,c;if(a.locations[0]){let u=a6(this.renderer,a,(c=(l=a.locations[0])==null?void 0:l.name)!=null?c:a.name,e);u&&n.push({textInfo:u,target:a})}}),n},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){O.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});p(this,"Labels",{all:({onCreate:e})=>{for(let i of Object.entries(this.mvf.space)){let[n,o]=i;o&&o.features.forEach(a=>{var y,g,x,T;let l=(y=this.api.getMapData())==null?void 0:y.getById("space",a.properties.id);if(!l)return;let c=(g=this.styleMap[a.properties.id])==null?void 0:g.showImage,u=(x=a.properties.details)==null?void 0:x.images,d={};c&&u&&u.length>0&&(d={marker:{icon:u[0].url}});let m=n?this.floorsById.get(n):this.currentFloor;if(a.properties.center&&a.properties.externalId!==""){let v=this.renderer.addLabel2D(a.properties.center,a.properties.externalId,{id:a.properties.id+"-label",appearance:d},(T=m.layers.get(Hn))==null?void 0:T.containerId);v&&e(v.id,a.properties.externalId,l)}})}},add:(e,i,n={})=>{var u;let{floorId:o,...a}=n,l=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addLabel2D(e,i,a,(u=l.layers.get(Hn))==null?void 0:u.containerId);if(!c)throw new Error("label creating failed");return c},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});p(this,"Paths",{add:(e,i)=>{var u;let n=[],o=e[0].floorId||"root",a=0;for(let d of e){let{floorId:m="root",latitude:y,longitude:g}=d;m!==o&&(a++,o=m),n[a]==null&&n.push({floorId:m,coordinates:[]}),n[a].coordinates.push([g,y])}let l=n.reduce((d,{floorId:m,coordinates:y},g)=>{if(g!==0){let T=n[g-1],v=y[0],b=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:T.floorId},geometry:{type:"Point",coordinates:T.coordinates[T.coordinates.length-1]}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:v}}]},i,this.id);b&&d.push(b)}let x=this.renderer.addPath({type:"FeatureCollection",features:y.map(T=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:T}}))},i,m);return x&&d.push(x),d},[]),c=new dt({fraction:0}).to({fraction:1},(u=i==null?void 0:i.drawDuration)!=null?u:1e3).onUpdate(({fraction:d})=>{l.forEach(m=>{this.renderer.setState(m.id,{completeFraction:d})})}).start();return this.renderer.getTweenGroup().add(c),this.renderer.render(),this.animations.set(l[0].id.toString(),c),{paths:l,animation:s1(c).then(()=>{this.animations.delete(l[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});C(this,ar,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=o.core,this.api=o,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.StackedMaps=new tp({currentMapGetter:()=>this}),this.DynamicFocus=new pp(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(u=i==null?void 0:i.mvf)!=null?u:{};let a=L4(this.mvf["styles.json"]||{});if(this.styleMap=a,M(this,ar,{enabled:!1,floorHeight:iA,updateCameraElevationOnFloorChange:!0,...n==null?void 0:n.multiFloorView}),!i){this.id!=="outdoors-container"&&O.warn("Map (".concat(this.id,") created with no data."));let g=new up({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(g.id,g),this.currentFloorStackId=g.id;let x=new ep(g.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,s(this,ar),n!=null?n:{});g.addFloor(x),this.floorsById.set(x.id,x),this.setFloor(x.id);return}let l=i.getMVFFeatureByType("floor-stack");(l==null||l.length===0)&&O.throw("MVF does not contain any Floor Stacks.");for(let g of l){let x=new up(g,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[g.id]);if(x.floorIds.length!==0){for(let T of x.floorIds){let v=i.getMVFFeatureById("floor",T);if(v!=null){let b=this.mvf.space[v.id],P=this.mvf.obstruction[v.id];if((b==null||b.features.length===0)&&(P==null||P.features.length===0))continue;let I=new ep(x.id,v,this.renderer,s(this,ar),n!=null?n:{},this.mvf,a);x.addFloor(I),this.floorsById.set(I.id,I)}}this.floorStacksById.set(g.id,x),this.currentFloorStackId||(this.currentFloorStackId=g.id)}}for(let[g]of Object.entries(i.facadesBySpaceId)){let x=i.getById("space",g);x&&(this.outdoorFloorStacks.add(x.floor.floorStack.id),(m=this.floorsById.get(x.floor.id))==null||m.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(n!=null&&n.initialFloor){let g=pc(n.initialFloor);g&&this.floorsById.has(g)?c=g:O.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);return e||O.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),e}setFloorStack(e){if(this.currentFloorStackId===e)return;let i=this.floorStacksById.get(e);if(i==null){O.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){O.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);return e||O.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var o,a,l;let i=this.floorsById.get(e),n=this.floorStacksById.get(this.currentFloorStackId);i&&n&&(!((o=s(this,ar))!=null&&o.enabled)||i.floorStackId!==(n==null?void 0:n.id)?this.outdoorFloorStacks.has(n.id)||n==null||n.floorObjects.forEach(c=>{c.id!==e&&c.setVisible(!1)}):(i6(this.currentFloorStack.floorObjects,i,((l=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:l.map(u=>u.id))||[]).forEach(u=>{var d,m,y,g;u.floor.setVisible(u.visible),Array.from(u.floor.layers.keys()).forEach(x=>{var v;let T=(v=u.floor.layers.get(x))==null?void 0:v.containerId;T&&this.renderer.setState(T,{visible:u.visibleLayers.includes(x)})}),u.expandFootprint?(this.renderer.setState("Footprint-".concat(u.floor.id),{height:Math.abs(u.floor.elevation)*s(this,ar).floorHeight,altitude:-s(this,ar).floorHeight/2}),(m=(d=this.api)==null?void 0:d.Outdoor)==null||m.setOpacity(.2)):(this.renderer.setState("Footprint-".concat(u.floor.id),{height:-s(this,ar).floorHeight,altitude:s(this,ar).floorHeight/2}),i.elevation>=0&&((g=(y=this.api)==null?void 0:y.Outdoor)==null||g.setOpacity("initial")))}),s(this,ar).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*s(this,ar).floorHeight)))}setFloor(e,i){if(this.currentFloorId!==e){if(!this.floorsById.has(e)){O.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:e}),this.DynamicFocus.enabled){let n=this.floorsById.get(e);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(n==null?void 0:n.floorStackId)===this.currentFloorStack.id){let o=this.floorsById.get(this.currentFloorId);o==null||o.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};ar=new WeakMap;function a6(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}f();var Ur,xp,bp=class{constructor({currentMapGetter:t}){C(this,Ur,new Map);C(this,xp,void 0);M(this,xp,t)}get currentMap(){return s(this,xp).call(this)}getById(t){return s(this,Ur).get(t)}add(t,e,i){let n=Ke(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Markers.add(n,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(a==null)throw new Error("error creating marker");let l=o.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new cn(a.id.toString(),l,t);return s(this,Ur).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var i;let e=s(this,Ur).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),s(this,Ur).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Ur).forEach(({marker:e})=>{this.remove(e),t.push(e),s(this,Ur).delete(e.id.toString())}),t}setPosition(t,e){var a;let i=Ke(e);if(!i){O.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){O.error("Cannot determine the current map.");return}let o=s(this,Ur).get(t.id);if(!o){O.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(o.entityId,pi(i),(a=i.floorId)!=null?a:n.currentFloorId),o.marker.updateTarget(e)}animateTo(t,e,i){var l;let n=Ke(e);if(!n)return O.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return O.error("Cannot determine the current map."),Promise.resolve();let a=s(this,Ur).get(t.id);return a?(a.marker.updateTarget(e),o.Markers.animateTo(a.entityId,pi(n),(l=n.floorId)!=null?l:o.currentFloorId,i)):(O.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Ur=new WeakMap,xp=new WeakMap;f();var yn,Sp,Cp=class{constructor({currentMapGetter:t}){C(this,yn,new Map);C(this,Sp,void 0);M(this,Sp,t)}get currentMap(){return s(this,Sp).call(this)}getById(t){return s(this,yn).get(t)}add(t,e,i){let n=Ke(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(pi(n),e,{...i,floorId:n.floorId});if(!a)throw new Error("image component should exist");let l=new Nu(a.id.toString(),e,t);return s(this,yn).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(t){var i;let e=s(this,yn).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),s(this,yn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,yn).forEach(({image:e})=>{this.remove(e),t.push(e),s(this,yn).delete(e.id.toString())}),t}};yn=new WeakMap,Sp=new WeakMap;f();var wi,Mp,Tp=class{constructor({currentMapGetter:t}){C(this,wi,new Map);C(this,Mp,void 0);M(this,Mp,t)}get currentMap(){return s(this,Mp).call(this)}getById(t){return s(this,wi).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],n=i.reduce((l,c)=>{var d;let u=Ke(c.target);return u?(l.has(u.floorId)||l.set(u.floorId,[]),(d=l.get(u.floorId))==null||d.push({...c,target:u}),l):(O.error("Cannot determine coordinate from options."),l)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=[];return n.forEach((l,c)=>{let u=ce();o.Models.add(u,l,{...e,floorId:c}).forEach(({id:m})=>{let y=new Hu(m.toString(),u);s(this,wi).set(y.id,{model:y,entityId:m.toString(),groupId:u}),a.push(y)})}),a}remove(t){var i;let e=s(this,wi).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),s(this,wi).delete(t.id.toString()))}removeAll(){let t=[];return s(this,wi).forEach(({model:e})=>{var n;let i=s(this,wi).get(e.id);i&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,wi).delete(e.id.toString()))}),t}};wi=new WeakMap,Mp=new WeakMap;f();var Ei,Ip,Pp=class{constructor({currentMapGetter:t}){C(this,Ei,new Map);C(this,Ip,void 0);M(this,Ip,t)}get currentMap(){return s(this,Ip).call(this)}getById(t){return s(this,Ei).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=i.Paths.add(t,e),o=n.paths.map(l=>l.id.toString()),a=new Pa(ce(),n.animation,t);for(let l of o)s(this,Ei).set(l,{path:a,entityIds:o});return s(this,Ei).set(a.id,{path:a,entityIds:o}),a}remove(t){var i;let e=s(this,Ei).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),s(this,Ei).delete(t.id),e.entityIds.forEach(n=>s(this,Ei).delete(n)))}removeAll(){let t=[];return s(this,Ei).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Ei=new WeakMap,Ip=new WeakMap;f();var v6=Ml(w1(),1);f();var D0="#2266ff",oA="#808080",s6="#f5f5f5";var l6={radius:10,color:D0,inactiveColor:oA,heading:{color:D0,opacity:.7},accuracyRing:{color:D0,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};f();var c6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";f();var u6=(r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),n=e/Math.sin(r/2),o=n+t,a=10,l=new Xr;l.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let c=0;c<a;c++)l.lineTo(-(o*Math.sin(r/2-r/a*c)),o*Math.cos(r/2-r/a*c)-i);for(let c=0;c<a;c++)l.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/a*c)),e*Math.cos(Math.PI/-2+Math.PI/a*c));return new Yr(l,{depth:.1,bevelEnabled:!1,UVGenerator:sA(t)})},O0=(r,t,e)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return n>1?n=1:n<0&&(n=0),new te(0,n)},sA=r=>({generateTopUV:(t,e,i,n,o)=>{let a=e[i*3],l=e[i*3+1],c=e[n*3],u=e[n*3+1],d=e[o*3],m=e[o*3+1];return[O0(a,l,r),O0(c,u,r),O0(d,m,r)]},generateSideWallUV:()=>[new te(0,1),new te(0,1),new te(0,1),new te(0,1)]});function p6(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}function lA([r,t],[e,i],[n,o]){let a=e-r,l=i-t,c=a**2+l**2;if(c===0)return;let u=((n-r)*a+(o-t)*l)/c,d;u<=0?d=[r,t]:u>=1?d=[e,i]:d=[r+u*a,t+u*l];let m=td([n,o],d);return{proportion:Math.max(0,Math.min(1,u)),intersection:d,distance:m}}function d6(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,n=0,o=0;for(let a=0;a<r.length-1;a++){let l=r[a],c=r[a+1],u=lA(l,c,t);u!=null&&u.distance<e&&(e=u.distance,i=u.intersection,n=a,o=u.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:n,proportion:o}}function h6(r,t){let e=new zr({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=u6(Math.PI/6,n,i);new Za().load(c6,l=>{e.alphaMap=l,e.needsUpdate=!0});let a=new Se(o,e);return a.position.z=-.05,a.renderOrder=0,a}function f6(r,t){let e=new Yp(1,1,.05,32),i=new zr({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),n=new Se(e,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}function m6(r){let t=new Yp(.35,.35,.07,32),e=new zr({transparent:!0,color:s6,depthTest:!1,depthWrite:!1}),i=new Se(t,e);i.renderOrder=2;let n=new Yp(.35*.8,.35*.8,.01,32),o=new zr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Se(n,o);return a.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:i,innerMesh:a}}var b6=Ml(y6(),1);var La,gn,sr,lr,vn,Aa,ka,Fa,Ze,Ut,wp,bn,Ep,_p,Dp,Op,fm,_i,xn,mm,Ba,Lp,Di,gl=class extends z{constructor(e,i){super();this.core=e;this.geoJSONApi=i;C(this,La,null);p(this,"geometry");C(this,gn,void 0);C(this,sr,void 0);C(this,lr,void 0);C(this,vn,void 0);C(this,Aa,void 0);C(this,ka,void 0);C(this,Fa,void 0);C(this,Ze,l6);C(this,Ut,1);C(this,wp,void 0);C(this,bn,void 0);p(this,"state","disabled");p(this,"following",!1);C(this,Ep,e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)});C(this,_p,e=>{var n;let i;if(e!=null){let o=(n=this.geoJSONApi.currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(e);i=o?s(this,Ep).call(this,o.id):void 0}return i});C(this,Dp,e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=e.children;if(s(this,fm).call(this),n.scale.set(s(this,Ut),s(this,Ut),s(this,Ut)),n.position.z=.07/2*s(this,Ut),o.scale.set(s(this,Ut),s(this,Ut),s(this,Ut)),o.position.z=.07*s(this,Ut),this.state==="active"){o.material.color.set(s(this,Ze).color);let l=this.accuracy;l!=null?(i.visible=!0,s(this,ka)&&s(this,ka).stop(),M(this,ka,new dt({scale:i.scale.x}).to({scale:l/2},150).onUpdate(({scale:u})=>{i.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(s(this,ka))):i.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,s(this,Fa)&&s(this,Fa).stop();let{start:u,end:d}=rd(a.rotation.z,-ge.degToRad(c));M(this,Fa,new dt({rotation:u}).to({rotation:d},150).onUpdate(({rotation:m})=>{a.rotation.z=m}).start()),this.core.getTweenGroup().add(s(this,Fa)),a.scale.set(s(this,Ut),s(this,Ut),1)}else a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,Ze).inactiveColor),a.visible=!1,i.visible=!1)});C(this,Op,e=>{var a,l;let i;try{i=hA.parse(p6(e,s(this,sr)))}catch(c){s(this,_i).call(this,"error"),O.error("BlueDot: Position parse failed",c instanceof E.ZodError?c.message:String(c)),this.publish("error");return}s(this,Ze).debug&&O.log("BlueDot: Parsed position",i),M(this,lr,i),s(this,_i).call(this,"position-update"),s(this,vn)&&clearTimeout(s(this,vn)),typeof s(this,Ze).timeout=="number"&&s(this,Ze).timeout<1/0&&M(this,vn,setTimeout(()=>{s(this,Ze).debug&&O.log("BlueDot: Position timed out after ".concat(s(this,Ze).timeout,"ms")),s(this,_i).call(this,"timeout"),this.core.render()},s(this,Ze).timeout)),(l=this.geoJSONApi.getMapDataInternal())==null||l.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(a=i.floor)==null?void 0:a.elevation,accuracy:i.accuracy}});let n=i.floor!=null?i.floor.id:"outdoors-container",o=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:o}},{setup:c=>{let u=f6(s(this,Ze).accuracyRing.color,s(this,Ze).accuracyRing.opacity),{outerMesh:d,innerMesh:m}=m6(s(this,Ze).color),y=h6(s(this,Ze).heading.color,s(this,Ze).heading.opacity);c.add(u),u.visible=!1,c.add(d),c.add(m),c.add(y),y.visible=!1,s(this,Dp).call(this,c)},update:s(this,Dp)},{visible:!0},n);else{let c=this.core.getState(this.geometry);o=[c.position[0],c.position[1]]}s(this,Aa)&&s(this,Aa).stop(),M(this,Aa,new dt(o).to([i.longitude,i.latitude],1e3).easing(Ne.Cubic.Out).onUpdate(c=>{if(this.geometry){let u={position:[c[0],c[1]]};u.parent=n,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(s(this,Aa)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});p(this,"onPositionUpdate",e=>{var i,n,o,a,l;if(this.state!=="disabled"){try{dA.parse(e)}catch(c){s(this,_i).call(this,"error"),O.error("BlueDot: Browser sent invalid position",c instanceof E.ZodError?c.message:String(c)),this.publish("error");return}M(this,gn,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(n=e.coords)==null?void 0:n.longitude,accuracy:(o=e.coords)==null?void 0:o.accuracy,heading:(a=e.coords)==null?void 0:a.heading,floor:s(this,_p).call(this,(l=e.coords)==null?void 0:l.floorLevel)}),s(this,Op).call(this,s(this,gn))}});p(this,"onPositionError",e=>{var i;switch(s(this,_i).call(this,"error"),e.code){case e.PERMISSION_DENIED:O.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:O.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:O.error("Geolocation request timed out.",e);break;default:O.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)});C(this,fm,()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==s(this,wp)){M(this,wp,e);let n=(i=this.core.getMetresPerPixel())!=null?i:1;M(this,Ut,Math.max(s(this,Ze).radius/(.35/n),1))}});C(this,_i,e=>{let i=pA[this.state].actions[e];if(i){switch(s(this,Ze).debug&&O.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else O.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))});C(this,xn,void 0);C(this,mm,()=>{if(s(this,xn)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(n=>n.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(n=>n.floorId===this.geoJSONApi.currentFloor.id);M(this,xn,(0,b6.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,xn)});C(this,Ba,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,Di)&&(this.off("position-update",s(this,Di)),M(this,Di,void 0)),this.following=!1,M(this,xn,void 0),this.core.off("user-interaction-start",s(this,Ba)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,Lp)),this.publish("follow-change",{following:!1})});C(this,Lp,()=>{M(this,xn,void 0)});C(this,Di,void 0);p(this,"follow",(e,i)=>{var o,a,l,c;if(e===!1){s(this,Ba).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&O.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(l=i==null?void 0:i.duration)!=null?l:1e3,easing:(c=i==null?void 0:i.easing)!=null?c:"ease-in-out"};this.following?s(this,Di)&&this.off("position-update",s(this,Di)):(this.following=!0,this.core.on("user-interaction-start",s(this,Ba)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,Lp))),M(this,Di,u=>{let{coordinate:d,heading:m,floor:y}=u;if(n.center=[d.longitude,d.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),M(this,xn,void 0)),e==="position-and-heading")n.bearing=m!=null?m:void 0;else if(e==="position-and-path-direction"){let g=s(this,mm).call(this);if(g!=null){let x=d6(g,[d.longitude,d.latitude]);if(x!=null){let T=g[x.segmentIndex],v=g[x.segmentIndex+1];n.bearing=Iv(T,v)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,Di)),this.publish("follow-change",{following:!0,mode:e})})}get heading(){var e;return(e=s(this,lr))==null?void 0:e.heading}get accuracy(){var e;return(e=s(this,lr))==null?void 0:e.accuracy}get coordinate(){var e,i;if(s(this,lr)!=null)return(s(this,bn)==null||((e=this.floor)==null?void 0:e.id)!==s(this,bn).floorId||s(this,lr).latitude!==s(this,bn).latitude||s(this,lr).longitude!==s(this,bn).longitude)&&M(this,bn,new ae(s(this,lr).latitude,s(this,lr).longitude,(i=this.floor)==null?void 0:i.id)),s(this,bn)}get floor(){var e;return(e=s(this,lr))==null?void 0:e.floor}enable(e){M(this,Ze,(0,v6.default)({},e,s(this,Ze))),s(this,_i).call(this,"enable"),this.watchDevicePosition(s(this,Ze).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,vn)&&(clearTimeout(s(this,vn)),M(this,vn,void 0)),this.following&&s(this,Ba).call(this),this.watchDevicePosition(!1),M(this,lr,void 0),M(this,sr,void 0),s(this,_i).call(this,"disable")}watchDevicePosition(e){if(s(this,La)&&(navigator.geolocation.clearWatch(s(this,La)),M(this,La,null)),s(this,gn)&&M(this,gn,void 0),e){if(this.state==="disabled"){O.warn("BlueDot must be enabled before watching browser position.");return}M(this,La,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var n,o;e==null?M(this,sr,void 0):"coords"in e?M(this,sr,Object.assign({},s(this,sr),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:s(this,_p).call(this,e.coords.floorLevel)})):(M(this,sr,Object.assign({},s(this,sr),e)),"floorOrFloorId"in e&&(s(this,sr).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?s(this,Ep).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((n=s(this,sr))==null?void 0:n.latitude)!=null&&((o=s(this,sr))==null?void 0:o.longitude)!=null||s(this,gn)!=null)&&s(this,Op).call(this,s(this,gn))}};La=new WeakMap,gn=new WeakMap,sr=new WeakMap,lr=new WeakMap,vn=new WeakMap,Aa=new WeakMap,ka=new WeakMap,Fa=new WeakMap,Ze=new WeakMap,Ut=new WeakMap,wp=new WeakMap,bn=new WeakMap,Ep=new WeakMap,_p=new WeakMap,Dp=new WeakMap,Op=new WeakMap,fm=new WeakMap,_i=new WeakMap,xn=new WeakMap,mm=new WeakMap,Ba=new WeakMap,Lp=new WeakMap,Di=new WeakMap;var pA={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},dA=E.object({coords:E.object({latitude:E.number(),longitude:E.number(),accuracy:E.number(),altitude:E.number().optional().nullable(),altitudeAccuracy:E.number().optional().nullable(),heading:E.number().optional().nullable(),speed:E.number().optional().nullable(),floorLevel:E.number().optional().nullable()}),timestamp:E.number()}),hA=E.object({latitude:E.number(),longitude:E.number(),floor:E.custom().optional(),accuracy:E.number().optional(),heading:E.number().optional().nullable()});f();var Cn,kp,Ap=class{constructor({currentMapGetter:t}){C(this,Cn,new Map);C(this,kp,void 0);M(this,kp,t)}get currentMap(){return s(this,kp).call(this)}getById(t){return s(this,Cn).get(t)}add(t,e,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),a=new ho(o);return s(this,Cn).set(a.id,a),a}remove(t){var i;s(this,Cn).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),s(this,Cn).delete(t.id.toString()))}removeAll(){let t=[];return s(this,Cn).forEach(e=>{this.remove(e),t.push(e.id),s(this,Cn).delete(e.id.toString())}),t}};Cn=new WeakMap,kp=new WeakMap;f();var Bp,Fp=class{constructor({currentMapGetter:t}){C(this,Bp,void 0);M(this,Bp,t)}get currentMap(){return s(this,Bp).call(this)}setFromStyleCollection(t){var e,i,n;for(let o in t)for(let a of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[o]==null||!a.layers.has(He))continue;let l=a.layers.get(He);if(l!=null&&l.layers.has(o)&&"color"in t[o]){let c=l.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(c,{color:t[o].color})}if(l&&o===jn&&!(ai in t)){let c=l.layers.get(ai);c&&"color"in t[o]&&((n=this.currentMap)==null||n.renderer.setState(c,{color:t[o].color}))}}}};Bp=new WeakMap;f();var L0={opacity:1},ft,Rp,Np,vo,Sn,Gp,A0,ym,x6,vl=class{constructor(t,e){C(this,Gp);C(this,ym);C(this,ft,void 0);C(this,Rp,void 0);C(this,Np,{opacity:"initial"});C(this,vo,{opacity:new Map});C(this,Sn,new Set);M(this,ft,t),M(this,Rp,e||[]);let i=s(this,ft).map;i&&i.on("idle",()=>{s(this,vo).opacity.size||V(this,Gp,A0).call(this,i)})}setStyle(t){var e,i;if(s(this,ft).map){(e=s(this,ft).map)==null||e.setStyle(t),s(this,Sn).size&&(s(this,Sn).clear(),this.hide()),V(this,ym,x6).call(this),V(this,Gp,A0).call(this,s(this,ft).map),this.setOpacity(s(this,Np).opacity),(i=s(this,ft).map)==null||i.moveLayer(Im);for(let[n,o]of s(this,Rp)||[])s(this,ft).hideOutdoorLayersUnderPoint(n,o)}}get map(){return s(this,ft).map}get enabled(){return!!s(this,ft).map}get visible(){return s(this,Sn).size===0}show(){let t=s(this,ft).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{s(this,Sn).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),s(this,Sn).clear())}hide(t=[]){let e=s(this,ft).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(n=>{let o=e.getLayoutProperty(n.id,"visibility");!t.includes(n.id)&&o!=="none"&&(e.setLayoutProperty(n.id,"visibility","none"),s(this,Sn).add(n.id))})}setOpacity(t,e=[]){var o,a;let i=s(this,ft).map;if(!i)return;let n=(a=(o=s(this,ft).map)==null?void 0:o.getStyle())==null?void 0:a.layers;n&&i.once("idle",()=>{n.forEach(l=>{let c=i.getLayoutProperty(l.id,"visibility");if(!e.includes(l.id)&&c!=="none")try{let u=s(this,vo).opacity.get(l.id);u!==void 0&&(l.id==="background"||(l.type==="symbol"?(i.setPaintProperty(l.id,"icon-opacity",t==="initial"?u[0]:t),i.setPaintProperty(l.id,"text-opacity",t==="initial"?u[1]:t)):i.setPaintProperty(l.id,"".concat(l.type,"-opacity"),t==="initial"?u[0]:t)),s(this,Np).opacity=t)}catch(u){O.warn("Error setting opacity:",u)}})})}};ft=new WeakMap,Rp=new WeakMap,Np=new WeakMap,vo=new WeakMap,Sn=new WeakMap,Gp=new WeakSet,A0=function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var o,a,l;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,vo).opacity.set(i.id,[(o=t.getPaintProperty(i.id,"icon-opacity"))!=null?o:L0.opacity,(a=t.getPaintProperty(i.id,"text-opacity"))!=null?a:L0.opacity]):s(this,vo).opacity.set(i.id,[(l=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?l:L0.opacity,void 0])))})},ym=new WeakSet,x6=function(){Object.values(s(this,vo)).forEach(t=>t.clear())};f();var Tn,Mn,bo,gm=class{constructor({currentMapGetter:t}){C(this,Tn,void 0);C(this,Mn,new Map);C(this,bo,new Map);M(this,Tn,t)}labelAll(t={}){var n,o;let e=[],i=new Set;return(o=(n=s(this,Tn).call(this))==null?void 0:n.Text3D.labelAll(t))==null||o.forEach(({textInfo:a,target:l})=>{let c=a.id.toString(),u=s(this,bo).get(c);if(u){i.has(c)||e.push(u.text3DView),i.add(c);return}i.add(c);let d=new fo(c,l);s(this,Mn).set(d.id,{targetId:l.id,text3d:c,text3DView:d}),s(this,bo).set(c,{text3DView:d}),e.push(d)}),e}label(t,e,i={}){var o;if(s(this,Tn).call(this))if(st.is(t)){let a=(o=s(this,Tn).call(this))==null?void 0:o.Text3D.label(t,e,i);if(!a)return;let l=a.textInfo.id.toString(),c=s(this,bo).get(l);if(c)return c.text3DView;let u=new fo(l,a.target);return s(this,Mn).set(u.id,{targetId:a.target.id,text3d:l,text3DView:u}),s(this,bo).set(l,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var n;let e=typeof t=="string"?t:t.id,i=s(this,Mn).get(e);i&&((n=s(this,Tn).call(this))==null||n.Text3D.remove(i.text3d),s(this,Mn).delete(e),s(this,bo).delete(i.text3d))}removeAll(){s(this,Mn).forEach(t=>{var e;(e=s(this,Tn).call(this))==null||e.Text3D.remove(t.text3d)}),s(this,Mn).clear()}};Tn=new WeakMap,Mn=new WeakMap,bo=new WeakMap;var vm=.05,Vp=class{constructor(t,e){p(this,"core");p(this,"mapObjects",[]);p(this,"id");p(this,"mapDataExternal",{});p(this,"mapsByFloorId",{});p(this,"mapData");p(this,"currentMap");p(this,"hiddenOutdoorGeometries",[]);p(this,"lastFacadeIntersected");p(this,"mapView");p(this,"Camera");p(this,"Labels");p(this,"Text3D");p(this,"Markers");p(this,"Models");p(this,"Paths");p(this,"Exporter");p(this,"Navigation");p(this,"Outdoor");p(this,"BlueDot");p(this,"Shapes");p(this,"Style");p(this,"Images");p(this,"update",()=>{this.core.render()});this.core=t,this.mapView=e,this.Camera=new $u(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new vp("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i;let n=new Uu(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=c=>u=>{var I,w,_,D;let d=[],m=[],y=[],g=[];u.labels.forEach(k=>{let N=this.Labels.getById(k.toString());N&&d.push(N.label)}),u.markers.forEach(k=>{let N=this.Markers.getById(k.toString())||this.Navigation.getMarkerById(k.toString());N&&m.push(N.marker)}),u.models.forEach(k=>{let N=this.Models.getById(k.toString());N&&y.push(N.model)}),u.paths.forEach(k=>{let N=this.Paths.getById(k.toString())||this.Navigation.getPathById(k.toString());N&&g.push(N.path)});let x=u.geometry[0],T;x&&(T=(I=this.getMapDataInternal())==null?void 0:I.getById("space",x)),T||(T=(w=this.getMapDataInternal())==null?void 0:w.getById("object",x));let v=u.containers.reduce((k,N)=>{var j;let R=(j=this.getMapDataInternal())==null?void 0:j.getById("floor",N);return R&&Yi.is(R)&&k.push(R),k},[]),b;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!1})}),T&&st.is(T)&&(b=(_=this.getMapDataInternal())==null?void 0:_.facadesBySpaceId[x],b&&b.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!0})})),this.lastFacadeIntersected=b;let P={coordinate:new ae(u.coordinate[1],u.coordinate[0],(D=v==null?void 0:v[0])==null?void 0:D.id),spaces:T&&st.is(T)?[T]:[],objects:T&&Rt.is(T)?[T]:[],markers:m,labels:d,models:y,paths:g,floors:v,facades:b?[b]:[]};"pointerEvent"in u&&(P.pointerEvent=u.pointerEvent),this.mapView.publish(c,P)};this.core.on("hover",o("hover")),this.core.on("click",o("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let a={currentMapGetter:()=>this.currentMap};this.Markers=new bp(a),this.Models=new Tp(a),this.Labels=new Qu(a),this.Text3D=new gm(a),this.Exporter=new Ju(a),this.Paths=new Pp(a),this.Navigation=new Zu(this.core,this,a.currentMapGetter),this.BlueDot=new gl(this.core,this),this.BlueDot.on("position-update",c=>{this.mapView.publish("blue-dot-position-update",c)}),this.BlueDot.on("state-change",c=>{this.mapView.publish("blue-dot-state-change",c)}),this.BlueDot.on("error",c=>{this.mapView.publish("blue-dot-error",c)}),this.BlueDot.on("follow-change",c=>{this.mapView.publish("blue-dot-follow-change",c)}),this.Outdoor=new vl(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new Cp(a),this.Shapes=new Ap(a),this.Style=new Fp(a);let l=new lm(e,this.mapDataExternal);this.auto=l.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(jn);a&&this.core.setState(a,n1(e,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(ai);a&&this.core.setState(a,n1(e,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(ds);a&&this.core.setState(a,Ph(e,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(hs);a&&this.core.setState(a,Ph(e,this.core.getState(a)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(uo.is(i))return this.core.setState(i.id,E4({...e,type:"label"},this.core.getState(i.id)));if(cn.is(i))return this.core.setState(i.id,_4({...e,type:"marker"},this.core.getState(i.id)));if((st.is(i)||Rt.is(i))&&this.core.setState(i.id,o1({...e,type:"geometry"},this.core.getState(i.id))),dr.is(i)&&this.core.setState(i.id,Ph({...e,type:"doors"},this.core.getState(i.id))),ho.is(i)&&this.core.setState(i.id,Ya(e,["altitude","color","opacity"])),Jt.is(i))for(let n of i.spaces)this.core.setState(n.id,o1({...e,type:"geometry"},this.core.getState(n.id)));fo.is(i)&&this.core.setState(i.id,Ya(e,Qh))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Ja(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var m,y,g;let n;try{n=Ja(t)}catch(x){O.error("Error adding map",x),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ae(a[1],a[0])});let l=o["manifest.geojson"].features[0].properties.name,c=new vp("mapObject-".concat(l),n,e,this),u=this.core.getBoundingArea(c.currentFloor.id);u==null&&O.error("Could not determine bounding box for map:",c.currentFloor.id);let d=(y=(m=e==null?void 0:e.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?y:[];if(d.length>0){let x=(g=this.core.getCenter(u))!=null?g:a;this.core.hideOutdoorLayersUnderPoint(x,d),this.hiddenOutdoorGeometries.push([x,d])}this.mapObjects.push(c),n.getMVFFeatureByType("floor").forEach(x=>{this.mapsByFloorId[x.id]=c}),c.on("navigation-connection-click",x=>{this.mapView.publish("navigation-connection-click",x)}),c.on("navigation-active-path-change",x=>{this.mapView.publish("navigation-active-path-change",x)}),c.StackedMaps.on("stacked-maps-state-change",({state:x})=>{this.mapView.publish("stacked-maps-state-change",{state:x})}),c.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),c.on("floor-change",x=>{this.mapView.publish("floor-change",{reason:x.reason,floor:this.currentFloor})}),this.currentMap=c,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null?(this.core.camera.setZoomLevel(e.zoomLevel),i(t)):this.core.mode!=="outdoors-overlay"&&u?this.core.camera.focusOn(u,{duration:f4,padding:{top:vm*this.core.canvasHeight,left:vm*this.core.canvasWidth,right:vm*this.core.canvasWidth,bottom:vm*this.core.canvasHeight}}).then(()=>{i(t)}):i(t)})}setFloor(t,e){return this.currentMap.setFloor(pc(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(pc(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw O.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw O.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw O.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw O.throw("Missing currentFloor");return e}getState(t){var n,o;if(typeof t=="object"&&Jt.is(t)){O.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}let e=A4(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:a,topColor:l,texture:c,topTexture:u,visible:d,height:m,opacity:y}=i;return{type:"walls",visible:d,color:a,topColor:l,texture:c?{url:c}:void 0,topTexture:u?{url:u}:void 0,height:m,opacity:y}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:a,topColor:l,texture:c,topTexture:u,visible:d,opacity:m}=i;return{type:"doors",visible:d,color:a,topColor:l,opacity:m,texture:c?{url:c}:void 0,topTexture:u?{url:u}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let a=typeof i.parent=="object"?i.parent.id:i.parent,l=this.Markers.getById(i.id.toString()),c=l!=null&&l.marker.target?Ke(l==null?void 0:l.marker.target):void 0;return c==null&&(c=new ae(i.position[1],i.position[0],a.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:c}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&ho.is(t)){let[a]=i.children;if(a.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(o=i.altitude)!=null?o:0,visible:i.visible,color:i.color,height:a.height,opacity:a.opacity}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinate(t,e,i){return new ae(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let n=this.core.projectScreenXYToCoordinate(t,e);return n?new ae(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){this.Labels.all()}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};f();f();var bm=class{constructor(t){p(this,"state");p(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};f();var C6=E.object({text3d:E.object({hoverColor:E.string().optional()}).optional(),geometry:E.object({hoverColor:E.string().optional()}).optional()}).strict();var jp,Q,Ra,bl=class extends z{constructor(e){super();C(this,jp,{});C(this,Q,void 0);C(this,Ra,void 0);p(this,"Camera");p(this,"Labels");p(this,"Text3D");p(this,"Markers");p(this,"Images");p(this,"Models");p(this,"Paths");p(this,"Exporter");p(this,"Navigation");p(this,"BlueDot");p(this,"Style");p(this,"Shapes");p(this,"Outdoor");p(this,"update",()=>{s(this,Q).core.render()});p(this,"getDirections",(e,i,n)=>{var o;return(o=s(this,Q).getMapData())==null?void 0:o.getDirections(e,i,n)});p(this,"getDirectionsMultiDestination",(e,i,n)=>{var o;return(o=s(this,Q).getMapData())==null?void 0:o.getDirectionsMultiDestination(e,i,n)});p(this,"on",(e,i)=>{super.on(e,i)});p(this,"off",(e,i)=>{super.off(e,i)});p(this,"Debug");M(this,Ra,e);let i=new Vp(e,this);M(this,Q,i),this.Camera=s(this,Q).Camera,M(this,jp,s(this,Q).mapDataExternal),this.Markers=s(this,Q).Markers,this.Models=s(this,Q).Models,this.Labels=s(this,Q).Labels,this.Text3D=s(this,Q).Text3D,this.Exporter=s(this,Q).Exporter,this.Paths=s(this,Q).Paths,this.Navigation=s(this,Q).Navigation,this.BlueDot=s(this,Q).BlueDot,this.Shapes=s(this,Q).Shapes,this.Style=s(this,Q).Style,this.auto=s(this,Q).auto,this.Outdoor=s(this,Q).Outdoor,this.Images=s(this,Q).Images,s(this,Ra).container.dataset.version=S.env.npm_package_version,this.Debug=new bm(s(this,Q).core)}get StackedMaps(){return s(this,Q).currentMap.StackedMaps}get DynamicFocus(){return s(this,Q).currentMap.DynamicFocus}updateState(e,i){return s(this,Q).updateState(e,i)}updateGlobalState(e){var i,n;try{C6.parse(e)}catch(o){O.error("updateGlobalState",o);return}if(typeof e=="object"&&!("id"in e)){let o={};(i=e.text3d)!=null&&i.hoverColor&&(o.text3dHoverColor=e.text3d.hoverColor),(n=e.geometry)!=null&&n.hoverColor&&(o.hoverColor=e.geometry.hoverColor),s(this,Q).core.setState(o)}}getGlobalState(){let e=s(this,Q).core.getState();return{geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return s(this,jp)}getDimensions(){return{width:s(this,Ra).canvasWidth,height:s(this,Ra).canvasHeight}}expand(e){var i;return(i=s(this,Q).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=s(this,Q).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return s(this,Q).addMap(e,i)}setFloor(e){return s(this,Q).setFloor(e)}setFloorStack(e){return s(this,Q).setFloorStack(e)}get currentFloorStack(){return s(this,Q).currentFloorStack}get currentFloor(){return s(this,Q).currentFloor}updateWatermark(e){s(this,Q).updateWatermark(e)}getState(e){return s(this,Q).getState(e)}setHoverColor(e){s(this,Q).setHoverColor(e)}getHoverColor(){return s(this,Q).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return s(this,Q).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return s(this,Q).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return s(this,Q).isInView(e)}getDistance(e,i){var n;return(n=s(this,Q).getMapData())==null?void 0:n.getDistance(e,i)}createCoordinate(e,i,n){return s(this,Q).createCoordinate(e,i,n)}createCoordinateFromScreenCoordinate(e,i,n){return s(this,Q).createCoordinateFromScreenCoordinate(e,i,n)}auto(){this.Labels.all()}get __core(){if(S.env.INTERNAL==="true")return s(this,Q).core;throw new Error("__core is not available.")}clear(){s(this,Q).clear()}destroy(){s(this,Q).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-VHBJTER4.js");await new i(this,s(this,Q)).enable(e)}};jp=new WeakMap,Q=new WeakMap,Ra=new WeakMap;f();f();var xm=class extends z{constructor(e){super();p(this,"gl");p(this,"el",document.createElement("div"));p(this,"core");p(this,"origin");p(this,"map");p(this,"layer");p(this,"handleStyleChange",()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))});p(this,"handleMove",()=>{if(!this.map)return;let[e,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ge.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ge.degToRad(this.map.getPitch()))});p(this,"handleError",e=>{O.warn(e)});this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new ku(e._container,{center:this.origin,zoomLevel:e.getZoom(),pitch:e.getPitch(),bearing:e.getBearing(),gl:this.gl,map:e,mode:"outdoors-overlay"}),this.map=e,this.core.camera.setMinZoomLevel(e.getMinZoom()),this.core.camera.setMaxZoomLevel(e.getMaxZoom()),this.core.camera.setMinPitch(e.getMinPitch()),this.core.camera.setMaxPitch(e.getMaxPitch()),this.map.on("error",this.handleError);let i=lv.fromLngLat(this.origin,0);return this.layer=Jp(i,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};var Na,xl,xo,Ga,Cm=class Cm extends z{constructor(e,i,n){super();C(this,Na,void 0);C(this,xl,void 0);C(this,xo,void 0);C(this,Ga,void 0);p(this,"on",(e,i)=>{super.on(e,i)});p(this,"off",(e,i)=>{super.off(e,i)});M(this,Ga,new xm(e)),M(this,Na,i),M(this,xl,n)}onAdd(e){var o,a;let i=s(this,Ga).onAdd(e),n={...dc,...(o=s(this,xl))!=null?o:{},outdoorView:{token:s(this,Na).outdoorViewToken,...(a=s(this,xl))==null?void 0:a.outdoorView}};return M(this,xo,new bl(s(this,Ga).core)),s(this,xo).addMap(s(this,Na),n).then(()=>{this.publish("loaded",{mapView:s(this,xo),mapData:s(this,Na)})}),i}onRemove(){s(this,xo)&&s(this,xo).clear(),Cm.instance=null,s(this,Ga).onRemove()}};Na=new WeakMap,xl=new WeakMap,xo=new WeakMap,Ga=new WeakMap,p(Cm,"instance");var Cl=Cm;var Yoe=async(r,t)=>{let e,i=Io();t&&i.updateByUserOption(t);try{t&&(e=(await Fl({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){O.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new _s(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new od(n)},S6=!1;function zoe(r){S6=r}var qoe=async(r,t)=>{var u,d,m,y;let e={...t||{}},i,n=Io();n.updateByUserOption(e);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(u=r.options)==null?void 0:u.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let g=await sd(r.main);i=ad(g),o.languagePacks=[];for(let x of(d=r.languagePacks)!=null?d:[])x.localePack instanceof Uint8Array&&o.languagePacks.push({language:x.language,localePack:await Qa(x.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(m=r.languagePacks)!=null?m:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(o.binaryBundle=r.main)}else i=r,o.enterprise=i.enterprise!=null;let a;if("accessToken"in e)a=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=n.getBaseAuthUri(o.enterprise);let g=await Fl(e,o.enterprise);a=(g==null?void 0:g.accessToken)||""}if(o.outdoorViewToken=a,o.env=n,a&&!o.enterprise)try{o.sasToken=(await ld(e,a)).token}catch(g){O.error("Failed to fetch SAS token.",g)}let l=new _s(i,o);a&&l.Analytics.init({accessToken:a,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:n.getAnalyticsBaseUri(),context:(y=e.analytics)==null?void 0:y.context});let c=new od(l);if("language"in e)try{await c.changeLanguage(e.language)}catch{}return c},fA=async r=>{var T;let t=S6,e,i=Io();i.updateByUserOption(r);let n={...r};if("accessToken"in n){e=n.accessToken;let{aud:v,sub:b}=ed(e);(y4.some(P=>v.includes(P))||b&&b.startsWith("client"))&&(t=!0)}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(t=!0),n.baseAuthUri=i.getBaseAuthUri(t),e=(await Fl(n,t)).accessToken;else throw new Error("Missing key or secret.");n.baseUri=i.getBaseUri(t);let o=performance.now(),a,l;if(t){let v={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0"},b=await km(v);a=b.compressed,l=b.localePacks}else a=await Fm(n,e);let c=performance.now(),u=await sd(a),d=ad(u),m=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(d);let y;if(!t)try{y=(await ld(n,e)).token}catch(v){O.error("Failed to fetch SAS token.",v)}let g=new _s(d,{env:i,outdoorViewToken:e,sasToken:y,enterprise:t,localePacksUrls:l,binaryBundle:a}),x=new od(g,{search:r.search});if(g.Analytics.init({accessToken:e,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(T=n.analytics)==null?void 0:T.context}),g.Analytics.sendGetMapDataEvent({parseDuration:m-c,downloadDuration:c-o,viewId:n.viewId}),"language"in n)try{await x.changeLanguage(n.language)}catch{}return x},$oe=fA,Joe=(r,t)=>{Cl.instance!=null&&O.warn("Only a single map venue is supported at this time.");let e=new Cl([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Cl.instance=e,e},mA=async(r,t,e)=>{var u,d,m,y,g,x,T,v,b;let i=performance.now(),n=Vg(e,t);try{e&&Gg(e)}catch(P){if(P instanceof Error&&P.name==="MissingOutdoorViewToken")O.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw P}let o=g4((u=t.outdoorViewToken)!=null?u:""),a=Ja(t);(d=n.outdoorView)!=null&&d.style&&a.envControl.updateTileServerBaseUrl((m=n.outdoorView)==null?void 0:m.style);let l=await V7(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(y=n.style)==null?void 0:y.backgroundAlpha,backgroundColor:(g=n.style)==null?void 0:g.backgroundColor,outdoorView:(x=n.outdoorView)!=null&&x.token?{headers:{"x-mappedin-tiles-key":(T=n.outdoorView)==null?void 0:T.token},style:t.getEnv().tileServerUri,enabled:!!((v=n.outdoorView)!=null&&v.enabled)}:void 0,watermark:{...n.watermark,visible:!o.remove_watermark},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((b=n.antialiasing)!=null&&b.enabled),accessToken:t.outdoorViewToken}),c=new bl(l);return await c.addMap(t,n),Ja(t).Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:c.getDimensions()}),c},Qoe=mA;export{Sv as a,L6 as b,wv as c,z as d,ae as e,ii as f,ph as g,hh as h,dr as i,st as j,Yi as k,qi as l,Rt as m,oi as n,Vn as o,fh as p,Jt as q,wr as r,mh as s,Jg as t,ad as u,sd as v,E as w,w1 as x,s5 as y,k5 as z,WL as A,Ih as B,wh as C,Yoe as D,zoe as E,qoe as F,fA as G,$oe as H,Joe as I,mA as J,Qoe as K};
|