@mappedin/mappedin-js 6.0.1-beta.2 → 6.0.1-beta.21

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.
@@ -0,0 +1 @@
1
+ import{h as jf,i as Ab,j as yp}from"./chunk-KHNMAHXS.js";import{a as Zr}from"./chunk-YLDMTX7X.js";import{A as mb,B as yb,C as gb,D as q,E as wi,F as vb,G as Ii,H as Ma,Ha as wa,I as dt,J as _e,Ka as fp,L as jt,La as Db,M as pl,O as Te,Oa as Ob,P as up,Q as dl,R as bb,Ra as Xr,S as Cb,Sa as Lb,T as xb,Ta as mp,U as yr,X as Sb,Y as Mb,Z as Pa,a as cp,c as Pi,ca as Pb,d as jr,e as Vf,fa as pp,ga as Ta,ha as dp,ja as oo,m as hb,n as fb,pa as Tb,qa as fn,ra as hp,sa as wb,ta as Hr,u as Ti,ua as Ur,va as Ib,w as ye,wa as Eb,x as te,xa as _b,za as Wr}from"./chunk-CHENVGKQ.js";import{a as l,b as N,c as P8,d as ul,e as d,f as s,g as M,h as T,i as U,j as m,k as C}from"./chunk-PLC5VOVX.js";var g2=N((om,am)=>{m();(function(r,e){typeof om=="object"&&typeof am<"u"?am.exports=e():typeof define=="function"&&define.amd?define(e):(r=r||self).RBush=e()})(om,function(){"use strict";function r(b,S,E,I,w){l(function _(D,R,V,G,Z){for(;G>V;){if(G-V>600){var z=G-V+1,ce=R-V+1,ve=Math.log(z),Re=.5*Math.exp(2*ve/3),Ve=.5*Math.sqrt(ve*Re*(z-Re)/z)*(ce-z/2<0?-1:1),it=Math.max(V,Math.floor(R-ce*Re/z+Ve)),mr=Math.min(G,Math.floor(R+(z-ce)*Re/z+Ve));_(D,R,it,mr,Z)}var Ae=D[R],qe=V,je=G;for(e(D,V,R),Z(D[G],Ae)>0&&e(D,V,G);qe<je;){for(e(D,qe,je),qe++,je--;Z(D[qe],Ae)<0;)qe++;for(;Z(D[je],Ae)>0;)je--}Z(D[V],Ae)===0?e(D,V,je):e(D,++je,G),je<=R&&(V=je+1),R<=je&&(G=je-1)}},"t")(b,S,E||0,I||b.length-1,w||t)}l(r,"t");function e(b,S,E){var I=b[S];b[S]=b[E],b[E]=I}l(e,"i");function t(b,S){return b<S?-1:b>S?1:0}l(t,"n");var i=l(function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function n(b,S,E){if(!E)return S.indexOf(b);for(var I=0;I<S.length;I++)if(E(b,S[I]))return I;return-1}l(n,"e");function o(b,S){a(b,0,b.children.length,S,b)}l(o,"a");function a(b,S,E,I,w){w||(w=x(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var _=S;_<E;_++){var D=b.children[_];u(w,b.leaf?I(D):D)}return w}l(a,"h");function u(b,S){return b.minX=Math.min(b.minX,S.minX),b.minY=Math.min(b.minY,S.minY),b.maxX=Math.max(b.maxX,S.maxX),b.maxY=Math.max(b.maxY,S.maxY),b}l(u,"o");function c(b,S){return b.minX-S.minX}l(c,"s");function p(b,S){return b.minY-S.minY}l(p,"l");function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}l(f,"f");function y(b){return b.maxX-b.minX+(b.maxY-b.minY)}l(y,"u");function g(b,S){return b.minX<=S.minX&&b.minY<=S.minY&&S.maxX<=b.maxX&&S.maxY<=b.maxY}l(g,"m");function v(b,S){return S.minX<=b.maxX&&S.minY<=b.maxY&&S.maxX>=b.minX&&S.maxY>=b.minY}l(v,"c");function x(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}l(x,"p");function P(b,S,E,I,w){for(var _=[S,E];_.length;)if(!((E=_.pop())-(S=_.pop())<=I)){var D=S+Math.ceil((E-S)/I/2)*I;r(b,D,S,E,w),_.push(S,D,D,E)}}return l(P,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var S=this.data,E=[];if(!v(b,S))return E;for(var I=this.toBBox,w=[];S;){for(var _=0;_<S.children.length;_++){var D=S.children[_],R=S.leaf?I(D):D;v(b,R)&&(S.leaf?E.push(D):g(b,R)?this._all(D,E):w.push(D))}S=w.pop()}return E},i.prototype.collides=function(b){var S=this.data;if(!v(b,S))return!1;for(var E=[];S;){for(var I=0;I<S.children.length;I++){var w=S.children[I],_=S.leaf?this.toBBox(w):w;if(v(b,_)){if(S.leaf||g(b,_))return!0;E.push(w)}}S=E.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var S=0;S<b.length;S++)this.insert(b[S]);return this}var E=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===E.height)this._splitRoot(this.data,E);else{if(this.data.height<E.height){var I=this.data;this.data=E,E=I}this._insert(E,this.data.height-E.height-1,!0)}else this.data=E;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=x([]),this},i.prototype.remove=function(b,S){if(!b)return this;for(var E,I,w,_=this.data,D=this.toBBox(b),R=[],V=[];_||R.length;){if(_||(_=R.pop(),I=R[R.length-1],E=V.pop(),w=!0),_.leaf){var G=n(b,_.children,S);if(G!==-1)return _.children.splice(G,1),R.push(_),this._condense(R),this}w||_.leaf||!g(_,D)?I?(E++,_=I.children[E],w=!1):_=null:(R.push(_),V.push(E),E=0,I=_,_=_.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,S){return b.minX-S.minX},i.prototype.compareMinY=function(b,S){return b.minY-S.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,S){for(var E=[];b;)b.leaf?S.push.apply(S,b.children):E.push.apply(E,b.children),b=E.pop();return S},i.prototype._build=function(b,S,E,I){var w,_=E-S+1,D=this._maxEntries;if(_<=D)return o(w=x(b.slice(S,E+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 R=Math.ceil(_/D),V=R*Math.ceil(Math.sqrt(D));P(b,S,E,V,this.compareMinX);for(var G=S;G<=E;G+=V){var Z=Math.min(G+V-1,E);P(b,G,Z,R,this.compareMinY);for(var z=G;z<=Z;z+=R){var ce=Math.min(z+R-1,Z);w.children.push(this._build(b,z,ce,I-1))}}return o(w,this.toBBox),w},i.prototype._chooseSubtree=function(b,S,E,I){for(;I.push(S),!S.leaf&&I.length-1!==E;){for(var w=1/0,_=1/0,D=void 0,R=0;R<S.children.length;R++){var V=S.children[R],G=f(V),Z=(z=b,ce=V,(Math.max(ce.maxX,z.maxX)-Math.min(ce.minX,z.minX))*(Math.max(ce.maxY,z.maxY)-Math.min(ce.minY,z.minY))-G);Z<_?(_=Z,w=G<w?G:w,D=V):Z===_&&G<w&&(w=G,D=V)}S=D||S.children[0]}var z,ce;return S},i.prototype._insert=function(b,S,E){var I=E?b:this.toBBox(b),w=[],_=this._chooseSubtree(I,this.data,S,w);for(_.children.push(b),u(_,I);S>=0&&w[S].children.length>this._maxEntries;)this._split(w,S),S--;this._adjustParentBBoxes(I,w,S)},i.prototype._split=function(b,S){var E=b[S],I=E.children.length,w=this._minEntries;this._chooseSplitAxis(E,w,I);var _=this._chooseSplitIndex(E,w,I),D=x(E.children.splice(_,E.children.length-_));D.height=E.height,D.leaf=E.leaf,o(E,this.toBBox),o(D,this.toBBox),S?b[S-1].children.push(D):this._splitRoot(E,D)},i.prototype._splitRoot=function(b,S){this.data=x([b,S]),this.data.height=b.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,S,E){for(var I,w,_,D,R,V,G,Z=1/0,z=1/0,ce=S;ce<=E-S;ce++){var ve=a(b,0,ce,this.toBBox),Re=a(b,ce,E,this.toBBox),Ve=(w=ve,_=Re,D=void 0,R=void 0,V=void 0,G=void 0,D=Math.max(w.minX,_.minX),R=Math.max(w.minY,_.minY),V=Math.min(w.maxX,_.maxX),G=Math.min(w.maxY,_.maxY),Math.max(0,V-D)*Math.max(0,G-R)),it=f(ve)+f(Re);Ve<Z?(Z=Ve,I=ce,z=it<z?it:z):Ve===Z&&it<z&&(z=it,I=ce)}return I||E-S},i.prototype._chooseSplitAxis=function(b,S,E){var I=b.leaf?this.compareMinX:c,w=b.leaf?this.compareMinY:p;this._allDistMargin(b,S,E,I)<this._allDistMargin(b,S,E,w)&&b.children.sort(I)},i.prototype._allDistMargin=function(b,S,E,I){b.children.sort(I);for(var w=this.toBBox,_=a(b,0,S,w),D=a(b,E-S,E,w),R=y(_)+y(D),V=S;V<E-S;V++){var G=b.children[V];u(_,b.leaf?w(G):G),R+=y(_)}for(var Z=E-S-1;Z>=S;Z--){var z=b.children[Z];u(D,b.leaf?w(z):z),R+=y(D)}return R},i.prototype._adjustParentBBoxes=function(b,S,E){for(var I=E;I>=0;I--)u(S[I],b)},i.prototype._condense=function(b){for(var S=b.length-1,E=void 0;S>=0;S--)b[S].children.length===0?S>0?(E=b[S-1].children).splice(E.indexOf(b[S]),1):this.clear():o(b[S],this.toBBox)},i})});var pm=N($=>{"use strict";m();Object.defineProperty($,"__esModule",{value:!0});$.earthRadius=63710088e-1;$.factors={centimeters:$.earthRadius*100,centimetres:$.earthRadius*100,degrees:$.earthRadius/111325,feet:$.earthRadius*3.28084,inches:$.earthRadius*39.37,kilometers:$.earthRadius/1e3,kilometres:$.earthRadius/1e3,meters:$.earthRadius,metres:$.earthRadius,miles:$.earthRadius/1609.344,millimeters:$.earthRadius*1e3,millimetres:$.earthRadius*1e3,nauticalmiles:$.earthRadius/1852,radians:1,yards:$.earthRadius*1.0936};$.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/$.earthRadius,yards:1.0936133};$.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 Cn(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}l(Cn,"feature");$.feature=Cn;function o9(r,e,t){switch(t===void 0&&(t={}),r){case"Point":return sm(e).geometry;case"LineString":return cm(e).geometry;case"Polygon":return lm(e).geometry;case"MultiPoint":return b2(e).geometry;case"MultiLineString":return v2(e).geometry;case"MultiPolygon":return C2(e).geometry;default:throw new Error(r+" is invalid")}}l(o9,"geometry");$.geometry=o9;function sm(r,e,t){if(t===void 0&&(t={}),!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(!Ep(r[0])||!Ep(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Cn(i,e,t)}l(sm,"point");$.point=sm;function a9(r,e,t){return t===void 0&&(t={}),_p(r.map(function(i){return sm(i,e)}),t)}l(a9,"points");$.points=a9;function lm(r,e,t){t===void 0&&(t={});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 u={type:"Polygon",coordinates:r};return Cn(u,e,t)}l(lm,"polygon");$.polygon=lm;function s9(r,e,t){return t===void 0&&(t={}),_p(r.map(function(i){return lm(i,e)}),t)}l(s9,"polygons");$.polygons=s9;function cm(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return Cn(i,e,t)}l(cm,"lineString");$.lineString=cm;function l9(r,e,t){return t===void 0&&(t={}),_p(r.map(function(i){return cm(i,e)}),t)}l(l9,"lineStrings");$.lineStrings=l9;function _p(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}l(_p,"featureCollection");$.featureCollection=_p;function v2(r,e,t){t===void 0&&(t={});var i={type:"MultiLineString",coordinates:r};return Cn(i,e,t)}l(v2,"multiLineString");$.multiLineString=v2;function b2(r,e,t){t===void 0&&(t={});var i={type:"MultiPoint",coordinates:r};return Cn(i,e,t)}l(b2,"multiPoint");$.multiPoint=b2;function C2(r,e,t){t===void 0&&(t={});var i={type:"MultiPolygon",coordinates:r};return Cn(i,e,t)}l(C2,"multiPolygon");$.multiPolygon=C2;function c9(r,e,t){t===void 0&&(t={});var i={type:"GeometryCollection",geometries:r};return Cn(i,e,t)}l(c9,"geometryCollection");$.geometryCollection=c9;function u9(r,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(r*t)/t}l(u9,"round");$.round=u9;function x2(r,e){e===void 0&&(e="kilometers");var t=$.factors[e];if(!t)throw new Error(e+" units is invalid");return r*t}l(x2,"radiansToLength");$.radiansToLength=x2;function um(r,e){e===void 0&&(e="kilometers");var t=$.factors[e];if(!t)throw new Error(e+" units is invalid");return r/t}l(um,"lengthToRadians");$.lengthToRadians=um;function p9(r,e){return S2(um(r,e))}l(p9,"lengthToDegrees");$.lengthToDegrees=p9;function d9(r){var e=r%360;return e<0&&(e+=360),e}l(d9,"bearingToAzimuth");$.bearingToAzimuth=d9;function S2(r){var e=r%(2*Math.PI);return e*180/Math.PI}l(S2,"radiansToDegrees");$.radiansToDegrees=S2;function h9(r){var e=r%360;return e*Math.PI/180}l(h9,"degreesToRadians");$.degreesToRadians=h9;function f9(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return x2(um(r,e),t)}l(f9,"convertLength");$.convertLength=f9;function m9(r,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=$.areaFactors[e];if(!i)throw new Error("invalid original units");var n=$.areaFactors[t];if(!n)throw new Error("invalid final units");return r/i*n}l(m9,"convertArea");$.convertArea=m9;function Ep(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l(Ep,"isNumber");$.isNumber=Ep;function y9(r){return!!r&&r.constructor===Object}l(y9,"isObject");$.isObject=y9;function g9(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(e){if(!Ep(e))throw new Error("bbox must only contain numbers")})}l(g9,"validateBBox");$.validateBBox=g9;function v9(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")}l(v9,"validateId");$.validateId=v9});var I2=N($e=>{"use strict";m();Object.defineProperty($e,"__esModule",{value:!0});var ot=pm();function Tl(r,e,t){if(r!==null)for(var i,n,o,a,u,c,p,f=0,y=0,g,v=r.type,x=v==="FeatureCollection",P=v==="Feature",b=x?r.features.length:1,S=0;S<b;S++){p=x?r.features[S].geometry:P?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var E=0;E<u;E++){var I=0,w=0;if(a=g?p.geometries[E]:p,a!==null){c=a.coordinates;var _=a.type;switch(f=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(c,y,S,I,w)===!1)return!1;y++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],y,S,I,w)===!1)return!1;y++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(e(c[i][n],y,S,I,w)===!1)return!1;y++}_==="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-f;o++){if(e(c[i][n][o],y,S,I,w)===!1)return!1;y++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Tl(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Tl,"coordEach");function b9(r,e,t,i){var n=t;return Tl(r,function(o,a,u,c,p){a===0&&t===void 0?n=o:n=e(n,o,a,u,c,p)},i),n}l(b9,"coordReduce");function M2(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}l(M2,"propEach");function C9(r,e,t){var i=t;return M2(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}l(C9,"propReduce");function P2(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}l(P2,"featureEach");function x9(r,e,t){var i=t;return P2(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}l(x9,"featureReduce");function S9(r){var e=[];return Tl(r,function(t){e.push(t)}),e}l(S9,"coordAll");function dm(r,e){var t,i,n,o,a,u,c,p,f,y,g=0,v=r.type==="FeatureCollection",x=r.type==="Feature",P=v?r.features.length:1;for(t=0;t<P;t++){for(u=v?r.features[t].geometry:x?r.geometry:r,p=v?r.features[t].properties:x?r.properties:{},f=v?r.features[t].bbox:x?r.bbox:void 0,y=v?r.features[t].id:x?r.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,n=0;n<a;n++){if(o=c?u.geometries[n]:u,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}l(dm,"geomEach");function M9(r,e,t){var i=t;return dm(r,function(n,o,a,u,c){o===0&&t===void 0?i=n:i=e(i,n,o,a,u,c)}),i}l(M9,"geomReduce");function Dp(r,e){dm(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(ot.feature(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:c,coordinates:f};if(e(ot.feature(y,n),i,p)===!1)return!1}})}l(Dp,"flattenEach");function P9(r,e,t){var i=t;return Dp(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}l(P9,"flattenReduce");function T2(r,e){Dp(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,c=0,p=0,f=0;if(Tl(t,function(y,g,v,x,P){if(u===void 0||i>c||x>p||P>f){u=y,c=i,p=x,f=P,o=0;return}var b=ot.lineString([u,y],t.properties);if(e(b,i,n,P,o)===!1)return!1;o++,u=y})===!1)return!1}}})}l(T2,"segmentEach");function T9(r,e,t){var i=t,n=!1;return T2(r,function(o,a,u,c,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,c,p),n=!0}),i}l(T9,"segmentReduce");function w2(r,e){if(!r)throw new Error("geojson is required");Dp(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var u=0;u<a.length;u++)if(e(ot.lineString(a[u],t.properties),i,n,u)===!1)return!1;break}}})}l(w2,"lineEach");function w9(r,e,t){var i=t;return w2(r,function(n,o,a,u){o===0&&t===void 0?i=n:i=e(i,n,o,a,u)}),i}l(w9,"lineReduce");function I9(r,e){if(e=e||{},!ot.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var c=u.coordinates;switch(u.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),ot.lineString([c[o],c[o+1]],a,e);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),ot.lineString([c[n][o],c[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),ot.lineString([c[i][o],c[i][o+1]],a,e);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),ot.lineString([c[i][n][o],c[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}l(I9,"findSegment");function E9(r,e){if(e=e||{},!ot.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var c=u.coordinates;switch(u.type){case"Point":return ot.point(c,a,e);case"MultiPoint":return i<0&&(i=c.length+i),ot.point(c[i],a,e);case"LineString":return o<0&&(o=c.length+o),ot.point(c[o],a,e);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),ot.point(c[n][o],a,e);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),ot.point(c[i][o],a,e);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),ot.point(c[i][n][o],a,e)}throw new Error("geojson is invalid")}l(E9,"findPoint");$e.coordAll=S9;$e.coordEach=Tl;$e.coordReduce=b9;$e.featureEach=P2;$e.featureReduce=x9;$e.findPoint=E9;$e.findSegment=I9;$e.flattenEach=Dp;$e.flattenReduce=P9;$e.geomEach=dm;$e.geomReduce=M9;$e.lineEach=w2;$e.lineReduce=w9;$e.propEach=M2;$e.propReduce=C9;$e.segmentEach=T2;$e.segmentReduce=T9});var hm=N((IB,_2)=>{"use strict";m();var E2=Object.prototype.toString;_2.exports=l(function(e){var t=E2.call(e),i=t==="[object Arguments]";return i||(i=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&E2.call(e.callee)==="[object Function]"),i},"isArguments")});var N2=N((DB,R2)=>{"use strict";m();var B2;Object.keys||(wl=Object.prototype.hasOwnProperty,fm=Object.prototype.toString,D2=hm(),mm=Object.prototype.propertyIsEnumerable,O2=!mm.call({toString:null},"toString"),L2=mm.call(function(){},"prototype"),Il=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Op=l(function(r){var e=r.constructor;return e&&e.prototype===r},"equalsConstructorPrototype"),A2={$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},k2=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!A2["$"+r]&&wl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Op(window[r])}catch{return!0}}catch{return!0}return!1}(),F2=l(function(r){if(typeof window>"u"||!k2)return Op(r);try{return Op(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),B2=l(function(e){var t=e!==null&&typeof e=="object",i=fm.call(e)==="[object Function]",n=D2(e),o=t&&fm.call(e)==="[object String]",a=[];if(!t&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var u=L2&&i;if(o&&e.length>0&&!wl.call(e,0))for(var c=0;c<e.length;++c)a.push(String(c));if(n&&e.length>0)for(var p=0;p<e.length;++p)a.push(String(p));else for(var f in e)!(u&&f==="prototype")&&wl.call(e,f)&&a.push(String(f));if(O2)for(var y=F2(e),g=0;g<Il.length;++g)!(y&&Il[g]==="constructor")&&wl.call(e,Il[g])&&a.push(Il[g]);return a},"keys"));var wl,fm,D2,mm,O2,L2,Il,Op,A2,k2,F2;R2.exports=B2});var Ap=N((AB,j2)=>{"use strict";m();var _9=Array.prototype.slice,D9=hm(),G2=Object.keys,Lp=G2?l(function(e){return G2(e)},"keys"):N2(),V2=Object.keys;Lp.shim=l(function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=l(function(i){return D9(i)?V2(_9.call(i)):V2(i)},"keys"))}else Object.keys=Lp;return Object.keys||Lp},"shimObjectKeys");j2.exports=Lp});var U2=N((BB,H2)=>{"use strict";m();H2.exports=Error});var X2=N((NB,W2)=>{"use strict";m();W2.exports=EvalError});var z2=N((VB,Z2)=>{"use strict";m();Z2.exports=RangeError});var q2=N((HB,Y2)=>{"use strict";m();Y2.exports=ReferenceError});var ym=N((WB,$2)=>{"use strict";m();$2.exports=SyntaxError});var Oi=N((ZB,J2)=>{"use strict";m();J2.exports=TypeError});var Q2=N((YB,K2)=>{"use strict";m();K2.exports=URIError});var El=N(($B,e3)=>{"use strict";m();e3.exports=l(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==n||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var kp=N((QB,r3)=>{"use strict";m();var t3=typeof Symbol<"u"&&Symbol,O9=El();r3.exports=l(function(){return typeof t3!="function"||typeof Symbol!="function"||typeof t3("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:O9()},"hasNativeSymbols")});var n3=N((rR,i3)=>{"use strict";m();var gm={__proto__:null,foo:{}},L9=Object;i3.exports=l(function(){return{__proto__:gm}.foo===gm.foo&&!(gm instanceof L9)},"hasProto")});var s3=N((oR,a3)=>{"use strict";m();var A9="Function.prototype.bind called on incompatible ",k9=Object.prototype.toString,F9=Math.max,B9="[object Function]",o3=l(function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<t.length;o+=1)i[o+e.length]=t[o];return i},"concatty"),R9=l(function(e,t){for(var i=[],n=t||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),N9=l(function(r,e){for(var t="",i=0;i<r.length;i+=1)t+=r[i],i+1<r.length&&(t+=e);return t},"joiny");a3.exports=l(function(e){var t=this;if(typeof t!="function"||k9.apply(t)!==B9)throw new TypeError(A9+t);for(var i=R9(arguments,1),n,o=l(function(){if(this instanceof n){var f=t.apply(this,o3(i,arguments));return Object(f)===f?f:this}return t.apply(e,o3(i,arguments))},"binder"),a=F9(0,t.length-i.length),u=[],c=0;c<a;c++)u[c]="$"+c;if(n=Function("binder","return function ("+N9(u,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var p=l(function(){},"Empty");p.prototype=t.prototype,n.prototype=new p,p.prototype=null}return n},"bind")});var Fp=N((lR,l3)=>{"use strict";m();var G9=s3();l3.exports=Function.prototype.bind||G9});var vm=N((uR,c3)=>{"use strict";m();var V9=Function.prototype.call,j9=Object.prototype.hasOwnProperty,H9=Fp();c3.exports=H9.call(V9,j9)});var xr=N((dR,f3)=>{"use strict";m();var he,U9=U2(),W9=X2(),X9=z2(),Z9=q2(),Aa=ym(),La=Oi(),z9=Q2(),h3=Function,bm=l(function(r){try{return h3('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),uo=Object.getOwnPropertyDescriptor;if(uo)try{uo({},"")}catch{uo=null}var Cm=l(function(){throw new La},"throwTypeError"),Y9=uo?function(){try{return arguments.callee,Cm}catch{try{return uo(arguments,"callee").get}catch{return Cm}}}():Cm,Da=kp()(),q9=n3()(),rt=Object.getPrototypeOf||(q9?function(r){return r.__proto__}:null),Oa={},$9=typeof Uint8Array>"u"||!rt?he:rt(Uint8Array),po={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":Da&&rt?rt([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":Oa,"%AsyncGenerator%":Oa,"%AsyncGeneratorFunction%":Oa,"%AsyncIteratorPrototype%":Oa,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":U9,"%eval%":eval,"%EvalError%":W9,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":h3,"%GeneratorFunction%":Oa,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Da&&rt?rt(rt([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Da||!rt?he:rt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":X9,"%ReferenceError%":Z9,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Da||!rt?he:rt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Da&&rt?rt(""[Symbol.iterator]()):he,"%Symbol%":Da?Symbol:he,"%SyntaxError%":Aa,"%ThrowTypeError%":Y9,"%TypedArray%":$9,"%TypeError%":La,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":z9,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet};if(rt)try{null.error}catch(r){u3=rt(rt(r)),po["%Error.prototype%"]=u3}var u3,J9=l(function r(e){var t;if(e==="%AsyncFunction%")t=bm("async function () {}");else if(e==="%GeneratorFunction%")t=bm("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=bm("async function* () {}");else if(e==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&rt&&(t=rt(n.prototype))}return po[e]=t,t},"doEval"),p3={__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"]},_l=Fp(),Bp=vm(),K9=_l.call(Function.call,Array.prototype.concat),Q9=_l.call(Function.apply,Array.prototype.splice),d3=_l.call(Function.call,String.prototype.replace),Rp=_l.call(Function.call,String.prototype.slice),eM=_l.call(Function.call,RegExp.prototype.exec),tM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rM=/\\(\\)?/g,iM=l(function(e){var t=Rp(e,0,1),i=Rp(e,-1);if(t==="%"&&i!=="%")throw new Aa("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new Aa("invalid intrinsic syntax, expected opening `%`");var n=[];return d3(e,tM,function(o,a,u,c){n[n.length]=u?d3(c,rM,"$1"):a||o}),n},"stringToPath"),nM=l(function(e,t){var i=e,n;if(Bp(p3,i)&&(n=p3[i],i="%"+n[0]+"%"),Bp(po,i)){var o=po[i];if(o===Oa&&(o=J9(i)),typeof o>"u"&&!t)throw new La("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Aa("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");f3.exports=l(function(e,t){if(typeof e!="string"||e.length===0)throw new La("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new La('"allowMissing" argument must be a boolean');if(eM(/^%?[^%]*%?$/,e)===null)throw new Aa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=iM(e),n=i.length>0?i[0]:"",o=nM("%"+n+"%",t),a=o.name,u=o.value,c=!1,p=o.alias;p&&(n=p[0],Q9(i,K9([0,1],p)));for(var f=1,y=!0;f<i.length;f+=1){var g=i[f],v=Rp(g,0,1),x=Rp(g,-1);if((v==='"'||v==="'"||v==="`"||x==='"'||x==="'"||x==="`")&&v!==x)throw new Aa("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(c=!0),n+="."+g,a="%"+n+"%",Bp(po,a))u=po[a];else if(u!=null){if(!(g in u)){if(!t)throw new La("base intrinsic for "+e+" exists, but the property is not available.");return}if(uo&&f+1>=i.length){var P=uo(u,g);y=!!P,y&&"get"in P&&!("originalValue"in P.get)?u=P.get:u=u[g]}else y=Bp(u,g),u=u[g];y&&!c&&(po[a]=u)}}return u},"GetIntrinsic")});var Gp=N((mR,m3)=>{"use strict";m();var oM=xr(),Np=oM("%Object.defineProperty%",!0)||!1;if(Np)try{Np({},"a",{value:1})}catch{Np=!1}m3.exports=Np});var jp=N((gR,y3)=>{"use strict";m();var aM=xr(),Vp=aM("%Object.getOwnPropertyDescriptor%",!0);if(Vp)try{Vp([],"length")}catch{Vp=null}y3.exports=Vp});var Hp=N((bR,b3)=>{"use strict";m();var g3=Gp(),sM=ym(),ka=Oi(),v3=jp();b3.exports=l(function(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new ka("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ka("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ka("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ka("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ka("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ka("`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,u=arguments.length>6?arguments[6]:!1,c=!!v3&&v3(e,t);if(g3)g3(e,t,{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(u||!n&&!o&&!a)e[t]=i;else throw new sM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Up=N((SR,x3)=>{"use strict";m();var xm=Gp(),C3=l(function(){return!!xm},"hasPropertyDescriptors");C3.hasArrayLengthDefineBug=l(function(){if(!xm)return null;try{return xm([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");x3.exports=C3});var xn=N((TR,T3)=>{"use strict";m();var lM=Ap(),cM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",uM=Object.prototype.toString,pM=Array.prototype.concat,S3=Hp(),dM=l(function(r){return typeof r=="function"&&uM.call(r)==="[object Function]"},"isFunction"),M3=Up()(),hM=l(function(r,e,t,i){if(e in r){if(i===!0){if(r[e]===t)return}else if(!dM(i)||!i())return}M3?S3(r,e,t,!0):S3(r,e,t)},"defineProperty"),P3=l(function(r,e){var t=arguments.length>2?arguments[2]:{},i=lM(e);cM&&(i=pM.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n+=1)hM(r,i[n],e[i[n]],t[i[n]])},"defineProperties");P3.supportsDescriptors=!!M3;T3.exports=P3});var D3=N((ER,_3)=>{"use strict";m();var fM=xr(),w3=Hp(),mM=Up()(),I3=jp(),E3=Oi(),yM=fM("%Math.floor%");_3.exports=l(function(e,t){if(typeof e!="function")throw new E3("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||yM(t)!==t)throw new E3("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&I3){var a=I3(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(mM?w3(e,"length",t,!0,!0):w3(e,"length",t)),e},"setFunctionLength")});var ho=N((OR,Wp)=>{"use strict";m();var Sm=Fp(),Xp=xr(),gM=D3(),vM=Oi(),A3=Xp("%Function.prototype.apply%"),k3=Xp("%Function.prototype.call%"),F3=Xp("%Reflect.apply%",!0)||Sm.call(k3,A3),O3=Gp(),bM=Xp("%Math.max%");Wp.exports=l(function(e){if(typeof e!="function")throw new vM("a function is required");var t=F3(Sm,k3,arguments);return gM(t,1+bM(0,e.length-(arguments.length-1)),!0)},"callBind");var L3=l(function(){return F3(Sm,A3,arguments)},"applyBind");O3?O3(Wp.exports,"apply",{value:L3}):Wp.exports.apply=L3});var Ut=N((kR,N3)=>{"use strict";m();var B3=xr(),R3=ho(),CM=R3(B3("String.prototype.indexOf"));N3.exports=l(function(e,t){var i=B3(e,!!t);return typeof i=="function"&&CM(e,".prototype.")>-1?R3(i):i},"callBoundIntrinsic")});var Mm=N((RR,U3)=>{"use strict";m();var xM=Ap(),j3=El()(),H3=Ut(),G3=Object,SM=H3("Array.prototype.push"),V3=H3("Object.prototype.propertyIsEnumerable"),MM=j3?Object.getOwnPropertySymbols:null;U3.exports=l(function(e,t){if(e==null)throw new TypeError("target must be an object");var i=G3(e);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=G3(arguments[n]),a=xM(o),u=j3&&(Object.getOwnPropertySymbols||MM);if(u)for(var c=u(o),p=0;p<c.length;++p){var f=c[p];V3(o,f)&&SM(a,f)}for(var y=0;y<a.length;++y){var g=a[y];if(V3(o,g)){var v=o[g];i[g]=v}}}return i},"assign")});var Tm=N((VR,W3)=>{"use strict";m();var Pm=Mm(),PM=l(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",e=r.split(""),t={},i=0;i<e.length;++i)t[e[i]]=e[i];var n=Object.assign({},t),o="";for(var a in n)o+=a;return r!==o},"lacksProperEnumerationOrder"),TM=l(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},"assignHasPendingExceptions");W3.exports=l(function(){return!Object.assign||PM()||TM()?Pm:Object.assign},"getPolyfill")});var Z3=N((UR,X3)=>{"use strict";m();var wM=xn(),IM=Tm();X3.exports=l(function(){var e=IM();return wM(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},"shimAssign")});var $3=N((ZR,q3)=>{"use strict";m();var EM=xn(),_M=ho(),DM=Mm(),z3=Tm(),OM=Z3(),LM=_M.apply(z3()),Y3=l(function(e,t){return LM(Object,arguments)},"assign");EM(Y3,{getPolyfill:z3,implementation:DM,shim:OM});q3.exports=Y3});var K3=N((qR,J3)=>{"use strict";m();var Ol=l(function(){return typeof l(function(){},"f").name=="string"},"functionsHaveNames"),Dl=Object.getOwnPropertyDescriptor;if(Dl)try{Dl([],"length")}catch{Dl=null}Ol.functionsHaveConfigurableNames=l(function(){if(!Ol()||!Dl)return!1;var e=Dl(function(){},"name");return!!e&&!!e.configurable},"functionsHaveConfigurableNames");var AM=Function.prototype.bind;Ol.boundFunctionsHaveNames=l(function(){return Ol()&&typeof AM=="function"&&l(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");J3.exports=Ol});var t4=N((KR,e4)=>{"use strict";m();var Q3=Hp(),kM=Up()(),FM=K3().functionsHaveConfigurableNames(),BM=Oi();e4.exports=l(function(e,t){if(typeof e!="function")throw new BM("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||FM)&&(kM?Q3(e,"name",t,!0,!0):Q3(e,"name",t)),e},"setFunctionName")});var wm=N((tN,r4)=>{"use strict";m();var RM=t4(),NM=Oi(),GM=Object;r4.exports=RM(l(function(){if(this==null||this!==GM(this))throw new NM("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"flags"),"get flags",!0)});var Im=N((nN,i4)=>{"use strict";m();var VM=wm(),jM=xn().supportsDescriptors,HM=Object.getOwnPropertyDescriptor;i4.exports=l(function(){if(jM&&/a/mig.flags==="gim"){var e=HM(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(i,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return VM},"getPolyfill")});var a4=N((sN,o4)=>{"use strict";m();var UM=xn().supportsDescriptors,WM=Im(),XM=Object.getOwnPropertyDescriptor,ZM=Object.defineProperty,zM=TypeError,n4=Object.getPrototypeOf,YM=/a/;o4.exports=l(function(){if(!UM||!n4)throw new zM("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=WM(),t=n4(YM),i=XM(t,"flags");return(!i||i.get!==e)&&ZM(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},"shimFlags")});var u4=N((uN,c4)=>{"use strict";m();var qM=xn(),$M=ho(),JM=wm(),s4=Im(),KM=a4(),l4=$M(s4());qM(l4,{getPolyfill:s4,implementation:JM,shim:KM});c4.exports=l4});var Sn=N((dN,p4)=>{"use strict";m();var QM=El();p4.exports=l(function(){return QM()&&!!Symbol.toStringTag},"hasToStringTagShams")});var _m=N((mN,h4)=>{"use strict";m();var eP=Sn()(),tP=Ut(),Em=tP("Object.prototype.toString"),Zp=l(function(e){return eP&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Em(e)==="[object Arguments]"},"isArguments"),d4=l(function(e){return Zp(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Em(e)!=="[object Array]"&&Em(e.callee)==="[object Function]"},"isArguments"),rP=function(){return Zp(arguments)}();Zp.isLegacyArguments=d4;h4.exports=rP?Zp:d4});var f4=N(()=>{m()});var k4=N((xN,A4)=>{m();var Gm=typeof Map=="function"&&Map.prototype,Dm=Object.getOwnPropertyDescriptor&&Gm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Yp=Gm&&Dm&&typeof Dm.get=="function"?Dm.get:null,m4=Gm&&Map.prototype.forEach,Vm=typeof Set=="function"&&Set.prototype,Om=Object.getOwnPropertyDescriptor&&Vm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,qp=Vm&&Om&&typeof Om.get=="function"?Om.get:null,y4=Vm&&Set.prototype.forEach,iP=typeof WeakMap=="function"&&WeakMap.prototype,Al=iP?WeakMap.prototype.has:null,nP=typeof WeakSet=="function"&&WeakSet.prototype,kl=nP?WeakSet.prototype.has:null,oP=typeof WeakRef=="function"&&WeakRef.prototype,g4=oP?WeakRef.prototype.deref:null,aP=Boolean.prototype.valueOf,sP=Object.prototype.toString,lP=Function.prototype.toString,cP=String.prototype.match,jm=String.prototype.slice,Pn=String.prototype.replace,uP=String.prototype.toUpperCase,v4=String.prototype.toLowerCase,I4=RegExp.prototype.test,b4=Array.prototype.concat,Yr=Array.prototype.join,pP=Array.prototype.slice,C4=Math.floor,km=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Lm=Object.getOwnPropertySymbols,Fm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",at=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Fa||!0)?Symbol.toStringTag:null,E4=Object.prototype.propertyIsEnumerable,x4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function S4(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||I4.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-C4(-r):C4(r);if(i!==r){var n=String(i),o=jm.call(e,n.length+1);return Pn.call(n,t,"$&_")+"."+Pn.call(Pn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pn.call(e,t,"$&_")}l(S4,"addNumericSeparator");var Bm=f4(),M4=Bm.custom,P4=D4(M4)?M4:null;A4.exports=l(function r(e,t,i,n){var o=t||{};if(Mn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Mn(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=Mn(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(Mn(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(Mn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return L4(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?S4(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return u?S4(e,p):p}var f=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=f&&f>0&&typeof e=="object")return Rm(e)?"[Array]":"[Object]";var y=_P(o,i);if(typeof n>"u")n=[];else if(O4(n,e)>=0)return"[Circular]";function g(ve,Re,Ve){if(Re&&(n=pP.call(n),n.push(Re)),Ve){var it={depth:o.depth};return Mn(o,"quoteStyle")&&(it.quoteStyle=o.quoteStyle),r(ve,it,i+1,n)}return r(ve,o,i+1,n)}if(l(g,"inspect"),typeof e=="function"&&!T4(e)){var v=CP(e),x=zp(e,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(x.length>0?" { "+Yr.call(x,", ")+" }":"")}if(D4(e)){var P=Fa?Pn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fm.call(e);return typeof e=="object"&&!Fa?Ll(P):P}if(wP(e)){for(var b="<"+v4.call(String(e.nodeName)),S=e.attributes||[],E=0;E<S.length;E++)b+=" "+S[E].name+"="+_4(dP(S[E].value),"double",o);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+v4.call(String(e.nodeName))+">",b}if(Rm(e)){if(e.length===0)return"[]";var I=zp(e,g);return y&&!EP(I)?"["+Nm(I,y)+"]":"[ "+Yr.call(I,", ")+" ]"}if(fP(e)){var w=zp(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!E4.call(e,"cause")?"{ ["+String(e)+"] "+Yr.call(b4.call("[cause]: "+g(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Yr.call(w,", ")+" }"}if(typeof e=="object"&&a){if(P4&&typeof e[P4]=="function"&&Bm)return Bm(e,{depth:f-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(xP(e)){var _=[];return m4&&m4.call(e,function(ve,Re){_.push(g(Re,e,!0)+" => "+g(ve,e))}),w4("Map",Yp.call(e),_,y)}if(PP(e)){var D=[];return y4&&y4.call(e,function(ve){D.push(g(ve,e))}),w4("Set",qp.call(e),D,y)}if(SP(e))return Am("WeakMap");if(TP(e))return Am("WeakSet");if(MP(e))return Am("WeakRef");if(yP(e))return Ll(g(Number(e)));if(vP(e))return Ll(g(km.call(e)));if(gP(e))return Ll(aP.call(e));if(mP(e))return Ll(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===global)return"{ [object globalThis] }";if(!hP(e)&&!T4(e)){var R=zp(e,g),V=x4?x4(e)===Object.prototype:e instanceof Object||e.constructor===Object,G=e instanceof Object?"":"null prototype",Z=!V&&at&&Object(e)===e&&at in e?jm.call(Tn(e),8,-1):G?"Object":"",z=V||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ce=z+(Z||G?"["+Yr.call(b4.call([],Z||[],G||[]),": ")+"] ":"");return R.length===0?ce+"{}":y?ce+"{"+Nm(R,y)+"}":ce+"{ "+Yr.call(R,", ")+" }"}return String(e)},"inspect_");function _4(r,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+r+i}l(_4,"wrapQuotes");function dP(r){return Pn.call(String(r),/"/g,"&quot;")}l(dP,"quote");function Rm(r){return Tn(r)==="[object Array]"&&(!at||!(typeof r=="object"&&at in r))}l(Rm,"isArray");function hP(r){return Tn(r)==="[object Date]"&&(!at||!(typeof r=="object"&&at in r))}l(hP,"isDate");function T4(r){return Tn(r)==="[object RegExp]"&&(!at||!(typeof r=="object"&&at in r))}l(T4,"isRegExp");function fP(r){return Tn(r)==="[object Error]"&&(!at||!(typeof r=="object"&&at in r))}l(fP,"isError");function mP(r){return Tn(r)==="[object String]"&&(!at||!(typeof r=="object"&&at in r))}l(mP,"isString");function yP(r){return Tn(r)==="[object Number]"&&(!at||!(typeof r=="object"&&at in r))}l(yP,"isNumber");function gP(r){return Tn(r)==="[object Boolean]"&&(!at||!(typeof r=="object"&&at in r))}l(gP,"isBoolean");function D4(r){if(Fa)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Fm)return!1;try{return Fm.call(r),!0}catch{}return!1}l(D4,"isSymbol");function vP(r){if(!r||typeof r!="object"||!km)return!1;try{return km.call(r),!0}catch{}return!1}l(vP,"isBigInt");var bP=Object.prototype.hasOwnProperty||function(r){return r in this};function Mn(r,e){return bP.call(r,e)}l(Mn,"has");function Tn(r){return sP.call(r)}l(Tn,"toStr");function CP(r){if(r.name)return r.name;var e=cP.call(lP.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}l(CP,"nameOf");function O4(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}l(O4,"indexOf");function xP(r){if(!Yp||!r||typeof r!="object")return!1;try{Yp.call(r);try{qp.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}l(xP,"isMap");function SP(r){if(!Al||!r||typeof r!="object")return!1;try{Al.call(r,Al);try{kl.call(r,kl)}catch{return!0}return r instanceof WeakMap}catch{}return!1}l(SP,"isWeakMap");function MP(r){if(!g4||!r||typeof r!="object")return!1;try{return g4.call(r),!0}catch{}return!1}l(MP,"isWeakRef");function PP(r){if(!qp||!r||typeof r!="object")return!1;try{qp.call(r);try{Yp.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}l(PP,"isSet");function TP(r){if(!kl||!r||typeof r!="object")return!1;try{kl.call(r,kl);try{Al.call(r,Al)}catch{return!0}return r instanceof WeakSet}catch{}return!1}l(TP,"isWeakSet");function wP(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}l(wP,"isElement");function L4(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return L4(jm.call(r,0,e.maxStringLength),e)+i}var n=Pn.call(Pn.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,IP);return _4(n,"single",e)}l(L4,"inspectString");function IP(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+uP.call(e.toString(16))}l(IP,"lowbyte");function Ll(r){return"Object("+r+")"}l(Ll,"markBoxed");function Am(r){return r+" { ? }"}l(Am,"weakCollectionOf");function w4(r,e,t,i){var n=i?Nm(t,i):Yr.call(t,", ");return r+" ("+e+") {"+n+"}"}l(w4,"collectionOf");function EP(r){for(var e=0;e<r.length;e++)if(O4(r[e],"\n")>=0)return!1;return!0}l(EP,"singleLineValues");function _P(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Yr.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Yr.call(Array(e+1),t)}}l(_P,"getIndent");function Nm(r,e){if(r.length===0)return"";var t="\n"+e.prev+e.base;return t+Yr.call(r,","+t)+"\n"+e.prev}l(Nm,"indentedJoin");function zp(r,e){var t=Rm(r),i=[];if(t){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=Mn(r,n)?e(r[n],r):""}var o=typeof Lm=="function"?Lm(r):[],a;if(Fa){a={};for(var u=0;u<o.length;u++)a["$"+o[u]]=o[u]}for(var c in r)Mn(r,c)&&(t&&String(Number(c))===c&&c<r.length||Fa&&a["$"+c]instanceof Symbol||(I4.call(/[^\w$]/,c)?i.push(e(c,r)+": "+e(r[c],r)):i.push(c+": "+e(r[c],r))));if(typeof Lm=="function")for(var p=0;p<o.length;p++)E4.call(r,o[p])&&i.push("["+e(o[p])+"]: "+e(r[o[p]],r));return i}l(zp,"arrObjKeys")});var Um=N((PN,B4)=>{"use strict";m();var F4=xr(),Ba=Ut(),DP=k4(),OP=Oi(),$p=F4("%WeakMap%",!0),Jp=F4("%Map%",!0),LP=Ba("WeakMap.prototype.get",!0),AP=Ba("WeakMap.prototype.set",!0),kP=Ba("WeakMap.prototype.has",!0),FP=Ba("Map.prototype.get",!0),BP=Ba("Map.prototype.set",!0),RP=Ba("Map.prototype.has",!0),Hm=l(function(r,e){for(var t=r,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),NP=l(function(r,e){var t=Hm(r,e);return t&&t.value},"listGet"),GP=l(function(r,e,t){var i=Hm(r,e);i?i.value=t:r.next={key:e,next:r.next,value:t}},"listSet"),VP=l(function(r,e){return!!Hm(r,e)},"listHas");B4.exports=l(function(){var e,t,i,n={assert:function(o){if(!n.has(o))throw new OP("Side channel does not contain "+DP(o))},get:function(o){if($p&&o&&(typeof o=="object"||typeof o=="function")){if(e)return LP(e,o)}else if(Jp){if(t)return FP(t,o)}else if(i)return NP(i,o)},has:function(o){if($p&&o&&(typeof o=="object"||typeof o=="function")){if(e)return kP(e,o)}else if(Jp){if(t)return RP(t,o)}else if(i)return VP(i,o);return!1},set:function(o,a){$p&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new $p),AP(e,o,a)):Jp?(t||(t=new Jp),BP(t,o,a)):(i||(i={key:{},next:null}),GP(i,o,a))}};return n},"getSideChannel")});var N4=N((IN,R4)=>{"use strict";m();var jP=vm(),Fl=Um()(),Li=Oi(),Wm={assert:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof e!="string")throw new Li("`slot` must be a string");if(Fl.assert(r),!Wm.has(r,e))throw new Li("`"+e+"` is not present on `O`")},get:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof e!="string")throw new Li("`slot` must be a string");var t=Fl.get(r);return t&&t["$"+e]},has:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof e!="string")throw new Li("`slot` must be a string");var t=Fl.get(r);return!!t&&jP(t,"$"+e)},set:function(r,e,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof e!="string")throw new Li("`slot` must be a string");var i=Fl.get(r);i||(i={},Fl.set(r,i)),i["$"+e]=t}};Object.freeze&&Object.freeze(Wm);R4.exports=Wm});var j4=N((_N,V4)=>{"use strict";m();var Bl=N4(),HP=SyntaxError,G4=typeof StopIteration=="object"?StopIteration:null;V4.exports=l(function(e){if(!G4)throw new HP("this environment lacks StopIteration");Bl.set(e,"[[Done]]",!1);var t={next:l(function(){var n=Bl.get(this,"[[Iterator]]"),o=Bl.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(Bl.set(n,"[[Done]]",!0),a!==G4)throw a;return{done:!0,value:void 0}}},"next")};return Bl.set(t,"[[Iterator]]",e),t},"getStopIterationIterator")});var Xm=N((LN,H4)=>{m();var UP={}.toString;H4.exports=Array.isArray||function(r){return UP.call(r)=="[object Array]"}});var Zm=N((kN,U4)=>{"use strict";m();var WP=String.prototype.valueOf,XP=l(function(e){try{return WP.call(e),!0}catch{return!1}},"tryStringObject"),ZP=Object.prototype.toString,zP="[object String]",YP=Sn()();U4.exports=l(function(e){return typeof e=="string"?!0:typeof e!="object"?!1:YP?XP(e):ZP.call(e)===zP},"isString")});var Ym=N((RN,Z4)=>{"use strict";m();var zm=typeof Map=="function"&&Map.prototype?Map:null,qP=typeof Set=="function"&&Set.prototype?Set:null,Kp;zm||(Kp=l(function(e){return!1},"isMap"));var X4=zm?Map.prototype.has:null,W4=qP?Set.prototype.has:null;!Kp&&!X4&&(Kp=l(function(e){return!1},"isMap"));Z4.exports=Kp||l(function(e){if(!e||typeof e!="object")return!1;try{if(X4.call(e),W4)try{W4.call(e)}catch{return!0}return e instanceof zm}catch{}return!1},"isMap")});var $m=N((VN,q4)=>{"use strict";m();var $P=typeof Map=="function"&&Map.prototype?Map:null,qm=typeof Set=="function"&&Set.prototype?Set:null,Qp;qm||(Qp=l(function(e){return!1},"isSet"));var z4=$P?Map.prototype.has:null,Y4=qm?Set.prototype.has:null;!Qp&&!Y4&&(Qp=l(function(e){return!1},"isSet"));q4.exports=Qp||l(function(e){if(!e||typeof e!="object")return!1;try{if(Y4.call(e),z4)try{z4.call(e)}catch{return!0}return e instanceof qm}catch{}return!1},"isSet")});var sC=N((UN,rd)=>{"use strict";m();var $4=_m(),J4=j4();kp()()||El()()?(ed=Symbol.iterator,rd.exports=l(function(e){if(e!=null&&typeof e[ed]<"u")return e[ed]();if($4(e))return Array.prototype[ed].call(e)},"getIterator")):(K4=Xm(),Q4=Zm(),Jm=xr(),eC=Jm("%Map%",!0),tC=Jm("%Set%",!0),nr=Ut(),Km=nr("Array.prototype.push"),Qm=nr("String.prototype.charCodeAt"),rC=nr("String.prototype.slice"),iC=l(function(e,t){var i=e.length;if(t+1>=i)return t+1;var n=Qm(e,t);if(n<55296||n>56319)return t+1;var o=Qm(e,t+1);return o<56320||o>57343?t+1:t+2},"advanceStringIndex"),td=l(function(e){var t=0;return{next:l(function(){var n=t>=e.length,o;return n||(o=e[t],t+=1),{done:n,value:o}},"next")}},"getArrayIterator"),ey=l(function(e,t){if(K4(e)||$4(e))return td(e);if(Q4(e)){var i=0;return{next:l(function(){var o=iC(e,i),a=rC(e,i,o);return i=o,{done:o>e.length,value:a}},"next")}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()},"getNonCollectionIterator"),!eC&&!tC?rd.exports=l(function(e){if(e!=null)return ey(e,!0)},"getIterator"):(nC=Ym(),oC=$m(),ty=nr("Map.prototype.forEach",!0),ry=nr("Set.prototype.forEach",!0),(typeof C>"u"||!C.versions||!C.versions.node)&&(iy=nr("Map.prototype.iterator",!0),ny=nr("Set.prototype.iterator",!0)),oy=nr("Map.prototype.@@iterator",!0)||nr("Map.prototype._es6-shim iterator_",!0),ay=nr("Set.prototype.@@iterator",!0)||nr("Set.prototype._es6-shim iterator_",!0),aC=l(function(e){if(nC(e)){if(iy)return J4(iy(e));if(oy)return oy(e);if(ty){var t=[];return ty(e,function(n,o){Km(t,[o,n])}),td(t)}}if(oC(e)){if(ny)return J4(ny(e));if(ay)return ay(e);if(ry){var i=[];return ry(e,function(n){Km(i,n)}),td(i)}}},"getCollectionIterator"),rd.exports=l(function(e){return aC(e)||ey(e)},"getIterator")));var ed,K4,Q4,Jm,eC,tC,nr,Km,Qm,rC,iC,td,ey,nC,oC,ty,ry,iy,ny,oy,ay,aC});var sy=N((ZN,cC)=>{"use strict";m();var lC=l(function(r){return r!==r},"numberIsNaN");cC.exports=l(function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||lC(e)&&lC(t))},"is")});var ly=N((qN,uC)=>{"use strict";m();var JP=sy();uC.exports=l(function(){return typeof Object.is=="function"?Object.is:JP},"getPolyfill")});var dC=N((KN,pC)=>{"use strict";m();var KP=ly(),QP=xn();pC.exports=l(function(){var e=KP();return QP(Object,{is:e},{is:l(function(){return Object.is!==e},"testObjectIs")}),e},"shimObjectIs")});var yC=N((tG,mC)=>{"use strict";m();var eT=xn(),tT=ho(),rT=sy(),hC=ly(),iT=dC(),fC=tT(hC(),Object);eT(fC,{getPolyfill:hC,implementation:rT,shim:iT});mC.exports=fC});var uy=N((iG,CC)=>{"use strict";m();var nT=ho(),bC=Ut(),oT=xr(),cy=oT("%ArrayBuffer%",!0),id=bC("ArrayBuffer.prototype.byteLength",!0),aT=bC("Object.prototype.toString"),gC=!!cy&&!id&&new cy(0).slice,vC=!!gC&&nT(gC);CC.exports=l(id||vC?function(e){if(!e||typeof e!="object")return!1;try{return id?id(e):vC(e,0),!0}catch{return!1}}:cy?function(e){return aT(e)==="[object ArrayBuffer]"}:function(e){return!1},"isArrayBuffer")});var SC=N((aG,xC)=>{"use strict";m();var sT=Date.prototype.getDay,lT=l(function(e){try{return sT.call(e),!0}catch{return!1}},"tryDateGetDayCall"),cT=Object.prototype.toString,uT="[object Date]",pT=Sn()();xC.exports=l(function(e){return typeof e!="object"||e===null?!1:pT?lT(e):cT.call(e)===uT},"isDateObject")});var IC=N((cG,wC)=>{"use strict";m();var py=Ut(),MC=Sn()(),PC,TC,dy,hy;MC&&(PC=py("Object.prototype.hasOwnProperty"),TC=py("RegExp.prototype.exec"),dy={},nd=l(function(){throw dy},"throwRegexMarker"),hy={toString:nd,valueOf:nd},typeof Symbol.toPrimitive=="symbol"&&(hy[Symbol.toPrimitive]=nd));var nd,dT=py("Object.prototype.toString"),hT=Object.getOwnPropertyDescriptor,fT="[object RegExp]";wC.exports=l(MC?function(e){if(!e||typeof e!="object")return!1;var t=hT(e,"lastIndex"),i=t&&PC(t,"value");if(!i)return!1;try{TC(e,hy)}catch(n){return n===dy}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:dT(e)===fT},"isRegex")});var DC=N((dG,_C)=>{"use strict";m();var mT=Ut(),EC=mT("SharedArrayBuffer.prototype.byteLength",!0);_C.exports=l(EC?function(e){if(!e||typeof e!="object")return!1;try{return EC(e),!0}catch{return!1}}:function(e){return!1},"isSharedArrayBuffer")});var LC=N((mG,OC)=>{"use strict";m();var yT=Number.prototype.toString,gT=l(function(e){try{return yT.call(e),!0}catch{return!1}},"tryNumberObject"),vT=Object.prototype.toString,bT="[object Number]",CT=Sn()();OC.exports=l(function(e){return typeof e=="number"?!0:typeof e!="object"?!1:CT?gT(e):vT.call(e)===bT},"isNumberObject")});var FC=N((vG,kC)=>{"use strict";m();var AC=Ut(),xT=AC("Boolean.prototype.toString"),ST=AC("Object.prototype.toString"),MT=l(function(e){try{return xT(e),!0}catch{return!1}},"booleanBrandCheck"),PT="[object Boolean]",TT=Sn()();kC.exports=l(function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:TT&&Symbol.toStringTag in e?MT(e):ST(e)===PT},"isBoolean")});var GC=N((xG,fy)=>{"use strict";m();var wT=Object.prototype.toString,IT=kp()();IT?(BC=Symbol.prototype.toString,RC=/^Symbol\(.*\)$/,NC=l(function(e){return typeof e.valueOf()!="symbol"?!1:RC.test(BC.call(e))},"isRealSymbolObject"),fy.exports=l(function(e){if(typeof e=="symbol")return!0;if(wT.call(e)!=="[object Symbol]")return!1;try{return NC(e)}catch{return!1}},"isSymbol")):fy.exports=l(function(e){return!1},"isSymbol");var BC,RC,NC});var HC=N((PG,jC)=>{"use strict";m();var VC=typeof BigInt<"u"&&BigInt;jC.exports=l(function(){return typeof VC=="function"&&typeof BigInt=="function"&&typeof VC(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var XC=N((IG,my)=>{"use strict";m();var ET=HC()();ET?(UC=BigInt.prototype.valueOf,WC=l(function(e){try{return UC.call(e),!0}catch{}return!1},"tryBigIntObject"),my.exports=l(function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:WC(e)},"isBigInt")):my.exports=l(function(e){return!1},"isBigInt");var UC,WC});var zC=N((DG,ZC)=>{"use strict";m();var _T=Zm(),DT=LC(),OT=FC(),LT=GC(),AT=XC();ZC.exports=l(function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(_T(e))return"String";if(DT(e))return"Number";if(OT(e))return"Boolean";if(LT(e))return"Symbol";if(AT(e))return"BigInt"},"whichBoxedPrimitive")});var $C=N((AG,qC)=>{"use strict";m();var od=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,YC=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,ad;od||(ad=l(function(e){return!1},"isWeakMap"));var gy=od?od.prototype.has:null,yy=YC?YC.prototype.has:null;!ad&&!gy&&(ad=l(function(e){return!1},"isWeakMap"));qC.exports=ad||l(function(e){if(!e||typeof e!="object")return!1;try{if(gy.call(e,gy),yy)try{yy.call(e,yy)}catch{return!0}return e instanceof od}catch{}return!1},"isWeakMap")});var KC=N((BG,by)=>{"use strict";m();var kT=xr(),JC=Ut(),FT=kT("%WeakSet%",!0),vy=JC("WeakSet.prototype.has",!0);vy?(sd=JC("WeakMap.prototype.has",!0),by.exports=l(function(e){if(!e||typeof e!="object")return!1;try{if(vy(e,vy),sd)try{sd(e,sd)}catch{return!0}return e instanceof FT}catch{}return!1},"isWeakSet")):by.exports=l(function(e){return!1},"isWeakSet");var sd});var e5=N((GG,QC)=>{"use strict";m();var BT=Ym(),RT=$m(),NT=$C(),GT=KC();QC.exports=l(function(e){if(e&&typeof e=="object"){if(BT(e))return"Map";if(RT(e))return"Set";if(NT(e))return"WeakMap";if(GT(e))return"WeakSet"}return!1},"whichCollection")});var n5=N((HG,i5)=>{"use strict";m();var r5=Function.prototype.toString,Ra=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,xy,ld;if(typeof Ra=="function"&&typeof Object.defineProperty=="function")try{xy=Object.defineProperty({},"length",{get:function(){throw ld}}),ld={},Ra(function(){throw 42},null,xy)}catch(r){r!==ld&&(Ra=null)}else Ra=null;var VT=/^\s*class\b/,Sy=l(function(e){try{var t=r5.call(e);return VT.test(t)}catch{return!1}},"isES6ClassFunction"),Cy=l(function(e){try{return Sy(e)?!1:(r5.call(e),!0)}catch{return!1}},"tryFunctionToStr"),cd=Object.prototype.toString,jT="[object Object]",HT="[object Function]",UT="[object GeneratorFunction]",WT="[object HTMLAllCollection]",XT="[object HTML document.all class]",ZT="[object HTMLCollection]",zT=typeof Symbol=="function"&&!!Symbol.toStringTag,YT=!(0 in[,]),My=l(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(t5=document.all,cd.call(t5)===cd.call(document.all)&&(My=l(function(e){if((YT||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=cd.call(e);return(t===WT||t===XT||t===ZT||t===jT)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var t5;i5.exports=l(Ra?function(e){if(My(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Ra(e,null,xy)}catch(t){if(t!==ld)return!1}return!Sy(e)&&Cy(e)}:function(e){if(My(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(zT)return Cy(e);if(Sy(e))return!1;var t=cd.call(e);return t!==HT&&t!==UT&&!/^\[object HTML/.test(t)?!1:Cy(e)},"isCallable")});var s5=N((XG,a5)=>{"use strict";m();var qT=n5(),$T=Object.prototype.toString,o5=Object.prototype.hasOwnProperty,JT=l(function(e,t,i){for(var n=0,o=e.length;n<o;n++)o5.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachArray"),KT=l(function(e,t,i){for(var n=0,o=e.length;n<o;n++)i==null?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},"forEachString"),QT=l(function(e,t,i){for(var n in e)o5.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachObject"),ew=l(function(e,t,i){if(!qT(t))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),$T.call(e)==="[object Array]"?JT(e,t,n):typeof e=="string"?KT(e,t,n):QT(e,t,n)},"forEach");a5.exports=ew});var c5=N((YG,l5)=>{"use strict";m();l5.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var p5=N(($G,u5)=>{"use strict";m();var Py=c5(),tw=typeof globalThis>"u"?global:globalThis;u5.exports=l(function(){for(var e=[],t=0;t<Py.length;t++)typeof tw[Py[t]]=="function"&&(e[e.length]=Py[t]);return e},"availableTypedArrays")});var y5=N((QG,m5)=>{"use strict";m();var pd=s5(),rw=p5(),d5=ho(),Iy=Ut(),ud=jp(),iw=Iy("Object.prototype.toString"),f5=Sn()(),h5=typeof globalThis>"u"?global:globalThis,wy=rw(),Ey=Iy("String.prototype.slice"),Ty=Object.getPrototypeOf,nw=Iy("Array.prototype.indexOf",!0)||l(function(e,t){for(var i=0;i<e.length;i+=1)if(e[i]===t)return i;return-1},"indexOf"),dd={__proto__:null};f5&&ud&&Ty?pd(wy,function(r){var e=new h5[r];if(Symbol.toStringTag in e){var t=Ty(e),i=ud(t,Symbol.toStringTag);if(!i){var n=Ty(t);i=ud(n,Symbol.toStringTag)}dd["$"+r]=d5(i.get)}}):pd(wy,function(r){var e=new h5[r],t=e.slice||e.set;t&&(dd["$"+r]=d5(t))});var ow=l(function(e){var t=!1;return pd(dd,function(i,n){if(!t)try{"$"+i(e)===n&&(t=Ey(n,1))}catch{}}),t},"tryAllTypedArrays"),aw=l(function(e){var t=!1;return pd(dd,function(i,n){if(!t)try{i(e),t=Ey(n,1)}catch{}}),t},"tryAllSlices");m5.exports=l(function(e){if(!e||typeof e!="object")return!1;if(!f5){var t=Ey(iw(e),8,-1);return nw(wy,t)>-1?t:t!=="Object"?!1:aw(e)}return ud?ow(e):null},"whichTypedArray")});var b5=N((rV,v5)=>{"use strict";m();var sw=Ut(),g5=sw("ArrayBuffer.prototype.byteLength",!0),lw=uy();v5.exports=l(function(e){return lw(e)?g5?g5(e):e.byteLength:NaN},"byteLength")});var W5=N((oV,U5)=>{"use strict";m();var V5=$3(),qr=Ut(),C5=u4(),cw=xr(),Na=sC(),uw=Um(),x5=yC(),S5=_m(),M5=Xm(),P5=uy(),T5=SC(),w5=IC(),I5=DC(),E5=Ap(),_5=zC(),D5=e5(),O5=y5(),L5=b5(),A5=qr("SharedArrayBuffer.prototype.byteLength",!0),k5=qr("Date.prototype.getTime"),_y=Object.getPrototypeOf,F5=qr("Object.prototype.toString"),fd=cw("%Set%",!0),Dy=qr("Map.prototype.has",!0),md=qr("Map.prototype.get",!0),B5=qr("Map.prototype.size",!0),yd=qr("Set.prototype.add",!0),j5=qr("Set.prototype.delete",!0),gd=qr("Set.prototype.has",!0),hd=qr("Set.prototype.size",!0);function R5(r,e,t,i){for(var n=Na(r),o;(o=n.next())&&!o.done;)if(Sr(e,o.value,t,i))return j5(r,o.value),!0;return!1}l(R5,"setHasEqualElement");function H5(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}l(H5,"findLooseMatchingPrimitives");function pw(r,e,t,i,n,o){var a=H5(t);if(a!=null)return a;var u=md(e,a),c=V5({},n,{strict:!1});return typeof u>"u"&&!Dy(e,a)||!Sr(i,u,c,o)?!1:!Dy(r,a)&&Sr(i,u,c,o)}l(pw,"mapMightHaveLoosePrim");function dw(r,e,t){var i=H5(t);return i!=null?i:gd(e,i)&&!gd(r,i)}l(dw,"setMightHaveLoosePrim");function N5(r,e,t,i,n,o){for(var a=Na(r),u,c;(u=a.next())&&!u.done;)if(c=u.value,Sr(t,c,n,o)&&Sr(i,md(e,c),n,o))return j5(r,c),!0;return!1}l(N5,"mapHasEqualEntry");function Sr(r,e,t,i){var n=t||{};if(n.strict?x5(r,e):r===e)return!0;var o=_5(r),a=_5(e);if(o!==a)return!1;if(!r||!e||typeof r!="object"&&typeof e!="object")return n.strict?x5(r,e):r==e;var u=i.has(r),c=i.has(e),p;if(u&&c){if(i.get(r)===i.get(e))return!0}else p={};return u||i.set(r,p),c||i.set(e,p),mw(r,e,n,i)}l(Sr,"internalDeepEqual");function G5(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))}l(G5,"isBuffer");function hw(r,e,t,i){if(hd(r)!==hd(e))return!1;for(var n=Na(r),o=Na(e),a,u,c;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new fd),yd(c,a.value);else if(!gd(e,a.value)){if(t.strict||!dw(r,e,a.value))return!1;c||(c=new fd),yd(c,a.value)}if(c){for(;(u=o.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!R5(c,u.value,t.strict,i))return!1}else if(!t.strict&&!gd(r,u.value)&&!R5(c,u.value,t.strict,i))return!1;return hd(c)===0}return!0}l(hw,"setEquiv");function fw(r,e,t,i){if(B5(r)!==B5(e))return!1;for(var n=Na(r),o=Na(e),a,u,c,p,f,y;(a=n.next())&&!a.done;)if(p=a.value[0],f=a.value[1],p&&typeof p=="object")c||(c=new fd),yd(c,p);else if(y=md(e,p),typeof y>"u"&&!Dy(e,p)||!Sr(f,y,t,i)){if(t.strict||!pw(r,e,p,f,t,i))return!1;c||(c=new fd),yd(c,p)}if(c){for(;(u=o.next())&&!u.done;)if(p=u.value[0],y=u.value[1],p&&typeof p=="object"){if(!N5(c,r,p,y,t,i))return!1}else if(!t.strict&&(!r.has(p)||!Sr(md(r,p),y,t,i))&&!N5(c,r,p,y,V5({},t,{strict:!1}),i))return!1;return hd(c)===0}return!0}l(fw,"mapEquiv");function mw(r,e,t,i){var n,o;if(typeof r!=typeof e||r==null||e==null||F5(r)!==F5(e)||S5(r)!==S5(e))return!1;var a=M5(r),u=M5(e);if(a!==u)return!1;var c=r instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(r.name!==e.name||r.message!==e.message))return!1;var f=w5(r),y=w5(e);if(f!==y||(f||y)&&(r.source!==e.source||C5(r)!==C5(e)))return!1;var g=T5(r),v=T5(e);if(g!==v||(g||v)&&k5(r)!==k5(e)||t.strict&&_y&&_y(r)!==_y(e))return!1;var x=O5(r),P=O5(e);if(x!==P)return!1;if(x||P){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var b=G5(r),S=G5(e);if(b!==S)return!1;if(b||S){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var E=P5(r),I=P5(e);if(E!==I)return!1;if(E||I)return L5(r)!==L5(e)?!1:typeof Uint8Array=="function"&&Sr(new Uint8Array(r),new Uint8Array(e),t,i);var w=I5(r),_=I5(e);if(w!==_)return!1;if(w||_)return A5(r)!==A5(e)?!1:typeof Uint8Array=="function"&&Sr(new Uint8Array(r),new Uint8Array(e),t,i);if(typeof r!=typeof e)return!1;var D=E5(r),R=E5(e);if(D.length!==R.length)return!1;for(D.sort(),R.sort(),n=D.length-1;n>=0;n--)if(D[n]!=R[n])return!1;for(n=D.length-1;n>=0;n--)if(o=D[n],!Sr(r[o],e[o],t,i))return!1;var V=D5(r),G=D5(e);return V!==G?!1:V==="Set"||G==="Set"?hw(r,e,t,i):V==="Map"?fw(r,e,t,i):!0}l(mw,"objEquiv");U5.exports=l(function(e,t,i){return Sr(e,t,i,uw())},"deepEqual")});var ax=N(ge=>{"use strict";m();Object.defineProperty(ge,"__esModule",{value:!0});function yw(r){return r&&r.__esModule?r:{default:r}}l(yw,"_interopRequireDefault");var gw=Object.defineProperty,xe=l((r,e)=>gw(r,"name",{value:e,configurable:!0}),"__name"),vw=W5(),bw=yw(vw),Gl,X5=(Gl=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,i,n;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(i=e==null?void 0:e.direction)!=null?i:!1,this.compareProperties=(n=e==null?void 0:e.compareProperties)!=null?n:!0}compare(e,t){if(e.type!==t.type||!Rl(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){let i=Oy(e),n=Oy(t);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((i,n)=>Math.abs(i-t[n])<this.precision)}compareLine(e,t,i=0,n=!1){if(!Rl(e,t))return!1;let o=e,a=t;if(n&&!this.compareCoord(o[0],a[0])){let c=this.fixStartIndex(a,o);if(c)a=c;else return!1}let u=this.compareCoord(o[i],a[i]);return this.direction||u?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(e,t){let i,n=-1;for(let o=0;o<e.length;o++)if(this.compareCoord(e[o],t[0])){n=o;break}return n>=0&&(i=[].concat(e.slice(n,e.length),e.slice(1,n+1))),i}comparePath(e,t){return e.every((i,n)=>this.compareCoord(i,t[n]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){let i=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(e,t){return Rl(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((i,n)=>this.compare(i,t.geometries[n]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?bw.default.call(void 0,e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return Rl(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((i,n)=>this.compare(i,t.features[n]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}},l(Gl,"_GeojsonEquality"),Gl);xe(X5,"GeojsonEquality");var Cw=X5;function Rl(r,e){return r.coordinates?r.coordinates.length===e.coordinates.length:r.length===e.length}l(Rl,"sameLength");xe(Rl,"sameLength");function Oy(r){return r.coordinates.map(e=>({type:r.type.replace("Multi",""),coordinates:e}))}l(Oy,"explode");xe(Oy,"explode");var Lt=63710088e-1,Ay={centimeters:Lt*100,centimetres:Lt*100,degrees:360/(2*Math.PI),feet:Lt*3.28084,inches:Lt*39.37,kilometers:Lt/1e3,kilometres:Lt/1e3,meters:Lt,metres:Lt,miles:Lt/1609.344,millimeters:Lt*1e3,millimetres:Lt*1e3,nauticalmiles:Lt/1852,radians:1,yards:Lt*1.0936},Ly={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 Ai(r,e,t={}){let i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}l(Ai,"feature");xe(Ai,"feature");function Z5(r,e,t={}){switch(r){case"Point":return vd(e).geometry;case"LineString":return Cd(e).geometry;case"Polygon":return bd(e).geometry;case"MultiPoint":return Fy(e).geometry;case"MultiLineString":return ky(e).geometry;case"MultiPolygon":return By(e).geometry;default:throw new Error(r+" is invalid")}}l(Z5,"geometry");xe(Z5,"geometry");function vd(r,e,t={}){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(!Nl(r[0])||!Nl(r[1]))throw new Error("coordinates must contain numbers");return Ai({type:"Point",coordinates:r},e,t)}l(vd,"point");xe(vd,"point");function z5(r,e,t={}){return Vl(r.map(i=>vd(i,e)),t)}l(z5,"points");xe(z5,"points");function bd(r,e,t={}){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 Ai({type:"Polygon",coordinates:r},e,t)}l(bd,"polygon");xe(bd,"polygon");function Y5(r,e,t={}){return Vl(r.map(i=>bd(i,e)),t)}l(Y5,"polygons");xe(Y5,"polygons");function Cd(r,e,t={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Ai({type:"LineString",coordinates:r},e,t)}l(Cd,"lineString");xe(Cd,"lineString");function q5(r,e,t={}){return Vl(r.map(i=>Cd(i,e)),t)}l(q5,"lineStrings");xe(q5,"lineStrings");function Vl(r,e={}){let t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}l(Vl,"featureCollection");xe(Vl,"featureCollection");function ky(r,e,t={}){return Ai({type:"MultiLineString",coordinates:r},e,t)}l(ky,"multiLineString");xe(ky,"multiLineString");function Fy(r,e,t={}){return Ai({type:"MultiPoint",coordinates:r},e,t)}l(Fy,"multiPoint");xe(Fy,"multiPoint");function By(r,e,t={}){return Ai({type:"MultiPolygon",coordinates:r},e,t)}l(By,"multiPolygon");xe(By,"multiPolygon");function $5(r,e,t={}){return Ai({type:"GeometryCollection",geometries:r},e,t)}l($5,"geometryCollection");xe($5,"geometryCollection");function J5(r,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let t=Math.pow(10,e||0);return Math.round(r*t)/t}l(J5,"round");xe(J5,"round");function Ry(r,e="kilometers"){let t=Ay[e];if(!t)throw new Error(e+" units is invalid");return r*t}l(Ry,"radiansToLength");xe(Ry,"radiansToLength");function xd(r,e="kilometers"){let t=Ay[e];if(!t)throw new Error(e+" units is invalid");return r/t}l(xd,"lengthToRadians");xe(xd,"lengthToRadians");function K5(r,e){return Ny(xd(r,e))}l(K5,"lengthToDegrees");xe(K5,"lengthToDegrees");function Q5(r){let e=r%360;return e<0&&(e+=360),e}l(Q5,"bearingToAzimuth");xe(Q5,"bearingToAzimuth");function Ny(r){return r%(2*Math.PI)*180/Math.PI}l(Ny,"radiansToDegrees");xe(Ny,"radiansToDegrees");function ex(r){return r%360*Math.PI/180}l(ex,"degreesToRadians");xe(ex,"degreesToRadians");function tx(r,e="kilometers",t="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Ry(xd(r,e),t)}l(tx,"convertLength");xe(tx,"convertLength");function rx(r,e="meters",t="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Ly[e];if(!i)throw new Error("invalid original units");let n=Ly[t];if(!n)throw new Error("invalid final units");return r/i*n}l(rx,"convertArea");xe(rx,"convertArea");function Nl(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l(Nl,"isNumber");xe(Nl,"isNumber");function ix(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}l(ix,"isObject");xe(ix,"isObject");function nx(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(e=>{if(!Nl(e))throw new Error("bbox must only contain numbers")})}l(nx,"validateBBox");xe(nx,"validateBBox");function ox(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")}l(ox,"validateId");xe(ox,"validateId");ge.GeojsonEquality=Cw;ge.areaFactors=Ly;ge.bearingToAzimuth=Q5;ge.convertArea=rx;ge.convertLength=tx;ge.degreesToRadians=ex;ge.earthRadius=Lt;ge.factors=Ay;ge.feature=Ai;ge.featureCollection=Vl;ge.geometry=Z5;ge.geometryCollection=$5;ge.isNumber=Nl;ge.isObject=ix;ge.lengthToDegrees=K5;ge.lengthToRadians=xd;ge.lineString=Cd;ge.lineStrings=q5;ge.multiLineString=ky;ge.multiPoint=Fy;ge.multiPolygon=By;ge.point=vd;ge.points=z5;ge.polygon=bd;ge.polygons=Y5;ge.radiansToDegrees=Ny;ge.radiansToLength=Ry;ge.round=J5;ge.validateBBox=nx;ge.validateId=ox});var gx=N(Je=>{"use strict";m();Object.defineProperty(Je,"__esModule",{value:!0});var xw=Object.defineProperty,nt=l((r,e)=>xw(r,"name",{value:e,configurable:!0}),"__name"),st=ax();function Ga(r,e,t){if(r!==null)for(var i,n,o,a,u,c,p,f=0,y=0,g,v=r.type,x=v==="FeatureCollection",P=v==="Feature",b=x?r.features.length:1,S=0;S<b;S++){p=x?r.features[S].geometry:P?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var E=0;E<u;E++){var I=0,w=0;if(a=g?p.geometries[E]:p,a!==null){c=a.coordinates;var _=a.type;switch(f=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(c,y,S,I,w)===!1)return!1;y++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],y,S,I,w)===!1)return!1;y++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(e(c[i][n],y,S,I,w)===!1)return!1;y++}_==="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-f;o++){if(e(c[i][n][o],y,S,I,w)===!1)return!1;y++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Ga(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Ga,"coordEach");nt(Ga,"coordEach");function sx(r,e,t,i){var n=t;return Ga(r,function(o,a,u,c,p){a===0&&t===void 0?n=o:n=e(n,o,a,u,c,p)},i),n}l(sx,"coordReduce");nt(sx,"coordReduce");function Gy(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}l(Gy,"propEach");nt(Gy,"propEach");function lx(r,e,t){var i=t;return Gy(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}l(lx,"propReduce");nt(lx,"propReduce");function Vy(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}l(Vy,"featureEach");nt(Vy,"featureEach");function cx(r,e,t){var i=t;return Vy(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}l(cx,"featureReduce");nt(cx,"featureReduce");function ux(r){var e=[];return Ga(r,function(t){e.push(t)}),e}l(ux,"coordAll");nt(ux,"coordAll");function Sd(r,e){var t,i,n,o,a,u,c,p,f,y,g=0,v=r.type==="FeatureCollection",x=r.type==="Feature",P=v?r.features.length:1;for(t=0;t<P;t++){for(u=v?r.features[t].geometry:x?r.geometry:r,p=v?r.features[t].properties:x?r.properties:{},f=v?r.features[t].bbox:x?r.bbox:void 0,y=v?r.features[t].id:x?r.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,n=0;n<a;n++){if(o=c?u.geometries[n]:u,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}l(Sd,"geomEach");nt(Sd,"geomEach");function px(r,e,t){var i=t;return Sd(r,function(n,o,a,u,c){o===0&&t===void 0?i=n:i=e(i,n,o,a,u,c)}),i}l(px,"geomReduce");nt(px,"geomReduce");function jl(r,e){Sd(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(st.feature.call(void 0,t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:c,coordinates:f};if(e(st.feature.call(void 0,y,n),i,p)===!1)return!1}})}l(jl,"flattenEach");nt(jl,"flattenEach");function dx(r,e,t){var i=t;return jl(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}l(dx,"flattenReduce");nt(dx,"flattenReduce");function jy(r,e){jl(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,c=0,p=0,f=0;if(Ga(t,function(y,g,v,x,P){if(u===void 0||i>c||x>p||P>f){u=y,c=i,p=x,f=P,o=0;return}var b=st.lineString.call(void 0,[u,y],t.properties);if(e(b,i,n,P,o)===!1)return!1;o++,u=y})===!1)return!1}}})}l(jy,"segmentEach");nt(jy,"segmentEach");function hx(r,e,t){var i=t,n=!1;return jy(r,function(o,a,u,c,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,c,p),n=!0}),i}l(hx,"segmentReduce");nt(hx,"segmentReduce");function Hy(r,e){if(!r)throw new Error("geojson is required");jl(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var u=0;u<a.length;u++)if(e(st.lineString.call(void 0,a[u],t.properties),i,n,u)===!1)return!1;break}}})}l(Hy,"lineEach");nt(Hy,"lineEach");function fx(r,e,t){var i=t;return Hy(r,function(n,o,a,u){o===0&&t===void 0?i=n:i=e(i,n,o,a,u)}),i}l(fx,"lineReduce");nt(fx,"lineReduce");function mx(r,e){if(e=e||{},!st.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var c=u.coordinates;switch(u.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),st.lineString.call(void 0,[c[o],c[o+1]],a,e);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),st.lineString.call(void 0,[c[n][o],c[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),st.lineString.call(void 0,[c[i][o],c[i][o+1]],a,e);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),st.lineString.call(void 0,[c[i][n][o],c[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}l(mx,"findSegment");nt(mx,"findSegment");function yx(r,e){if(e=e||{},!st.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var c=u.coordinates;switch(u.type){case"Point":return st.point.call(void 0,c,a,e);case"MultiPoint":return i<0&&(i=c.length+i),st.point.call(void 0,c[i],a,e);case"LineString":return o<0&&(o=c.length+o),st.point.call(void 0,c[o],a,e);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),st.point.call(void 0,c[n][o],a,e);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),st.point.call(void 0,c[i][o],a,e);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),st.point.call(void 0,c[i][n][o],a,e)}throw new Error("geojson is invalid")}l(yx,"findPoint");nt(yx,"findPoint");Je.coordAll=ux;Je.coordEach=Ga;Je.coordReduce=sx;Je.featureEach=Vy;Je.featureReduce=cx;Je.findPoint=yx;Je.findSegment=mx;Je.flattenEach=jl;Je.flattenReduce=dx;Je.geomEach=Sd;Je.geomReduce=px;Je.lineEach=Hy;Je.lineReduce=fx;Je.propEach=Gy;Je.propReduce=lx;Je.segmentEach=jy;Je.segmentReduce=hx});var vx=N(Md=>{"use strict";m();Object.defineProperty(Md,"__esModule",{value:!0});var Sw=Object.defineProperty,Mw=l((r,e)=>Sw(r,"name",{value:e,configurable:!0}),"__name"),Pw=gx();function Uy(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;let t=[1/0,1/0,-1/0,-1/0];return Pw.coordEach.call(void 0,r,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}l(Uy,"bbox");Mw(Uy,"bbox");var Tw=Uy;Md.bbox=Uy;Md.default=Tw});var Mx=N((bV,Wy)=>{m();var $r=g2(),Cx=pm(),xx=I2(),Va=vx().default,ww=xx.featureEach,gV=xx.coordEach,vV=Cx.polygon,bx=Cx.featureCollection;function Sx(r){var e=new $r(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Va(t),$r.prototype.insert.call(this,t)},e.load=function(t){var i=[];return Array.isArray(t)?t.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Va(n),i.push(n)}):ww(t,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Va(n),i.push(n)}),$r.prototype.load.call(this,i)},e.remove=function(t,i){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Va(t),$r.prototype.remove.call(this,t,i)},e.clear=function(){return $r.prototype.clear.call(this)},e.search=function(t){var i=$r.prototype.search.call(this,this.toBBox(t));return bx(i)},e.collides=function(t){return $r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=$r.prototype.all.call(this);return bx(t)},e.toJSON=function(){return $r.prototype.toJSON.call(this)},e.fromJSON=function(t){return $r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var i;if(t.bbox)i=t.bbox;else if(Array.isArray(t)&&t.length===4)i=t;else if(Array.isArray(t)&&t.length===6)i=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")i=Va(t);else if(t.type==="FeatureCollection")i=Va(t);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},e}l(Sx,"geojsonRbush");Wy.exports=Sx;Wy.exports.default=Sx});var u0=N((jc,As)=>{m();var NE=200,rS="__lodash_hash_undefined__",GE=800,VE=16,iS=9007199254740991,nS="[object Arguments]",jE="[object Array]",HE="[object AsyncFunction]",UE="[object Boolean]",WE="[object Date]",XE="[object Error]",oS="[object Function]",ZE="[object GeneratorFunction]",zE="[object Map]",YE="[object Number]",qE="[object Null]",aS="[object Object]",$E="[object Proxy]",JE="[object RegExp]",KE="[object Set]",QE="[object String]",e_="[object Undefined]",t_="[object WeakMap]",r_="[object ArrayBuffer]",i_="[object DataView]",n_="[object Float32Array]",o_="[object Float64Array]",a_="[object Int8Array]",s_="[object Int16Array]",l_="[object Int32Array]",c_="[object Uint8Array]",u_="[object Uint8ClampedArray]",p_="[object Uint16Array]",d_="[object Uint32Array]",h_=/[\\^$.*+?()[\]{}|]/g,f_=/^\[object .+?Constructor\]$/,m_=/^(?:0|[1-9]\d*)$/,Oe={};Oe[n_]=Oe[o_]=Oe[a_]=Oe[s_]=Oe[l_]=Oe[c_]=Oe[u_]=Oe[p_]=Oe[d_]=!0;Oe[nS]=Oe[jE]=Oe[r_]=Oe[UE]=Oe[i_]=Oe[WE]=Oe[XE]=Oe[oS]=Oe[zE]=Oe[YE]=Oe[aS]=Oe[JE]=Oe[KE]=Oe[QE]=Oe[t_]=!1;var sS=typeof global=="object"&&global&&global.Object===Object&&global,y_=typeof self=="object"&&self&&self.Object===Object&&self,Wc=sS||y_||Function("return this")(),lS=typeof jc=="object"&&jc&&!jc.nodeType&&jc,Hc=lS&&typeof As=="object"&&As&&!As.nodeType&&As,cS=Hc&&Hc.exports===lS,Q1=cS&&sS.process,z7=function(){try{var r=Hc&&Hc.require&&Hc.require("util").types;return r||Q1&&Q1.binding&&Q1.binding("util")}catch{}}(),Y7=z7&&z7.isTypedArray;function uS(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}l(uS,"apply");function g_(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}l(g_,"baseTimes");function v_(r){return function(e){return r(e)}}l(v_,"baseUnary");function b_(r,e){return r==null?void 0:r[e]}l(b_,"getValue");function C_(r,e){return function(t){return r(e(t))}}l(C_,"overArg");var x_=Array.prototype,S_=Function.prototype,Ch=Object.prototype,e0=Wc["__core-js_shared__"],xh=S_.toString,Qi=Ch.hasOwnProperty,q7=function(){var r=/[^.]+$/.exec(e0&&e0.keys&&e0.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),pS=Ch.toString,M_=xh.call(Object),P_=RegExp("^"+xh.call(Qi).replace(h_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vh=cS?Wc.Buffer:void 0,$7=Wc.Symbol,J7=Wc.Uint8Array,K7=vh?vh.allocUnsafe:void 0,dS=C_(Object.getPrototypeOf,Object),Q7=Object.create,T_=Ch.propertyIsEnumerable,w_=x_.splice,Jo=$7?$7.toStringTag:void 0,bh=function(){try{var r=s0(Object,"defineProperty");return r({},"",{}),r}catch{}}(),I_=vh?vh.isBuffer:void 0,eS=Math.max,E_=Date.now,hS=s0(Wc,"Map"),Uc=s0(Object,"create"),__=function(){function r(){}return l(r,"object"),function(e){if(!Ki(e))return{};if(Q7)return Q7(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function Ko(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}l(Ko,"Hash");function D_(){this.__data__=Uc?Uc(null):{},this.size=0}l(D_,"hashClear");function O_(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}l(O_,"hashDelete");function L_(r){var e=this.__data__;if(Uc){var t=e[r];return t===rS?void 0:t}return Qi.call(e,r)?e[r]:void 0}l(L_,"hashGet");function A_(r){var e=this.__data__;return Uc?e[r]!==void 0:Qi.call(e,r)}l(A_,"hashHas");function k_(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Uc&&e===void 0?rS:e,this}l(k_,"hashSet");Ko.prototype.clear=D_;Ko.prototype.delete=O_;Ko.prototype.get=L_;Ko.prototype.has=A_;Ko.prototype.set=k_;function en(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}l(en,"ListCache");function F_(){this.__data__=[],this.size=0}l(F_,"listCacheClear");function B_(r){var e=this.__data__,t=Sh(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():w_.call(e,t,1),--this.size,!0}l(B_,"listCacheDelete");function R_(r){var e=this.__data__,t=Sh(e,r);return t<0?void 0:e[t][1]}l(R_,"listCacheGet");function N_(r){return Sh(this.__data__,r)>-1}l(N_,"listCacheHas");function G_(r,e){var t=this.__data__,i=Sh(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}l(G_,"listCacheSet");en.prototype.clear=F_;en.prototype.delete=B_;en.prototype.get=R_;en.prototype.has=N_;en.prototype.set=G_;function ks(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}l(ks,"MapCache");function V_(){this.size=0,this.__data__={hash:new Ko,map:new(hS||en),string:new Ko}}l(V_,"mapCacheClear");function j_(r){var e=Ph(this,r).delete(r);return this.size-=e?1:0,e}l(j_,"mapCacheDelete");function H_(r){return Ph(this,r).get(r)}l(H_,"mapCacheGet");function U_(r){return Ph(this,r).has(r)}l(U_,"mapCacheHas");function W_(r,e){var t=Ph(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}l(W_,"mapCacheSet");ks.prototype.clear=V_;ks.prototype.delete=j_;ks.prototype.get=H_;ks.prototype.has=U_;ks.prototype.set=W_;function Fs(r){var e=this.__data__=new en(r);this.size=e.size}l(Fs,"Stack");function X_(){this.__data__=new en,this.size=0}l(X_,"stackClear");function Z_(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}l(Z_,"stackDelete");function z_(r){return this.__data__.get(r)}l(z_,"stackGet");function Y_(r){return this.__data__.has(r)}l(Y_,"stackHas");function q_(r,e){var t=this.__data__;if(t instanceof en){var i=t.__data__;if(!hS||i.length<NE-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new ks(i)}return t.set(r,e),this.size=t.size,this}l(q_,"stackSet");Fs.prototype.clear=X_;Fs.prototype.delete=Z_;Fs.prototype.get=z_;Fs.prototype.has=Y_;Fs.prototype.set=q_;function $_(r,e){var t=n0(r),i=!t&&i0(r),n=!t&&!i&&vS(r),o=!t&&!i&&!n&&CS(r),a=t||i||n||o,u=a?g_(r.length,String):[],c=u.length;for(var p in r)(e||Qi.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||yS(p,c)))&&u.push(p);return u}l($_,"arrayLikeKeys");function t0(r,e,t){(t!==void 0&&!Th(r[e],t)||t===void 0&&!(e in r))&&o0(r,e,t)}l(t0,"assignMergeValue");function J_(r,e,t){var i=r[e];(!(Qi.call(r,e)&&Th(i,t))||t===void 0&&!(e in r))&&o0(r,e,t)}l(J_,"assignValue");function Sh(r,e){for(var t=r.length;t--;)if(Th(r[t][0],e))return t;return-1}l(Sh,"assocIndexOf");function o0(r,e,t){e=="__proto__"&&bh?bh(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}l(o0,"baseAssignValue");var K_=uD();function Mh(r){return r==null?r===void 0?e_:qE:Jo&&Jo in Object(r)?pD(r):gD(r)}l(Mh,"baseGetTag");function tS(r){return Xc(r)&&Mh(r)==nS}l(tS,"baseIsArguments");function Q_(r){if(!Ki(r)||mD(r))return!1;var e=c0(r)?P_:f_;return e.test(xD(r))}l(Q_,"baseIsNative");function eD(r){return Xc(r)&&bS(r.length)&&!!Oe[Mh(r)]}l(eD,"baseIsTypedArray");function tD(r){if(!Ki(r))return yD(r);var e=gS(r),t=[];for(var i in r)i=="constructor"&&(e||!Qi.call(r,i))||t.push(i);return t}l(tD,"baseKeysIn");function a0(r,e,t,i,n){r!==e&&K_(e,function(o,a){if(n||(n=new Fs),Ki(o))rD(r,e,a,t,a0,i,n);else{var u=i?i(r0(r,a),o,a+"",r,e,n):void 0;u===void 0&&(u=o),t0(r,a,u)}},xS)}l(a0,"baseMerge");function rD(r,e,t,i,n,o,a){var u=r0(r,t),c=r0(e,t),p=a.get(c);if(p){t0(r,t,p);return}var f=o?o(u,c,t+"",r,e,a):void 0,y=f===void 0;if(y){var g=n0(c),v=!g&&vS(c),x=!g&&!v&&CS(c);f=c,g||v||x?n0(u)?f=u:SD(u)?f=sD(u):v?(y=!1,f=nD(c,!0)):x?(y=!1,f=aD(c,!0)):f=[]:MD(c)||i0(c)?(f=u,i0(u)?f=PD(u):(!Ki(u)||c0(u))&&(f=dD(c))):y=!1}y&&(a.set(c,f),n(f,c,i,o,a),a.delete(c)),t0(r,t,f)}l(rD,"baseMergeDeep");function fS(r,e){return bD(vD(r,e,SS),r+"")}l(fS,"baseRest");var iD=bh?function(r,e){return bh(r,"toString",{configurable:!0,enumerable:!1,value:ID(e),writable:!0})}:SS;function nD(r,e){if(e)return r.slice();var t=r.length,i=K7?K7(t):new r.constructor(t);return r.copy(i),i}l(nD,"cloneBuffer");function oD(r){var e=new r.constructor(r.byteLength);return new J7(e).set(new J7(r)),e}l(oD,"cloneArrayBuffer");function aD(r,e){var t=e?oD(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}l(aD,"cloneTypedArray");function sD(r,e){var t=-1,i=r.length;for(e||(e=Array(i));++t<i;)e[t]=r[t];return e}l(sD,"copyArray");function lD(r,e,t,i){var n=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var u=e[o],c=i?i(t[u],r[u],u,t,r):void 0;c===void 0&&(c=r[u]),n?o0(t,u,c):J_(t,u,c)}return t}l(lD,"copyObject");function cD(r){return fS(function(e,t){var i=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&hD(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++i<n;){var u=t[i];u&&r(e,u,i,o)}return e})}l(cD,"createAssigner");function uD(r){return function(e,t,i){for(var n=-1,o=Object(e),a=i(e),u=a.length;u--;){var c=a[r?u:++n];if(t(o[c],c,o)===!1)break}return e}}l(uD,"createBaseFor");function mS(r,e,t,i,n,o){return Ki(r)&&Ki(e)&&(o.set(e,r),a0(r,e,void 0,mS,o),o.delete(e)),r}l(mS,"customDefaultsMerge");function Ph(r,e){var t=r.__data__;return fD(e)?t[typeof e=="string"?"string":"hash"]:t.map}l(Ph,"getMapData");function s0(r,e){var t=b_(r,e);return Q_(t)?t:void 0}l(s0,"getNative");function pD(r){var e=Qi.call(r,Jo),t=r[Jo];try{r[Jo]=void 0;var i=!0}catch{}var n=pS.call(r);return i&&(e?r[Jo]=t:delete r[Jo]),n}l(pD,"getRawTag");function dD(r){return typeof r.constructor=="function"&&!gS(r)?__(dS(r)):{}}l(dD,"initCloneObject");function yS(r,e){var t=typeof r;return e=e==null?iS:e,!!e&&(t=="number"||t!="symbol"&&m_.test(r))&&r>-1&&r%1==0&&r<e}l(yS,"isIndex");function hD(r,e,t){if(!Ki(t))return!1;var i=typeof e;return(i=="number"?l0(t)&&yS(e,t.length):i=="string"&&e in t)?Th(t[e],r):!1}l(hD,"isIterateeCall");function fD(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}l(fD,"isKeyable");function mD(r){return!!q7&&q7 in r}l(mD,"isMasked");function gS(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ch;return r===t}l(gS,"isPrototype");function yD(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}l(yD,"nativeKeysIn");function gD(r){return pS.call(r)}l(gD,"objectToString");function vD(r,e,t){return e=eS(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,o=eS(i.length-e,0),a=Array(o);++n<o;)a[n]=i[e+n];n=-1;for(var u=Array(e+1);++n<e;)u[n]=i[n];return u[e]=t(a),uS(r,this,u)}}l(vD,"overRest");function r0(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}l(r0,"safeGet");var bD=CD(iD);function CD(r){var e=0,t=0;return function(){var i=E_(),n=VE-(i-t);if(t=i,n>0){if(++e>=GE)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}l(CD,"shortOut");function xD(r){if(r!=null){try{return xh.call(r)}catch{}try{return r+""}catch{}}return""}l(xD,"toSource");function Th(r,e){return r===e||r!==r&&e!==e}l(Th,"eq");var i0=tS(function(){return arguments}())?tS:function(r){return Xc(r)&&Qi.call(r,"callee")&&!T_.call(r,"callee")},n0=Array.isArray;function l0(r){return r!=null&&bS(r.length)&&!c0(r)}l(l0,"isArrayLike");function SD(r){return Xc(r)&&l0(r)}l(SD,"isArrayLikeObject");var vS=I_||ED;function c0(r){if(!Ki(r))return!1;var e=Mh(r);return e==oS||e==ZE||e==HE||e==$E}l(c0,"isFunction");function bS(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=iS}l(bS,"isLength");function Ki(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}l(Ki,"isObject");function Xc(r){return r!=null&&typeof r=="object"}l(Xc,"isObjectLike");function MD(r){if(!Xc(r)||Mh(r)!=aS)return!1;var e=dS(r);if(e===null)return!0;var t=Qi.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&xh.call(t)==M_}l(MD,"isPlainObject");var CS=Y7?v_(Y7):eD;function PD(r){return lD(r,xS(r))}l(PD,"toPlainObject");var TD=fS(function(r){return r.push(void 0,mS),uS(wD,void 0,r)});function xS(r){return l0(r)?$_(r,!0):tD(r)}l(xS,"keysIn");var wD=cD(function(r,e,t,i){a0(r,e,t,i)});function ID(r){return function(){return r}}l(ID,"constant");function SS(r){return r}l(SS,"identity");function ED(){return!1}l(ED,"stubFalse");As.exports=TD});var b6=N((IQ,ru)=>{"use strict";m();var QD=!1,na=!1,d6=!0,h6=!1,h={},f6=!1;typeof ru<"u"&&ru.exports?(ru.exports=h,f6=!0):typeof document<"u"?window.ClipperLib=h:self.ClipperLib=h;var jh;f6?(tt="chrome",jh="Netscape"):(tt=navigator.userAgent.toString().toLowerCase(),jh=navigator.appName);var tt,pe={};tt.indexOf("chrome")!=-1&&tt.indexOf("chromium")==-1?pe.chrome=1:pe.chrome=0;tt.indexOf("chromium")!=-1?pe.chromium=1:pe.chromium=0;tt.indexOf("safari")!=-1&&tt.indexOf("chrome")==-1&&tt.indexOf("chromium")==-1?pe.safari=1:pe.safari=0;tt.indexOf("firefox")!=-1?pe.firefox=1:pe.firefox=0;tt.indexOf("firefox/17")!=-1?pe.firefox17=1:pe.firefox17=0;tt.indexOf("firefox/15")!=-1?pe.firefox15=1:pe.firefox15=0;tt.indexOf("firefox/3")!=-1?pe.firefox3=1:pe.firefox3=0;tt.indexOf("opera")!=-1?pe.opera=1:pe.opera=0;tt.indexOf("msie 10")!=-1?pe.msie10=1:pe.msie10=0;tt.indexOf("msie 9")!=-1?pe.msie9=1:pe.msie9=0;tt.indexOf("msie 8")!=-1?pe.msie8=1:pe.msie8=0;tt.indexOf("msie 7")!=-1?pe.msie7=1:pe.msie7=0;tt.indexOf("msie ")!=-1?pe.msie=1:pe.msie=0;h.biginteger_used=null;var Zn,eO=0xdeadbeefcafe,u6=(eO&16777215)==15715070;function F(r,e,t){h.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof e>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}l(F,"BigInteger");function fe(){return new F(null)}l(fe,"nbi");function tO(r,e,t,i,n,o){for(;--o>=0;){var a=e*this[r++]+t[i]+n;n=Math.floor(a/67108864),t[i++]=a&67108863}return n}l(tO,"am1");function rO(r,e,t,i,n,o){for(var a=e&32767,u=e>>15;--o>=0;){var c=this[r]&32767,p=this[r++]>>15,f=u*c+p*a;c=a*c+((f&32767)<<15)+t[i]+(n&1073741823),n=(c>>>30)+(f>>>15)+u*p+(n>>>30),t[i++]=c&1073741823}return n}l(rO,"am2");function iO(r,e,t,i,n,o){for(var a=e&16383,u=e>>14;--o>=0;){var c=this[r]&16383,p=this[r++]>>14,f=u*c+p*a;c=a*c+((f&16383)<<14)+t[i]+n,n=(c>>28)+(f>>14)+u*p,t[i++]=c&268435455}return n}l(iO,"am3");u6&&jh=="Microsoft Internet Explorer"?(F.prototype.am=rO,Zn=30):u6&&jh!="Netscape"?(F.prototype.am=tO,Zn=26):(F.prototype.am=iO,Zn=28);F.prototype.DB=Zn;F.prototype.DM=(1<<Zn)-1;F.prototype.DV=1<<Zn;var G0=52;F.prototype.FV=Math.pow(2,G0);F.prototype.F1=G0-Zn;F.prototype.F2=2*Zn-G0;var nO="0123456789abcdefghijklmnopqrstuvwxyz",Uh=new Array,Gs,fr;Gs=48;for(fr=0;fr<=9;++fr)Uh[Gs++]=fr;Gs=97;for(fr=10;fr<36;++fr)Uh[Gs++]=fr;Gs=65;for(fr=10;fr<36;++fr)Uh[Gs++]=fr;function p6(r){return nO.charAt(r)}l(p6,"int2char");function m6(r,e){var t=Uh[r.charCodeAt(e)];return t==null?-1:t}l(m6,"intAt");function oO(r){for(var e=this.t-1;e>=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s}l(oO,"bnpCopyTo");function aO(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}l(aO,"bnpFromInt");function Xn(r){var e=fe();return e.fromInt(r),e}l(Xn,"nbv");function sO(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var i=r.length,n=!1,o=0;--i>=0;){var a=t==8?r[i]&255:m6(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+t>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+=t,o>=this.DB&&(o-=this.DB)}t==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)}l(sO,"bnpFromString");function lO(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}l(lO,"bnpClamp");function cO(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,i,n=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(i=this[a]>>u)>0&&(n=!0,o=p6(i));a>=0;)u<e?(i=(this[a]&(1<<u)-1)<<e-u,i|=this[--a]>>(u+=this.DB-e)):(i=this[a]>>(u-=e)&t,u<=0&&(u+=this.DB,--a)),i>0&&(n=!0),n&&(o+=p6(i));return n?o:"0"}l(cO,"bnToString");function uO(){var r=fe();return F.ZERO.subTo(this,r),r}l(uO,"bnNegate");function pO(){return this.s<0?this.negate():this}l(pO,"bnAbs");function dO(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0}l(dO,"bnCompareTo");function Wh(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}l(Wh,"nbits");function hO(){return this.t<=0?0:this.DB*(this.t-1)+Wh(this[this.t-1]^this.s&this.DM)}l(hO,"bnBitLength");function fO(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s}l(fO,"bnpDLShiftTo");function mO(r,e){for(var t=r;t<this.t;++t)e[t-r]=this[t];e.t=Math.max(this.t-r,0),e.s=this.s}l(mO,"bnpDRShiftTo");function yO(r,e){var t=r%this.DB,i=this.DB-t,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<t&this.DM,u;for(u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>i|a,a=(this[u]&n)<<t;for(u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}l(yO,"bnpLShiftTo");function gO(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var i=r%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[t]>>i;for(var a=t+1;a<this.t;++a)e[a-t-1]|=(this[a]&o)<<n,e[a-t]=this[a]>>i;i>0&&(e[this.t-t-1]|=(this.s&o)<<n),e.t=this.t-t,e.clamp()}l(gO,"bnpRShiftTo");function vO(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]-r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i-=r[t],e[t++]=i&this.DM,i>>=this.DB;i-=r.s}e.s=i<0?-1:0,i<-1?e[t++]=this.DV+i:i>0&&(e[t++]=i),e.t=t,e.clamp()}l(vO,"bnpSubTo");function bO(r,e){var t=this.abs(),i=r.abs(),n=t.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+t.t]=t.am(0,i[n],e,n,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&F.ZERO.subTo(e,e)}l(bO,"bnpMultiplyTo");function CO(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r[t]=0;for(t=0;t<e.t-1;++t){var i=e.am(t,e[t],r,2*t,0,1);(r[t+e.t]+=e.am(t+1,2*e[t],r,2*t+1,i,e.t-t-1))>=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()}l(CO,"bnpSquareTo");function xO(r,e,t){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){e!=null&&e.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=fe());var o=fe(),a=this.s,u=r.s,c=this.DB-Wh(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,t)):(i.copyTo(o),n.copyTo(t));var p=o.t,f=o[p-1];if(f!=0){var y=f*(1<<this.F1)+(p>1?o[p-2]>>this.F2:0),g=this.FV/y,v=(1<<this.F1)/y,x=1<<this.F2,P=t.t,b=P-p,S=e==null?fe():e;for(o.dlShiftTo(b,S),t.compareTo(S)>=0&&(t[t.t++]=1,t.subTo(S,t)),F.ONE.dlShiftTo(p,S),S.subTo(o,o);o.t<p;)o[o.t++]=0;for(;--b>=0;){var E=t[--P]==f?this.DM:Math.floor(t[P]*g+(t[P-1]+x)*v);if((t[P]+=o.am(0,E,t,b,0,p))<E)for(o.dlShiftTo(b,S),t.subTo(S,t);t[P]<--E;)t.subTo(S,t)}e!=null&&(t.drShiftTo(p,e),a!=u&&F.ZERO.subTo(e,e)),t.t=p,t.clamp(),c>0&&t.rShiftTo(c,t),a<0&&F.ZERO.subTo(t,t)}}}l(xO,"bnpDivRemTo");function SO(r){var e=fe();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(F.ZERO)>0&&r.subTo(e,e),e}l(SO,"bnMod");function oa(r){this.m=r}l(oa,"Classic");function MO(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}l(MO,"cConvert");function PO(r){return r}l(PO,"cRevert");function TO(r){r.divRemTo(this.m,null,r)}l(TO,"cReduce");function wO(r,e,t){r.multiplyTo(e,t),this.reduce(t)}l(wO,"cMulTo");function IO(r,e){r.squareTo(e),this.reduce(e)}l(IO,"cSqrTo");oa.prototype.convert=MO;oa.prototype.revert=PO;oa.prototype.reduce=TO;oa.prototype.mulTo=wO;oa.prototype.sqrTo=IO;function EO(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}l(EO,"bnpInvDigit");function aa(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}l(aa,"Montgomery");function _O(r){var e=fe();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(F.ZERO)>0&&this.m.subTo(e,e),e}l(_O,"montConvert");function DO(r){var e=fe();return r.copyTo(e),this.reduce(e),e}l(DO,"montRevert");function OO(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r[e]&32767,i=t*this.mpl+((t*this.mph+(r[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,i,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}l(OO,"montReduce");function LO(r,e){r.squareTo(e),this.reduce(e)}l(LO,"montSqrTo");function AO(r,e,t){r.multiplyTo(e,t),this.reduce(t)}l(AO,"montMulTo");aa.prototype.convert=_O;aa.prototype.revert=DO;aa.prototype.reduce=OO;aa.prototype.mulTo=AO;aa.prototype.sqrTo=LO;function kO(){return(this.t>0?this[0]&1:this.s)==0}l(kO,"bnpIsEven");function FO(r,e){if(r>4294967295||r<1)return F.ONE;var t=fe(),i=fe(),n=e.convert(this),o=Wh(r)-1;for(n.copyTo(t);--o>=0;)if(e.sqrTo(t,i),(r&1<<o)>0)e.mulTo(i,n,t);else{var a=t;t=i,i=a}return e.revert(t)}l(FO,"bnpExp");function BO(r,e){var t;return r<256||e.isEven()?t=new oa(e):t=new aa(e),this.exp(r,t)}l(BO,"bnModPowInt");F.prototype.copyTo=oO;F.prototype.fromInt=aO;F.prototype.fromString=sO;F.prototype.clamp=lO;F.prototype.dlShiftTo=fO;F.prototype.drShiftTo=mO;F.prototype.lShiftTo=yO;F.prototype.rShiftTo=gO;F.prototype.subTo=vO;F.prototype.multiplyTo=bO;F.prototype.squareTo=CO;F.prototype.divRemTo=xO;F.prototype.invDigit=EO;F.prototype.isEven=kO;F.prototype.exp=FO;F.prototype.toString=cO;F.prototype.negate=uO;F.prototype.abs=pO;F.prototype.compareTo=dO;F.prototype.bitLength=hO;F.prototype.mod=SO;F.prototype.modPowInt=BO;F.ZERO=Xn(0);F.ONE=Xn(1);function RO(){var r=fe();return this.copyTo(r),r}l(RO,"bnClone");function NO(){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]}l(NO,"bnIntValue");function GO(){return this.t==0?this.s:this[0]<<24>>24}l(GO,"bnByteValue");function VO(){return this.t==0?this.s:this[0]<<16>>16}l(VO,"bnShortValue");function jO(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}l(jO,"bnpChunkSize");function HO(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}l(HO,"bnSigNum");function UO(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),i=Xn(t),n=fe(),o=fe(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(t+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}l(UO,"bnpToRadix");function WO(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),i=Math.pow(e,t),n=!1,o=0,a=0,u=0;u<r.length;++u){var c=m6(r,u);if(c<0){r.charAt(u)=="-"&&this.signum()==0&&(n=!0);continue}a=e*a+c,++o>=t&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),n&&F.ZERO.subTo(this,this)}l(WO,"bnpFromRadix");function XO(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(F.ONE.shiftLeft(r-1),V0,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)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,e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}l(XO,"bnpFromNumber");function ZO(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(t<this.DB&&(i=this[r]>>t)!=(this.s&this.DM)>>t&&(e[n++]=i|this.s<<this.DB-t);r>=0;)t<8?(i=(this[r]&(1<<t)-1)<<8-t,i|=this[--r]>>(t+=this.DB-8)):(i=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}l(ZO,"bnToByteArray");function zO(r){return this.compareTo(r)==0}l(zO,"bnEquals");function YO(r){return this.compareTo(r)<0?this:r}l(YO,"bnMin");function qO(r){return this.compareTo(r)>0?this:r}l(qO,"bnMax");function $O(r,e,t){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)t[i]=e(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)t[i]=e(this[i],n);t.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)t[i]=e(n,r[i]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}l($O,"bnpBitwiseTo");function JO(r,e){return r&e}l(JO,"op_and");function KO(r){var e=fe();return this.bitwiseTo(r,JO,e),e}l(KO,"bnAnd");function V0(r,e){return r|e}l(V0,"op_or");function QO(r){var e=fe();return this.bitwiseTo(r,V0,e),e}l(QO,"bnOr");function y6(r,e){return r^e}l(y6,"op_xor");function eL(r){var e=fe();return this.bitwiseTo(r,y6,e),e}l(eL,"bnXor");function g6(r,e){return r&~e}l(g6,"op_andnot");function tL(r){var e=fe();return this.bitwiseTo(r,g6,e),e}l(tL,"bnAndNot");function rL(){for(var r=fe(),e=0;e<this.t;++e)r[e]=this.DM&~this[e];return r.t=this.t,r.s=~this.s,r}l(rL,"bnNot");function iL(r){var e=fe();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}l(iL,"bnShiftLeft");function nL(r){var e=fe();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}l(nL,"bnShiftRight");function oL(r){if(r==0)return-1;var e=0;return r&65535||(r>>=16,e+=16),r&255||(r>>=8,e+=8),r&15||(r>>=4,e+=4),r&3||(r>>=2,e+=2),r&1||++e,e}l(oL,"lbit");function aL(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+oL(this[r]);return this.s<0?this.t*this.DB:-1}l(aL,"bnGetLowestSetBit");function sL(r){for(var e=0;r!=0;)r&=r-1,++e;return e}l(sL,"cbit");function lL(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=sL(this[t]^e);return r}l(lL,"bnBitCount");function cL(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<r%this.DB)!=0}l(cL,"bnTestBit");function uL(r,e){var t=F.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}l(uL,"bnpChangeBit");function pL(r){return this.changeBit(r,V0)}l(pL,"bnSetBit");function dL(r){return this.changeBit(r,g6)}l(dL,"bnClearBit");function hL(r){return this.changeBit(r,y6)}l(hL,"bnFlipBit");function fL(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]+r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i+=r[t],e[t++]=i&this.DM,i>>=this.DB;i+=r.s}e.s=i<0?-1:0,i>0?e[t++]=i:i<-1&&(e[t++]=this.DV+i),e.t=t,e.clamp()}l(fL,"bnpAddTo");function mL(r){var e=fe();return this.addTo(r,e),e}l(mL,"bnAdd");function yL(r){var e=fe();return this.subTo(r,e),e}l(yL,"bnSubtract");function gL(r){var e=fe();return this.multiplyTo(r,e),e}l(gL,"bnMultiply");function vL(){var r=fe();return this.squareTo(r),r}l(vL,"bnSquare");function bL(r){var e=fe();return this.divRemTo(r,e,null),e}l(bL,"bnDivide");function CL(r){var e=fe();return this.divRemTo(r,null,e),e}l(CL,"bnRemainder");function xL(r){var e=fe(),t=fe();return this.divRemTo(r,e,t),new Array(e,t)}l(xL,"bnDivideAndRemainder");function SL(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}l(SL,"bnpDMultiply");function ML(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}l(ML,"bnpDAddOffset");function iu(){}l(iu,"NullExp");function v6(r){return r}l(v6,"nNop");function PL(r,e,t){r.multiplyTo(e,t)}l(PL,"nMulTo");function TL(r,e){r.squareTo(e)}l(TL,"nSqrTo");iu.prototype.convert=v6;iu.prototype.revert=v6;iu.prototype.mulTo=PL;iu.prototype.sqrTo=TL;function wL(r){return this.exp(r,new iu)}l(wL,"bnPow");function IL(r,e,t){var i=Math.min(this.t+r.t,e);for(t.s=0,t.t=i;i>0;)t[--i]=0;var n;for(n=t.t-this.t;i<n;++i)t[i+this.t]=this.am(0,r[i],t,i,0,this.t);for(n=Math.min(r.t,e);i<n;++i)this.am(0,r[i],t,i,0,e-i);t.clamp()}l(IL,"bnpMultiplyLowerTo");function EL(r,e,t){--e;var i=t.t=this.t+r.t-e;for(t.s=0;--i>=0;)t[i]=0;for(i=Math.max(e-this.t,0);i<r.t;++i)t[this.t+i-e]=this.am(e-i,r[i],t,0,0,this.t+i-e);t.clamp(),t.drShiftTo(1,t)}l(EL,"bnpMultiplyUpperTo");function Vs(r){this.r2=fe(),this.q3=fe(),F.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}l(Vs,"Barrett");function _L(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 e=fe();return r.copyTo(e),this.reduce(e),e}l(_L,"barrettConvert");function DL(r){return r}l(DL,"barrettRevert");function OL(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)}l(OL,"barrettReduce");function LL(r,e){r.squareTo(e),this.reduce(e)}l(LL,"barrettSqrTo");function AL(r,e,t){r.multiplyTo(e,t),this.reduce(t)}l(AL,"barrettMulTo");Vs.prototype.convert=_L;Vs.prototype.revert=DL;Vs.prototype.reduce=OL;Vs.prototype.mulTo=AL;Vs.prototype.sqrTo=LL;function kL(r,e){var t=r.bitLength(),i,n=Xn(1),o;if(t<=0)return n;t<18?i=1:t<48?i=3:t<144?i=4:t<768?i=5:i=6,t<8?o=new oa(e):e.isEven()?o=new Vs(e):o=new aa(e);var a=new Array,u=3,c=i-1,p=(1<<i)-1;if(a[1]=o.convert(this),i>1){var f=fe();for(o.sqrTo(a[1],f);u<=p;)a[u]=fe(),o.mulTo(f,a[u-2],a[u]),u+=2}var y=r.t-1,g,v=!0,x=fe(),P;for(t=Wh(r[y])-1;y>=0;){for(t>=c?g=r[y]>>t-c&p:(g=(r[y]&(1<<t+1)-1)<<c-t,y>0&&(g|=r[y-1]>>this.DB+t-c)),u=i;!(g&1);)g>>=1,--u;if((t-=u)<0&&(t+=this.DB,--y),v)a[g].copyTo(n),v=!1;else{for(;u>1;)o.sqrTo(n,x),o.sqrTo(x,n),u-=2;u>0?o.sqrTo(n,x):(P=n,n=x,x=P),o.mulTo(x,a[g],n)}for(;y>=0&&!(r[y]&1<<t);)o.sqrTo(n,x),P=n,n=x,x=P,--t<0&&(t=this.DB-1,--y)}return o.revert(n)}l(kL,"bnModPow");function FL(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var i=e;e=t,t=i}var n=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t}l(FL,"bnGCD");function BL(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this[0]%r;else for(var i=this.t-1;i>=0;--i)t=(e*t+this[i])%r;return t}l(BL,"bnpModInt");function RL(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return F.ZERO;for(var t=r.clone(),i=this.clone(),n=Xn(1),o=Xn(0),a=Xn(0),u=Xn(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!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),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(r,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(r,u),u.rShiftTo(1,u);t.compareTo(i)>=0?(t.subTo(i,t),e&&n.subTo(a,n),o.subTo(u,o)):(i.subTo(t,i),e&&a.subTo(n,a),u.subTo(o,u))}if(i.compareTo(F.ONE)!=0)return F.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u}l(RL,"bnModInverse");var Mt=[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],NL=(1<<26)/Mt[Mt.length-1];function GL(r){var e,t=this.abs();if(t.t==1&&t[0]<=Mt[Mt.length-1]){for(e=0;e<Mt.length;++e)if(t[0]==Mt[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Mt.length;){for(var i=Mt[e],n=e+1;n<Mt.length&&i<NL;)i*=Mt[n++];for(i=t.modInt(i);e<n;)if(i%Mt[e++]==0)return!1}return t.millerRabin(r)}l(GL,"bnIsProbablePrime");function VL(r){var e=this.subtract(F.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var i=e.shiftRight(t);r=r+1>>1,r>Mt.length&&(r=Mt.length);for(var n=fe(),o=0;o<r;++o){n.fromInt(Mt[Math.floor(Math.random()*Mt.length)]);var a=n.modPow(i,this);if(a.compareTo(F.ONE)!=0&&a.compareTo(e)!=0){for(var u=1;u++<t&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(F.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0}l(VL,"bnpMillerRabin");F.prototype.chunkSize=jO;F.prototype.toRadix=UO;F.prototype.fromRadix=WO;F.prototype.fromNumber=XO;F.prototype.bitwiseTo=$O;F.prototype.changeBit=uL;F.prototype.addTo=fL;F.prototype.dMultiply=SL;F.prototype.dAddOffset=ML;F.prototype.multiplyLowerTo=IL;F.prototype.multiplyUpperTo=EL;F.prototype.modInt=BL;F.prototype.millerRabin=VL;F.prototype.clone=RO;F.prototype.intValue=NO;F.prototype.byteValue=GO;F.prototype.shortValue=VO;F.prototype.signum=HO;F.prototype.toByteArray=ZO;F.prototype.equals=zO;F.prototype.min=YO;F.prototype.max=qO;F.prototype.and=KO;F.prototype.or=QO;F.prototype.xor=eL;F.prototype.andNot=tL;F.prototype.not=rL;F.prototype.shiftLeft=iL;F.prototype.shiftRight=nL;F.prototype.getLowestSetBit=aL;F.prototype.bitCount=lL;F.prototype.testBit=cL;F.prototype.setBit=pL;F.prototype.clearBit=dL;F.prototype.flipBit=hL;F.prototype.add=mL;F.prototype.subtract=yL;F.prototype.multiply=gL;F.prototype.divide=bL;F.prototype.remainder=CL;F.prototype.divideAndRemainder=xL;F.prototype.modPow=kL;F.prototype.modInverse=RL;F.prototype.pow=wL;F.prototype.gcd=FL;F.prototype.isProbablePrime=GL;F.prototype.square=vL;var le=F;le.prototype.IsNegative=function(){return this.compareTo(le.ZERO)==-1};le.op_Equality=function(r,e){return r.compareTo(e)==0};le.op_Inequality=function(r,e){return r.compareTo(e)!=0};le.op_GreaterThan=function(r,e){return r.compareTo(e)>0};le.op_LessThan=function(r,e){return r.compareTo(e)<0};le.op_Addition=function(r,e){return new le(r).add(new le(e))};le.op_Subtraction=function(r,e){return new le(r).subtract(new le(e))};le.Int128Mul=function(r,e){return new le(r).multiply(new le(e))};le.op_Division=function(r,e){return r.divide(e)};le.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Hh>"u"&&(Hh=l(function(r,e){var t;if(typeof Object.getOwnPropertyNames>"u"){for(t in e.prototype)(typeof r.prototype[t]>"u"||r.prototype[t]==Object.prototype[t])&&(r.prototype[t]=e.prototype[t]);for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}else{for(var i=Object.getOwnPropertyNames(e.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(e.prototype,i[n]));for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}},"Inherit"));var Hh;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,e){this.X=r,this.Y=e};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,e=this.m_Parent;e!==null;)r=!r,e=e.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 e=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=e};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,e=this.m_AllPolys.length;r<e;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};Hh(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,e){return Math.max(r,e)};pe.msie||pe.opera||pe.safari?h.Cast_Int32=function(r){return r|0}:h.Cast_Int32=function(r){return~~r};pe.chrome?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:pe.firefox&&typeof Number.toInteger=="function"?h.Cast_Int64=function(r){return Number.toInteger(r)}:pe.msie7||pe.msie8?h.Cast_Int64=function(r){return parseInt(r,10)}:pe.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,e=r.length;if(this.X=0,this.Y=0,na)if(this.Z=0,e==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(e==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(e==1)if(r[0]instanceof h.DoublePoint){var t=r[0];this.X=h.Clipper.Round(t.X),this.Y=h.Clipper.Round(t.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(e==2)this.X=r[0],this.Y=r[1];else if(e==1)if(r[0]instanceof h.DoublePoint){var t=r[0];this.X=h.Clipper.Round(t.X),this.Y=h.Clipper.Round(t.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,e){return r.X==e.X&&r.Y==e.Y};h.IntPoint.op_Inequality=function(r,e){return r.X!=e.X||r.Y!=e.Y};na?(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,e){this.X=r,this.Y=e,this.Z=0},h.IntPoint3=function(r,e,t){this.X=r,this.Y=e,this.Z=t}):(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,e){this.X=r,this.Y=e});h.IntRect=function(){var r=arguments,e=r.length;e==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):e==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,e,t,i){this.left=r,this.top=e,this.right=t,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};h6&&(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,e){return e.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;QD?(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,e){var t=e;do{if(h.IntPoint.op_Equality(t.Pt,r))return!0;t=t.Next}while(t!=e);return!1};h.ClipperBase.prototype.PointOnLineSegment=function(r,e,t,i){return i?r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&le.op_Equality(le.Int128Mul(r.X-e.X,t.Y-e.Y),le.Int128Mul(t.X-e.X,r.Y-e.Y)):r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&(r.X-e.X)*(t.Y-e.Y)==(t.X-e.X)*(r.Y-e.Y)};h.ClipperBase.prototype.PointOnPolygon=function(r,e,t){for(var i=e;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,t))return!0;if(i=i.Next,i==e)break}return!1};h.ClipperBase.prototype.SlopesEqual=h.ClipperBase.SlopesEqual=function(){var r=arguments,e=r.length,t,i,n,o,a,u,c;return e==3?(t=r[0],i=r[1],c=r[2],c?le.op_Equality(le.Int128Mul(t.Delta.Y,i.Delta.X),le.Int128Mul(t.Delta.X,i.Delta.Y)):h.Cast_Int64(t.Delta.Y*i.Delta.X)==h.Cast_Int64(t.Delta.X*i.Delta.Y)):e==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],u=r[3],c=r[4],c?le.op_Equality(le.Int128Mul(n.Y-o.Y,a.X-u.X),le.Int128Mul(n.X-o.X,a.Y-u.Y)):h.Cast_Int64((n.Y-o.Y)*(a.X-u.X))-h.Cast_Int64((n.X-o.X)*(a.Y-u.Y))===0)};h.ClipperBase.SlopesEqual3=function(r,e,t){return t?le.op_Equality(le.Int128Mul(r.Delta.Y,e.Delta.X),le.Int128Mul(r.Delta.X,e.Delta.Y)):h.Cast_Int64(r.Delta.Y*e.Delta.X)==h.Cast_Int64(r.Delta.X*e.Delta.Y)};h.ClipperBase.SlopesEqual4=function(r,e,t,i){return i?le.op_Equality(le.Int128Mul(r.Y-e.Y,e.X-t.X),le.Int128Mul(r.X-e.X,e.Y-t.Y)):h.Cast_Int64((r.Y-e.Y)*(e.X-t.X))-h.Cast_Int64((r.X-e.X)*(e.Y-t.Y))===0};h.ClipperBase.SlopesEqual5=function(r,e,t,i,n){return n?le.op_Equality(le.Int128Mul(r.Y-e.Y,t.X-i.X),le.Int128Mul(r.X-e.X,t.Y-i.Y)):h.Cast_Int64((r.Y-e.Y)*(t.X-i.X))-h.Cast_Int64((r.X-e.X)*(t.Y-i.Y))===0};h.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,e=this.m_edges.length;r<e;++r){for(var t=0,i=this.m_edges[r].length;t<i;++t)this.m_edges[r][t]=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,e){e.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)&&(e.Value=!0,this.RangeTest(r,e))};h.ClipperBase.prototype.InitEdge=function(r,e,t,i){r.Next=e,r.Prev=t,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};h.ClipperBase.prototype.InitEdge2=function(r,e){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=e};h.ClipperBase.prototype.FindNextLocMin=function(r){for(var e;;){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(e=r;r.Dx==h.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){e.Prev.Bot.X<r.Bot.X&&(r=e);break}}return r};h.ClipperBase.prototype.ProcessBound=function(r,e){var t=r,i=r,n,o;if(r.Dx==h.ClipperBase.horizontal&&(e?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=h.ClipperBase.Skip)if(e){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?e||(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!=t&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==h.ClipperBase.horizontal&&r!=t&&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?e||(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!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==h.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==h.ClipperBase.Skip){if(r=i,e){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)e?i=r.Next:i=r.Prev;else{e?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,e),this.InsertLocalMinima(a)}}return i};h.ClipperBase.prototype.AddPath=function(r,e,t){d6?!t&&e==h.PolyType.ptClip&&h.Error("AddPath: Open paths must be subject."):t||h.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(t)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(t&&i<2||!t&&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 u={Value:this.m_UseFullRange};this.RangeTest(r[0],u),this.m_UseFullRange=u.Value,u.Value=this.m_UseFullRange,this.RangeTest(r[i],u),this.m_UseFullRange=u.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)u.Value=this.m_UseFullRange,this.RangeTest(r[o],u),this.m_UseFullRange=u.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var c=n[0],p=c,f=c;;){if(h.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==c&&(c=p.Next),p=this.RemoveEdge(p),f=p;continue}if(p.Prev==p.Next)break;if(t&&h.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==c&&(c=p.Next),p=this.RemoveEdge(p),p=p.Prev,f=p;continue}if(p=p.Next,p==f)break}if(!t&&p==p.Next||t&&p.Prev==p.Next)return!1;t||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=h.ClipperBase.Skip);var y=c;p=c;do this.InitEdge2(p,e),p=p.Next,a&&p.Curr.Y!=c.Curr.Y&&(a=!1);while(p!=c);if(a){if(t)return!1;p.Prev.OutIdx=h.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new h.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=h.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=h.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(g),this.m_edges.push(n),!0}this.m_edges.push(n);for(var v,x=null;p=this.FindNextLocMin(p),p!=x;){x==null&&(x=p);var g=new h.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,v=!1):(g.LeftBound=p,g.RightBound=p.Prev,v=!0),g.LeftBound.Side=h.EdgeSide.esLeft,g.RightBound.Side=h.EdgeSide.esRight,t?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,p=this.ProcessBound(g.LeftBound,v);var P=this.ProcessBound(g.RightBound,!v);g.LeftBound.OutIdx==h.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==h.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),v||(p=P)}return!0};h.ClipperBase.prototype.AddPaths=function(r,e,t){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],e,t)&&(i=!0);return i};h.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,e,t){return h.IntPoint.op_Equality(r,t)||h.IntPoint.op_Equality(r,e)||h.IntPoint.op_Equality(t,e)?!1:r.X!=t.X?e.X>r.X==e.X<t.X:e.Y>r.Y==e.Y<t.Y};h.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var e=r.Next;return r.Prev=null,e};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 e=this.m_MinimaList;e.Next!==null&&r.Y<e.Next.Y;)e=e.Next;r.Next=e.Next,e.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 e=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=e,na&&(e=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=e)};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 e=r.LeftBound;e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=h.EdgeSide.esLeft,e.OutIdx=h.ClipperBase.Unassigned),e=r.RightBound,e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=h.EdgeSide.esRight,e.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,na&&(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 e=new h.Scanbeam;e.Y=r,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(var t=this.m_Scanbeam;t.Next!==null&&r<=t.Next.Y;)t=t.Next;if(r==t.Y)return;var e=new h.Scanbeam;e.Y=r,e.Next=t.Next,t.Next=e}};h.Clipper.prototype.Execute=function(){var r=arguments,e=r.length,t=r[1]instanceof h.PolyTree;if(e==4&&!t){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 u=this.ExecuteInternal();u&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(e==4&&t){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 u=this.ExecuteInternal();u&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(e==2&&!t){var i=r[0],n=r[1];return this.Execute(i,n,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}else if(e==2&&t){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 e=r.FirstLeft;e!==null&&(e.IsHole==r.IsHole||e.Pts===null);)e=e.FirstLeft;r.FirstLeft=e}};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 e=this.PopScanbeam();if(!this.ProcessIntersections(r,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),r=e}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];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,e=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,e=null,r};h.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,e=this.m_PolyOuts.length;r<e;++r)this.DisposeOutRec(r);h.Clear(this.m_PolyOuts)};h.Clipper.prototype.DisposeOutRec=function(r){var e=this.m_PolyOuts[r];e.Pts!==null&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[r]=null};h.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var e=null;for(r.Prev.Next=null;r!==null;)e=r,r=r.Next,e=null}};h.Clipper.prototype.AddJoin=function(r,e,t){var i=new h.Join;i.OutPt1=r,i.OutPt2=e,i.OffPt.X=t.X,i.OffPt.Y=t.Y,this.m_Joins.push(i)};h.Clipper.prototype.AddGhostJoin=function(r,e){var t=new h.Join;t.OutPt1=r,t.OffPt.X=e.X,t.OffPt.Y=e.Y,this.m_GhostJoins.push(t)};na&&(h.Clipper.prototype.SetZ=function(r,e){r.Z=0,this.ZFillFunction!==null&&(e.OutIdx<0?this.ZFillFunction(e.Bot,e.Top,r):this.ZFillFunction(e.Top,e.Bot,r))});h.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var e=this.m_CurrentLM.LeftBound,t=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(e===null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot))):t==null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(t,e),this.SetWindingCount(e),t.WindCnt=e.WindCnt,t.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(i=this.AddLocalMinPoly(e,t,e.Bot)),this.InsertScanbeam(e.Top.Y)),t!=null&&(h.ClipperBase.IsHorizontal(t)?this.AddEdgeToSEL(t):this.InsertScanbeam(t.Top.Y)),!(e==null||t==null)){if(i!==null&&h.ClipperBase.IsHorizontal(t)&&this.m_GhostJoins.length>0&&t.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,t.Bot,t.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X==e.Bot.X&&e.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,u,e.Top)}if(e.NextInAEL!=t){if(t.OutIdx>=0&&t.PrevInAEL.OutIdx>=0&&h.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,u,t.Top)}var c=e.NextInAEL;if(c!==null)for(;c!=t;)this.IntersectEdges(t,c,e.Curr,!1),c=c.NextInAEL}}}};h.Clipper.prototype.InsertEdgeIntoAEL=function(r,e){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(e===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(e===null&&(e=this.m_ActiveEdges);e.NextInAEL!==null&&!this.E2InsertsBeforeE1(e.NextInAEL,r);)e=e.NextInAEL;r.NextInAEL=e.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=r),r.PrevInAEL=e,e.NextInAEL=r}};h.Clipper.prototype.E2InsertsBeforeE1=function(r,e){return e.Curr.X==r.Curr.X?e.Top.Y>r.Top.Y?e.Top.X<h.Clipper.TopX(r,e.Top.Y):r.Top.X>h.Clipper.TopX(e,r.Top.Y):e.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 e,t;switch(r.PolyTyp==h.PolyType.ptSubject?(e=this.m_SubjFillType,t=this.m_ClipFillType):(e=this.m_ClipFillType,t=this.m_SubjFillType),e){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(t){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(t){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(t){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(t){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(t){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 e=r.PrevInAEL;e!==null&&(e.PolyTyp!=r.PolyTyp||e.WindDelta===0);)e=e.PrevInAEL;if(e===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,e=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=h.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var t=!0,i=e.PrevInAEL;i!==null;)i.PolyTyp==e.PolyTyp&&i.WindDelta!==0&&(t=!t),i=i.PrevInAEL;r.WindCnt=t?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;e!=r;)e.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),e=e.NextInAEL;else for(;e!=r;)r.WindCnt2+=e.WindDelta,e=e.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,e){if(!(r.NextInAEL==r.PrevInAEL||e.NextInAEL==e.PrevInAEL)){if(r.NextInAEL==e){var t=e.NextInAEL;t!==null&&(t.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=e),e.PrevInAEL=i,e.NextInAEL=r,r.PrevInAEL=e,r.NextInAEL=t}else if(e.NextInAEL==r){var t=r.NextInAEL;t!==null&&(t.PrevInAEL=e);var i=e.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=e,e.PrevInAEL=r,e.NextInAEL=t}else{var t=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=e.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=e.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),e.NextInAEL=t,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=i,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e)}r.PrevInAEL===null?this.m_ActiveEdges=r:e.PrevInAEL===null&&(this.m_ActiveEdges=e)}};h.Clipper.prototype.SwapPositionsInSEL=function(r,e){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(e.NextInSEL===null&&e.PrevInSEL===null)){if(r.NextInSEL==e){var t=e.NextInSEL;t!==null&&(t.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=e),e.PrevInSEL=i,e.NextInSEL=r,r.PrevInSEL=e,r.NextInSEL=t}else if(e.NextInSEL==r){var t=r.NextInSEL;t!==null&&(t.PrevInSEL=e);var i=e.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=e,e.PrevInSEL=r,e.NextInSEL=t}else{var t=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=e.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=e.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),e.NextInSEL=t,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=i,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e)}r.PrevInSEL===null?this.m_SortedEdges=r:e.PrevInSEL===null&&(this.m_SortedEdges=e)}};h.Clipper.prototype.AddLocalMaxPoly=function(r,e,t){this.AddOutPt(r,t),e.WindDelta==0&&this.AddOutPt(e,t),r.OutIdx==e.OutIdx?(r.OutIdx=-1,e.OutIdx=-1):r.OutIdx<e.OutIdx?this.AppendPolygon(r,e):this.AppendPolygon(e,r)};h.Clipper.prototype.AddLocalMinPoly=function(r,e,t){var i,n,o;if(h.ClipperBase.IsHorizontal(e)||r.Dx>e.Dx?(i=this.AddOutPt(r,t),e.OutIdx=r.OutIdx,r.Side=h.EdgeSide.esLeft,e.Side=h.EdgeSide.esRight,n=r,n.PrevInAEL==e?o=e.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(e,t),r.OutIdx=e.OutIdx,r.Side=h.EdgeSide.esRight,e.Side=h.EdgeSide.esLeft,n=e,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&h.Clipper.TopX(o,t.Y)==h.Clipper.TopX(n,t.Y)&&h.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,t);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,e){var t=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=e.X,n.Pt.Y=e.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),na&&(h.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(e,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(t&&h.IntPoint.op_Equality(e,o.Pt))return o;if(!t&&h.IntPoint.op_Equality(e,o.Prev.Pt))return o.Prev;var n=new h.OutPt;return n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,t&&(i.Pts=n),na&&(h.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):h.IntPoint.op_Equality(e,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,e){var t=new h.IntPoint(r.Value);r.Value.X=e.Value.X,r.Value.Y=e.Value.Y,e.Value.X=t.X,e.Value.Y=t.Y};h.Clipper.prototype.HorzSegmentsOverlap=function(r,e,t,i){return r.X>t.X==r.X<i.X||e.X>t.X==e.X<i.X||t.X>r.X==t.X<e.X||i.X>r.X==i.X<e.X||r.X==t.X&&e.X==i.X?!0:r.X==i.X&&e.X==t.X};h.Clipper.prototype.InsertPolyPtBetween=function(r,e,t){var i=new h.OutPt;return i.Pt.X=t.X,i.Pt.Y=t.Y,e==r.Next?(r.Next=i,e.Prev=i,i.Next=e,i.Prev=r):(e.Next=i,r.Prev=i,i.Next=r,i.Prev=e),i};h.Clipper.prototype.SetHoleState=function(r,e){for(var t=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(t=!t,e.FirstLeft===null&&(e.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;t&&(e.IsHole=!0)};h.Clipper.prototype.GetDx=function(r,e){return r.Y==e.Y?h.ClipperBase.horizontal:(e.X-r.X)/(e.Y-r.Y)};h.Clipper.prototype.FirstIsBottomPt=function(r,e){for(var t=r.Prev;h.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Prev;var i=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=r.Next;h.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Next;var n=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=e.Prev;h.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Prev;var o=Math.abs(this.GetDx(e.Pt,t.Pt));for(t=e.Next;h.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Next;var a=Math.abs(this.GetDx(e.Pt,t.Pt));return i>=o&&i>=a||n>=o&&n>=a};h.Clipper.prototype.GetBottomPt=function(r){for(var e=null,t=r.Next;t!=r;)t.Pt.Y>r.Pt.Y?(r=t,e=null):t.Pt.Y==r.Pt.Y&&t.Pt.X<=r.Pt.X&&(t.Pt.X<r.Pt.X?(e=null,r=t):t.Next!=r&&t.Prev!=r&&(e=t)),t=t.Next;if(e!==null)for(;e!=t;)for(this.FirstIsBottomPt(t,e)||(r=e),e=e.Next;h.IntPoint.op_Inequality(e.Pt,r.Pt);)e=e.Next;return r};h.Clipper.prototype.GetLowermostRec=function(r,e){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts));var t=r.BottomPt,i=e.BottomPt;return t.Pt.Y>i.Pt.Y?r:t.Pt.Y<i.Pt.Y?e:t.Pt.X<i.Pt.X?r:t.Pt.X>i.Pt.X||t.Next==t?e:i.Next==i||this.FirstIsBottomPt(t,i)?r:e};h.Clipper.prototype.Param1RightOfParam2=function(r,e){do if(r=r.FirstLeft,r==e)return!0;while(r!==null);return!1};h.Clipper.prototype.GetOutRec=function(r){for(var e=this.m_PolyOuts[r];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e};h.Clipper.prototype.AppendPolygon=function(r,e){var t=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[e.OutIdx],n;this.Param1RightOfParam2(t,i)?n=i:this.Param1RightOfParam2(i,t)?n=t:n=this.GetLowermostRec(t,i);var o=t.Pts,a=o.Prev,u=i.Pts,c=u.Prev,p;r.Side==h.EdgeSide.esLeft?(e.Side==h.EdgeSide.esLeft?(this.ReversePolyPtLinks(u),u.Next=o,o.Prev=u,a.Next=c,c.Prev=a,t.Pts=c):(c.Next=o,o.Prev=c,u.Prev=a,a.Next=u,t.Pts=u),p=h.EdgeSide.esLeft):(e.Side==h.EdgeSide.esRight?(this.ReversePolyPtLinks(u),a.Next=c,c.Prev=a,u.Next=o,o.Prev=u):(a.Next=u,u.Prev=a,o.Prev=c,c.Next=o),p=h.EdgeSide.esRight),t.BottomPt=null,n==i&&(i.FirstLeft!=t&&(t.FirstLeft=i.FirstLeft),t.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=t;var f=r.OutIdx,y=e.OutIdx;r.OutIdx=-1,e.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=f,g.Side=p;break}g=g.NextInAEL}i.Idx=t.Idx};h.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var e,t;e=r;do t=e.Next,e.Next=e.Prev,e.Prev=t,e=t;while(e!=r)}};h.Clipper.SwapSides=function(r,e){var t=r.Side;r.Side=e.Side,e.Side=t};h.Clipper.SwapPolyIndexes=function(r,e){var t=r.OutIdx;r.OutIdx=e.OutIdx,e.OutIdx=t};h.Clipper.prototype.IntersectEdges=function(r,e,t,i){var n=!i&&r.NextInLML===null&&r.Top.X==t.X&&r.Top.Y==t.Y,o=!i&&e.NextInLML===null&&e.Top.X==t.X&&e.Top.Y==t.Y,a=r.OutIdx>=0,u=e.OutIdx>=0;if(d6&&(r.WindDelta===0||e.WindDelta===0)){r.WindDelta===0&&e.WindDelta===0?(n||o)&&a&&u&&this.AddLocalMaxPoly(r,e,t):r.PolyTyp==e.PolyTyp&&r.WindDelta!=e.WindDelta&&this.m_ClipType==h.ClipType.ctUnion?r.WindDelta===0?u&&(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(e,t),u&&(e.OutIdx=-1)):r.PolyTyp!=e.PolyTyp&&(r.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||e.WindCnt2===0)?(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):e.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(e,t),u&&(e.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):h.Error("Error intersecting polylines")),o&&(e.OutIdx<0?this.DeleteFromAEL(e):h.Error("Error intersecting polylines"));return}if(r.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(r)){var c=r.WindCnt;r.WindCnt=e.WindCnt,e.WindCnt=c}else r.WindCnt+e.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=e.WindDelta,e.WindCnt-r.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(e)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(r)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2-=r.WindDelta;var p,f,y,g;r.PolyTyp==h.PolyType.ptSubject?(p=this.m_SubjFillType,y=this.m_ClipFillType):(p=this.m_ClipFillType,y=this.m_SubjFillType),e.PolyTyp==h.PolyType.ptSubject?(f=this.m_SubjFillType,g=this.m_ClipFillType):(f=this.m_ClipFillType,g=this.m_SubjFillType);var v,x;switch(p){case h.PolyFillType.pftPositive:v=r.WindCnt;break;case h.PolyFillType.pftNegative:v=-r.WindCnt;break;default:v=Math.abs(r.WindCnt);break}switch(f){case h.PolyFillType.pftPositive:x=e.WindCnt;break;case h.PolyFillType.pftNegative:x=-e.WindCnt;break;default:x=Math.abs(e.WindCnt);break}if(a&&u)n||o||v!==0&&v!=1||x!==0&&x!=1||r.PolyTyp!=e.PolyTyp&&this.m_ClipType!=h.ClipType.ctXor?this.AddLocalMaxPoly(r,e,t):(this.AddOutPt(r,t),this.AddOutPt(e,t),h.Clipper.SwapSides(r,e),h.Clipper.SwapPolyIndexes(r,e));else if(a)(x===0||x==1)&&(this.AddOutPt(r,t),h.Clipper.SwapSides(r,e),h.Clipper.SwapPolyIndexes(r,e));else if(u)(v===0||v==1)&&(this.AddOutPt(e,t),h.Clipper.SwapSides(r,e),h.Clipper.SwapPolyIndexes(r,e));else if((v===0||v==1)&&(x===0||x==1)&&!n&&!o){var P,b;switch(y){case h.PolyFillType.pftPositive:P=r.WindCnt2;break;case h.PolyFillType.pftNegative:P=-r.WindCnt2;break;default:P=Math.abs(r.WindCnt2);break}switch(g){case h.PolyFillType.pftPositive:b=e.WindCnt2;break;case h.PolyFillType.pftNegative:b=-e.WindCnt2;break;default:b=Math.abs(e.WindCnt2);break}if(r.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(r,e,t);else if(v==1&&x==1)switch(this.m_ClipType){case h.ClipType.ctIntersection:P>0&&b>0&&this.AddLocalMinPoly(r,e,t);break;case h.ClipType.ctUnion:P<=0&&b<=0&&this.AddLocalMinPoly(r,e,t);break;case h.ClipType.ctDifference:(r.PolyTyp==h.PolyType.ptClip&&P>0&&b>0||r.PolyTyp==h.PolyType.ptSubject&&P<=0&&b<=0)&&this.AddLocalMinPoly(r,e,t);break;case h.ClipType.ctXor:this.AddLocalMinPoly(r,e,t);break}else h.Clipper.SwapSides(r,e)}n!=o&&(n&&r.OutIdx>=0||o&&e.OutIdx>=0)&&(h.Clipper.SwapSides(r,e),h.Clipper.SwapPolyIndexes(r,e)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(e)};h.Clipper.prototype.DeleteFromAEL=function(r){var e=r.PrevInAEL,t=r.NextInAEL;e===null&&t===null&&r!=this.m_ActiveEdges||(e!==null?e.NextInAEL=t:this.m_ActiveEdges=t,t!==null&&(t.PrevInAEL=e),r.NextInAEL=null,r.PrevInAEL=null)};h.Clipper.prototype.DeleteFromSEL=function(r){var e=r.PrevInSEL,t=r.NextInSEL;e===null&&t===null&&r!=this.m_SortedEdges||(e!==null?e.NextInSEL=t:this.m_SortedEdges=t,t!==null&&(t.PrevInSEL=e),r.NextInSEL=null,r.PrevInSEL=null)};h.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&h.Error("UpdateEdgeIntoAEL: invalid call");var e=r.PrevInAEL,t=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,e!==null?e.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,t!==null&&(t.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=e,r.NextInAEL=t,h.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};h.Clipper.prototype.ProcessHorizontals=function(r){for(var e=this.m_SortedEdges;e!==null;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,r),e=this.m_SortedEdges};h.Clipper.prototype.GetHorzDirection=function(r,e){r.Bot.X<r.Top.X?(e.Left=r.Bot.X,e.Right=r.Top.X,e.Dir=h.Direction.dLeftToRight):(e.Left=r.Top.X,e.Right=r.Bot.X,e.Dir=h.Direction.dRightToLeft)};h.Clipper.prototype.PrepareHorzJoins=function(r,e){var t=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=h.EdgeSide.esLeft&&(t=t.Prev),e&&(h.IntPoint.op_Equality(t.Pt,r.Top)?this.AddGhostJoin(t,r.Bot):this.AddGhostJoin(t,r.Top))};h.Clipper.prototype.ProcessHorizontal=function(r,e){var t={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,t);for(var i=t.Dir,n=t.Left,o=t.Right,a=r,u=null;a.NextInLML!==null&&h.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(u=this.GetMaximaPair(a));;){for(var c=r==a,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var f=this.GetNextInAEL(p,i);if(i==h.Direction.dLeftToRight&&p.Curr.X<=o||i==h.Direction.dRightToLeft&&p.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,e),p==u&&c){i==h.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),u.OutIdx>=0&&h.Error("ProcessHorizontal error");return}else if(i==h.Direction.dLeftToRight){var y=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,y,!0)}else{var y=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,y,!0)}this.SwapPositionsInAEL(r,p)}else if(i==h.Direction.dLeftToRight&&p.Curr.X>=o||i==h.Direction.dRightToLeft&&p.Curr.X<=n)break;p=f}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,e),r.NextInLML!==null&&h.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var t={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,t),i=t.Dir,n=t.Left,o=t.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var v=r.PrevInAEL,f=r.NextInAEL;if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&h.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var x=this.AddOutPt(v,r.Bot);this.AddJoin(g,x,r.Top)}else if(f!==null&&f.Curr.X==r.Bot.X&&f.Curr.Y==r.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&h.ClipperBase.SlopesEqual(r,f,this.m_UseFullRange)){var x=this.AddOutPt(f,r.Bot);this.AddJoin(g,x,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else u!==null?u.OutIdx>=0?(i==h.Direction.dLeftToRight?this.IntersectEdges(r,u,r.Top,!1):this.IntersectEdges(u,r,r.Top,!1),u.OutIdx>=0&&h.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(u)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};h.Clipper.prototype.GetNextInAEL=function(r,e){return e==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,e){return r!==null&&r.Top.Y==e&&r.NextInLML===null};h.Clipper.prototype.IsIntermediate=function(r,e){return r.Top.Y==e&&r.NextInLML!==null};h.Clipper.prototype.GetMaximaPair=function(r){var e=null;return h.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?e=r.Next:h.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(e=r.Prev),e!==null&&(e.OutIdx==-2||e.NextInAEL==e.PrevInAEL&&!h.ClipperBase.IsHorizontal(e))?null:e};h.Clipper.prototype.ProcessIntersections=function(r,e){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,e),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,e){if(this.m_ActiveEdges!==null){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t.Curr.X=h.Clipper.TopX(t,e),t=t.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,t=this.m_SortedEdges;t.NextInSEL!==null;){var n=t.NextInSEL,o=new h.IntPoint;if(t.Curr.X>n.Curr.X){!this.IntersectPoint(t,n,o)&&t.Curr.X>n.Curr.X+1&&h.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(t.Dx)>Math.abs(n.Dx)?o.X=h.Clipper.TopX(n,r):o.X=h.Clipper.TopX(t,r));var a=new h.IntersectNode;a.Edge1=t,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(t,n),i=!0}else t=n}if(t.PrevInSEL!==null)t.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,e){return e.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,e=0;e<r;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var t=e+1;t<r&&!this.EdgesAdjacent(this.m_IntersectList[t]);)t++;if(t==r)return!1;var i=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[t],this.m_IntersectList[t]=i}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0};h.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,e=this.m_IntersectList.length;r<e;r++){var t=this.m_IntersectList[r];this.IntersectEdges(t.Edge1,t.Edge2,t.Pt,!0),this.SwapPositionsInAEL(t.Edge1,t.Edge2)}this.m_IntersectList.length=0};var jL=l(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),HL=l(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),UL=l(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),WL=l(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");pe.msie?h.Clipper.Round=jL:pe.chromium?h.Clipper.Round=UL:pe.safari?h.Clipper.Round=WL:h.Clipper.Round=HL;h.Clipper.TopX=function(r,e){return e==r.Top.Y?r.Top.X:r.Bot.X+h.Clipper.Round(r.Dx*(e-r.Bot.Y))};h.Clipper.prototype.IntersectPoint=function(r,e,t){t.X=0,t.Y=0;var i,n;if(h.ClipperBase.SlopesEqual(r,e,this.m_UseFullRange)||r.Dx==e.Dx)return e.Bot.Y>r.Bot.Y?(t.X=e.Bot.X,t.Y=e.Bot.Y):(t.X=r.Bot.X,t.Y=r.Bot.Y),!1;if(r.Delta.X===0)t.X=r.Bot.X,h.ClipperBase.IsHorizontal(e)?t.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,t.Y=h.Clipper.Round(t.X/e.Dx+n));else if(e.Delta.X===0)t.X=e.Bot.X,h.ClipperBase.IsHorizontal(r)?t.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,t.Y=h.Clipper.Round(t.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=e.Bot.X-e.Bot.Y*e.Dx;var o=(n-i)/(r.Dx-e.Dx);t.Y=h.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=h.Clipper.Round(r.Dx*o+i):t.X=h.Clipper.Round(e.Dx*o+n)}if(t.Y<r.Top.Y||t.Y<e.Top.Y){if(r.Top.Y>e.Top.Y)return t.Y=r.Top.Y,t.X=h.Clipper.TopX(e,r.Top.Y),t.X<r.Top.X;t.Y=e.Top.Y,Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=h.Clipper.TopX(r,t.Y):t.X=h.Clipper.TopX(e,t.Y)}return!0};h.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var e=this.m_ActiveEdges;e!==null;){var t=this.IsMaxima(e,r);if(t){var i=this.GetMaximaPair(e);t=i===null||!h.ClipperBase.IsHorizontal(i)}if(t){var n=e.PrevInAEL;this.DoMaxima(e),n===null?e=this.m_ActiveEdges:e=n.NextInAEL}else{if(this.IsIntermediate(e,r)&&h.ClipperBase.IsHorizontal(e.NextInLML)?(e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=h.Clipper.TopX(e,r),e.Curr.Y=r),this.StrictlySimple){var n=e.PrevInAEL;if(e.OutIdx>=0&&e.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==e.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,e.Curr),a=this.AddOutPt(e,e.Curr);this.AddJoin(o,a,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;e!==null;){if(this.IsIntermediate(e,r)){var o=null;e.OutIdx>=0&&(o=this.AddOutPt(e,e.Top)),e=this.UpdateEdgeIntoAEL(e);var n=e.PrevInAEL,u=e.NextInAEL;if(n!==null&&n.Curr.X==e.Bot.X&&n.Curr.Y==e.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&h.ClipperBase.SlopesEqual(e,n,this.m_UseFullRange)&&e.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,e.Bot);this.AddJoin(o,a,e.Top)}else if(u!==null&&u.Curr.X==e.Bot.X&&u.Curr.Y==e.Bot.Y&&o!==null&&u.OutIdx>=0&&u.Curr.Y>u.Top.Y&&h.ClipperBase.SlopesEqual(e,u,this.m_UseFullRange)&&e.WindDelta!==0&&u.WindDelta!==0){var a=this.AddOutPt(u,e.Bot);this.AddJoin(o,a,e.Top)}}e=e.NextInAEL}};h.Clipper.prototype.DoMaxima=function(r){var e=this.GetMaximaPair(r);if(e===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var t=r.NextInAEL,i=!0;t!==null&&t!=e;)this.IntersectEdges(r,t,r.Top,!0),this.SwapPositionsInAEL(r,t),t=r.NextInAEL;r.OutIdx==-1&&e.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(e)):r.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(r,e,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),e.OutIdx>=0&&(this.AddOutPt(e,r.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):h.Error("DoMaxima error")};h.Clipper.ReversePaths=function(r){for(var e=0,t=r.length;e<t;e++)r[e].reverse()};h.Clipper.Orientation=function(r){return h.Clipper.Area(r)>=0};h.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var e=0,t=r;do e++,t=t.Next;while(t!=r);return e};h.Clipper.prototype.BuildResult=function(r){h.Clear(r);for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),u=0;u<o;u++)a[u]=n.Pt,n=n.Prev;r.push(a)}}}};h.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e],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,u=0;u<n;u++)o.m_polygon[u]=a.Pt,a=a.Prev}}for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];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 e=null;r.BottomPt=null;for(var t=r.Pts;;){if(t.Prev==t||t.Prev==t.Next){this.DisposeOutPts(t),r.Pts=null;return}if(h.IntPoint.op_Equality(t.Pt,t.Next.Pt)||h.IntPoint.op_Equality(t.Pt,t.Prev.Pt)||h.ClipperBase.SlopesEqual(t.Prev.Pt,t.Pt,t.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(t.Prev.Pt,t.Pt,t.Next.Pt))){e=null;var i=t;t.Prev.Next=t.Next,t.Next.Prev=t.Prev,t=t.Prev,i=null}else{if(t==e)break;e===null&&(e=t),t=t.Next}}r.Pts=t};h.Clipper.prototype.DupOutPt=function(r,e){var t=new h.OutPt;return t.Pt.X=r.Pt.X,t.Pt.Y=r.Pt.Y,t.Idx=r.Idx,e?(t.Next=r.Next,t.Prev=r,r.Next.Prev=t,r.Next=t):(t.Prev=r.Prev,t.Next=r,r.Prev.Next=t,r.Prev=t),t};h.Clipper.prototype.GetOverlap=function(r,e,t,i,n){return r<e?t<i?(n.Left=Math.max(r,t),n.Right=Math.min(e,i)):(n.Left=Math.max(r,i),n.Right=Math.min(e,t)):t<i?(n.Left=Math.max(e,t),n.Right=Math.min(r,i)):(n.Left=Math.max(e,i),n.Right=Math.min(r,t)),n.Left<n.Right};h.Clipper.prototype.JoinHorz=function(r,e,t,i,n,o){var a=r.Pt.X>e.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight,u=t.Pt.X>i.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight;if(a==u)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),e=this.DupOutPt(r,!o),h.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=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),e=this.DupOutPt(r,o),h.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=this.DupOutPt(r,o))}if(u==h.Direction.dLeftToRight){for(;t.Next.Pt.X<=n.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,!o),h.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,!o))}else{for(;t.Next.Pt.X>=n.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;!o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,o),h.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,o))}return a==h.Direction.dLeftToRight==o?(r.Prev=t,t.Next=r,e.Next=i,i.Prev=e):(r.Next=t,t.Prev=r,e.Prev=i,i.Next=e),!0};h.Clipper.prototype.JoinPoints=function(r,e,t){var i=r.OutPt1,n=new h.OutPt,o=r.OutPt2,a=new h.OutPt,u=r.OutPt1.Pt.Y==r.OffPt.Y;if(u&&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 p=a.Pt.Y>r.OffPt.Y;return c==p?!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(u){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 f={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,f))return!1;var y=f.Left,g=f.Right,v=new h.IntPoint,x;return i.Pt.X>=y&&i.Pt.X<=g?(v.X=i.Pt.X,v.Y=i.Pt.Y,x=i.Pt.X>n.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(v.X=o.Pt.X,v.Y=o.Pt.Y,x=o.Pt.X>a.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(v.X=n.Pt.X,v.Y=n.Pt.Y,x=n.Pt.X>i.Pt.X):(v.X=a.Pt.X,v.Y=a.Pt.Y,x=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,v,x)}else{for(n=i.Next;h.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var P=n.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(P){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 b=a.Pt.Y>o.Pt.Y||!h.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(b){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||e==t&&P==b?!1:P?(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 e=0,t=r.length;e<t&&r[e].length==0;)e++;if(e==t)return new h.IntRect(0,0,0,0);var i=new h.IntRect;for(i.left=r[e][0].X,i.right=i.left,i.top=r[e][0].Y,i.bottom=i.top;e<t;e++)for(var n=0,o=r[e].length;n<o;n++)r[e][n].X<i.left?i.left=r[e][n].X:r[e][n].X>i.right&&(i.right=r[e][n].X),r[e][n].Y<i.top?i.top=r[e][n].Y:r[e][n].Y>i.bottom&&(i.bottom=r[e][n].Y);return i};h.Clipper.prototype.GetBounds2=function(r){var e=r,t=new h.IntRect;for(t.left=r.Pt.X,t.right=r.Pt.X,t.top=r.Pt.Y,t.bottom=r.Pt.Y,r=r.Next;r!=e;)r.Pt.X<t.left&&(t.left=r.Pt.X),r.Pt.X>t.right&&(t.right=r.Pt.X),r.Pt.Y<t.top&&(t.top=r.Pt.Y),r.Pt.Y>t.bottom&&(t.bottom=r.Pt.Y),r=r.Next;return t};h.Clipper.PointInPolygon=function(r,e){var t=0,i=e.length;if(i<3)return 0;for(var n=e[0],o=1;o<=i;++o){var a=o==i?e[0]:e[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)t=1-t;else{var u=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(u==0)return-1;u>0==a.Y>n.Y&&(t=1-t)}else if(a.X>r.X){var u=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(u==0)return-1;u>0==a.Y>n.Y&&(t=1-t)}}n=a}return t};h.Clipper.prototype.PointInPolygon=function(r,e){for(var t=0,i=e;;){var n=e.Pt.X,o=e.Pt.Y,a=e.Next.Pt.X,u=e.Next.Pt.Y;if(u==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=u<r.Y){if(n>=r.X)if(a>r.X)t=1-t;else{var c=(n-r.X)*(u-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==u>o&&(t=1-t)}else if(a>r.X){var c=(n-r.X)*(u-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==u>o&&(t=1-t)}}if(e=e.Next,i==e)break}return t};h.Clipper.prototype.Poly2ContainsPoly1=function(r,e){var t=r;do{var i=this.PointInPolygon(t.Pt,e);if(i>=0)return i!=0;t=t.Next}while(t!=r);return!0};h.Clipper.prototype.FixupFirstLefts1=function(r,e){for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,e.Pts)&&(n.FirstLeft=e)}};h.Clipper.prototype.FixupFirstLefts2=function(r,e){for(var t=0,i=this.m_PolyOuts,n=i.length,o=i[t];t<n;t++,o=i[t])o.FirstLeft==r&&(o.FirstLeft=e)};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,e=this.m_Joins.length;r<e;r++){var t=this.m_Joins[r],i=this.GetOutRec(t.OutPt1.Idx),n=this.GetOutRec(t.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(t,i,n))if(i==n){if(i.Pts=t.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=t.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,u=this.m_PolyOuts.length;a<u-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,t.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 e=r.Pts;do e.Idx=r.Idx,e=e.Prev;while(e!=r.Pts)};h.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var e=this.m_PolyOuts[r++],t=e.Pts;if(t!==null)do{for(var i=t.Next;i!=e.Pts;){if(h.IntPoint.op_Equality(t.Pt,i.Pt)&&i.Next!=t&&i.Prev!=t){var n=t.Prev,o=i.Prev;t.Prev=o,o.Next=t,i.Prev=n,n.Next=i,e.Pts=t;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,e.Pts)?(a.IsHole=!e.IsHole,a.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,a.Pts)?(a.IsHole=e.IsHole,e.IsHole=!a.IsHole,a.FirstLeft=e.FirstLeft,e.FirstLeft=a):(a.IsHole=e.IsHole,a.FirstLeft=e.FirstLeft),i=t}i=i.Next}t=t.Next}while(t!=e.Pts)}};h.Clipper.Area=function(r){var e=r.length;if(e<3)return 0;for(var t=0,i=0,n=e-1;i<e;++i)t+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-t*.5};h.Clipper.prototype.Area=function(r){var e=r.Pts;if(e==null)return 0;var t=0;do t=t+(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next;while(e!=r.Pts);return t*.5};h6&&(h.Clipper.OffsetPaths=function(r,e,t,i,n){var o=new h.Paths,a=new h.ClipperOffset(n,n);return a.AddPaths(r,t,i),a.Execute(o,e),o});h.Clipper.SimplifyPolygon=function(r,e){var t=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,t,e,e),t};h.Clipper.SimplifyPolygons=function(r,e){typeof e>"u"&&(e=h.PolyFillType.pftEvenOdd);var t=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,t,e,e),t};h.Clipper.DistanceSqrd=function(r,e){var t=r.X-e.X,i=r.Y-e.Y;return t*t+i*i};h.Clipper.DistanceFromLineSqrd=function(r,e,t){var i=e.Y-t.Y,n=t.X-e.X,o=i*e.X+n*e.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};h.Clipper.SlopesNearCollinear=function(r,e,t,i){return h.Clipper.DistanceFromLineSqrd(e,r,t)<i};h.Clipper.PointsAreClose=function(r,e,t){var i=r.X-e.X,n=r.Y-e.Y;return i*i+n*n<=t};h.Clipper.ExcludeOp=function(r){var e=r.Prev;return e.Next=r.Next,r.Next.Prev=e,e.Idx=0,e};h.Clipper.CleanPolygon=function(r,e){typeof e>"u"&&(e=1.415);var t=r.length;if(t==0)return new Array;for(var i=new Array(t),n=0;n<t;++n)i[n]=new h.OutPt;for(var n=0;n<t;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%t],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=e*e,a=i[0];a.Idx==0&&a.Next!=a.Prev;)h.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=h.Clipper.ExcludeOp(a),t--):h.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(h.Clipper.ExcludeOp(a.Next),a=h.Clipper.ExcludeOp(a),t-=2):h.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=h.Clipper.ExcludeOp(a),t--):(a.Idx=1,a=a.Next);t<3&&(t=0);for(var u=new Array(t),n=0;n<t;++n)u[n]=new h.IntPoint(a.Pt),a=a.Next;return i=null,u};h.Clipper.CleanPolygons=function(r,e){for(var t=new Array(r.length),i=0,n=r.length;i<n;i++)t[i]=h.Clipper.CleanPolygon(r[i],e);return t};h.Clipper.Minkowski=function(r,e,t,i){var n=i?1:0,o=r.length,a=e.length,u=new Array;if(t)for(var c=0;c<a;c++){for(var p=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])p[f]=new h.IntPoint(e[c].X+g.X,e[c].Y+g.Y);u.push(p)}else for(var c=0;c<a;c++){for(var p=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])p[f]=new h.IntPoint(e[c].X-g.X,e[c].Y-g.Y);u.push(p)}for(var v=new Array,c=0;c<a-1+n;c++)for(var f=0;f<o;f++){var x=new Array;x.push(u[c%a][f%o]),x.push(u[(c+1)%a][f%o]),x.push(u[(c+1)%a][(f+1)%o]),x.push(u[c%a][(f+1)%o]),h.Clipper.Orientation(x)||x.reverse(),v.push(x)}var P=new h.Clipper(0);return P.AddPaths(v,h.PolyType.ptSubject,!0),P.Execute(h.ClipType.ctUnion,u,h.PolyFillType.pftNonZero,h.PolyFillType.pftNonZero),u};h.Clipper.MinkowskiSum=function(){var r=arguments,e=r.length;if(e==3){var t=r[0],i=r[1],n=r[2];return h.Clipper.Minkowski(t,i,!0,n)}else if(e==4){for(var t=r[0],o=r[1],a=r[2],n=r[3],u=new h.Clipper,c,p=0,f=o.length;p<f;++p){var c=h.Clipper.Minkowski(t,o[p],!0,n);u.AddPaths(c,h.PolyType.ptSubject,!0)}n&&u.AddPaths(o,h.PolyType.ptClip,!0);var y=new h.Paths;return u.Execute(h.ClipType.ctUnion,y,a,a),y}};h.Clipper.MinkowskiDiff=function(r,e,t){return h.Clipper.Minkowski(r,e,!1,t)};h.Clipper.PolyTreeToPaths=function(r){var e=new Array;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntAny,e),e};h.Clipper.AddPolyNodeToPaths=function(r,e,t){var i=!0;switch(e){case h.Clipper.NodeType.ntOpen:return;case h.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&t.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,u=o[n];n<a;n++,u=o[n])h.Clipper.AddPolyNodeToPaths(u,e,t)};h.Clipper.OpenPathsFromPolyTree=function(r){for(var e=new h.Paths,t=0,i=r.ChildCount();t<i;t++)r.Childs()[t].IsOpen&&e.push(r.Childs()[t].m_polygon);return e};h.Clipper.ClosedPathsFromPolyTree=function(r){var e=new h.Paths;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntClosed,e),e};Hh(h.Clipper,h.ClipperBase);h.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};h.ClipperOffset=function(r,e){typeof r>"u"&&(r=2),typeof e>"u"&&(e=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=e,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,e,t){var i=r.length-1;if(!(i<0)){var n=new h.PolyNode;if(n.m_jointype=e,n.m_endtype=t,t==h.EndType.etClosedLine||t==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,u=1;u<=i;u++)h.IntPoint.op_Inequality(n.m_polygon[o],r[u])&&(o++,n.m_polygon.push(r[u]),(r[u].Y>n.m_polygon[a].Y||r[u].Y==n.m_polygon[a].Y&&r[u].X<n.m_polygon[a].X)&&(a=o));if(!(t==h.EndType.etClosedPolygon&&o<2||t!=h.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),t==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,e,t){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],e,t)};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 e=this.m_polyNodes.Childs()[r];(e.m_endtype==h.EndType.etClosedPolygon||e.m_endtype==h.EndType.etClosedLine&&h.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];e.m_endtype==h.EndType.etClosedLine&&!h.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}};h.ClipperOffset.GetUnitNormal=function(r,e){var t=e.X-r.X,i=e.Y-r.Y;if(t==0&&i==0)return new h.DoublePoint(0,0);var n=1/Math.sqrt(t*t+i*i);return t*=n,i*=n,new h.DoublePoint(i,-t)};h.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,h.ClipperBase.near_zero(r)){for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==h.EndType.etClosedPolygon&&this.m_destPolys.push(t.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 e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];this.m_srcPoly=t.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||t.m_endtype!=h.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(t.m_jointype==h.JoinType.jtRound)for(var a=1,u=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+u*r)));var p=a;a=a*this.m_cos-this.m_sin*u,u=p*this.m_sin+u*this.m_cos}else for(var a=-1,u=-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+u*r))),a<0?a=1:u<0?u=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(t.m_endtype==h.EndType.etClosedLine||t.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])),t.m_endtype==h.EndType.etClosedPolygon){for(var f=o-1,c=0;c<o;c++)f=this.OffsetPoint(c,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(t.m_endtype==h.EndType.etClosedLine){for(var f=o-1,c=0;c<o;c++)f=this.OffsetPoint(c,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=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(-y.X,-y.Y),f=0;for(var c=o-1;c>=0;c--)f=this.OffsetPoint(c,f,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,c=1;c<o-1;++c)f=this.OffsetPoint(c,f,t.m_jointype);var g;if(t.m_endtype==h.EndType.etOpenButt){var c=o-1;g=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(g),g=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(g)}else{var c=o-1;f=o-2,this.m_sinA=0,this.m_normals[c]=new h.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),t.m_endtype==h.EndType.etOpenSquare?this.DoSquare(c,f):this.DoRound(c,f)}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),f=o-1;for(var c=f-1;c>0;--c)f=this.OffsetPoint(c,f,t.m_jointype);t.m_endtype==h.EndType.etOpenButt?(g=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(g),g=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(g)):(f=1,this.m_sinA=0,t.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,e=r[0]instanceof h.PolyTree;if(e){var t=r[0],i=r[1];t.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,t,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,t,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),t.ChildCount()==1&&t.Childs()[0].ChildCount()>0){var u=t.Childs()[0];t.Childs()[0]=u.Childs()[0];for(var c=1;c<u.ChildCount();c++)t.AddChild(u.Childs()[c])}else t.Clear()}}else{var t=r[0],i=r[1];h.Clear(t),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,t,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,t,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),t.length>0&&t.splice(0,1)}}};h.ClipperOffset.prototype.OffsetPoint=function(r,e,t){if(this.m_sinA=this.m_normals[e].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;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[e].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[e].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(t){case h.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[e].X+this.m_normals[r].Y*this.m_normals[e].Y);i>=this.m_miterLim?this.DoMiter(r,e,i):this.DoSquare(r,e);break}case h.JoinType.jtSquare:this.DoSquare(r,e);break;case h.JoinType.jtRound:this.DoRound(r,e);break}return e=r,e};h.ClipperOffset.prototype.DoSquare=function(r,e){var t=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].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[e].X-this.m_normals[e].Y*t)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*t)))),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*t)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*t))))};h.ClipperOffset.prototype.DoMiter=function(r,e,t){var i=this.m_delta/t;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[e].X+this.m_normals[r].X)*i),h.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[e].Y+this.m_normals[r].Y)*i)))};h.ClipperOffset.prototype.DoRound=function(r,e){for(var t=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y),i=h.Cast_Int32(h.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(t))),n=this.m_normals[e].X,o=this.m_normals[e].Y,a,u=0;u<i;++u)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(e){alert(e.message)}};h.JS={};h.JS.AreaOfPolygon=function(r,e){return e||(e=1),h.Clipper.Area(r)/(e*e)};h.JS.AreaOfPolygons=function(r,e){e||(e=1);for(var t=0,i=0;i<r.length;i++)t+=h.Clipper.Area(r[i]);return t/(e*e)};h.JS.BoundsOfPath=function(r,e){return h.JS.BoundsOfPaths([r],e)};h.JS.BoundsOfPaths=function(r,e){e||(e=1);var t=h.Clipper.GetBounds(r);return t.left/=e,t.bottom/=e,t.right/=e,t.top/=e,t};h.JS.Clean=function(i,e){if(!(i instanceof Array))return[];var t=i[0]instanceof Array,i=h.JS.Clone(i);if(typeof e!="number"||e===null)return h.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||e<0)return i;t||(i=[i]);for(var n=i.length,o,a,u,c,p,f,y,g=[],v=0;v<n;v++)if(a=i[v],o=a.length,o!==0){if(o<3){u=a,g.push(u);continue}for(u=a,c=e*e,p=a[0],f=1,y=1;y<o;y++)(a[y].X-p.X)*(a[y].X-p.X)+(a[y].Y-p.Y)*(a[y].Y-p.Y)<=c||(u[f]=a[y],p=a[y],f++);p=a[f-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=c&&f--,f<o&&u.splice(f,o-f),u.length&&g.push(u)}return!t&&g.length?g=g[0]:!t&&g.length===0?g=[]:t&&g.length===0&&(g=[[]]),g};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 e=r[0]instanceof Array;e||(r=[r]);var t=r.length,i,n,o,a,u=new Array(t);for(n=0;n<t;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};u[n]=a}return e||(u=u[0]),u};h.JS.Lighten=function(r,e){if(!(r instanceof Array))return[];if(typeof e!="number"||e===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||e<0)return h.JS.Clone(r);r[0]instanceof Array||(r=[r]);var t,i,n,o,a,u,c,p,f,y,g,v,x,P,b,S,E,I=r.length,w=e*e,_=[];for(t=0;t<I;t++)if(n=r[t],u=n.length,u!=0){for(o=0;o<1e6;o++){for(a=[],u=n.length,n[u-1].X!=n[0].X||n[u-1].Y!=n[0].Y?(v=1,n.push({X:n[0].X,Y:n[0].Y}),u=n.length):v=0,g=[],i=0;i<u-2;i++)c=n[i],f=n[i+1],p=n[i+2],S=c.X,E=c.Y,x=p.X-S,P=p.Y-E,(x!==0||P!==0)&&(b=((f.X-S)*x+(f.Y-E)*P)/(x*x+P*P),b>1?(S=p.X,E=p.Y):b>0&&(S+=x*b,E+=P*b)),x=f.X-S,P=f.Y-E,y=x*x+P*P,y<=w&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<u-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[u-1].X,Y:n[u-1].Y}),v&&n.pop(),g.length)n=a;else break}u=a.length,a[u-1].X==a[0].X&&a[u-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,e,t){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,u=0,c=0,p=0,f=0,y=r.length;if(y<2)return 0;for(e&&(r[y]=r[0],y++);--y;)o=r[y],u=o.X,c=o.Y,a=r[y-1],p=a.X,f=a.Y,n+=i((u-p)*(u-p)+(c-f)*(c-f));return e&&r.pop(),n/t};h.JS.PerimeterOfPaths=function(r,e,t){t||(t=1);for(var i=0,n=0;n<r.length;n++)i+=h.JS.PerimeterOfPath(r[n],e,t);return i};h.JS.ScaleDownPath=function(r,e){var t,i;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=i.X/e,i.Y=i.Y/e};h.JS.ScaleDownPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=n.X/e,n.Y=n.Y/e};h.JS.ScaleUpPath=function(r,e){var t,i,n=Math.round;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=n(i.X*e),i.Y=n(i.Y*e)};h.JS.ScaleUpPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=o(n.X*e),n.Y=o(n.Y*e)};h.ExPolygons=function(){return[]};h.ExPolygon=function(){this.outer=null,this.holes=null};h.JS.AddOuterPolyNodeToExPolygons=function(r,e){var t=new h.ExPolygon;t.outer=r.Contour();var i=r.Childs(),n=i.length;t.holes=new Array(n);var o,a,u,c,p,f;for(u=0;u<n;u++)for(o=i[u],t.holes[u]=o.Contour(),c=0,p=o.Childs(),f=p.length;c<f;c++)a=p[c],h.JS.AddOuterPolyNodeToExPolygons(a,e);e.push(t)};h.JS.ExPolygonsToPaths=function(r){var e,t,i,n,o=new h.Paths;for(e=0,i=r.length;e<i;e++)for(o.push(r[e].outer),t=0,n=r[e].holes.length;t<n;t++)o.push(r[e].holes[t]);return o};h.JS.PolyTreeToExPolygons=function(r){var e=new h.ExPolygons,t,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)t=n[i],h.JS.AddOuterPolyNodeToExPolygons(t,e);return e};ru.exports=h});var u8=N((ise,Of)=>{m();(function(){"use strict";function r(a,u){var c=a.x-u.x,p=a.y-u.y;return c*c+p*p}l(r,"getSqDist");function e(a,u,c){var p=u.x,f=u.y,y=c.x-p,g=c.y-f;if(y!==0||g!==0){var v=((a.x-p)*y+(a.y-f)*g)/(y*y+g*g);v>1?(p=c.x,f=c.y):v>0&&(p+=y*v,f+=g*v)}return y=a.x-p,g=a.y-f,y*y+g*g}l(e,"getSqSegDist");function t(a,u){for(var c=a[0],p=[c],f,y=1,g=a.length;y<g;y++)f=a[y],r(f,c)>u&&(p.push(f),c=f);return c!==f&&p.push(f),p}l(t,"simplifyRadialDist");function i(a,u,c,p,f){for(var y=p,g,v=u+1;v<c;v++){var x=e(a[v],a[u],a[c]);x>y&&(g=v,y=x)}y>p&&(g-u>1&&i(a,u,g,p,f),f.push(a[g]),c-g>1&&i(a,g,c,p,f))}l(i,"simplifyDPStep");function n(a,u){var c=a.length-1,p=[a[0]];return i(a,0,c,u,p),p.push(a[c]),p}l(n,"simplifyDouglasPeucker");function o(a,u,c){if(a.length<=2)return a;var p=u!==void 0?u*u:1;return a=c?a:t(a,p),a=n(a,p),a}l(o,"simplify"),typeof define=="function"&&define.amd?define(function(){return o}):typeof Of<"u"?(Of.exports=o,Of.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});m();m();m();m();m();m();var gp="[MappedinJS]",kb=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))(kb||{});function T8(r){0<=r&&r<=3&&(Fb.logState=r)}l(T8,"setLoggerLevel");var Fb={logState:C.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(gp,...r)},warn(...r){this.logState<=1&&console.warn(gp,...r)},error(...r){this.logState<=2&&console.error(gp,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,e){throw new Error("".concat(gp," ").concat(r),e)}},A=Fb;m();m();var Hf=class Hf extends Error{};l(Hf,"InvalidTokenError");var ao=Hf;ao.prototype.name="InvalidTokenError";function w8(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}l(w8,"b64DecodeUnicode");function I8(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return w8(e)}catch{return atob(e)}}l(I8,"base64UrlDecode");function Bb(r,e){if(typeof r!="string")throw new ao("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,i=r.split(".")[t];if(typeof i!="string")throw new ao("Invalid token specified: missing part #".concat(t+1));let n;try{n=I8(i)}catch(o){throw new ao("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(o.message,")"))}try{return JSON.parse(n)}catch(o){throw new ao("Invalid token specified: invalid json for part #".concat(t+1," (").concat(o.message,")"))}}l(Bb,"jwtDecode");m();var zr=63710088e-1;function vp(r){var t,i;let e=Bb(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(i=e.capabilities)!=null?i:{}}}l(vp,"decodeAccessToken");function mn(r){return r*(Math.PI/180)}l(mn,"toRadians");function E8(r){return r*(180/Math.PI)}l(E8,"toDegrees");function bp([r,e],[t,i]){let n=mn(i-e),o=mn(t-r),a=mn(e),u=mn(i),c=Math.sin(n/2)*Math.sin(n/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(u),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return zr*p}l(bp,"haversineDistance");function Rb([r,e],[t,i]){let n=mn(e),o=mn(r),a=mn(i),c=mn(t)-o,p=Math.sin(c)*Math.cos(a),f=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(c);return E8((Math.atan2(p,f)+Math.PI*2)%(Math.PI*2))}l(Rb,"getForwardBearing");m();function Nb(r,e,t=!1){let i=null,n=0;return function(...o){n++,n===1&&t===!0&&r(...o);let a=l(()=>{(!t||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}l(Nb,"debounce");m();var Uf=class Uf{constructor(){d(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(i){typeof i=="function"&&i(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let i=this._subscribers[e].indexOf(t);i!==-1&&this._subscribers[e].splice(i,1)}destroy(){this._subscribers={}}};l(Uf,"PubSub");var J=Uf;m();m();var Wf=[0,4,6,8,10],ae=l(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let i=0;i<r.length;i++)i>0&&!(i&3)&&(e=Math.random()*4294967296),r[i]=e>>>((i&3)<<3)&255;let t=r.map(i=>i.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Wf.map((i,n)=>t.slice(i,n===Wf.length-1?void 0:Wf[n+1]).join("")).join("-")},"randomId");var Gb="mi-session-data",Vb="mi-local-data",so,gr,vr,hl=class hl{constructor(){M(this,gr,void 0);M(this,vr,void 0);try{let e=sessionStorage.getItem(Gb);e?T(this,gr,JSON.parse(e)):T(this,gr,{id:ae()})}catch{T(this,gr,{id:ae()})}try{let e=localStorage.getItem(Vb);e?T(this,vr,JSON.parse(e)):T(this,vr,{deviceId:ae()})}catch{T(this,vr,{deviceId:ae()})}s(this,gr).id||(s(this,gr).id=ae()),s(this,vr).deviceId||(s(this,vr).deviceId=ae())}static getInstance(){return s(this,so)||T(this,so,new hl),s(this,so)}static ___clearInstance(){T(this,so,void 0)}saveSessionData(e,t){s(this,gr)[e]=t;try{return sessionStorage.setItem(Gb,JSON.stringify(s(this,gr))),!0}catch{return!1}}loadSessionData(e){let t=s(this,gr)[e];if(t!=null)return t}saveLocalData(e,t){s(this,vr)[e]=t;try{return localStorage.setItem(Vb,JSON.stringify(s(this,vr))),!0}catch{return!1}}loadLocalData(e){let t=s(this,vr)[e];if(t!=null)return t}};so=new WeakMap,gr=new WeakMap,vr=new WeakMap,l(hl,"SafeStorage"),M(hl,so,void 0);var yn=hl;m();m();var fl=l(r=>r!=null,"notNull");var _8=l(function(){let e=globalThis.fetch;return{fetch(...t){if(!fl(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e==null?void 0:e(...t)},setFetch(t){e=t}}},"createFetchControl")(),jb=_8.fetch;var Xb=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],Hb=Xb[0],Zb="https://api-gateway.mappedin.com/track-analytics/a/",zb="deny-watchposition",Yb="load-mapview",qb="load-mapdata",$b="change-language",Jb="query-directions";var Ei,br,Ia,Cp,Zf=class Zf{constructor(){M(this,Ia);M(this,Ei,Object.freeze({}));M(this,br,void 0);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",Nb((e,t)=>this.sendAnalyticEvent(Jb,{start:e,end:t,type:"location_to_location"}),2500));T(this,br,U(this,Ia,Cp).call(this,s(this,Ei)))}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){T(this,Ei,{}),T(this,br,U(this,Ia,Cp).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return T(this,Ei,Object.freeze(Object.assign({},s(this,Ei),e))),T(this,br,U(this,Ia,Cp).call(this,e)),s(this,br)}updateState(e){let t={...e};t.mapId&&(t.analyticsBaseUrl=Xf({...s(this,br),mapId:t.mapId})),t.context&&(t.context=Wb(t.context)),t.baseUri&&(t.analyticsBaseUrl=Xf({baseUri:t.baseUri,mapId:s(this,br).mapId})),Object.assign(s(this,br),t),this.handleStateUpdate(e)}handleStateUpdate(e){var t;(t=e.userPosition)!=null&&t.floorLevel?this.sendBlueDotEvents("found-floor"):e.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:e,secret:t,accessToken:i}=this.getState();return!!(e&&t)||!!i}getState(){return s(this,br)}getContext(){return this.getState().context||s(this,Ei).context||Hb}getSessionId(){return this.getState().sessionId||s(this,Ei).sessionId||Ub()}sendAnalyticEvent(e,t={}){let i=this.getState(),n=O8(i.analyticsBaseUrl,e),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&A.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return A.warn("Auth needs to be ready to send analytics.");let a={...t,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)),jb(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(e,t){if(A8.includes(e))return A.warn("".concat(e," event is sent internally.")),Promise.resolve();let i=L8.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(i,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(qb,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent($b,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(zb)}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t}){return this.sendAnalyticEvent(Yb,{type:"3d",firstRenderDuration:e,width:t.width,height:t.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};Ei=new WeakMap,br=new WeakMap,Ia=new WeakSet,Cp=l(function(e){var i,n,o,a;let t=(i=e.baseUri)!=null?i:Zb;return{baseUri:t,analyticsBaseUrl:Xf({...e,baseUri:t}),version:((n=C==null?void 0:C.env)==null?void 0:n.npm_package_version)||"v6",deviceId:e.deviceId||D8(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||Ub(),platformString:e.platformString||"",context:Wb(e.context)||Hb,geolocationMode:!1,sendEvents:(o=e.sendEvents)!=null?o:!0,logEvents:(a=e.logEvents)!=null?a:!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret}},"#getStateWithOption"),l(Zf,"AnalyticsInternal");var Ea=Zf;function Xf({mapId:r,baseUri:e=Zb}){return"".concat(e).concat(r,"/")}l(Xf,"getBaseUrl");function D8(){return yn.getInstance().loadLocalData("deviceId")}l(D8,"getDeviceIDFromStorage");function Ub(){return yn.getInstance().loadSessionData("id")}l(Ub,"getSessionIDFromStorage");function O8(r,e){return r+e}l(O8,"buildUrl");function Wb(r){return Xb.find(e=>e===r)}l(Wb,"getValidContext");var L8=["$select-location","$select-category","$query-suggest","$query-search"],A8=[Yb,qb,Jb,zb,$b],qk=new Ea,_i,zf=class zf{constructor(e){M(this,_i,void 0);d(this,"capture");d(this,"updateState");T(this,_i,e),this.capture=s(this,_i).capture.bind(s(this,_i)),this.updateState=s(this,_i).updateState.bind(s(this,_i))}getState(){return Object.assign({},s(this,_i).getState())}};_i=new WeakMap,l(zf,"Analytics");var ml=zf;m();m();var gl,vl,bl,Yf=class Yf{constructor(e,t,{enabled:i=!1}={}){M(this,gl,void 0);d(this,"searchInstance");M(this,vl,void 0);M(this,bl,void 0);d(this,"enabled",!1);T(this,gl,e),T(this,vl,t),T(this,bl,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(i){return A.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(i){return A.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-422K3KWW.js").then(({InternalSearch:e})=>new e(s(this,gl)))),s(this,vl).on("language-change",s(this,bl)),await this.searchInstance)}};gl=new WeakMap,vl=new WeakMap,bl=new WeakMap,l(Yf,"Search");var yl=Yf;var Kb=new WeakMap,be,$f=class $f extends J{constructor(t,{search:i}={}){super();M(this,be,void 0);d(this,"Analytics");d(this,"Search");d(this,"getDirections",l((t,i,n)=>s(this,be).getDirections(t,i,n),"getDirections"));d(this,"getDirectionsMultiDestination",l((t,i,n)=>s(this,be).getDirectionsMultiDestination(t,i,n),"getDirectionsMultiDestination"));T(this,be,t),Kb.set(this,t),this.Analytics=new ml(t.Analytics),this.Search=new yl(this,t,{enabled:i==null?void 0:i.enabled}),s(this,be).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,be).getEnv()}get mapName(){return s(this,be).mapName}get mapCenter(){return s(this,be).mapCenter}get organizationId(){return s(this,be).organizationId}get outdoorViewToken(){return s(this,be).outdoorViewToken}getByType(t){switch(t){case"node":return s(this,be).nodes;case"space":return s(this,be).spaces;case"door":return s(this,be).doors;case"floor":return s(this,be).floors;case"floor-stack":return s(this,be).floorStacks;case"connection":return s(this,be).connections;case"object":return s(this,be).objects;case"point-of-interest":return s(this,be).pointsOfInterest;case"annotation":return s(this,be).annotations;case"enterprise-location":return s(this,be).locations;case"enterprise-category":return s(this,be).categories;case"enterprise-venue":return s(this,be).venue;default:return[]}}getById(t,i){return s(this,be).getById(t,i)}async changeLanguage(t){return s(this,be).changeLanguage(t)}get currentLanguage(){return s(this,be).currentLanguage}getDistance(t,i){return s(this,be).getDistance(t,i)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return s(this,be).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return s(this,be).toJSONBundle({downloadLanguagePacks:t})}};be=new WeakMap,l($f,"MapData");var qf=$f,xp=qf;function _a(r){let e=Kb.get(r);if(!e)throw new Error("MapDataInternal not found");return e}l(_a,"getMapDataInternal");m();m();m();m();var Qb=globalThis.fetch,r2,k8=(r2=C==null?void 0:C.env)==null?void 0:r2.npm_package_version,i2="https://app.mappedin.com/",F8="https://auth.mappedin.com/",e2="accessTokens";function gn(){if(Qb==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Qb}l(gn,"isomorphicFetch");var n2={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function o2(r){var t;let e={...n2,...r};return e.headers={...e.headers,"mappedin-sdk-version":k8},e.things=[],"platformString"in r&&(e.headers={...e.headers,"mappedin-platform-version":r.platformString}),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e.language=(t=e.language)==null?void 0:t.toLowerCase(),e}l(o2,"parseOptions");function B8(r,e,t=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};t&&delete i.language,i.language&&(e+="&lang=".concat(encodeURIComponent(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)),i.language&&(n["Accept-Language"]=i.language);let o={method:"GET",headers:n};return r.secure&&(e+="&withcdntoken"),{req:o,url:e}}l(B8,"constructParamsForRequest");async function R8(r,e,t=!1){let i=B8(r,e,t),n=await gn()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}l(R8,"generateAPIRequest");async function N8(r,e="exports/mvf/1/bundle"){var o;let t=o2({baseUri:"https://api-gateway.mappedin.com/",...n2,...r}),i="".concat(t.baseUri+e,"?venue=").concat(t.venue,"&version=").concat((o=t.version)!=null?o:"2.0.0");return t.headers["Content-Type"]="application/zip",await R8(t,i)}l(N8,"getVenueMVFURL");var Jf=new TextDecoder;async function Kf(r,{signal:e}){let t=await(await gn()(r,{signal:e})).arrayBuffer();return new Uint8Array(t)}l(Kf,"getLanguagePackUnitArray");async function Cl(r){let t=(await import("./browser-644AOSQ2.js")).unzipSync(r),i={};if(t["enterprise/"]!=null){i.enterprise={};let n=t["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(Jf.decode(n)));let o=t["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(Jf.decode(o)))}return t["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Jf.decode(t["manifest.json"]))),i}l(Cl,"parseLanguagePack");async function a2(r,{signal:e}){try{let t=await(await gn()(r,{signal:e})).arrayBuffer();if(e.aborted)return;let i=new Uint8Array(t);return await Cl(i)}catch(t){let i=new Error("downloadLanguagePack failed");throw i.cause=t,i}}l(a2,"downloadLanguagePack");async function Qf(r){return new Promise(async(e,t)=>{try{let{url:i,locale_packs:n}=await N8(r,"exports/mvf2/1/bundle"),o=await gn()(i).then(u=>u.arrayBuffer()),a=new Uint8Array(o);e({compressed:a,localePacks:n})}catch(i){t(i)}})}l(Qf,"downloadVenueBundleMVFAPIGateway");async function em(r,e){return new Promise(async(t,i)=>{try{let{url:n}=await G8(r,e),o=await gn()(n).then(u=>u.arrayBuffer()),a=new Uint8Array(o);t(a)}catch(n){i(n)}})}l(em,"downloadMVF");function s2(r){return r.endsWith("/")?r:"".concat(r,"/")}l(s2,"normalizeUrl");async function G8(r,e){let t="".concat(r.baseUri?s2(r.baseUri):i2,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await gn()(t,{headers:{Authorization:"Bearer ".concat(e)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}l(G8,"getMakerBundleURL");async function xl(r,e=!1){let t="".concat(r.key),i=yn.getInstance(),n=(i==null?void 0:i.loadSessionData(e2))||{},o=Math.floor(Date.now()/1e3);if(n[t]&&o<n[t].expiresTimestamp)return n[t];let a=e?await V8(r,o):await j8(r,o),u={...n,[t]:a};return i==null||i.saveSessionData(e2,u),a}l(xl,"getAccessToken");async function V8(r,e){var o;let t="".concat((o=r.baseAuthUri)!=null?o:F8,"oauth2/token"),i=await gn()(t,{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:e+n.expires_in}}l(V8,"fetchAccessTokenEnterprise");async function j8(r,e){let t="".concat(r.baseAuthUri?s2(r.baseAuthUri):i2,"api/api-key/token"),i=await gn()(t,{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:e+n.expires_in}}l(j8,"fetchAccessToken");function Sp(r){var i,n,o,a,u,c,p,f;let e=new TextDecoder,t=e.decode.bind(e);try{let y={"connection.json":JSON.parse(t(r["connection.json"])),"manifest.geojson":JSON.parse(t(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(t(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(t(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(r["node.geojson"])),obstruction:{},space:{},entrance:{}};if(r.enterprise!=null&&(y.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(y.enterprise.locations=JSON.parse(t((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(y.enterprise.categories=JSON.parse(t((a=r.enterprise)==null?void 0:a["categories.json"]))),(u=r.enterprise)!=null&&u["venue.json"]&&(y.enterprise.venue=JSON.parse(t((c=r.enterprise)==null?void 0:c["venue.json"]))),(p=r.enterprise)!=null&&p["locationInstances.json"]&&(y.enterprise.locationInstances=JSON.parse(t((f=r.enterprise)==null?void 0:f["locationInstances.json"])))),r["floorstack.json"]!=null?y["floorstack.json"]=JSON.parse(t(r["floorstack.json"])):r["mapstack.json"]!=null&&(y["mapstack.json"]=JSON.parse(t(r["mapstack.json"]))),y["floorstack.json"]==null&&y["mapstack.json"]==null&&y["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(y["floor.geojson"]=JSON.parse(t(r["floor.geojson"]))),y["floor.geojson"]==null&&y["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(y["styles.json"]=JSON.parse(t(r["styles.json"]))),"shapes.json"in r&&(y["shapes.json"]=JSON.parse(t(r["shapes.json"]))),r.annotation!=null){y.annotation={};let v=Object.keys(r.annotation);for(let x of v){let P=x.replace(/\.json|\.geojson/g,"");y.annotation[P]=JSON.parse(t(r.annotation[x]))}}let g=Object.keys(r.space);for(let v of g){let x=v.replace(/\.json|\.geojson/g,"");y.space[x]=JSON.parse(t(r.space[v]))}if(r.obstruction!=null){let v=Object.keys(r.obstruction);for(let x of v){let P=x.replace(/\.json|\.geojson/g,"");y.obstruction[P]=JSON.parse(t(r.obstruction[x]))}}else y.obstruction={};if(r.entrance!=null){let v=Object.keys(r.entrance);for(let x of v){let P=x.replace(/\.json|\.geojson/g,"");y.entrance[P]=JSON.parse(t(r.entrance[x]))}}else y.entrance={};if("floorImages"in r&&r.floorImages!=null){y.floorImages={};for(let v of Object.keys(r.floorImages)){let x=v.replace(/\.json|\.geojson/g,"");y.floorImages[x]=JSON.parse(t(r.floorImages[v]))}}if("textAreas"in r&&r.textAreas!=null){y.textAreas={};for(let v of Object.keys(r.textAreas)){let x=v.replace(/\.json|\.geojson/g,"");y.textAreas[x]=JSON.parse(t(r.textAreas[v]))}}return y}catch(y){throw A.error(y),new Error("MVF parsing failed! Probably encountered a bad file.")}}l(Sp,"parseMVF");function H8(r){if(r==null||typeof r!="object")return!1;let e=["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&&e.push("styles.json"),"shapes.json"in r&&e.push("shapes.json");for(let t of e)if(r[t]==null||r[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}l(H8,"validateStaticMVFFiles");async function Mp(r){return new Promise(async(e,t)=>{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-644AOSQ2.js")).unzipSync(r);if(!H8(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let u of a){if(n[u].length===0)continue;let c=u.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[u];continue}if(c[0]==="image"){A.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[u]}e(o)}catch(i){t(i)}})}l(Mp,"unzipMVF");function lo(){let r="us",e={};function t(){return X8(z8(r),e)}return l(t,"getState"),{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(e.baseUri=i.baseUri),i.baseAuthUri&&(e.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(e.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){e.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?t2.baseUri:t().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?t2.baseAuthUri:t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){r="us",e={}},__getState:t}}l(lo,"createEnvControl");var l2=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"}),t2=Object.freeze({...l2,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),U8=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"}),W8=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 X8(r,e){return{...r,...e}}l(X8,"getAuthStateByEnvironment");var Z8={eu:U8,us:l2,"us-staging":W8};function z8(r){return Z8[r]}l(z8,"getEnvironmentAuthState");m();m();m();m();var ht=63710088e-1,c2={centimeters:ht*100,centimetres:ht*100,degrees:ht/111325,feet:ht*3.28084,inches:ht*39.37,kilometers:ht/1e3,kilometres:ht/1e3,meters:ht,metres:ht,miles:ht/1609.344,millimeters:ht*1e3,millimetres:ht*1e3,nauticalmiles:ht/1852,radians:1,yards:ht*1.0936},xF={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/ht,yards:1.0936133};function vn(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}l(vn,"feature");function Cr(r,e,t){if(t===void 0&&(t={}),!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(!tm(r[0])||!tm(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return vn(i,e,t)}l(Cr,"point");function Di(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return vn(i,e,t)}l(Di,"lineString");function Sl(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}l(Sl,"featureCollection");function u2(r,e){e===void 0&&(e="kilometers");var t=c2[e];if(!t)throw new Error(e+" units is invalid");return r*t}l(u2,"radiansToLength");function p2(r,e){e===void 0&&(e="kilometers");var t=c2[e];if(!t)throw new Error(e+" units is invalid");return r/t}l(p2,"lengthToRadians");function Ml(r){var e=r%(2*Math.PI);return e*180/Math.PI}l(Ml,"radiansToDegrees");function Ot(r){var e=r%360;return e*Math.PI/180}l(Ot,"degreesToRadians");function tm(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l(tm,"isNumber");function rr(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")}l(rr,"getCoord");function Ht(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")}l(Ht,"getCoords");function d2(r){return r.type==="Feature"?r.geometry:r}l(d2,"getGeom");function h2(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}l(h2,"getType");function Y8(r,e,t){t===void 0&&(t={});for(var i=rr(r),n=Ht(e),o=0;o<n.length-1;o++){var a=!1;if(t.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),q8(n[o],n[o+1],i,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}l(Y8,"booleanPointOnLine");function q8(r,e,t,i,n){var o=t[0],a=t[1],u=r[0],c=r[1],p=e[0],f=e[1],y=t[0]-u,g=t[1]-c,v=p-u,x=f-c,P=y*x-g*v;if(n!==null){if(Math.abs(P)>n)return!1}else if(P!==0)return!1;if(i){if(i==="start")return Math.abs(v)>=Math.abs(x)?v>0?u<o&&o<=p:p<=o&&o<u:x>0?c<a&&a<=f:f<=a&&a<c;if(i==="end")return Math.abs(v)>=Math.abs(x)?v>0?u<=o&&o<p:p<o&&o<=u:x>0?c<=a&&a<f:f<a&&a<=c;if(i==="both")return Math.abs(v)>=Math.abs(x)?v>0?u<o&&o<p:p<o&&o<u:x>0?c<a&&a<f:f<a&&a<c}else return Math.abs(v)>=Math.abs(x)?v>0?u<=o&&o<=p:p<=o&&o<=u:x>0?c<=a&&a<=f:f<=a&&a<=c;return!1}l(q8,"isPointOnLineSegment");var f2=Y8;m();m();m();function Pp(r,e,t){if(r!==null)for(var i,n,o,a,u,c,p,f=0,y=0,g,v=r.type,x=v==="FeatureCollection",P=v==="Feature",b=x?r.features.length:1,S=0;S<b;S++){p=x?r.features[S].geometry:P?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var E=0;E<u;E++){var I=0,w=0;if(a=g?p.geometries[E]:p,a!==null){c=a.coordinates;var _=a.type;switch(f=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(c,y,S,I,w)===!1)return!1;y++,I++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],y,S,I,w)===!1)return!1;y++,_==="MultiPoint"&&I++}_==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(e(c[i][n],y,S,I,w)===!1)return!1;y++}_==="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-f;o++){if(e(c[i][n][o],y,S,I,w)===!1)return!1;y++}w++}I++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Pp(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Pp,"coordEach");function rm(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}l(rm,"featureEach");function $8(r,e){var t,i,n,o,a,u,c,p,f,y,g=0,v=r.type==="FeatureCollection",x=r.type==="Feature",P=v?r.features.length:1;for(t=0;t<P;t++){for(u=v?r.features[t].geometry:x?r.geometry:r,p=v?r.features[t].properties:x?r.properties:{},f=v?r.features[t].bbox:x?r.bbox:void 0,y=v?r.features[t].id:x?r.id:void 0,c=u?u.type==="GeometryCollection":!1,a=c?u.geometries.length:1,n=0;n<a;n++){if(o=c?u.geometries[n]:u,o===null){if(e(null,g,p,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}l($8,"geomEach");function Pl(r,e){$8(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(vn(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(u){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var f=t.coordinates[p],y={type:c,coordinates:f};if(e(vn(y,n),i,p)===!1)return!1}})}l(Pl,"flattenEach");function J8(r,e){Pl(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,c=0,p=0,f=0;if(Pp(t,function(y,g,v,x,P){if(u===void 0||i>c||x>p||P>f){u=y,c=i,p=x,f=P,o=0;return}var b=Di([u,y],t.properties);if(e(b,i,n,P,o)===!1)return!1;o++,u=y})===!1)return!1}}})}l(J8,"segmentEach");function m2(r,e,t){var i=t,n=!1;return J8(r,function(o,a,u,c,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,c,p),n=!0}),i}l(m2,"segmentReduce");function im(r){var e=[1/0,1/0,-1/0,-1/0];return Pp(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}l(im,"bbox");im.default=im;var Tp=im;function K8(r,e){e===void 0&&(e={});var t=Tp(r),i=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return Cr([i,n],e.properties,e)}l(K8,"center");var y2=K8;m();m();function Q8(r,e,t){t===void 0&&(t={});var i=rr(r),n=rr(e),o=Ot(n[1]-i[1]),a=Ot(n[0]-i[0]),u=Ot(i[1]),c=Ot(n[1]),p=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return u2(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),t.units)}l(Q8,"distance");var bn=Q8;function wp(r,e){return e===void 0&&(e={}),m2(r,function(t,i){var n=i.geometry.coordinates;return t+bn(n[0],n[1],e)},0)}l(wp,"length");m();m();m();function Ip(r,e,t){if(t===void 0&&(t={}),t.final===!0)return e9(r,e);var i=rr(r),n=rr(e),o=Ot(i[0]),a=Ot(n[0]),u=Ot(i[1]),c=Ot(n[1]),p=Math.sin(a-o)*Math.cos(c),f=Math.cos(u)*Math.sin(c)-Math.sin(u)*Math.cos(c)*Math.cos(a-o);return Ml(Math.atan2(p,f))}l(Ip,"bearing");function e9(r,e){var t=Ip(e,r);return t=(t+180)%360,t}l(e9,"calculateFinalBearing");m();function co(r,e,t,i){i===void 0&&(i={});var n=rr(r),o=Ot(n[0]),a=Ot(n[1]),u=Ot(t),c=p2(e,i.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(u)),f=o+Math.atan2(Math.sin(u)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),y=Ml(f),g=Ml(p);return Cr([y,g],i.properties)}l(co,"destination");m();m();function t9(r){if(!r)throw new Error("geojson is required");var e=[];return Pl(r,function(t){r9(t,e)}),Sl(e)}l(t9,"lineSegment");function r9(r,e){var t=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":t=Ht(i);break;case"LineString":t=[Ht(i)]}t.forEach(function(n){var o=i9(n,r.properties);o.forEach(function(a){a.id=e.length,e.push(a)})})}}l(r9,"lineSegmentFeature");function i9(r,e){var t=[];return r.reduce(function(i,n){var o=Di([i,n],e);return o.bbox=n9(i,n),t.push(o),n}),t}l(i9,"createSegments");function n9(r,e){var t=r[0],i=r[1],n=e[0],o=e[1],a=t<n?t:n,u=i<o?i:o,c=t>n?t:n,p=i>o?i:o;return[a,u,c,p]}l(n9,"bbox");var nm=t9;var Tx=ul(Mx(),1);function Iw(r,e){var t={},i=[];if(r.type==="LineString"&&(r=vn(r)),e.type==="LineString"&&(e=vn(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var n=Px(r,e);return n&&i.push(n),Sl(i)}var o=(0,Tx.default)();return o.load(nm(e)),rm(nm(r),function(a){rm(o.search(a),function(u){var c=Px(a,u);if(c){var p=Ht(c).join(",");t[p]||(t[p]=!0,i.push(c))}})}),Sl(i)}l(Iw,"lineIntersect");function Px(r,e){var t=Ht(r),i=Ht(e);if(t.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=t[0][0],o=t[0][1],a=t[1][0],u=t[1][1],c=i[0][0],p=i[0][1],f=i[1][0],y=i[1][1],g=(y-p)*(a-n)-(f-c)*(u-o),v=(f-c)*(o-p)-(y-p)*(n-c),x=(a-n)*(o-p)-(u-o)*(n-c);if(g===0)return null;var P=v/g,b=x/g;if(P>=0&&P<=1&&b>=0&&b<=1){var S=n+P*(a-n),E=o+P*(u-o);return Cr([S,E])}return null}l(Px,"intersects");var wx=Iw;function Ew(r,e,t){t===void 0&&(t={});var i=Cr([1/0,1/0],{dist:1/0}),n=0;return Pl(r,function(o){for(var a=Ht(o),u=0;u<a.length-1;u++){var c=Cr(a[u]);c.properties.dist=bn(e,c,t);var p=Cr(a[u+1]);p.properties.dist=bn(e,p,t);var f=bn(c,p,t),y=Math.max(c.properties.dist,p.properties.dist),g=Ip(c,p),v=co(e,y,g+90,t),x=co(e,y,g-90,t),P=wx(Di([v.geometry.coordinates,x.geometry.coordinates]),Di([c.geometry.coordinates,p.geometry.coordinates])),b=null;P.features.length>0&&(b=P.features[0],b.properties.dist=bn(e,b,t),b.properties.location=n+bn(c,b,t)),c.properties.dist<i.properties.dist&&(i=c,i.properties.index=u,i.properties.location=n),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=u+1,i.properties.location=n+f),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=u),n+=f}}),i}l(Ew,"nearestPointOnLine");var Hl=Ew;function _w(r,e,t){var i=Ht(t);if(h2(t)!=="LineString")throw new Error("line must be a LineString");var n=Hl(t,r),o=Hl(t,e),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var u=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)u.push(i[c]);return u.push(a[1].geometry.coordinates),Di(u,t.properties)}l(_w,"lineSlice");var Xy=_w;var Dw=1e-7;function Zy(r){return{type:"Point",coordinates:r}}l(Zy,"point");function Ow(r,e){let{coordinates:t}=e.geometry,{coordinates:i}=r.geometry,n=t.map(o=>Hl(r,Zy(o)));return i.reduce((o,a)=>{let u=Xy(Zy(a),n[0],r),c=Xy(Zy(a),n[1],r),p=wp(u)<wp(c)?u:c;return p.properties={...r.properties,entrances:[]},o.concat([p])},[])}l(Ow,"splitObstructionByEntrance");function zy(r,e){return e.reduce((t,i)=>{let n={epsilon:Dw},o=t.obstructions.findIndex(u=>f2(y2(i),u,n)),a=t.obstructions[o];if(a){let[u,c]=Ow(a,i);t.entrances.push(i),t.obstructions.splice(o,1,u,c)}return t},{obstructions:[r],entrances:[]})}l(zy,"findAndSplitObstructionByAllEntrances");m();m();m();var ja=class ja{constructor(e,t,i){d(this,"__type",ja.__type);d(this,"id",ae());d(this,"latitude");d(this,"longitude");d(this,"floorId");this.latitude=e,this.longitude=t,this.floorId=i}static is(e){return e.__type===ja.__type}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};l(ja,"Coordinate"),d(ja,"__type","coordinate");var Yy=ja,ue=Yy;m();m();m();m();var qy=class qy{constructor(e){d(this,"id");this.id=e}};l(qy,"BaseMetaData");var fo=qy;var Wl,Ha,Ul=class Ul extends fo{constructor(t){super(String(ae()));M(this,Wl,{});M(this,Ha,void 0);T(this,Ha,t.mvfData)}static is(t){return t.__type===Ul.__type}get url(){return s(this,Ha).url}get name(){return s(this,Ha).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,Wl)))delete s(this,Wl)[t]}};Wl=new WeakMap,Ha=new WeakMap,l(Ul,"Hyperlink"),d(Ul,"__type","hyperlink");var $y=Ul,Pd=$y;var Jy=class Jy{constructor(e,t){d(this,"id");d(this,"links",[]);var n;this.id=e;let i=(n=t==null?void 0:t.links)!=null?n:[];i.length>0&&(this.links=i.map(o=>new Pd({mvfData:o})))}};l(Jy,"BaseMapData");var we=Jy;var wn,ft,mo,yo,Ua=class Ua extends we{constructor(t,i){super(i.mvfData.properties.id);d(this,"__type",Ua.__type);M(this,wn,void 0);M(this,ft,{});M(this,mo,void 0);M(this,yo,void 0);T(this,wn,t),T(this,mo,i.floorId),T(this,yo,i.mvfData)}static is(t){return t.__type===Ua.__type}get locations(){return s(this,ft).locations?s(this,ft).locations:(s(this,ft).locations=(s(this,wn).locationIdsByNodeId[this.id]||[]).map(t=>s(this,wn).getById("enterprise-location",t)).filter(Boolean),s(this,ft).locations)}get floor(){let t=s(this,wn).getById("floor",s(this,mo));if(t==null)throw new Error("Floor ".concat(s(this,mo)," not found!"));return t}get coordinate(){if(s(this,ft).coordinate==null){let[t,i]=s(this,yo).geometry.coordinates;s(this,ft).coordinate=new ue(i,t,s(this,mo))}return s(this,ft).coordinate}get externalId(){var t;return(t=s(this,yo).properties.externalId)!=null?t:""}get neighbors(){if(s(this,ft).neighbours==null){let t=s(this,yo).properties.neighbors.map(i=>{let n=s(this,wn).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,ft).neighbours=t}return s(this,ft).neighbours}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,ft)))delete s(this,ft)[t]}};wn=new WeakMap,ft=new WeakMap,mo=new WeakMap,yo=new WeakMap,l(Ua,"Node"),d(Ua,"__type","node");var Ky=Ua,Jr=Ky;m();var go,ki,vo,Mr,Wa=class Wa extends we{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);d(this,"__type",Wa.__type);M(this,go,void 0);M(this,ki,void 0);M(this,vo,void 0);M(this,Mr,void 0);T(this,ki,{}),T(this,Mr,i.mvfData),T(this,go,t),T(this,vo,i.floorId)}static is(t){return t.__type===Wa.__type}get name(){var t,i,n;return"details"in s(this,Mr).properties?(n=(i=s(this,Mr).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,Mr).properties.externalId)!=null?t:""}get externalId(){var t;return(t=s(this,Mr).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,Mr).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=s(this,Mr).properties.details)==null?void 0:t.images)!=null?i:[]}get floor(){let t=s(this,go).getById("floor",s(this,vo));if(t==null)throw new Error("Floor ".concat(s(this,vo)," not found!"));return t}get center(){if(s(this,ki).center==null){let[[t,i],[n,o]]=s(this,Mr).geometry.coordinates,a=(t+n)/2,u=(i+o)/2;s(this,ki).center=new ue(u,a,s(this,vo))}return s(this,ki).center}get isExterior(){var n;let t=s(this,go).obstructionIdByEntranceId[this.id],i=s(this,go).getMVFFeatureById("obstruction",t);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 t of Object.keys(s(this,ki)))delete s(this,ki)[t]}};go=new WeakMap,ki=new WeakMap,vo=new WeakMap,Mr=new WeakMap,l(Wa,"Door"),d(Wa,"__type","door");var Qy=Wa,or=Qy;m();var In,bo,Wt,At,Xa=class Xa extends we{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);d(this,"__type",Xa.__type);M(this,In,void 0);M(this,bo,void 0);M(this,Wt,{});M(this,At,void 0);T(this,In,t),T(this,bo,i.floorId),T(this,At,i.mvfData)}static is(t){return t.__type===Xa.__type}get name(){var t,i,n;return"details"in s(this,At).properties?(n=(i=s(this,At).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,At).properties.externalId)!=null?t:""}get type(){return Aw(s(this,At).properties.kind)}get description(){var t,i;return(i=(t=s(this,At).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=s(this,At).properties.details)==null?void 0:t.images)!=null?i:[]}get externalId(){var t;return(t=s(this,At).properties.externalId)!=null?t:""}get locations(){if(s(this,Wt).locations)return s(this,Wt).locations;s(this,Wt).locations=[];let t=s(this,In).locationsBySpaceId[s(this,At).properties.id];if((t==null?void 0:t.length)>0)for(let i of t){let n=s(this,In).getById("enterprise-location",i.id);n&&s(this,Wt).locations.push(n)}return s(this,Wt).locations}get floor(){let t=s(this,In).getById("floor",s(this,bo));if(t==null)throw new Error("Floor ".concat(s(this,bo)," not found!"));return t}get doors(){return s(this,At).properties.destinationNodes.reduce((t,i)=>{let n=s(this,In).doorsByNodeId[i];return n&&t.push(n),t},[])}get center(){var t;if(s(this,Wt).center==null){let[i,n]=(t=s(this,At).properties.center)!=null?t:[0,0];s(this,Wt).center=new ue(n,i,s(this,bo))}return s(this,Wt).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,Wt)))delete s(this,Wt)[t]}};In=new WeakMap,bo=new WeakMap,Wt=new WeakMap,At=new WeakMap,l(Xa,"Space"),d(Xa,"__type","space");var eg=Xa,Lw=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Aw(r){if(r==null||r==="default")return"room";let e=r.toLowerCase();return Lw.includes(e)?e:"room"}l(Aw,"validateSpaceType");var Xt=eg;m();var Pr,Ie,Fi,Za=class Za extends we{constructor(t,i){super(i.mvfData.id);d(this,"__type",Za.__type);M(this,Pr,void 0);M(this,Ie,{});M(this,Fi,void 0);T(this,Pr,t),T(this,Fi,i.mvfData)}static is(t){return t.__type===Za.__type}get name(){var t,i;return"name"in s(this,Fi)?(i=s(this,Fi).name)!=null?i:"":(t=s(this,Fi).externalId)!=null?t:""}get externalId(){var t;return(t=s(this,Fi).externalId)!=null?t:""}get elevation(){return s(this,Fi).elevation}get spaces(){if(s(this,Ie).spaces==null){let t=s(this,Pr).spaces.filter(i=>i.floor.id===this.id);s(this,Ie).spaces=t}return s(this,Ie).spaces}get objects(){if(s(this,Ie).objects==null){let t=s(this,Pr).objects.filter(i=>i.floor.id===this.id);s(this,Ie).objects=t}return s(this,Ie).objects}get connections(){if(s(this,Ie).connections==null){let t=s(this,Pr).connections.filter(i=>i.floors.includes(this));s(this,Ie).connections=t}return s(this,Ie).connections}get doors(){if(s(this,Ie).doors==null){let t=s(this,Pr).doors.filter(i=>i.floor.id===this.id);s(this,Ie).doors=t}return s(this,Ie).doors}get annotations(){if(s(this,Ie).annotations==null){let t=s(this,Pr).annotations.filter(i=>i.floor.id===this.id);s(this,Ie).annotations=t}return s(this,Ie).annotations}get pois(){if(s(this,Ie).pois==null){let t=s(this,Pr).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Ie).pois=t}return s(this,Ie).pois}get floorStack(){if(s(this,Ie).floorStack==null){let t=s(this,Pr).floorStacks.find(i=>i.floors.includes(this));s(this,Ie).floorStack=t}return s(this,Ie).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,Ie)))delete s(this,Ie)[t]}};Pr=new WeakMap,Ie=new WeakMap,Fi=new WeakMap,l(Za,"Floor"),d(Za,"__type","floor");var tg=Za,Bi=tg;m();m();m();function Xl(r){return typeof r=="string"?r:r.id}l(Xl,"getId");function rg(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}l(rg,"isPosition");m();function mt(r){let e;if(Xt.is(r)||or.is(r)||Zt.is(r))e=r.center;else if(Kr.is(r)||En.is(r))e=r.coordinate;else if(ue.is(r))e=r;else if(Jr.is(r))e=r.coordinate;else if(Tr.is(r))e=r.coordinates[0];else return;return e}l(mt,"getCoordinateFromStuffs");m();m();var Zl={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},Qr="ExteriorWalls",_n="Walls",Ix=0,za="InteriorDoors",Ya="ExteriorDoors";var Ex=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function ig(r){var e,t;if((e=r.outdoorView)!=null&&e.enabled&&!((t=r.outdoorView)!=null&&t.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}l(ig,"validateOptions");function ng(r,e){var n,o,a,u;let t=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||e.outdoorViewToken,i={...Zl,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!t:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(u=Zl.outdoorView)==null?void 0:u.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return t&&i.outdoorView&&(i.outdoorView.token=t),i}l(ng,"handleShow3DMapOptionDefault");function _x(r){let e={remove_watermark:!1};if(r)try{let t=vp(r);Object.assign(e,t.capabilities)}catch(t){A.error("Error decoding capabilities from token",t)}return e}l(_x,"handleTokenCapabilities");var $a,Ri,ar,qa=class qa extends we{constructor(t,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,n.properties.details);d(this,"__type",qa.__type);M(this,$a,void 0);M(this,Ri,void 0);M(this,ar,void 0);T(this,Ri,{}),T(this,$a,t),T(this,ar,i.mvfDataByFloorId)}static is(t){return t.__type===qa.__type}get name(){var i,n,o;let t=Object.values(s(this,ar))[0];return"details"in t.properties?(o=(n=t.properties.details)==null?void 0:n.name)!=null?o:"":(i=t.properties.externalId)!=null?i:""}get description(){var t,i;return(i=(t=Object.values(s(this,ar))[0].properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=Object.values(s(this,ar))[0].properties.details)==null?void 0:t.images)!=null?i:[]}get accessible(){var t;return(t=Object.values(s(this,ar))[0].properties.accessible)!=null?t:!1}get externalId(){var t;return(t=Object.values(s(this,ar))[0].properties.externalId)!=null?t:""}get type(){var t,i;return(i=(t=Object.values(s(this,ar))[0].properties.kind)==null?void 0:t.split(".")[1])!=null?i:"unknown"}get coordinates(){return s(this,Ri).coordinates==null&&(s(this,Ri).coordinates=Object.entries(s(this,ar)).map(([t,i])=>new ue(i.geometry.coordinates[1],i.geometry.coordinates[0],t))),s(this,Ri).coordinates}get nodes(){return Object.values(s(this,ar))[0].properties.nodes.map(t=>s(this,$a).getById("node",t))}get floors(){return this.coordinates.map(t=>t.floorId?s(this,$a).getById("floor",t.floorId):void 0).filter(fl)}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,Ri)))delete s(this,Ri)[t]}};$a=new WeakMap,Ri=new WeakMap,ar=new WeakMap,l(qa,"Connection"),d(qa,"__type","connection");var og=qa,Ni=og;m();var zl,Co,Dn,sr,Ja=class Ja extends we{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);d(this,"__type",Ja.__type);M(this,zl,void 0);M(this,Co,void 0);M(this,Dn,{});M(this,sr,void 0);T(this,zl,t),T(this,Co,i.floorId),T(this,sr,i.mvfData)}static is(t){return t.__type===Ja.__type}get name(){var t,i,n;return"details"in s(this,sr).properties?(n=(i=s(this,sr).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,sr).properties.externalId)!=null?t:""}get externalId(){var t;return(t=s(this,sr).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,sr).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;return(i=(t=s(this,sr).properties.details)==null?void 0:t.images)!=null?i:[]}get type(){let t=s(this,sr).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=s(this,zl).getById("floor",s(this,Co));if(t==null)throw new Error("Floor ".concat(s(this,Co)," not found!"));return t}get center(){var t;if(s(this,Dn).center==null){let[i,n]=(t=s(this,sr).properties.center)!=null?t:[0,0];s(this,Dn).center=new ue(n,i,s(this,Co))}return s(this,Dn).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(s(this,Dn)))s(this,Dn)[t]=null}};zl=new WeakMap,Co=new WeakMap,Dn=new WeakMap,sr=new WeakMap,l(Ja,"MapObject"),d(Ja,"__type","object");var ag=Ja,Zt=ag;m();m();var ql,Ka,Yl=class Yl extends fo{constructor(t){super(String(ae()));M(this,ql,{});M(this,Ka,void 0);T(this,Ka,t.mvfData)}static is(t){return t.__type===Yl.__type}get url(){return s(this,Ka).url}get name(){return s(this,Ka).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,ql)))delete s(this,ql)[t]}};ql=new WeakMap,Ka=new WeakMap,l(Yl,"Image"),d(Yl,"__type","image");var sg=Yl,Td=sg;var $l,xo,wr,Ir,Qa=class Qa extends we{constructor(t,i){super(i.mvfData.properties.id,i.mvfData.properties.details);d(this,"__type",Qa.__type);M(this,$l,void 0);M(this,xo,void 0);M(this,wr,{});M(this,Ir,void 0);T(this,$l,t),T(this,Ir,i.mvfData),T(this,xo,i.floorId)}static is(t){return t.__type===Qa.__type}get name(){var t,i,n;return"details"in s(this,Ir).properties?(n=(i=s(this,Ir).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,Ir).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,Ir).properties.details)==null?void 0:t.description)!=null?i:""}get images(){var t,i;if(s(this,wr).images==null){let n=(i=(t=s(this,Ir).properties.details)==null?void 0:t.images)!=null?i:[];s(this,wr).images=n.map(o=>new Td({mvfData:o}))}return s(this,wr).images}get floor(){let t=s(this,$l).getById("floor",s(this,xo));if(t==null)throw new Error("Floor ".concat(s(this,xo)," not found!"));return t}get coordinate(){var t;if(s(this,wr).coordinate==null){let[i,n]=(t=s(this,Ir).geometry.coordinates)!=null?t:[0,0];s(this,wr).coordinate=new ue(n,i,s(this,xo))}return s(this,wr).coordinate}get externalId(){var t;return(t=s(this,Ir).properties.externalId)!=null?t:""}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in s(this,wr))s(this,wr)[t]=null}};$l=new WeakMap,xo=new WeakMap,wr=new WeakMap,Ir=new WeakMap,l(Qa,"PointOfInterest"),d(Qa,"__type","point-of-interest");var lg=Qa,Kr=lg;m();var Jl,So,On,Mo,Kl,ug,es=class es extends we{constructor(t,i){super(i.mvfData.properties.id);M(this,Kl);d(this,"__type",es.__type);M(this,Jl,void 0);M(this,So,void 0);M(this,On,{});M(this,Mo,void 0);T(this,Jl,t),T(this,So,i.floorId),T(this,Mo,i.mvfData)}static is(t){return t.__type===es.__type}get group(){return U(this,Kl,ug).call(this).group}get type(){return U(this,Kl,ug).call(this).type}get externalId(){var t;return(t=s(this,Mo).properties.externalId)!=null?t:""}get coordinate(){if(s(this,On).coordinate==null){let[t,i]=s(this,Mo).geometry.coordinates;s(this,On).coordinate=new ue(i,t,s(this,So))}return s(this,On).coordinate}get floor(){let t=s(this,Jl).getById("floor",s(this,So));if(t==null)throw new Error("Floor ".concat(s(this,So)," not found!"));return t}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(s(this,On)))delete s(this,On)[t]}};Jl=new WeakMap,So=new WeakMap,On=new WeakMap,Mo=new WeakMap,Kl=new WeakSet,ug=l(function(){let[t,i]=s(this,Mo).properties.symbolId.split("--");return{group:t,type:i}},"#getGroupAndTypeFromSymbolId"),l(es,"Annotation"),d(es,"__type","annotation");var cg=es,En=cg;m();var Ql,Ln,Gi,ts=class ts extends we{constructor(t,i){super(i.mvfData.id);d(this,"__type",ts.__type);M(this,Ql,void 0);M(this,Ln,{});M(this,Gi,void 0);T(this,Ql,t),T(this,Gi,i.mvfData)}static is(t){return t.__type===ts.__type}get type(){return s(this,Gi).type}get name(){var t;return(t=s(this,Gi).name)!=null?t:""}get externalId(){var t;return(t=s(this,Gi).externalId)!=null?t:""}get floors(){var t,i;if(s(this,Ln).floors==null){let n=((i=(t=s(this,Gi).floors)!=null?t:s(this,Gi).maps)!=null?i:[]).reduce((o,a)=>{let u=s(this,Ql).floorsById[a];return u&&o.push(u),o},[]);s(this,Ln).floors=n}return s(this,Ln).floors}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,Ln)))delete s(this,Ln)[t]}};Ql=new WeakMap,Ln=new WeakMap,Gi=new WeakMap,l(ts,"FloorStack"),d(ts,"__type","floor-stack");var pg=ts,wd=pg;m();m();var kw=new Set(["polygons"]),An,Fe,ei,ec,rs=class rs extends we{constructor(t,i){super(i.mvfData.externalId,i.mvfData);d(this,"__type",rs.__type);d(this,"description");d(this,"name","");d(this,"amenity");d(this,"externalId","");d(this,"extra");d(this,"gallery");d(this,"instances");d(this,"logo");d(this,"operationHours");d(this,"phone");d(this,"picture");d(this,"shortName");d(this,"showFloatingLabelWhenImagePresent");d(this,"showLogo");d(this,"siblingGroups");d(this,"social");d(this,"sortOrder",-1);d(this,"states");d(this,"tags");d(this,"type","");M(this,An,void 0);M(this,Fe,{});M(this,ei,void 0);M(this,ec,void 0);T(this,An,t),T(this,ei,i.mvfData),T(this,ec,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!kw.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,An).getPropTranslation(this.__type,n,s(this,ei).id,s(this,ei)[n])}})}static is(t){return t.__type===rs.__type}get categories(){return s(this,Fe).categories?s(this,Fe).categories:(s(this,Fe).categories=(s(this,ec).map(t=>s(this,An).getById("enterprise-category",t))||[]).filter(Boolean),s(this,Fe).categories)}get coordinates(){if(s(this,Fe).coordinates)return s(this,Fe).coordinates;s(this,Fe).coordinates=[];for(let t=0;t<this.nodes.length;t++)s(this,Fe).coordinates.push(this.nodes[t].coordinate);return s(this,Fe).coordinates}get nodes(){if(s(this,Fe).nodes)return s(this,Fe).nodes;s(this,Fe).nodes=[];for(let t=0;t<s(this,ei).nodes.length;t++){let i=s(this,An).getById("node",s(this,ei).nodes[t].id);i&&s(this,Fe).nodes.push(i)}return s(this,Fe).nodes}get spaces(){if(s(this,Fe).spaces)return s(this,Fe).spaces;s(this,Fe).spaces=[];for(let t=0;t<s(this,ei).polygons.length;t++){let i=s(this,An).getById("space",s(this,ei).polygons[t].id);i&&s(this,Fe).spaces.push(i)}return s(this,Fe).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,Fe)))delete s(this,Fe)[t]}};An=new WeakMap,Fe=new WeakMap,ei=new WeakMap,ec=new WeakMap,l(rs,"EnterpriseLocation"),d(rs,"__type","enterprise-location");var dg=rs,Tr=dg;m();var Fw=new Set,Po,yt,ti,is=class is extends we{constructor(t,i){super(i.mvfData.externalId,i.mvfData);d(this,"__type",is.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);M(this,Po,void 0);M(this,yt,{});M(this,ti,void 0);T(this,Po,t),T(this,ti,i.mvfData);for(let n in i.mvfData)!Fw.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Po).getPropTranslation(this.__type,n,s(this,ti).id,s(this,ti)[n])}})}static is(t){return t.__type===is.__type}get children(){if(s(this,yt).children)return s(this,yt).children;s(this,yt).children=[];for(let t=0;t<s(this,ti).children.length;t++){let i=s(this,Po).getById("enterprise-category",s(this,ti).children[t]);i&&s(this,yt).children.push(i)}return s(this,yt).children}get locations(){if(s(this,yt).locations)return s(this,yt).locations;s(this,yt).locations=[];for(let t=0;t<s(this,ti).locations.length;t++){let i=s(this,Po).getById("enterprise-location",s(this,ti).locations[t]);i&&s(this,yt).locations.push(i)}return s(this,yt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,yt)))delete s(this,yt)[t]}};Po=new WeakMap,yt=new WeakMap,ti=new WeakMap,l(is,"EnterpriseCategory"),d(is,"__type","enterprise-category");var hg=is,Id=hg;var Bw=l((r,e)=>{var y,g;let t={},i={},n={},o={},a={},u={},c={},p={},f=globalThis.Object.keys(r.space);for(let v of f){let x=r.space[v];if(x!=null)for(let P of x.features){p[P.properties.id]=v,a[P.properties.id]=P;for(let b of P.properties.destinationNodes)n[b]==null&&(n[b]=[]),n[b].push(P.properties.id);if(P.properties.kind==="desk-entrance"&&(o[P.properties.externalId]==null&&(o[P.properties.externalId]=[]),o[P.properties.externalId].push(...P.properties.destinationNodes)),!["void","desk-entrance"].includes((y=P.properties.kind)!=null?y:"")){if((g=P.properties.kind)!=null&&g.includes("connection")){let b="".concat(P.geometry.coordinates[1],"-").concat(P.geometry.coordinates[0]);u[b]==null&&(u[b]=[]),u[b].push(P.properties.id);continue}if(P.properties.kind==="poi"){let b=new Kr(e,{floorId:v,mvfData:P});i[P.properties.id]=b}else{let b=new Xt(e,{floorId:v,mvfData:P});t[P.properties.id]=b}}}}for(let v in u){let x=u[v],P={};for(let S of x){let E=p[S],I=a[S];P[E]=I}let b=new Ni(e,{mvfDataByFloorId:P});c[b.id]=b}return{spacesById:t,poisById:i,connectionsById:c,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:u}},"processMVFSpaces"),Rw=l((r,e)=>{var n;let t={},i={};for(let o of r["node.geojson"].features){i[o.properties.id]=o;let a=new Jr(e,{mvfData:o,floorId:(n=o.properties.floor)!=null?n:o.properties.map});t[o.properties.id]=a}return{nodesById:t,mvfNodesById:i}},"processMVFNodes"),Nw=l((r,e)=>{let t={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let u=r.obstruction[a];if(u!=null)for(let c of u.features){i[c.properties.id]=c;for(let f of c.properties.entrances)n[f]=c.properties.id;if(c.properties.kind==="Wall")continue;let p=new Zt(e,{floorId:a,mvfData:c});t[c.properties.id]=p}}return{objectsById:t,mvfObstructionById:i,obstructionIdByEntranceId:n}},"processMVFObstructions"),Gw=l((r,e)=>{let t={},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 Bi(e,{mvfData:n.properties});t[n.properties.id]=o}else for(let n of r["map.geojson"]){i[n.id]=n;let o=new Bi(e,{mvfData:n});t[n.id]=o}return{floorsById:t,mvfFloorsById:i}},"processMVFFloors"),Vw=l((r,e)=>{let t={},i={},n=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(n!=null)for(let o of n){let a=new wd(e,{mvfData:o});t[o.id]=a,i[o.id]=o}return{floorStacksById:t,mvfFloorStacksById:i}},"processMVFFloorStacks"),jw=l(r=>{let e={},t=r["connection.json"].reduce((i,n)=>(n.nodes.forEach(o=>i[o]=n),e[n.id]=n,i),{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:t}},"processMVFConnections"),Hw=l((r,e)=>{let t={},i={},n={},o=globalThis.Object.keys(r.entrance);for(let a of o){let u=r.entrance[a];if(u!=null)for(let c of u.features){n[c.properties.id]=c;let p=new or(e,{floorId:a,mvfData:c});c.properties.node&&(i[c.properties.node]=p),t[c.properties.id]=p}}return{doorsById:t,doorsByNodeId:i,mvfEntrancesById:n}},"processMVFEntrances"),Uw=l((r,e,t)=>{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 u=a==null?void 0:a.properties,c=e[u.anchorId]||t[u.anchorId];if(c!=null&&u!=null){let p=c.properties;p.textArea=u,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),Ww=l((r,e,t)=>{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 u=a==null?void 0:a.properties,c=e[u.anchorId]||t[u.anchorId];if(c!=null&&u!=null){let p=c.properties;p.image=u,p.image&&(p.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),Xw=l((r,e)=>{let t={},i={};if(r.annotation==null)return{annotationsById:t,mvfAnnotationsById:i};let n=globalThis.Object.keys(r.annotation);for(let o of n){let a=r.annotation[o];if(a!=null)for(let u of a.features){i[u.properties.id]=u;let c=new En(e,{floorId:o,mvfData:u});t[u.properties.id]=c}}return{annotationsById:t,mvfAnnotationsById:i}},"processMVFAnnotations"),Dx=l((r,e)=>{var g,v,x,P,b,S,E,I,w;let t={},i={},n=((v=(g=r.enterprise)==null?void 0:g.locations)!=null?v:[]).reduce((_,D)=>(_[D.id]=D,_),{}),o={},a={},u={},c={},p={},f=((x=r.enterprise)==null?void 0:x.venue)||{};for(let _ of(b=(P=r.enterprise)==null?void 0:P.categories)!=null?b:[])o[_.id]=new Id(e,{mvfData:_}),a[_.id]=_,_.locations.forEach(D=>{c[D]==null&&(c[D]=[]),c[D].push(_.id)});let y={};for(let _ of(E=(S=r.enterprise)==null?void 0:S.locationInstances)!=null?E:[]){let R={...n[_.parent],polygons:[],nodes:[],..._};y[R.parent]==null&&(y[R.parent]=[]),y[R.parent].push(new Tr(e,{mvfData:R,categoryIds:c[R.id]}))}for(let _ of(w=(I=r.enterprise)==null?void 0:I.locations)!=null?w:[]){i[_.id]=new Tr(e,{mvfData:_,categoryIds:c[_.id],locationInstances:y[_.id]}),_.nodes.forEach(D=>{p[D.id]==null&&(p[D.id]=[]),p[D.id].push(_.id)});for(let D of _.polygons)u[D.id]==null&&(u[D.id]=[]),u[D.id].push(_)}if(e.enterpriseMode===!0){for(let _ in e.mvfConnectionsById){let D={};for(let R of e.mvfConnectionsById[_].nodes){let V=e.nodesById[R],G=e.mvfConnectionsById[_];V!=null&&(D[V.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[V.coordinate.longitude,V.coordinate.latitude]},properties:{id:_,externalId:G.externalId,kind:"enterprise."+G.type,destinationNodes:[],flags:"",type:G.type,nodes:G.nodes,accessible:G.accessible}})}Object.keys(D).length>0&&(t[_]=new Ni(e,{mvfDataByFloorId:D}))}e.connectionsById=t}return{locationIdsByNodeId:p,locationsBySpaceId:u,mvfLocationsById:n,mvfCategoriesById:a,locationsById:i,categoriesById:o,venue:f}},"createEnterpriseDataFromMVF"),Ox=l((r,e)=>{let{spacesById:t,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:u,connectionIdsByLatLon:c}=Bw(r,e),{nodesById:p,mvfNodesById:f}=Rw(r,e),{objectsById:y,mvfObstructionById:g,obstructionIdByEntranceId:v}=Nw(r,e),{floorsById:x,mvfFloorsById:P}=Gw(r,e),{floorStacksById:b,mvfFloorStacksById:S}=Vw(r,e),{mvfConnectionsById:E,mvfConnectionsByNodeId:I}=jw(r),{doorsById:w,doorsByNodeId:_,mvfEntrancesById:D}=Hw(r,e),{annotationsById:R,mvfAnnotationsById:V}=Xw(r,e);return Ww(r,o,g),Uw(r,o,g),{spacesById:t,nodesById:p,objectsById:y,floorsById:x,floorStacksById:b,connectionsById:u,doorsById:w,doorsByNodeId:_,poisById:n,annotationsById:R,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:v,connectionIdsByLatLon:c,mvfSpacesById:o,mvfNodesById:f,mvfObstructionById:g,mvfFloorsById:P,mvfFloorStacksById:S,mvfConnectionsById:E,mvfConnectionsByNodeId:I,mvfEntrancesById:D,mvfAnnotationsById:V}},"createDataFromMVF");m();var Zw=new Set,tc,rc,ns=class ns extends we{constructor(t,i){super(i.mvfData.externalId,i.mvfData);d(this,"__type",ns.__type);d(this,"countrycode");d(this,"externalId","");d(this,"defaultLanguage",{code:"en",name:"English"});d(this,"defaultMap");d(this,"extra");d(this,"icon");d(this,"languages",[]);d(this,"links",[]);d(this,"logo");d(this,"mappedinWebUrl");d(this,"slug","");d(this,"topLocations");d(this,"tzid");M(this,tc,{});M(this,rc,void 0);T(this,rc,i.mvfData);for(let n in i.mvfData)!Zw.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(t){return t.__type===ns.__type}get name(){var t;return(t=s(this,rc).name)!=null?t:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,tc)))delete s(this,tc)[t]}};tc=new WeakMap,rc=new WeakMap,l(ns,"EnterpriseVenue"),d(ns,"__type","enterprise-venue");var fg=ns,mg=fg;m();function yg(r){var e,t,i,n;return{type:"downloaded",data:r,optimized:{locations:(t=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:t.reduce((o,a)=>(o[a.id]=a,o),{}),categories:(n=(i=r.enterprise)==null?void 0:i.categories)==null?void 0:n.reduce((o,a)=>(o[a.id]=a,o),{})}}}l(yg,"parseLocalePackToLanguagePack");m();m();m();m();m();m();m();m();function gg(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return Lx(this.cover(e,t),e,t,r)}l(gg,"default");function Lx(r,e,t,i){if(isNaN(e)||isNaN(t))return r;var n,o=r._root,a={data:i},u=r._x0,c=r._y0,p=r._x1,f=r._y1,y,g,v,x,P,b,S,E;if(!o)return r._root=a,r;for(;o.length;)if((P=e>=(y=(u+p)/2))?u=y:p=y,(b=t>=(g=(c+f)/2))?c=g:f=g,n=o,!(o=o[S=b<<1|P]))return n[S]=a,r;if(v=+r._x.call(null,o.data),x=+r._y.call(null,o.data),e===v&&t===x)return a.next=o,n?n[S]=a:r._root=a,r;do n=n?n[S]=new Array(4):r._root=new Array(4),(P=e>=(y=(u+p)/2))?u=y:p=y,(b=t>=(g=(c+f)/2))?c=g:f=g;while((S=b<<1|P)===(E=(x>=g)<<1|v>=y));return n[E]=o,n[S]=a,r}l(Lx,"add");function Ax(r){var e,t,i=r.length,n,o,a=new Array(i),u=new Array(i),c=1/0,p=1/0,f=-1/0,y=-1/0;for(t=0;t<i;++t)isNaN(n=+this._x.call(null,e=r[t]))||isNaN(o=+this._y.call(null,e))||(a[t]=n,u[t]=o,n<c&&(c=n),n>f&&(f=n),o<p&&(p=o),o>y&&(y=o));if(c>f||p>y)return this;for(this.cover(c,p).cover(f,y),t=0;t<i;++t)Lx(this,a[t],u[t],r[t]);return this}l(Ax,"addAll");m();function vg(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(t))n=(t=Math.floor(r))+1,o=(i=Math.floor(e))+1;else{for(var a=n-t||1,u=this._root,c,p;t>r||r>=n||i>e||e>=o;)switch(p=(e<i)<<1|r<t,c=new Array(4),c[p]=u,u=c,a*=2,p){case 0:n=t+a,o=i+a;break;case 1:t=n-a,o=i+a;break;case 2:n=t+a,i=o-a;break;case 3:t=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=u)}return this._x0=t,this._y0=i,this._x1=n,this._y1=o,this}l(vg,"default");m();function bg(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}l(bg,"default");m();function Cg(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]]}l(Cg,"default");m();m();function Ke(r,e,t,i,n){this.node=r,this.x0=e,this.y0=t,this.x1=i,this.y1=n}l(Ke,"default");function xg(r,e,t){var i,n=this._x0,o=this._y0,a,u,c,p,f=this._x1,y=this._y1,g=[],v=this._root,x,P;for(v&&g.push(new Ke(v,n,o,f,y)),t==null?t=1/0:(n=r-t,o=e-t,f=r+t,y=e+t,t*=t);x=g.pop();)if(!(!(v=x.node)||(a=x.x0)>f||(u=x.y0)>y||(c=x.x1)<n||(p=x.y1)<o))if(v.length){var b=(a+c)/2,S=(u+p)/2;g.push(new Ke(v[3],b,S,c,p),new Ke(v[2],a,S,b,p),new Ke(v[1],b,u,c,S),new Ke(v[0],a,u,b,S)),(P=(e>=S)<<1|r>=b)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-P],g[g.length-1-P]=x)}else{var E=r-+this._x.call(null,v.data),I=e-+this._y.call(null,v.data),w=E*E+I*I;if(w<t){var _=Math.sqrt(t=w);n=r-_,o=e-_,f=r+_,y=e+_,i=v.data}}return i}l(xg,"default");m();function Sg(r){if(isNaN(f=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var e,t=this._root,i,n,o,a=this._x0,u=this._y0,c=this._x1,p=this._y1,f,y,g,v,x,P,b,S;if(!t)return this;if(t.length)for(;;){if((x=f>=(g=(a+c)/2))?a=g:c=g,(P=y>=(v=(u+p)/2))?u=v:p=v,e=t,!(t=t[b=P<<1|x]))return this;if(!t.length)break;(e[b+1&3]||e[b+2&3]||e[b+3&3])&&(i=e,S=b)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[b]=o:delete e[b],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[S]=t:this._root=t),this):(this._root=o,this)}l(Sg,"default");function kx(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}l(kx,"removeAll");m();function Mg(){return this._root}l(Mg,"default");m();function Pg(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}l(Pg,"default");m();function Tg(r){var e=[],t,i=this._root,n,o,a,u,c;for(i&&e.push(new Ke(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(i=t.node,o=t.x0,a=t.y0,u=t.x1,c=t.y1)&&i.length){var p=(o+u)/2,f=(a+c)/2;(n=i[3])&&e.push(new Ke(n,p,f,u,c)),(n=i[2])&&e.push(new Ke(n,o,f,p,c)),(n=i[1])&&e.push(new Ke(n,p,a,u,f)),(n=i[0])&&e.push(new Ke(n,o,a,p,f))}return this}l(Tg,"default");m();function wg(r){var e=[],t=[],i;for(this._root&&e.push(new Ke(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var n=i.node;if(n.length){var o,a=i.x0,u=i.y0,c=i.x1,p=i.y1,f=(a+c)/2,y=(u+p)/2;(o=n[0])&&e.push(new Ke(o,a,u,f,y)),(o=n[1])&&e.push(new Ke(o,f,u,c,y)),(o=n[2])&&e.push(new Ke(o,a,y,f,p)),(o=n[3])&&e.push(new Ke(o,f,y,c,p))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}l(wg,"default");m();function Fx(r){return r[0]}l(Fx,"defaultX");function Ig(r){return arguments.length?(this._x=r,this):this._x}l(Ig,"default");m();function Bx(r){return r[1]}l(Bx,"defaultY");function Eg(r){return arguments.length?(this._y=r,this):this._y}l(Eg,"default");function ic(r,e,t){var i=new _g(e==null?Fx:e,t==null?Bx:t,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}l(ic,"quadtree");function _g(r,e,t,i,n,o){this._x=r,this._y=e,this._x0=t,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}l(_g,"Quadtree");function Rx(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}l(Rx,"leaf_copy");var gt=ic.prototype=_g.prototype;gt.copy=function(){var r=new _g(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=Rx(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=Rx(i));return r};gt.add=gg;gt.addAll=Ax;gt.cover=vg;gt.data=bg;gt.extent=Cg;gt.find=xg;gt.remove=Sg;gt.removeAll=kx;gt.root=Mg;gt.size=Pg;gt.visit=Tg;gt.visitAfter=wg;gt.x=Ig;gt.y=Eg;m();m();var Dg=class Dg{constructor({origin:e,destination:t,distance:i=0,angle:n=0,pathWeight:o=0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");this.origin=e,this.destination=t,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")}};l(Dg,"Edge");var To=Dg;m();m();m();function Og(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=rr(r),n=d2(e),o=n.type,a=e.bbox,u=n.coordinates;if(a&&zw(i,a)===!1)return!1;o==="Polygon"&&(u=[u]);for(var c=!1,p=0;p<u.length&&!c;p++)if(Nx(i,u[p][0],t.ignoreBoundary)){for(var f=!1,y=1;y<u[p].length&&!f;)Nx(i,u[p][y],!t.ignoreBoundary)&&(f=!0),y++;f||(c=!0)}return c}l(Og,"booleanPointInPolygon");function Nx(r,e,t){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var n=0,o=e.length-1;n<e.length;o=n++){var a=e[n][0],u=e[n][1],c=e[o][0],p=e[o][1],f=r[1]*(a-c)+u*(c-r[0])+p*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(u-r[1])*(p-r[1])<=0;if(f)return!t;var y=u>r[1]!=p>r[1]&&r[0]<(c-a)*(r[1]-u)/(p-u)+a;y&&(i=!i)}return i}l(Nx,"inRing");function zw(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}l(zw,"inBBox");m();m();function Vi([r,e],[t,i]){let n=e-i,o=r-t;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}l(Vi,"getAngle");m();var Yw=63710088e-1;function ji(r,e){let[t,i]=r.map(f=>f*Math.PI/180),[n,o]=e.map(f=>f*Math.PI/180),a=o-i,u=n-t,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Yw*p}l(ji,"getDistance");m();m();function Ed(r,e,t,i){let[n,o]=r,[a,u]=e,[c,p]=t,[f,y]=i;if(o===u&&n===a||p===y&&c===f)return null;let g=(f-c)*(u-o)-(y-p)*(a-n);if(g===0)return null;let v=((y-p)*(n-c)-(f-c)*(o-p))/g,x=((u-o)*(n-c)-(a-n)*(o-p))/g;if(v<0||v>1||x<0||x>1)return null;let P=o+v*(u-o);return[n+v*(a-n),P]}l(Ed,"getLineIntersection");m();function Lg(r,e,t,i){let n=co(r,t/1e3,i),o=co(e,t/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}l(Lg,"getOffsetLine");m();function Ag(r){let e=r*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}l(Ag,"radToDegNormalized");function Gx(r,e,t=[],i=0){let n=!0,o=r.geometry.coordinates,a=e.geometry.coordinates,u=Ag(Vi(o,a)-Math.PI/2),c=Ag(Vi(o,a)+Math.PI/2);return t.forEach(p=>{if(i>0){let f=Lg(o,a,i,u),y=Lg(o,a,i,c);if(Ed(f[0],f[1],p[0],p[1])||Ed(y[0],y[1],p[0],p[1])){n=!1;return}}else if(Ed(o,a,p[0],p[1])){n=!1;return}}),n}l(Gx,"hasLineOfSight");var wo,nc,kg,Dd,Vx,Od,jx,Ld,Hx,Ad,Ux,kd,Wx,Fd,Xx,Bd,Fg=class Fg{constructor({nodes:e,groupBy:t}){M(this,nc);M(this,Dd);M(this,Od);M(this,Ld);M(this,Ad);M(this,kd);M(this,Fd);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);M(this,wo,void 0);M(this,Bd,l((e,t)=>{let i=0;for(let n of t)(!n[s(this,wo)]||n[s(this,wo)]===e.properties[s(this,wo)])&&Og(e.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));T(this,wo,t);let{features:i}=e;this.nodesById=U(this,Dd,Vx).call(this,i),U(this,Od,jx).call(this),U(this,Ld,Hx).call(this,i,t)}getShortestEuclideanDistance(e,t){return t.reduce((i,n)=>{let o=ji(e.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:e,destinationNodeIds:t,excludedNodeIds:i,zones:n}){let o=U(this,nc,kg).call(this,e),a=U(this,nc,kg).call(this,t);if(o.length===0||a.length===0)return[];let{frontier:u,cameFrom:c,costSoFar:p}=U(this,Ad,Ux).call(this,o,a);for(;u.length>0;){let f=u.shift();if(!f)break;if(U(this,kd,Wx).call(this,f.origin,a))return U(this,Fd,Xx).call(this,c,f.origin.properties.id);for(let y of this.edges[f.origin.properties.id]){let g=p[f.origin.properties.id]+y.weight+s(this,Bd).call(this,y.destination,n);if(!(g===1/0||i!=null&&i.has(y.destination.properties.id))&&(p[y.destination.properties.id]==null||g<p[y.destination.properties.id])){let v=g+this.getShortestEuclideanDistance(y.destination,a);p[y.destination.properties.id]=g,c[y.destination.properties.id]=y,u.push({origin:y.destination,priority:v})}}u.sort((y,g)=>y.priority-g.priority)}return[]}};wo=new WeakMap,nc=new WeakSet,kg=l(function(e){return e.map(t=>this.nodesById[t]).filter(Boolean)},"#filterValidNodes"),Dd=new WeakSet,Vx=l(function(e){return e.reduce((t,i)=>(t[i.properties.id]=i,t),{})},"#createNodesById"),Od=new WeakSet,jx=l(function(){for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].properties.neighbors=this.nodesById[e].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},"#removeInvalidNeighbors"),Ld=new WeakSet,Hx=l(function(e,t){e.forEach(i=>{let n=t==="default"?t:i.properties[t];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 u=this.nodesById[o],c=ji(i.geometry.coordinates,u.geometry.coordinates),p=Vi(i.geometry.coordinates,u.geometry.coordinates);return new To({origin:i,destination:u,pathWeight:a,distance:c,angle:p})})})},"#initializeEdgesAndGroups"),Ad=new WeakSet,Ux=l(function(e,t){let i=[],n={},o={};return e.forEach(a=>{let u=this.getShortestEuclideanDistance(a,t);i.push({origin:a,priority:u}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,u)=>a.priority-u.priority),{frontier:i,cameFrom:n,costSoFar:o}},"#initializeSearch"),kd=new WeakSet,Wx=l(function(e,t){return t.some(i=>i.properties.id===e.properties.id)},"#isDestinationNode"),Fd=new WeakSet,Xx=l(function(e,t){let i=[],n=e[t];for(;n;)i.push(n),n=e[n.origin.properties.id];return i.reverse()},"#reconstructPath"),Bd=new WeakMap,l(Fg,"NavigationGraph");var _d=Fg;var qw=.4,Bg=class Bg{constructor({nodes:e,geojsonCollection:t,groupBy:i="default"}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"cache",{nodeTreesByGroup:new Map});d(this,"findNearestNode",l(e=>{var n;let t=this.groupBy==="default"?this.groupBy:e.properties[this.groupBy];if(!this.cache.nodeTreesByGroup.has(t)){let o=(n=this.graph.nodesByGroup.get(t))!=null?n:[],a=ic();a.x(u=>u.geometry.coordinates[1]),a.y(u=>u.geometry.coordinates[0]),a.addAll(o),this.cache.nodeTreesByGroup.set(t,a)}return this.cache.nodeTreesByGroup.get(t).find(e.geometry.coordinates[1],e.geometry.coordinates[0])||null},"findNearestNode"));d(this,"generatePath",l(e=>{let{destination:t}=e[e.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<e.length;o++){let{origin:a}=e[o],u={id:a.properties.id,angle:e[o].angle,distance:e[o].distance};this.groupBy!=="default"&&(u.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:u})}let n={id:t.properties.id};return this.groupBy!=="default"&&(n.groupBy=t.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:n}),i},"generatePath"));d(this,"getDistance",l((e,t)=>ji(e,t),"getDistance"));d(this,"getAngle",l((e,t)=>Vi(e,t),"getAngle"));this.groupBy=i,this.graph=new _d({nodes:e,groupBy:this.groupBy}),((t==null?void 0:t.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 u=this.groupBy==="default"?this.groupBy:o.properties[this.groupBy];this.geometryEdgesByMapId.has(u)||this.geometryEdgesByMapId.set(u,[]),a.forEach((c,p)=>{this.geometryEdgesByMapId.get(u).push([c,a[p+1]||a[0]])})}})}getDirections({zones:e,originIds:t,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var p,f;let a=(p=o==null?void 0:o.enabled)!=null?p:!0,u=e!=null?e:[],c=this.graph.aStar({originIds:t,destinationNodeIds:i,zones:u,excludedNodeIds:new Set(n)});return c.length===0?{type:"FeatureCollection",features:[]}:(a&&(c=this.simplifyAllSteps(c,(f=o==null?void 0:o.bufferRadius)!=null?f:qw)),this.generatePath(c))}simplifyAllSteps(e,t){var c,p;let i=[],n=[e[0]];for(let f=1;f<e.length;f++)if(this.groupBy!=="default"&&e[f].origin.properties[this.groupBy]!==e[f-1].origin.properties[this.groupBy]){let y=e[f-1].origin.properties[this.groupBy],g=(c=this.geometryEdgesByMapId.get(y))!=null?c:[];i.push(...this.simplifySteps(n,g,t)),n=[e[f]]}else n.push(e[f]);let o=e[e.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],u=(p=this.geometryEdgesByMapId.get(a))!=null?p:[];return i.push(...this.simplifySteps(n,u,t)),i}simplifySteps(e,t,i){if(e.length<3)return e;let n=[e[0]],o=1;for(let a=o+2;a<e.length;a++)if(!Gx(e[o].origin,e[a].origin,t,i)){let u=a-1;n.push(new To({...e[o],destination:e[u].origin,distance:ji(e[o].origin.geometry.coordinates,e[u].origin.geometry.coordinates),angle:Vi(e[o].origin.geometry.coordinates,e[u].origin.geometry.coordinates)})),o=u}return n.push(new To({...e[o],destination:e[e.length-1].origin,distance:ji(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates),angle:Vi(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates)}),e[e.length-1]),n}};l(Bg,"Navigator");var os=Bg;m();function ri(r){return[r.longitude,r.latitude]}l(ri,"convertCoordinateToPosition");function $w(r){return new Map(r.map(e=>{let{properties:t}=e,{id:i}=t;return[i,e]}))}l($w,"getEntranceMap");var Rg=l((r,e)=>{let t=$w(e),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((u,c)=>(t.has(c)&&u.push(t.get(c)),u),[]);if(a.length){let{entrances:u,obstructions:c}=zy(n,a);o=c.map(p=>p.geometry.coordinates),i.entrances.features.push(...u)}i.walls.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function Zx(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.text&&(t.text=r.text),r.appearance&&(t.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!==void 0&&(t.enabled=r.enabled),r.interactive!==null&&(t.options.interactive=r.interactive),t}l(Zx,"translateLabelStateToGeojsonCore");function zx(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!=null&&(t.enabled=r.enabled),r.interactive!=null&&(t.options.interactive=r.interactive),t}l(zx,"translateMarkerStateToGeojsonCore");function Rd(r,e){var i,n;let t={};return e==null||(r.color&&(t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url),r.opacity!==void 0&&(t.opacity=r.opacity)),t}l(Rd,"translateDoorsStateToGeojsonCore");function Ng(r,e){var i,n;let t={};return e==null||(r.color&&(t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url)),t}l(Ng,"translateWallsStateToGeojsonCore");function Yx(r,e){var i,n;let t={};return e==null||(r.color&&(r.color==="initial"?t.color=e.initialColor:t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(t.hoverColor=r.hoverColor),r.interactive!==void 0&&(t.interactive=r.interactive),r.height!==void 0&&(t.height=r.height),r.opacity!==void 0&&(t.opacity=r.opacity)),t}l(Yx,"translateSpaceStateToGeojsonCore");function qx(r,e){return((e-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}l(qx,"differenceBetweenAngles");function $x(r,e){let t="Left";return r<=-Math.PI/4?t="Right":r<=-e?t="SlightRight":r<=e?t="Straight":r<=Math.PI/4?t="SlightLeft":t="Left",t}l($x,"getRelativeBearing");function Jx(r){let e={};for(let t in r){let i=r[t];if(i!=null){if(i.id=t,"polygons"in i)for(let n of i.polygons)e[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)e[n]=i;else if("points"in i)for(let n of i.points)e[n]=i}}return e}l(Jx,"extractStyleMap");function Gg(r,e){return r.reduce((t,i)=>{let n=e[i.properties.id];return n==null||(t.has(n)||t.set(n,[]),t.get(n).push(i)),t},new Map)}l(Gg,"groupGeometryByStyle");function oc(r,e={}){var n,o,a,u,c,p;let t={...r},i=(o=(n=e==null?void 0:e.style)==null?void 0:n.shading)!=null?o:e==null?void 0:e.shadingAndOutlines;if(i===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(t.shading={start:i.start,end:i.end,intensity:i.intensity}),t.outline=(u=(a=e==null?void 0:e.style)==null?void 0:a.outlines)!=null?u:e==null?void 0:e.shadingAndOutlines,"lineStrings"in r){let f=(p=(c=e==null?void 0:e.style)==null?void 0:c.wallTopColor)!=null?p:e==null?void 0:e.wallTopColor;f!=null&&(t.topColor=f)}return t}l(oc,"translateToCoreStyle");var Kx=l((r,e)=>{var t,i,n,o;switch(r){case"interior-walls":return(t=e.currentMap)==null?void 0:t.currentFloor.layers.get(_n);case"exterior-walls":return(i=e.currentMap)==null?void 0:i.currentFloor.layers.get(Qr);case"interior-doors":return(n=e.currentMap)==null?void 0:n.currentFloor.layers.get(za);case"exterior-doors":return(o=e.currentMap)==null?void 0:o.currentFloor.layers.get(Ya);default:return typeof r=="string"?r:r.id}},"getTargetID");function Vg(r){return new Promise(e=>{r.onComplete(e),r.onStop(e)})}l(Vg,"tweenToPromise");var Qx=Math.PI*.1,vt,bt,zt,Hi,Io,Hd,e7,kn,as,Ud,t7,jg=class jg{constructor(e,t){M(this,Hd);M(this,kn);M(this,Ud);M(this,vt,{});M(this,bt,void 0);M(this,zt,void 0);M(this,Hi,void 0);M(this,Io,void 0);T(this,bt,t),T(this,zt,e.features),T(this,bt,t),T(this,zt,e.features)}get path(){return s(this,zt).map(e=>s(this,bt).getById("node",e.properties.id)).filter(Boolean)}get coordinates(){return s(this,vt).coordinates?s(this,vt).coordinates:(s(this,vt).coordinates=s(this,zt).map(e=>new ue(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),s(this,vt).coordinates)}get distance(){return s(this,vt).distance?s(this,vt).distance:(s(this,vt).distance=s(this,zt).reduce((e,t)=>e+(t.properties.distance||0),0),s(this,vt).distance)}get instructions(){if(s(this,zt).length<2)return[];if(s(this,vt).instructions)return s(this,vt).instructions;let e=[],t=0;for(let i=0;i<s(this,zt).length;i++){let n=s(this,zt)[i],o=s(this,zt)[i-1],a=s(this,zt)[i+1],u=new ue(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=U(this,Hd,e7).call(this,{prevDirection:o,direction:n,nextDirection:a});t+=(o==null?void 0:o.properties.distance)||0;for(let p of c)p&&(e.push({action:p,distance:t,coordinate:u,node:s(this,bt).getById("node",n.properties.id)}),t=0)}return s(this,vt).instructions=e,s(this,vt).instructions}};vt=new WeakMap,bt=new WeakMap,zt=new WeakMap,Hi=new WeakMap,Io=new WeakMap,Hd=new WeakSet,e7=l(function(e){var g,v,x;let{prevDirection:t,direction:i,nextDirection:n}=e,o=t&&s(this,bt).getById("floor",t.properties.groupBy),a=s(this,bt).getById("floor",i.properties.groupBy),u=n&&s(this,bt).getById("floor",n.properties.groupBy),c=[];t||c.push({type:"Departure"});let p=s(this,bt).getMVFFeatureByNodeId("connection",i.properties.id),f=s(this,bt).getMVFFeatureByNodeId("connection",(g=n==null?void 0:n.properties.id)!=null?g:""),y=p?s(this,bt).getById("connection",p.id):void 0;if(p)if(!s(this,Hi)||s(this,Hi)==="exit")c.push(U(this,kn,as).call(this,"TakeConnection",a,u,y,p)),T(this,Hi,"take"),T(this,Io,y);else{let P=s(this,bt).getMVFFeatureByNodeId("connection",(v=t==null?void 0:t.properties.id)!=null?v:""),b=s(this,bt).getById("connection",(x=P==null?void 0:P.id)!=null?x:"");c.push(U(this,kn,as).call(this,"ExitConnection",a,o,b,P)),T(this,Hi,"exit"),T(this,Io,y)}else f&&s(this,Hi)==="take"?(c.push(U(this,kn,as).call(this,"ExitConnection",a,o,s(this,Io))),T(this,Hi,"exit"),T(this,Io,y)):u&&a.id!==u.id?c.push(U(this,kn,as).call(this,"TakeConnection",a,u,y)):o&&o.id!==a.id?c.push(U(this,kn,as).call(this,"ExitConnection",a,o,y)):c.push(U(this,Ud,t7).call(this,t,i));return n||c.push({type:"Arrival"}),c},"#getActions"),kn=new WeakSet,as=l(function(e,t,i,n,o){var c,p;let a="none";if(t.elevation!=null&&(i==null?void 0:i.elevation)!=null){let f=t.elevation-i.elevation;f>0?a="down":f<0&&(a="up")}let u=(p=(c=n==null?void 0:n.type)!=null?c:o==null?void 0:o.type)!=null?p:"stairs";return{type:e,fromFloor:t,toFloor:i,direction:a,connection:n,connectionType:u}},"#createConnectionAction"),Ud=new WeakSet,t7=l(function(e,t){let i=e?-qx(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=Qx?{type:"Turn",bearing:$x(i,Qx),referencePosition:"At"}:null},"#createTurnAction"),l(jg,"Directions");var Vd=jg,Hg=class Hg{constructor({nodes:e,geojsonCollection:t,connections:i,groupBy:n}){d(this,"navigator");d(this,"connections");d(this,"getDirections",l((e,t,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:u}}=i,c=e.flatMap(v=>this.getNodesFromTarget(v,n)),p=t.flatMap(v=>this.getNodesFromTarget(v,n)),f=this.getExcludedNodeIds(o).filter(v=>!c.includes(v)&&!p.includes(v)),y=this.navigator.getDirections({zones:i.zones.map(v=>{var x;return{geometry:v.geometry,cost:v.cost,map:(x=v.floor)==null?void 0:x.id}}),originIds:c,destinationNodeIds:p,excludedNodeIds:f,simplify:{enabled:a,bufferRadius:u}});this.addCoordinateDirections(y,e,t);let g=new Vd(y,n);if(!(g.distance===0&&new Set([...c,...p]).size===c.length+p.length))return g},"getDirections"));d(this,"getExcludedNodeIds",l(e=>e?this.connections.reduce((t,i)=>i.accessible?t:t.concat(i.nodes),[]):[],"getExcludedNodeIds"));d(this,"addCoordinateDirections",l((e,[t],[i])=>{if(e.features.length){if(ue.is(t)){let n=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,n)}if(ue.is(i)){let n=this.createDirectionFeature(i,0,0),o=e.features[e.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]),e.features.push(n)}}},"addCoordinateDirections"));d(this,"getNodesFromTarget",l((e,t)=>{if(ue.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e));return i?[i.properties.id]:[]}else if(Kr.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e.coordinate));return i?[i.properties.id]:[]}else if(or.is(e)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(e.center));return i?[i.properties.id]:[]}else if(Xt.is(e)){let i=t==null?void 0:t.getMVFFeatureById("space",e.id);return i==null?[]:i.properties.destinationNodes}else{if(Ni.is(e))return e.coordinates.reduce((i,n)=>{let o=this.navigator.findNearestNode(this.createCoordinateFeature(n));return o&&i.push(o.properties.id),i},[]);if(Zt.is(e)){let i=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return i!=null?i:[]}else return Tr.is(e)?e.nodes.map(i=>i.id):Jr.is(e)?[e.id]:[]}},"getNodesFromTarget"));d(this,"createCoordinateFeature",l(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{map:e.floorId}}),"createCoordinateFeature"));d(this,"createDirectionFeature",l((e,t,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:i}}),"createDirectionFeature"));this.navigator=new os({nodes:e,geojsonCollection:this.createCollection(t),groupBy:n}),this.connections=i}createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[i,n])=>t.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};l(Hg,"DirectionsInternal");var jd=Hg;var ie,ss,Ug=class Ug extends J{constructor(t,i){var u,c,p,f;super();d(this,"Analytics");M(this,ie,{});d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"locationsById");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"locationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"localePacksUrls");d(this,"currentLanguage");d(this,"languagePacks",{});d(this,"binaryBundle");d(this,"envControl");M(this,ss,void 0);d(this,"getDirectionsMultiDestination",l((t,i,n)=>this.getDirections(t,i,{...n,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",l((t,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:u=!1}=n||{},c=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,f=(n==null?void 0:n.zones)||[],y={accessible:o,zones:f,smoothing:{enabled:c!=null?c:!0,radius:p!=null?p:.75}};if(u&&Array.isArray(i)){let g=Array.isArray(t)?t:[t],v=[];for(let x of i){let P=Array.isArray(x)?x:[x],b=this.directions.getDirections(g,P,y,this);if(!b){A.error("getDirections failed due to missing directions for one of the segments");return}g=P,v.push(b)}return v}else{let g=Array.isArray(t)?t:[t],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){A.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,v[0].id),this.directions.getDirections(g,v,y,this)}},"getDirections"));let n=(u=i==null?void 0:i.env)!=null?u:lo();this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Ea,this.localePacksUrls=(c=i==null?void 0:i.localePacksUrls)!=null?c:{},this.mvf=t,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.enterpriseMode=(p=i==null?void 0:i.enterprise)!=null?p:!1;let o=Ox(t,this);this.nodesById=o.nodesById,this.spacesById=o.spacesById,this.floorsById=o.floorsById,this.floorStacksById=o.floorStacksById,this.connectionsById=o.connectionsById,this.objectsById=o.objectsById,this.doorsById=o.doorsById,this.pointsOfInterestById=o.poisById,this.annotationsById=o.annotationsById,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.doorsByNodeId=o.doorsByNodeId,this.spaceIdsByDestinationNodeId=o.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=o.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=o.obstructionIdByEntranceId;let a=Dx(t,this);this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.locationsBySpaceId=a.locationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,a.venue.name!=null&&(this.venue=new mg(this,{mvfData:a.venue}),this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:a.mvfLocationsById,categories:a.mvfCategoriesById}},(f=i==null?void 0:i.languagePacks)==null||f.forEach(({language:y,localePack:g})=>{this.languagePacks[y.code]=yg(g)}),this.currentLanguage=this.venue.defaultLanguage),this.directions=new jd({nodes:t["node.geojson"],geojsonCollection:t.enterprise?t.space:t.obstruction,connections:t["connection.json"],groupBy:"map"})}getEnv(){let t=this;return{get baseUri(){var i;return t.envControl.getBaseUri((i=t.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return t.envControl.getBaseAuthUri()},get analyticsBaseUri(){return t.envControl.getAnalyticsBaseUri()},get tileServerUri(){return t.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var t;return(t=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?t:""}get mapCenter(){return new ue(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return s(this,ie).spaces==null&&(s(this,ie).spaces=globalThis.Object.values(this.spacesById)),s(this,ie).spaces}get objects(){return s(this,ie).objects==null&&(s(this,ie).objects=globalThis.Object.values(this.objectsById)),s(this,ie).objects}get connections(){return s(this,ie).connections==null&&(s(this,ie).connections=globalThis.Object.values(this.connectionsById)),s(this,ie).connections}get floors(){return s(this,ie).floors==null&&(s(this,ie).floors=globalThis.Object.values(this.floorsById)),s(this,ie).floors}get floorStacks(){return s(this,ie).floorStacks==null&&(s(this,ie).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,ie).floorStacks}get doors(){return s(this,ie).doors==null&&(s(this,ie).doors=globalThis.Object.values(this.doorsById)),s(this,ie).doors}get pointsOfInterest(){return s(this,ie).pointsOfInterest==null&&(s(this,ie).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,ie).pointsOfInterest}get annotations(){return s(this,ie).annotations==null&&(s(this,ie).annotations=globalThis.Object.values(this.annotationsById)),s(this,ie).annotations}get nodes(){return s(this,ie).nodes==null&&(s(this,ie).nodes=globalThis.Object.values(this.nodesById)),s(this,ie).nodes}get locations(){return s(this,ie).locations==null&&(s(this,ie).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,ie).categories==null&&(s(this,ie).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get mvfFloors(){return s(this,ie).mvfFloors==null&&(s(this,ie).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,ie).mvfFloors}get mvfFloorStacks(){return s(this,ie).mvfFloorStacks==null&&(s(this,ie).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,ie).mvfFloorStacks}getById(t,i){switch(t){case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[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"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:throw new Error("Unknown type: ".concat(t))}}getMapDataById(t){var i,n,o,a,u,c,p;return(p=(c=(u=(a=(o=(n=(i=this.spacesById[t])!=null?i:this.floorsById[t])!=null?n:this.nodesById[t])!=null?o:this.doorsById[t])!=null?a:this.connectionsById[t])!=null?u:this.objectsById[t])!=null?c:this.pointsOfInterestById[t])!=null?p:this.annotationsById[t]}getMVFFeatureById(t,i){switch(t){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];default:throw new Error("Unknown MVF feature type: ".concat(t))}}getMVFFeatureByNodeId(t,i){switch(t){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getMVFFeatureByType(t){switch(t){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getPropTranslation(t,i,n,o){var p,f;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,u=t==="enterprise-category"?"categories":t==="enterprise-location"?"locations":void 0;if(!u)return o;let c=(f=(p=this.languagePacks[a])==null?void 0:p.optimized)==null?void 0:f[u];if(c){let y=c[n];if(y!=null&&y[i]!==void 0)return y[i]}return o}async changeLanguage(t){var u;let i=t.toLowerCase();if(!i){A.error("language code must be defined");return}if(!this.currentLanguage){A.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(u=this.venue)==null?void 0:u.languages.find(({code:c})=>c.toLowerCase()===i.toLowerCase());if(!o){A.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){A.error("locale packs url not found for ".concat(o.code));return}s(this,ss)&&s(this,ss).abort();let p=new AbortController;T(this,ss,p);let f;try{f=await a2(c,{signal:p.signal})}catch(y){A.error("failed downloading language pack",y);return}if(!f||p.signal.aborted)return;a=yg(f),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(t,i){let n=mt(t),o=mt(i);return ji([n.longitude,n.latitude],[o.longitude,o.latitude])}async toJSONBundle({downloadLanguagePacks:t=!0}={}){var n;let i=[];if(t&&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 u=await Kf(this.localePacksUrls[a.code],{signal:o.signal}),c=await Cl(u);c&&i.push({language:{code:a.code,name:a.name},localePack:c})}}catch(u){A.warn("failed downloading language pack",u)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:[],main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:t=!0}={}){var n;if(!this.binaryBundle){A.error("binary bundle not found");return}let i=[];if(t&&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 u=await Kf(this.localePacksUrls[a.code],{signal:o.signal});u&&i.push({language:{code:a.code,name:a.name},localePack:u})}}catch(u){A.warn("failed downloading language pack",u)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let t of globalThis.Object.keys(s(this,ie)))s(this,ie)[t]=null}};ie=new WeakMap,ss=new WeakMap,l(Ug,"MapDataInternal");var ls=Ug;m();m();m();m();var Nd=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(Nd||{}),Gd=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(Gd||{});m();m();var cs=class cs{constructor(e,t,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",cs.__type);this.id=e,this.text=t,this.target=i}static is(e){return e.__type===cs.__type}};l(cs,"Label"),d(cs,"__type","Label");var Fn=cs;m();var us=class us{constructor(e,t,i){d(this,"id");d(this,"target");d(this,"__type",us.__type);d(this,"contentEl");this.id=e,this.contentEl=t,this.target=i}static is(e){return e.__type===us.__type}};l(us,"Marker"),d(us,"__type","Marker");var Ui=us;m();var sc,lc,ps=class ps{constructor(e,t,i){M(this,sc,void 0);M(this,lc,void 0);d(this,"target");d(this,"__type",ps.__type);T(this,sc,e),T(this,lc,t),this.target=i}static is(e){return e.__type===ps.__type}get id(){return s(this,sc)}get url(){return s(this,lc)}};sc=new WeakMap,lc=new WeakMap,l(ps,"Image"),d(ps,"__type","Image");var ac=ps;m();var ds=class ds{constructor(e,t){d(this,"id");d(this,"groupId");d(this,"__type",ds.__type);this.id=e,this.groupId=t}static is(e){return e.__type===ds.__type}};l(ds,"Model"),d(ds,"__type","Model");var cc=ds;m();var Wg=class Wg{constructor(e,t,i){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"__type");this.id=e,this.__type="Path",this.animation=t,this.coordinates=i}};l(Wg,"Path");var Eo=Wg;m();var Bn,Xg=class Xg{constructor(e){M(this,Bn,void 0);T(this,Bn,e)}get center(){return s(this,Bn).center}get bearing(){return s(this,Bn).bearing}get pitch(){return s(this,Bn).pitch}get zoomLevel(){return s(this,Bn).zoomLevel}};Bn=new WeakMap,l(Xg,"CameraTransform");var uc=Xg;m();var hs=class hs{constructor(e){d(this,"id");d(this,"__type",hs.__type);this.id=e}static is(e){return e.__type===hs.__type}};l(hs,"Shape"),d(hs,"__type","Shape");var Rn=hs;m();m();m();var Jw=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>']]),Kw=/<svg([^>]*)>/g;function r7(r,e,t){let i=Jw.get(r);return i?i.replace(Kw,'<svg$1 style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}l(r7,"getStyledIcon");var Qw=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 '),"getDeparturePin"),eI=l(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 '),"getDestinationPin"),Zg="#722ED1",zg="#1890FF",i7=l(({type:r="departure",color:e=zg})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?Qw(e):eI(e),"\n </div>"),"DroppedPin"),tI=l(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),n7=l(({type:r="stairs",color:e=Zg,direction:t="up"})=>{let i=tI("default"),n=i/2+2,o=t&&t!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(e,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(r7("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(t==="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>")},"ConnectionMarker");m();var o7=l(async r=>new Promise(e=>setTimeout(e,r)),"ms");var fs={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:zg,destinationColor:Zg}},Wi,Xi,dc,De,hc,Zi,lt,ii,lr,zi,_o,Zd,a7,ms,Wd,ys,Xd,zd,s7,fc,Yg=class Yg{constructor(e,t,i){M(this,Zd);M(this,ms);M(this,ys);M(this,zd);M(this,Wi,new Map);M(this,Xi,void 0);M(this,dc,void 0);M(this,De,fs);M(this,hc,void 0);M(this,Zi,void 0);M(this,lt,[]);M(this,ii,void 0);M(this,lr,new Map);M(this,zi,new Map);M(this,_o,new Map);M(this,fc,l(e=>{var t;if((t=s(this,De).createMarkers)!=null&&t.connection&&e.markers.length>0){let{instruction:i}=s(this,Wi).get(e.markers[0]);i!=null&&i.action.toFloor&&(s(this,De).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}))}},"#handleClick"));T(this,Xi,e),T(this,hc,i),T(this,dc,t)}get currentMap(){return s(this,hc).call(this)}get isMultiFloor(){if(!s(this,lt).length)return!1;let e=new Set;for(let t of s(this,lt))for(let i of t.coordinates)if(i.floorId&&(e.add(i.floorId),e.size>1))return!0;return!1}getPathById(e){return s(this,lr).get(e)}getMarkerById(e){return s(this,Wi).get(e)}get paths(){let e=[];return s(this,lr).forEach(({path:t})=>e.push(t)),e}get activeDirections(){return s(this,_o).get(s(this,ii))}get activePath(){var e;if(s(this,ii))return(e=s(this,lr).get(s(this,ii).id))==null?void 0:e.path}get floorStacks(){let e=s(this,dc).getMapData();if(!s(this,lt).length||!e)return[];let t=new Set;for(let i of s(this,lt))for(let n of i.coordinates)if(n.floorId){let o=e.getById("floor",n.floorId);o&&t.add(o.floorStack)}return Array.from(t)}setActivePathByIndex(e){let t=s(this,lt)[e];if(!s(this,lt).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,lt)[e]){A.warn("Direction #".concat(e," does not exist"));return}let i=s(this,zi).get(t);if(!i){A.warn("The direction is not a part of muli-direcional path");return}U(this,ms,Wd).call(this,i)}setActivePath(e){if(!s(this,lt).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,_o).get(e)){A.warn('Path "'.concat(e.id,'" is not a part of muli-direcional path'));return}U(this,ms,Wd).call(this,e)}setActivePathByDirections(e){if(!s(this,lt).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=s(this,zi).get(e);if(!t){A.warn("The direction is not a part of muli-direcional path");return}U(this,ms,Wd).call(this,t)}async draw(e,t={}){var c;let i=Array.isArray(e)?e:[e],n=i[0],o=i[i.length-1],a=n.coordinates[0];a.floorId&&this.currentMap.setFloor(a.floorId),T(this,lt,i),s(this,Zi)&&this.clear(),T(this,De,{setMapOnConnectionClick:(c=t.setMapOnConnectionClick)!=null?c:fs.setMapOnConnectionClick,pathOptions:{...fs.pathOptions,...t.pathOptions},inactivePathOptions:{...fs.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...fs.createMarkers,...t.createMarkers},markerOptions:{...fs.markerOptions,...t.markerOptions}});let u=!1;return T(this,Zi,{promise:new Promise(async p=>{var f,y,g;if(C.env.NODE_ENV!=="test"&&await o7(500),u||!i.length){p();return}(f=s(this,De).createMarkers)!=null&&f.departure&&U(this,ys,Xd).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let v=0;v<i.length;v++){let x=i[v],P=v?{...s(this,De).inactivePathOptions}:{...s(this,De).pathOptions};if(x.coordinates.length<2){A.warn("Directions must have at least 2 coordinates"),p();return}let b=this.currentMap.Paths.add(x.coordinates,P),S=b.paths.map(I=>I.id.toString()),E=new Eo(ae(),b.animation,x.coordinates);for(let I of S){s(this,lr).set(I,{path:E,entityIds:S});let w=v?{...s(this,De).inactivePathOptions,altitude:0}:{...s(this,De).pathOptions,altitude:.05};s(this,Xi).setState(I,w)}if(s(this,lr).set(E.id,{path:E,entityIds:S}),s(this,zi).set(x,E),s(this,_o).set(E,x),C.env.NODE_ENV!=="test"&&await b.animation,u){p();return}(y=s(this,De).createMarkers)!=null&&y.connection&&U(this,zd,s7).call(this,x.instructions,"connection"),v===0&&(T(this,ii,s(this,zi).get(s(this,lt)[0])),s(this,Xi).on("click",s(this,fc)))}if((g=s(this,De).createMarkers)!=null&&g.destination&&U(this,ys,Xd).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),u){p();return}p()}),cancel:()=>{u=!0}}),s(this,Zi).promise}clear(){s(this,Wi).forEach((e,t)=>{this.currentMap.Markers.remove(t.toString())}),s(this,Wi).clear(),s(this,lr).forEach(({path:e,entityIds:t})=>{s(this,lr).delete(e.id),t.forEach(i=>s(this,lr).delete(i)),this.currentMap.Paths.remove(t)}),s(this,Zi)&&(s(this,Zi).cancel(),T(this,Zi,void 0)),T(this,lt,[]),s(this,zi).clear(),s(this,_o).clear(),T(this,ii,void 0),s(this,Xi).off("click",s(this,fc))}};Wi=new WeakMap,Xi=new WeakMap,dc=new WeakMap,De=new WeakMap,hc=new WeakMap,Zi=new WeakMap,lt=new WeakMap,ii=new WeakMap,lr=new WeakMap,zi=new WeakMap,_o=new WeakMap,Zd=new WeakSet,a7=l(function(e){return e!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(e.type)},"#isVortexAction"),ms=new WeakSet,Wd=l(function(e){T(this,ii,e),s(this,lt).forEach(t=>{let i=s(this,zi).get(t);if(i){let n=s(this,lr).get(i.id),o=n.path.id===s(this,ii).id?{...s(this,De).pathOptions,altitude:.05}:{...s(this,De).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,Xi).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),ys=new WeakSet,Xd=l(function(e,t,i){var n,o,a,u,c;if(t==="connection"&&i){let p=i.action.type==="ExitConnection"?s(this,De).markerOptions.departureColor:s(this,De).markerOptions.destinationColor,f;if(typeof((n=s(this,De).createMarkers)==null?void 0:n.connection)=="function"){let g=s(this,De).createMarkers.connection(i);s(this,Xi).setState(g.id.toString(),{options:{interactive:!0}}),f={id:g.id,type:"marker"}}else f=this.currentMap.Markers.add(i.coordinate,n7({type:(a=(o=i.action.connection)==null?void 0:o.type)!=null?a:i.action.connectionType,color:p,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let y=this.currentMap.Markers.getContentEl(f.id.toString());if(!y)throw new Error("marker component should exist");s(this,Wi).set(f.id,{instruction:i,marker:new Ui(f.id.toString(),y,i.coordinate)})}else{let p=t==="departure"?s(this,De).markerOptions.departureColor:s(this,De).markerOptions.destinationColor,f;typeof((u=s(this,De).createMarkers)==null?void 0:u.departure)=="function"&&t==="departure"?f={id:s(this,De).createMarkers.departure(i).id,type:"marker"}:typeof((c=s(this,De).createMarkers)==null?void 0:c.destination)=="function"&&t==="destination"?f={id:s(this,De).createMarkers.destination(i).id,type:"marker"}:f=this.currentMap.Markers.add(e,i7({type:t,color:p}),{anchor:"top",rank:"always-visible"}),s(this,Wi).set(f.id,void 0)}},"#addMarker"),zd=new WeakSet,s7=l(function(e,t){e.filter(n=>U(this,Zd,a7).call(this,n.action)).forEach(n=>{U(this,ys,Xd).call(this,n.coordinate,t,n)})},"#addMarkers"),fc=new WeakMap,l(Yg,"Navigation");var pc=Yg;m();m();m();var rI=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>']]),iI=/<svg([^>]*)>/g;function l7(r,e,t){let i=rI.get(r);return i?i.replace(iI,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}l(l7,"getStyledIcon");var Do,gs,mc,qg,qd,c7,$d,u7,yc,$g,Jd,p7,Jg=class Jg{constructor(e,t){M(this,mc);M(this,qd);M(this,$d);M(this,yc);M(this,Jd);M(this,Do,void 0);M(this,gs,void 0);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});T(this,Do,e),T(this,gs,t)}auto(){let e=s(this,gs)[Object.keys(s(this,gs))[0]];[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(t=>{if(t.__type==="connection")t.coordinates.forEach(i=>{let n=t.name||t.externalId;n&&s(this,Do).Labels.add(i,n,U(this,mc,qg).call(this,t))});else{t.__type==="space"&&t.name!==""&&s(this,Do).updateState(t,{interactive:!0,hoverColor:"#F0F0F0"});let i=t.name||t.externalId;i&&s(this,Do).Labels.add(t,i,U(this,mc,qg).call(this,t))}})}};Do=new WeakMap,gs=new WeakMap,mc=new WeakSet,qg=l(function(e){let t=l7(U(this,qd,c7).call(this,e),"white",12);return{appearance:{text:{foregroundColor:U(this,yc,$g).call(this,e)},marker:{foregroundColor:{active:U(this,yc,$g).call(this,e)},icon:t,iconSize:12}},interactive:!0,rank:U(this,Jd,p7).call(this,e)}},"#generatLabelAppearance"),qd=new WeakSet,c7=l(function(e){return e.__type==="connection"?U(this,$d,u7).call(this,e.type):e.name.includes("Washroom")?"washroom-14x14":e.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),$d=new WeakSet,u7=l(function(e){let t="";switch(e){case"elevator":t="connection-elevator-12x12";break;case"escalator":t="connection-escalator-12x12";break;case"stairs":t="connection-stairs-12x12";break}return t},"#attemptIconNameForConnection"),yc=new WeakSet,$g=l(function(e){return e.__type==="connection"?this.colors.connection:e.__type==="point-of-interest"?this.colors.point:"name"in e&&e.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),Jd=new WeakSet,p7=l(function(e){return e.__type==="connection"?"high":(e.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),l(Jg,"Labels");var Yd=Jg;var Kg=class Kg{constructor(e,t){d(this,"Labels");d(this,"auto",l(()=>{this.Labels.auto()},"auto"));this.Labels=new Yd(e,t)}};l(Kg,"DefaultTheme");var Kd=Kg;m();var se,Qd,d7,Qg=class Qg{constructor(e){M(this,Qd);M(this,se,void 0);d(this,"setMinPitch",l(e=>{s(this,se).camera.setMinPitch(e)},"setMinPitch"));d(this,"setMaxPitch",l(e=>{s(this,se).camera.setMaxPitch(e)},"setMaxPitch"));d(this,"setMinZoomLevel",l(e=>{s(this,se).camera.setMinZoomLevel(e,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",l(e=>{s(this,se).camera.setMaxZoomLevel(e)},"setMaxZoomLevel"));T(this,se,e)}setScreenOffsets(e){s(this,se).camera.setInsetPadding(e)}get screenOffsets(){return s(this,se).camera.insetsPadding}get panMode(){return s(this,se).camera.panMode}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&s(this,se).camera.setPanMode(e)}focusOn(e,t){var o,a,u;let i=[],n=Array.isArray(e)&&!rg(e)?e:[e];for(let c of n)if(c!=null)if(Ni.is(c)){let p;for(p of c.coordinates)if(p.floorId!=null){let f=s(this,se).getBoundingArea(p.floorId);f&&i.push([p.longitude,p.latitude,(o=f[0][2])!=null?o:s(this,se).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,se).camera.elevation])}else if(Bi.is(c)||Xt.is(c)||Zt.is(c)){let p=s(this,se).getBoundingArea(c.id);p&&i.push(...p)}else if(ue.is(c)||Jr.is(c)||Kr.is(c)||En.is(c)||or.is(c)){let p=mt(c);if(p)if(p.floorId!=null){let f=s(this,se).getBoundingArea(p.floorId);f&&i.push([p.longitude,p.latitude,(a=f[0][2])!=null?a:s(this,se).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,se).camera.elevation])}else if(Tr.is(c))for(let p of c.spaces){let f=s(this,se).getBoundingArea(p.id);f&&i.push(...f)}else rg(c)&&i.push(c);return((u=t==null?void 0:t.axisAlignedPadding)==null?void 0:u.vertical)!==void 0&&(i=U(this,Qd,d7).call(this,i,t.axisAlignedPadding)),s(this,se).camera.focusOn(i,{pitch:t==null?void 0:t.pitch,bearing:t==null?void 0:t.bearing,padding:t==null?void 0:t.screenOffsets,maxZoomLevel:t==null?void 0:t.maxZoomLevel,minZoomLevel:t==null?void 0:t.minZoomLevel,duration:t==null?void 0:t.duration,easing:t==null?void 0:t.easing})}animateTo(e,t){var p;let{center:i,zoomLevel:n,bearing:o,pitch:a}=e,u=i!=null?i:this.center,c=[u.longitude,u.latitude,this.elevation];return s(this,se).camera.animateTo({center:c,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(p=t==null?void 0:t.duration)!=null?p:600,easing:t==null?void 0:t.easing})}set(e){let{center:t=this.center,zoomLevel:i=this.zoomLevel,bearing:n=this.bearing,pitch:o=this.pitch}=e,a=[t.longitude,t.latitude];s(this,se).camera.setCenter(a),s(this,se).camera.setZoomLevel(i),s(this,se).camera.setBearing(n),s(this,se).camera.setPitch(o)}get center(){let e=s(this,se).camera.center;return new ue(e[1],e[0],void 0)}setAutoMinZoomLevel(e){s(this,se).camera.setAutoMinZoomLevel(e)}get autoMinZoomLevel(){return s(this,se).camera.autoMinZoomLevel}get zoomLevel(){return s(this,se).camera.zoomLevel}get pitch(){return s(this,se).camera.pitch}get minPitch(){return s(this,se).camera.minPitch}get maxPitch(){return s(this,se).camera.maxPitch}get bearing(){let e=s(this,se).camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return s(this,se).camera.minZoomLevel}get maxZoomLevel(){return s(this,se).camera.maxZoomLevel}setElevation(e){s(this,se).camera.setElevation(e)}get elevation(){return s(this,se).camera.elevation}animateElevation(e,t){return s(this,se).camera.animateElevation(e,t)}};se=new WeakMap,Qd=new WeakSet,d7=l(function(e,t){var o;let i=(o=t==null?void 0:t.vertical)!=null?o:0;return[e.map(a=>{var u;return[a[0],a[1],((u=a[2])!=null?u:0)-i]}),e.map(a=>{var u;return[a[0],a[1],(u=a[2])!=null?u:0]}),e.map(a=>{var u;return[a[0],a[1],((u=a[2])!=null?u:0)+i]})].flat()},"#expandCoordinateCloud"),l(Qg,"Camera");var gc=Qg;m();var vs,e1=class e1{constructor({currentMapGetter:e}){M(this,vs,void 0);T(this,vs,e)}get currentMap(){return s(this,vs).call(this)}async getCurrentSceneGLTF(e){let t=s(this,vs).call(this);return t?t==null?void 0:t.Exporter.getCurrentSceneGLTF(e):(A.error("There is no map to export. Please load a map first."),new Blob)}};vs=new WeakMap,l(e1,"Exporter");var vc=e1;m();var ni,Cc,t1=class t1{constructor({currentMapGetter:e}){M(this,ni,new Map);M(this,Cc,void 0);T(this,Cc,e)}get currentMap(){return s(this,Cc).call(this)}getById(e){return s(this,ni).get(e)}add(e,t,i){let n=mt(e);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(ri(n),t,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),u=new Fn(a.id.toString(),t,e);return s(this,ni).set(u.id,{label:u,entityId:u.id}),u}all(){var t;let e=[];return(t=this.currentMap)==null||t.Labels.all({onCreate:(i,n,o)=>{let a=new Fn(i.toString(),n,o);s(this,ni).set(a.id,{label:a,entityId:a.id}),e.push(a)}}),e}remove(e){var i;let t=s(this,ni).get(e.id);t&&((i=this.currentMap)==null||i.Labels.remove(t.entityId),s(this,ni).delete(e.id.toString()))}removeAll(){let e=[];return s(this,ni).forEach(({label:t})=>{this.remove(t),e.push(t),s(this,ni).delete(t.id.toString())}),e}};ni=new WeakMap,Cc=new WeakMap,l(t1,"Labels");var bc=t1;m();m();var h7={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},f7={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},m7=.5,r1=class r1{constructor(e,t,i,n,o,a){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"floorStackId");d(this,"load",l(()=>{var e,t,i;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;if(this.loaded=!0,this.spaces!=null&&this.spaces.features.length>0){let n=this.spaces.features.filter(c=>{var p;return c.geometry.type==="Polygon"&&((p=c.properties.kind)==null?void 0:p.toLowerCase())!=="void"}),o=Gg(n,this.styleMap),a=this.renderer.addGroupContainer("spaces-".concat(this.id),{},this.id),u=0;for(let[c,p]of o){let f=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(u),{features:p},oc(c,this.options),a);u++;let y=f.id.toString();this.layers.set(c.id||y,f.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let n=this.obstructions.features.filter(v=>v.geometry.type==="Polygon"&&v.properties.kind==="object"),o=Gg(n,this.styleMap),a=this.renderer.addGroupContainer("objects-".concat(this.id),{},this.id),u=0;for(let[v,x]of o){let P=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(u),{features:x},oc(v,this.options),a);u++;let b=P.id.toString();this.layers.set(v.id||b,b)}let c=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind==="Wall"&&v.properties.footprintComponent===!1),p=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind==="Wall"&&v.properties.footprintComponent===!0),f=this.entrances,y=h7,g=h7;if(c!=null&&c.length>0){let v=this.styleMap[(e=c[0].properties)==null?void 0:e.id];v!=null&&(y={...v}),g=y;let{walls:x,entrances:P}=Rg(c,(f==null?void 0:f.features)||[]),b=Math.max(y.height-.11,m7),S={...f7,height:b},E=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),P,S,this.id);this.layers.set(za,E.id.toString());let I=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[x]},oc(y,this.options),this.id);this.layers.set(_n,I.id.toString())}if(p!=null&&p.length>0){let v=this.styleMap[(t=p[0].properties)==null?void 0:t.id];v!=null&&(g={...v,id:Qr});let{walls:x,entrances:P}=Rg(p,(f==null?void 0:f.features)||[]),b=Math.max(g.height-.11,m7),S={...f7,height:b},E=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),P,S,this.id);this.layers.set(Ya,E.id.toString());let I=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[x]},oc(g,this.options),this.id);this.layers.set(Qr,I.id.toString())}}if(this.floorImages!=null){let n=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let o of this.floorImages.features||[])"anchorId"in o.properties||"anchorId"in o.properties&&((i=o.properties)==null?void 0:i.anchorId)==null||this.renderer.addImage(ae(),o,{url:o.properties.path,flipImageToFaceCamera:!0},n);this.layers.set(n.id.toString(),n.id.toString())}return this.renderer.render(),this},"load"));var c;this.id=t.id,this.options=n;let u=i.addGroupContainer(this.id,{visible:!1,interactive:!0},e);this.containerId=u.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.elevation=t.elevation,o!=null&&a!=null&&(this.styleMap=a,this.spaces=o.space[this.id],this.entrances=o.entrance[this.id],this.obstructions=o.obstruction[this.id],this.floorImages=(c=o.floorImages)==null?void 0:c[this.id]),this.renderer=i,this.floorStackId=e}};l(r1,"FloorObject");var xc=r1;m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();m();m();m();m();function y7(r){return Tp(r)}l(y7,"getBoundingBoxFromFeature");m();var eh="#ffffff";var i1=class i1{constructor(e={}){d(this,"initialColor",eh);d(this,"color",eh);d(this,"topColor");d(this,"topTexture");d(this,"texture");d(this,"hoverColor");d(this,"dirty",!0);d(this,"visible",!0);d(this,"opacity",1);d(this,"width",.1);d(this,"height",.1);d(this,"initialHeight",.1);d(this,"altitude",0);d(this,"join","round");d(this,"cap","round");d(this,"outline",!0);d(this,"showImage",!0);d(this,"showTextLabel",!1);d(this,"flipImageToFaceCamera",!0);d(this,"flipTextToFaceCamera",!0);d(this,"url");this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.showTextLabel=(e==null?void 0:e.showTextLabel)!==void 0?e.showTextLabel:this.showTextLabel,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.flipTextToFaceCamera=(e==null?void 0:e.flipTextToFaceCamera)!==void 0?e.flipTextToFaceCamera:this.flipTextToFaceCamera,this.url=e==null?void 0:e.url}};l(i1,"StyleComponent");var Er=i1;var n1=class n1 extends Ta{constructor(){super(...arguments);d(this,"userData",{entities:{}})}};l(n1,"EntityBatchedMesh");var oi=n1,Sc,Mc,Oo,o1=class o1{constructor(e){d(this,"mesh");d(this,"focusMesh");d(this,"outline");d(this,"imageMesh");d(this,"textAreaMesh");d(this,"type","geometry");d(this,"dirty",!0);d(this,"detached",!1);d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"currentHeight",.1);d(this,"focusable",!1);d(this,"color",new _e);d(this,"topColor",new _e);d(this,"position",new q);M(this,Sc,0);M(this,Mc,1);M(this,Oo,void 0);d(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e),this.imageMesh&&(this.imageMesh.visible=e)}setOpacity(e){this.mesh&&(this.material&&(this.material.opacity=e,this.material.transparent=e<1),this.outline&&(this.outline.material.opacity=e),e===0?this.mesh.visible=!1:this.mesh.visible=!0)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return s(this,Sc)}set altitude(e){this.mesh&&(this.mesh.position.z=e,T(this,Sc,e))}get opacity(){return s(this,Mc)}set opacity(e){this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.outline&&(this.outline.material.opacity=e),this.material.needsUpdate=!0),T(this,Mc,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return s(this,Oo)?s(this,Oo):(T(this,Oo,y7(this.feature)),s(this,Oo))}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)}};Sc=new WeakMap,Mc=new WeakMap,Oo=new WeakMap,l(o1,"MeshComponent");var Ee=o1;m();var oI="#ffffff",Nn,a1=class a1{constructor(e={}){d(this,"color",oI);d(this,"topColor");d(this,"opacity",1);M(this,Nn,void 0);d(this,"outline",!0);d(this,"texture");d(this,"topTexture");d(this,"dirty",!0);var t,i;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(i=e==null?void 0:e.opacity)!=null?i:this.opacity,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return s(this,Nn)}set shading(e){var t;if(!e){T(this,Nn,void 0);return}T(this,Nn,(t=s(this,Nn))!=null?t:{start:0,end:0,intensity:0}),Object.assign(s(this,Nn),e)}};Nn=new WeakMap,l(a1,"GeometryGroupStyleComponent");var Lo=a1;m();m();function Gn(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return e instanceof oo?e:void 0}l(Gn,"findOutline");m();m();m();m();var s1=class s1{constructor(){d(this,"hover",!1);d(this,"dirty",!1)}};l(s1,"InteractionComponent");var bs=s1;m();m();var g7=["","","low","medium","high","always-visible"];function v7(r){return Math.min(5,Math.max(2,r))}l(v7,"clampTierNumber");function Cs(r){if(typeof r=="number")return v7(r);let e=g7.indexOf(r);return e===-1?3:e}l(Cs,"convertCollisionRankingTierToNumber");function Pc(r){let e=v7(r);return g7[e]}l(Pc,"convertNumberToCollisionRankingTier");m();var me;(function(r){r.assertEqual=n=>n;function e(n){}l(e,"assertIs"),r.assertIs=e;function t(n){throw new Error}l(t,"assertNever"),r.assertNever=t,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(u=>typeof n[n[u]]!="number"),a={};for(let u of o)a[u]=n[u];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)}l(i,"joinValues"),r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(me||(me={}));var c1;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(c1||(c1={}));var H=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vn=l(r=>{switch(typeof r){case"undefined":return H.undefined;case"string":return H.string;case"number":return isNaN(r)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":return Array.isArray(r)?H.array:r===null?H.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?H.promise:typeof Map<"u"&&r instanceof Map?H.map:typeof Set<"u"&&r instanceof Set?H.set:typeof Date<"u"&&r instanceof Date?H.date:H.object;default:return H.unknown}},"getParsedType"),B=me.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=l(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),sh=class sh extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(o){return o.message},i={_errors:[]},n=l(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(t(a));else{let u=i,c=0;for(;c<a.path.length;){let p=a.path[c];c===a.path.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(a))):u[p]=u[p]||{_errors:[]},u=u[p],c++}}},"processError");return n(this),i}static assert(e){if(!(e instanceof sh))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},i=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}};l(sh,"ZodError");var qt=sh;qt.create=r=>new qt(r);var Ts=l((r,e)=>{let t;switch(r.code){case B.invalid_type:r.received===H.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case B.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,me.jsonStringifyReplacer));break;case B.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(me.joinValues(r.keys,", "));break;case B.invalid_union:t="Invalid input";break;case B.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(me.joinValues(r.options));break;case B.invalid_enum_value:t="Invalid enum value. Expected ".concat(me.joinValues(r.options),", received '").concat(r.received,"'");break;case B.invalid_arguments:t="Invalid function arguments";break;case B.invalid_return_type:t="Invalid function return type";break;case B.invalid_date:t="Invalid date";break;case B.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):me.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case B.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case B.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case B.custom:t="Invalid input";break;case B.invalid_intersection_types:t="Intersection results could not be merged";break;case B.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case B.not_finite:t="Number must be finite";break;default:t=e.defaultError,me.assertNever(r)}return{message:t}},"errorMap"),x7=Ts;function sI(r){x7=r}l(sI,"setErrorMap");function th(){return x7}l(th,"getErrorMap");var rh=l(r=>{let{data:e,path:t,errorMaps:i,issueData:n}=r,o=[...t,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let u="",c=i.filter(p=>!!p).slice().reverse();for(let p of c)u=p(a,{data:e,defaultError:u}).message;return{...n,path:o,message:u}},"makeIssue"),lI=[];function j(r,e){let t=th(),i=rh({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Ts?void 0:Ts].filter(n=>!!n)});r.common.issues.push(i)}l(j,"addIssueToContext");var lh=class lh{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let i=[];for(let n of t){if(n.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){let i=[];for(let n of t){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return lh.mergeObjectSync(e,i)}static mergeObjectSync(e,t){let i={};for(let n of t){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}};l(lh,"ParseStatus");var ct=lh,Q=Object.freeze({status:"aborted"}),Ss=l(r=>({status:"dirty",value:r}),"DIRTY"),Ct=l(r=>({status:"valid",value:r}),"OK"),u1=l(r=>r.status==="aborted","isAborted"),p1=l(r=>r.status==="dirty","isDirty"),Lc=l(r=>r.status==="valid","isValid"),Ac=l(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function ih(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}l(ih,"__classPrivateFieldGet");function S7(r,e,t,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 e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}l(S7,"__classPrivateFieldSet");var Y;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Y||(Y={}));var Tc,wc,h1=class h1{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,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}};l(h1,"ParseInputLazyPath");var ur=h1,b7=l((r,e)=>{if(Lc(e))return{success:!0,data:e.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 t=new qt(r.common.issues);return this._error=t,this._error}}},"handleResult");function ne(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:i,description:n}=r;if(e&&(t||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:n}:{errorMap:l((a,u)=>{var c,p;let{message:f}=r;return a.code==="invalid_enum_value"?{message:f!=null?f:u.defaultError}:typeof u.data>"u"?{message:(c=f!=null?f:i)!==null&&c!==void 0?c:u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:(p=f!=null?f:t)!==null&&p!==void 0?p:u.defaultError}},"customMap"),description:n}}l(ne,"processCreateParams");var f1=class f1{constructor(e){this.spa=this.safeParseAsync,this._def=e,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(e){return Vn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ct,ctx:{common:e.parent.common,data:e.data,parsedType:Vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ac(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vn(e)},o=this._parseSync({data:e,path:n.path,parent:n});return b7(n,o)}async parseAsync(e,t){let i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){let i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vn(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(Ac(n)?n:Promise.resolve(n));return b7(i,o)}refine(e,t){let i=l(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,o)=>{let a=e(n),u=l(()=>o.addIssue({code:B.custom,...i(n)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,t){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof t=="function"?t(i,n):t),!1))}_refinement(e){return new $t({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cr.create(this,this._def)}nullable(){return si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this,this._def)}promise(){return Un.create(this,this._def)}or(e){return Vo.create([this,e],this._def)}and(e){return jo.create(this,e,this._def)}transform(e){return new $t({...ne(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Zo({...ne(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new kc({typeName:K.ZodBranded,type:this,...ne(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new zo({...ne(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fc.create(this,e)}readonly(){return Yo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(f1,"ZodType");var oe=f1,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})+$",l1,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}=))?$/,M7="((\\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])))",CI=new RegExp("^".concat(M7,"$"));function P7(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}l(P7,"timeRegexSource");function xI(r){return new RegExp("^".concat(P7(r),"$"))}l(xI,"timeRegex");function T7(r){let e="".concat(M7,"T").concat(P7(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}l(T7,"datetimeRegex");function SI(r,e){return!!((e==="v4"||!e)&&gI.test(r)||(e==="v6"||!e)&&vI.test(r))}l(SI,"isValidIP");var Ao=class Ao extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let o=this._getOrReturnCtx(e);return j(o,{code:B.invalid_type,expected:H.string,received:o.parsedType}),Q}let i=new ct,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),j(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=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(n=this._getOrReturnCtx(e,n),a?j(n,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&j(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(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"email",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")l1||(l1=new RegExp(yI,"u")),l1.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"emoji",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")dI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"uuid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")hI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"nanoid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")cI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"cuid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")uI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"cuid2",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")pI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"ulid",code:B.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),j(n,{validation:"url",code:B.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"regex",code:B.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?T7(o).test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?CI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?xI(o).test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{code:B.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?fI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"duration",code:B.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?SI(e.data,o.version)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"ip",code:B.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?bI.test(e.data)||(n=this._getOrReturnCtx(e,n),j(n,{validation:"base64",code:B.invalid_string,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(n=>e.test(n),{validation:t,code:B.invalid_string,...Y.errToObj(i)})}_addCheck(e){return new Ao({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Y.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Y.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...Y.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Y.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Y.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Y.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Y.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Y.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Y.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Y.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Y.errToObj(t)})}nonempty(e){return this.min(1,Y.errToObj(e))}trim(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};l(Ao,"ZodString");var jn=Ao;jn.create=r=>{var e;return new jn({checks:[],typeName:K.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};function MI(r,e){let t=(r.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=t>i?t:i,o=parseInt(r.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}l(MI,"floatSafeRemainder");var Ic=class Ic extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let o=this._getOrReturnCtx(e);return j(o,{code:B.invalid_type,expected:H.number,received:o.parsedType}),Q}let i,n=new ct;for(let o of this._def.checks)o.kind==="int"?me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),j(i,{code:B.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),j(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?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),j(i,{code:B.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?MI(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),j(i,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),j(i,{code:B.not_finite,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Y.toString(t))}setLimit(e,t,i,n){return new Ic({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:Y.toString(n)}]})}_addCheck(e){return new Ic({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Y.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}};l(Ic,"ZodNumber");var ko=Ic;ko.create=r=>new ko({checks:[],typeName:K.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});var Ec=class Ec extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==H.bigint){let o=this._getOrReturnCtx(e);return j(o,{code:B.invalid_type,expected:H.bigint,received:o.parsedType}),Q}let i,n=new ct;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),j(i,{code:B.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),j(i,{code:B.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),j(i,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Y.toString(t))}setLimit(e,t,i,n){return new Ec({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:Y.toString(n)}]})}_addCheck(e){return new Ec({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};l(Ec,"ZodBigInt");var Fo=Ec;Fo.create=r=>{var e;return new Fo({checks:[],typeName:K.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};var m1=class m1 extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.boolean,received:i.parsedType}),Q}return Ct(e.data)}};l(m1,"ZodBoolean");var Bo=m1;Bo.create=r=>new Bo({typeName:K.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});var ch=class ch extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let o=this._getOrReturnCtx(e);return j(o,{code:B.invalid_type,expected:H.date,received:o.parsedType}),Q}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return j(o,{code:B.invalid_date}),Q}let i=new ct,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:B.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:B.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):me.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ch({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Y.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};l(ch,"ZodDate");var Ro=ch;Ro.create=r=>new Ro({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:K.ZodDate,...ne(r)});var y1=class y1 extends oe{_parse(e){if(this._getType(e)!==H.symbol){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.symbol,received:i.parsedType}),Q}return Ct(e.data)}};l(y1,"ZodSymbol");var ws=y1;ws.create=r=>new ws({typeName:K.ZodSymbol,...ne(r)});var g1=class g1 extends oe{_parse(e){if(this._getType(e)!==H.undefined){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.undefined,received:i.parsedType}),Q}return Ct(e.data)}};l(g1,"ZodUndefined");var No=g1;No.create=r=>new No({typeName:K.ZodUndefined,...ne(r)});var v1=class v1 extends oe{_parse(e){if(this._getType(e)!==H.null){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.null,received:i.parsedType}),Q}return Ct(e.data)}};l(v1,"ZodNull");var Go=v1;Go.create=r=>new Go({typeName:K.ZodNull,...ne(r)});var b1=class b1 extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}};l(b1,"ZodAny");var Hn=b1;Hn.create=r=>new Hn({typeName:K.ZodAny,...ne(r)});var C1=class C1 extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}};l(C1,"ZodUnknown");var qi=C1;qi.create=r=>new qi({typeName:K.ZodUnknown,...ne(r)});var x1=class x1 extends oe{_parse(e){let t=this._getOrReturnCtx(e);return j(t,{code:B.invalid_type,expected:H.never,received:t.parsedType}),Q}};l(x1,"ZodNever");var _r=x1;_r.create=r=>new _r({typeName:K.ZodNever,...ne(r)});var S1=class S1 extends oe{_parse(e){if(this._getType(e)!==H.undefined){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.void,received:i.parsedType}),Q}return Ct(e.data)}};l(S1,"ZodVoid");var Is=S1;Is.create=r=>new Is({typeName:K.ZodVoid,...ne(r)});var Ms=class Ms extends oe{_parse(e){let{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==H.array)return j(t,{code:B.invalid_type,expected:H.array,received:t.parsedType}),Q;if(n.exactLength!==null){let a=t.data.length>n.exactLength.value,u=t.data.length<n.exactLength.value;(a||u)&&(j(t,{code:a?B.too_big:B.too_small,minimum:u?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&&t.data.length<n.minLength.value&&(j(t,{code:B.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(j(t,{code:B.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((a,u)=>n.type._parseAsync(new ur(t,a,t.path,u)))).then(a=>ct.mergeArray(i,a));let o=[...t.data].map((a,u)=>n.type._parseSync(new ur(t,a,t.path,u)));return ct.mergeArray(i,o)}get element(){return this._def.type}min(e,t){return new Ms({...this._def,minLength:{value:e,message:Y.toString(t)}})}max(e,t){return new Ms({...this._def,maxLength:{value:e,message:Y.toString(t)}})}length(e,t){return new Ms({...this._def,exactLength:{value:e,message:Y.toString(t)}})}nonempty(e){return this.min(1,e)}};l(Ms,"ZodArray");var $i=Ms;$i.create=(r,e)=>new $i({type:r,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...ne(e)});function xs(r){if(r instanceof kt){let e={};for(let t in r.shape){let i=r.shape[t];e[t]=cr.create(xs(i))}return new kt({...r._def,shape:()=>e})}else return r instanceof $i?new $i({...r._def,type:xs(r.element)}):r instanceof cr?cr.create(xs(r.unwrap())):r instanceof si?si.create(xs(r.unwrap())):r instanceof ai?ai.create(r.items.map(e=>xs(e))):r}l(xs,"deepPartialify");var Yt=class Yt extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=me.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==H.object){let p=this._getOrReturnCtx(e);return j(p,{code:B.invalid_type,expected:H.object,received:p.parsedType}),Q}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof _r&&this._def.unknownKeys==="strip"))for(let p in n.data)a.includes(p)||u.push(p);let c=[];for(let p of a){let f=o[p],y=n.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new ur(n,y,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof _r){let p=this._def.unknownKeys;if(p==="passthrough")for(let f of u)c.push({key:{status:"valid",value:f},value:{status:"valid",value:n.data[f]}});else if(p==="strict")u.length>0&&(j(n,{code:B.unrecognized_keys,keys:u}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let f of u){let y=n.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new ur(n,y,n.path,f)),alwaysSet:f in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let f of c){let y=await f.key,g=await f.value;p.push({key:y,value:g,alwaysSet:f.alwaysSet})}return p}).then(p=>ct.mergeObjectSync(i,p)):ct.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return Y.errToObj,new Yt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var n,o,a,u;let c=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,t,i).message)!==null&&a!==void 0?a:i.defaultError;return t.code==="unrecognized_keys"?{message:(u=Y.errToObj(e).message)!==null&&u!==void 0?u:c}:{message:c}}}:{}})}strip(){return new Yt({...this._def,unknownKeys:"strip"})}passthrough(){return new Yt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Yt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Yt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Yt({...this._def,catchall:e})}pick(e){let t={};return me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Yt({...this._def,shape:()=>t})}omit(e){let t={};return me.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Yt({...this._def,shape:()=>t})}deepPartial(){return xs(this)}partial(e){let t={};return me.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?t[i]=n:t[i]=n.optional()}),new Yt({...this._def,shape:()=>t})}required(e){let t={};return me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof cr;)o=o._def.innerType;t[i]=o}}),new Yt({...this._def,shape:()=>t})}keyof(){return w7(me.objectKeys(this.shape))}};l(Yt,"ZodObject");var kt=Yt;kt.create=(r,e)=>new kt({shape:()=>r,unknownKeys:"strip",catchall:_r.create(),typeName:K.ZodObject,...ne(e)});kt.strictCreate=(r,e)=>new kt({shape:()=>r,unknownKeys:"strict",catchall:_r.create(),typeName:K.ZodObject,...ne(e)});kt.lazycreate=(r,e)=>new kt({shape:r,unknownKeys:"strip",catchall:_r.create(),typeName:K.ZodObject,...ne(e)});var M1=class M1 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=this._def.options;function n(o){for(let u of o)if(u.result.status==="valid")return u.result;for(let u of o)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let a=o.map(u=>new qt(u.ctx.common.issues));return j(t,{code:B.invalid_union,unionErrors:a}),Q}if(l(n,"handleResults"),t.common.async)return Promise.all(i.map(async o=>{let a={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let c of i){let p={...t,common:{...t.common,issues:[]},parent:null},f=c._parseSync({data:t.data,path:t.path,parent:p});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let u=a.map(c=>new qt(c));return j(t,{code:B.invalid_union,unionErrors:u}),Q}}get options(){return this._def.options}};l(M1,"ZodUnion");var Vo=M1;Vo.create=(r,e)=>new Vo({options:r,typeName:K.ZodUnion,...ne(e)});var Yi=l(r=>r instanceof Ho?Yi(r.schema):r instanceof $t?Yi(r.innerType()):r instanceof Uo?[r.value]:r instanceof Wo?r.options:r instanceof Xo?me.objectValues(r.enum):r instanceof Zo?Yi(r._def.innerType):r instanceof No?[void 0]:r instanceof Go?[null]:r instanceof cr?[void 0,...Yi(r.unwrap())]:r instanceof si?[null,...Yi(r.unwrap())]:r instanceof kc||r instanceof Yo?Yi(r.unwrap()):r instanceof zo?Yi(r._def.innerType):[],"getDiscriminator"),uh=class uh extends oe{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return j(t,{code:B.invalid_type,expected:H.object,received:t.parsedType}),Q;let i=this.discriminator,n=t.data[i],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(j(t,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){let n=new Map;for(let o of t){let a=Yi(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let u of a){if(n.has(u))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(u)));n.set(u,o)}}return new uh({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ne(i)})}};l(uh,"ZodDiscriminatedUnion");var nh=uh;function d1(r,e){let t=Vn(r),i=Vn(e);if(r===e)return{valid:!0,data:r};if(t===H.object&&i===H.object){let n=me.objectKeys(e),o=me.objectKeys(r).filter(u=>n.indexOf(u)!==-1),a={...r,...e};for(let u of o){let c=d1(r[u],e[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(t===H.array&&i===H.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],u=e[o],c=d1(a,u);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return t===H.date&&i===H.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}l(d1,"mergeValues");var P1=class P1 extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e),n=l((o,a)=>{if(u1(o)||u1(a))return Q;let u=d1(o.value,a.value);return u.valid?((p1(o)||p1(a))&&t.dirty(),{status:t.value,value:u.data}):(j(i,{code:B.invalid_intersection_types}),Q)},"handleParsed");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}))}};l(P1,"ZodIntersection");var jo=P1;jo.create=(r,e,t)=>new jo({left:r,right:e,typeName:K.ZodIntersection,...ne(t)});var ph=class ph extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.array)return j(i,{code:B.invalid_type,expected:H.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return j(i,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(j(i,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...i.data].map((a,u)=>{let c=this._def.items[u]||this._def.rest;return c?c._parse(new ur(i,a,i.path,u)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>ct.mergeArray(t,a)):ct.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new ph({...this._def,rest:e})}};l(ph,"ZodTuple");var ai=ph;ai.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ai({items:r,typeName:K.ZodTuple,rest:null,...ne(e)})};var _c=class _c extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.object)return j(i,{code:B.invalid_type,expected:H.object,received:i.parsedType}),Q;let n=[],o=this._def.keyType,a=this._def.valueType;for(let u in i.data)n.push({key:o._parse(new ur(i,u,i.path,u)),value:a._parse(new ur(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ct.mergeObjectAsync(t,n):ct.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof oe?new _c({keyType:e,valueType:t,typeName:K.ZodRecord,...ne(i)}):new _c({keyType:jn.create(),valueType:e,typeName:K.ZodRecord,...ne(t)})}};l(_c,"ZodRecord");var oh=_c,T1=class T1 extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.map)return j(i,{code:B.invalid_type,expected:H.map,received:i.parsedType}),Q;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([u,c],p)=>({key:n._parse(new ur(i,u,i.path,[p,"key"])),value:o._parse(new ur(i,c,i.path,[p,"value"]))}));if(i.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let c of a){let p=await c.key,f=await c.value;if(p.status==="aborted"||f.status==="aborted")return Q;(p.status==="dirty"||f.status==="dirty")&&t.dirty(),u.set(p.value,f.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let c of a){let p=c.key,f=c.value;if(p.status==="aborted"||f.status==="aborted")return Q;(p.status==="dirty"||f.status==="dirty")&&t.dirty(),u.set(p.value,f.value)}return{status:t.value,value:u}}}};l(T1,"ZodMap");var Es=T1;Es.create=(r,e,t)=>new Es({valueType:e,keyType:r,typeName:K.ZodMap,...ne(t)});var Dc=class Dc extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==H.set)return j(i,{code:B.invalid_type,expected:H.set,received:i.parsedType}),Q;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(j(i,{code:B.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(j(i,{code:B.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let o=this._def.valueType;function a(c){let p=new Set;for(let f of c){if(f.status==="aborted")return Q;f.status==="dirty"&&t.dirty(),p.add(f.value)}return{status:t.value,value:p}}l(a,"finalizeSet");let u=[...i.data.values()].map((c,p)=>o._parse(new ur(i,c,i.path,p)));return i.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,t){return new Dc({...this._def,minSize:{value:e,message:Y.toString(t)}})}max(e,t){return new Dc({...this._def,maxSize:{value:e,message:Y.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};l(Dc,"ZodSet");var _s=Dc;_s.create=(r,e)=>new _s({valueType:r,minSize:null,maxSize:null,typeName:K.ZodSet,...ne(e)});var Ps=class Ps extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return j(t,{code:B.invalid_type,expected:H.function,received:t.parsedType}),Q;function i(u,c){return rh({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,th(),Ts].filter(p=>!!p),issueData:{code:B.invalid_arguments,argumentsError:c}})}l(i,"makeArgsIssue");function n(u,c){return rh({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,th(),Ts].filter(p=>!!p),issueData:{code:B.invalid_return_type,returnTypeError:c}})}l(n,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Un){let u=this;return Ct(async function(...c){let p=new qt([]),f=await u._def.args.parseAsync(c,o).catch(v=>{throw p.addIssue(i(c,v)),p}),y=await Reflect.apply(a,this,f);return await u._def.returns._def.type.parseAsync(y,o).catch(v=>{throw p.addIssue(n(y,v)),p})})}else{let u=this;return Ct(function(...c){let p=u._def.args.safeParse(c,o);if(!p.success)throw new qt([i(c,p.error)]);let f=Reflect.apply(a,this,p.data),y=u._def.returns.safeParse(f,o);if(!y.success)throw new qt([n(f,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ps({...this._def,args:ai.create(e).rest(qi.create())})}returns(e){return new Ps({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Ps({args:e||ai.create([]).rest(qi.create()),returns:t||qi.create(),typeName:K.ZodFunction,...ne(i)})}};l(Ps,"ZodFunction");var ah=Ps,w1=class w1 extends oe{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};l(w1,"ZodLazy");var Ho=w1;Ho.create=(r,e)=>new Ho({getter:r,typeName:K.ZodLazy,...ne(e)});var I1=class I1 extends oe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return j(t,{received:t.data,code:B.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};l(I1,"ZodLiteral");var Uo=I1;Uo.create=(r,e)=>new Uo({value:r,typeName:K.ZodLiteral,...ne(e)});function w7(r,e){return new Wo({values:r,typeName:K.ZodEnum,...ne(e)})}l(w7,"createZodEnum");var Oc=class Oc extends oe{constructor(){super(...arguments),Tc.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),i=this._def.values;return j(t,{expected:me.joinValues(i),received:t.parsedType,code:B.invalid_type}),Q}if(ih(this,Tc,"f")||S7(this,Tc,new Set(this._def.values),"f"),!ih(this,Tc,"f").has(e.data)){let t=this._getOrReturnCtx(e),i=this._def.values;return j(t,{received:t.data,code:B.invalid_enum_value,options:i}),Q}return Ct(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Oc.create(e,{...this._def,...t})}exclude(e,t=this._def){return Oc.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}};l(Oc,"ZodEnum");var Wo=Oc;Tc=new WeakMap;Wo.create=w7;var E1=class E1 extends oe{constructor(){super(...arguments),wc.set(this,void 0)}_parse(e){let t=me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==H.string&&i.parsedType!==H.number){let n=me.objectValues(t);return j(i,{expected:me.joinValues(n),received:i.parsedType,code:B.invalid_type}),Q}if(ih(this,wc,"f")||S7(this,wc,new Set(me.getValidEnumValues(this._def.values)),"f"),!ih(this,wc,"f").has(e.data)){let n=me.objectValues(t);return j(i,{received:i.data,code:B.invalid_enum_value,options:n}),Q}return Ct(e.data)}get enum(){return this._def.values}};l(E1,"ZodNativeEnum");var Xo=E1;wc=new WeakMap;Xo.create=(r,e)=>new Xo({values:r,typeName:K.ZodNativeEnum,...ne(e)});var _1=class _1 extends oe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.promise&&t.common.async===!1)return j(t,{code:B.invalid_type,expected:H.promise,received:t.parsedType}),Q;let i=t.parsedType===H.promise?t.data:Promise.resolve(t.data);return Ct(i.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};l(_1,"ZodPromise");var Un=_1;Un.create=(r,e)=>new Un({type:r,typeName:K.ZodPromise,...ne(e)});var D1=class D1 extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:a=>{j(i,a),a.fatal?t.abort():t.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 u=>{if(t.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return c.status==="aborted"?Q:c.status==="dirty"||t.value==="dirty"?Ss(c.value):c});{if(t.value==="aborted")return Q;let u=this._def.schema._parseSync({data:a,path:i.path,parent:i});return u.status==="aborted"?Q:u.status==="dirty"||t.value==="dirty"?Ss(u.value):u}}if(n.type==="refinement"){let a=l(u=>{let c=n.refinement(u,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 u},"executeRefinement");if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Q:(u.status==="dirty"&&t.dirty(),a(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Q:(u.status==="dirty"&&t.dirty(),a(u.value).then(()=>({status:t.value,value:u.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(!Lc(a))return a;let u=n.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Lc(a)?Promise.resolve(n.transform(a.value,o)).then(u=>({status:t.value,value:u})):a);me.assertNever(n)}};l(D1,"ZodEffects");var $t=D1;$t.create=(r,e,t)=>new $t({schema:r,typeName:K.ZodEffects,effect:e,...ne(t)});$t.createWithPreprocess=(r,e,t)=>new $t({schema:e,effect:{type:"preprocess",transform:r},typeName:K.ZodEffects,...ne(t)});var O1=class O1 extends oe{_parse(e){return this._getType(e)===H.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l(O1,"ZodOptional");var cr=O1;cr.create=(r,e)=>new cr({innerType:r,typeName:K.ZodOptional,...ne(e)});var L1=class L1 extends oe{_parse(e){return this._getType(e)===H.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};l(L1,"ZodNullable");var si=L1;si.create=(r,e)=>new si({innerType:r,typeName:K.ZodNullable,...ne(e)});var A1=class A1 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return t.parsedType===H.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};l(A1,"ZodDefault");var Zo=A1;Zo.create=(r,e)=>new Zo({innerType:r,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});var k1=class k1 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ac(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new qt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new qt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};l(k1,"ZodCatch");var zo=k1;zo.create=(r,e)=>new zo({innerType:r,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});var F1=class F1 extends oe{_parse(e){if(this._getType(e)!==H.nan){let i=this._getOrReturnCtx(e);return j(i,{code:B.invalid_type,expected:H.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};l(F1,"ZodNaN");var Ds=F1;Ds.create=r=>new Ds({typeName:K.ZodNaN,...ne(r)});var PI=Symbol("zod_brand"),B1=class B1 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}};l(B1,"ZodBranded");var kc=B1,dh=class dh extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return l(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Q:o.status==="dirty"?(t.dirty(),Ss(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})},"handleAsync")();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?Q:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,t){return new dh({in:e,out:t,typeName:K.ZodPipeline})}};l(dh,"ZodPipeline");var Fc=dh,R1=class R1 extends oe{_parse(e){let t=this._def.innerType._parse(e),i=l(n=>(Lc(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return Ac(t)?t.then(n=>i(n)):i(t)}unwrap(){return this._def.innerType}};l(R1,"ZodReadonly");var Yo=R1;Yo.create=(r,e)=>new Yo({innerType:r,typeName:K.ZodReadonly,...ne(e)});function I7(r,e={},t){return r?Hn.create().superRefine((i,n)=>{var o,a;if(!r(i)){let u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,c=(a=(o=u.fatal)!==null&&o!==void 0?o:t)!==null&&a!==void 0?a:!0,p=typeof u=="string"?{message:u}:u;n.addIssue({code:"custom",...p,fatal:c})}}):Hn.create()}l(I7,"custom");var TI={object:kt.lazycreate},K;(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"})(K||(K={}));var wI=l((r,e={message:"Input not instance of ".concat(r.name)})=>I7(t=>t instanceof r,e),"instanceOfType"),E7=jn.create,_7=ko.create,II=Ds.create,EI=Fo.create,D7=Bo.create,_I=Ro.create,DI=ws.create,OI=No.create,LI=Go.create,AI=Hn.create,kI=qi.create,FI=_r.create,BI=Is.create,RI=$i.create,NI=kt.create,GI=kt.strictCreate,VI=Vo.create,jI=nh.create,HI=jo.create,UI=ai.create,WI=oh.create,XI=Es.create,ZI=_s.create,zI=ah.create,YI=Ho.create,qI=Uo.create,$I=Wo.create,JI=Xo.create,KI=Un.create,C7=$t.create,QI=cr.create,eE=si.create,tE=$t.createWithPreprocess,rE=Fc.create,iE=l(()=>E7().optional(),"ostring"),nE=l(()=>_7().optional(),"onumber"),oE=l(()=>D7().optional(),"oboolean"),aE={string:r=>jn.create({...r,coerce:!0}),number:r=>ko.create({...r,coerce:!0}),boolean:r=>Bo.create({...r,coerce:!0}),bigint:r=>Fo.create({...r,coerce:!0}),date:r=>Ro.create({...r,coerce:!0})},sE=Q,L=Object.freeze({__proto__:null,defaultErrorMap:Ts,setErrorMap:sI,getErrorMap:th,makeIssue:rh,EMPTY_PATH:lI,addIssueToContext:j,ParseStatus:ct,INVALID:Q,DIRTY:Ss,OK:Ct,isAborted:u1,isDirty:p1,isValid:Lc,isAsync:Ac,get util(){return me},get objectUtil(){return c1},ZodParsedType:H,getParsedType:Vn,ZodType:oe,datetimeRegex:T7,ZodString:jn,ZodNumber:ko,ZodBigInt:Fo,ZodBoolean:Bo,ZodDate:Ro,ZodSymbol:ws,ZodUndefined:No,ZodNull:Go,ZodAny:Hn,ZodUnknown:qi,ZodNever:_r,ZodVoid:Is,ZodArray:$i,ZodObject:kt,ZodUnion:Vo,ZodDiscriminatedUnion:nh,ZodIntersection:jo,ZodTuple:ai,ZodRecord:oh,ZodMap:Es,ZodSet:_s,ZodFunction:ah,ZodLazy:Ho,ZodLiteral:Uo,ZodEnum:Wo,ZodNativeEnum:Xo,ZodPromise:Un,ZodEffects:$t,ZodTransformer:$t,ZodOptional:cr,ZodNullable:si,ZodDefault:Zo,ZodCatch:zo,ZodNaN:Ds,BRAND:PI,ZodBranded:kc,ZodPipeline:Fc,ZodReadonly:Yo,custom:I7,Schema:oe,ZodSchema:oe,late:TI,get ZodFirstPartyTypeKind(){return K},coerce:aE,any:AI,array:RI,bigint:EI,boolean:D7,date:_I,discriminatedUnion:jI,effect:C7,enum:$I,function:zI,instanceof:wI,intersection:HI,lazy:YI,literal:qI,map:XI,nan:II,nativeEnum:JI,never:FI,null:LI,nullable:eE,number:_7,object:NI,oboolean:oE,onumber:nE,optional:QI,ostring:iE,pipeline:rE,preprocess:tE,promise:KI,record:WI,set:ZI,strictObject:GI,string:E7,symbol:DI,transformer:C7,tuple:UI,undefined:OI,union:VI,unknown:kI,void:BI,NEVER:sE,ZodIssueCode:B,quotelessJson:aI,ZodError:qt});var N1=L.object({rank:L.union([L.enum(["low","medium","high","always-visible"]),L.number()]).optional(),interactive:L.union([L.boolean(),L.literal("pointer-events-auto")]).optional(),id:L.string().optional(),anchor:L.union([L.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),L.array(L.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:L.boolean().optional()});function O7(r,e,t){L.array(L.number()).refine(i=>i.length===2||i.length===3,{message:"Array length must be either 2 or 3"}).parse(r),L.string().parse(e),N1.parse(t)}l(O7,"validateMarker");var qo=class qo{constructor(e,t={}){d(this,"id");d(this,"type","marker");d(this,"rank",0);d(this,"initialRank",0);d(this,"activeAnchor","center");d(this,"pointerEvents","none");d(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1});d(this,"projection",new te);d(this,"enabled",!0);d(this,"activeStrategyIndex",-1);d(this,"strategyIndex",-1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"containerEl");d(this,"contentEl",null);d(this,"contentHtml","");d(this,"style",{top:"0px",left:"0px"});d(this,"dirty",!1);d(this,"collisionDirty",!0);d(this,"visibilityNeedsUpdate",!0);d(this,"visible",!1);d(this,"animation",null);d(this,"currentStrategyIndex",-1);d(this,"onStrategySelected",l((e,t=!1)=>{if(this.currentStrategyIndex===e||t)return;this.activeAnchor=this.strategies[e].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},"onStrategySelected"));if(this.id=(t==null?void 0:t.id)||ae(),this.options={...this.options,...t},typeof t.rank=="string")this.rank=Cs(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let n=Math.trunc(C.env.NODE_ENV==="test"?qo.testId:qo.testId*10)/10;qo.testId+=.001,this.rank=n}typeof t.interactive=="string"&&(this.pointerEvents=t.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,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(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};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:e,height:t}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(n=>({name:n,getBoundingBox:()=>{let o=t/2,a=t/2,u=e/2,c=e/2;switch(n){case"top":{o=t,a=0;break}case"bottom":{o=0,a=t;break}case"left":{u=e,c=0;break}case"right":{u=0,c=e;break}case"top-left":{o=t,u=e,a=0,c=0;break}case"top-right":{o=t,c=e,a=0,u=0;break}case"bottom-left":{a=t,u=e,o=0,c=0;break}case"bottom-right":{a=t,c=e,o=0,u=0;break}}return[o,a,u,c]}}))}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((e,t)=>({index:t,boundingBox:e.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};l(qo,"MarkerComponent"),d(qo,"testId",0);var li=qo;m();m();var G1=class G1 extends dt{constructor(){super(...arguments);d(this,"userData",{entityId:"",type:"geometry"})}};l(G1,"Geometry3DObject3D");var pr=G1,V1=class V1{constructor(e,t){d(this,"id",ae());d(this,"components");this.components=[e,t]}get object3d(){return this.components[0].mesh}get parent(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}};l(V1,"Geometry3D");var Se=V1;m();var Os=L.object({type:L.enum(["Point"]),coordinates:L.array(L.number()).length(2)});var lE=L.object({interactive:L.boolean().optional(),id:L.string().optional(),nearRadius:L.number().optional(),farRadius:L.number().optional(),accentColor:L.string().optional(),displayArrowsOnPath:L.boolean().optional(),animateArrowsOnPath:L.boolean().optional()}),cE=L.object({type:L.enum(["Feature"]),geometry:Os,properties:L.object({parentId:L.any().optional()})});function L7(r,e){L.object({features:L.array(cE)}).parse(r),lE.parse(e)}l(L7,"validatePath");var Bc,j1=class j1{constructor(e,t){d(this,"type","path");d(this,"mesh",new pr);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new q);M(this,Bc,0);var i,n,o,a,u;this.feature=e,this.options=t||{},this.accentColor=(i=t==null?void 0:t.accentColor)!=null?i:this.accentColor,this.nearRadius=(n=t==null?void 0:t.nearRadius)!=null?n:this.nearRadius,this.farRadius=(o=t==null?void 0:t.farRadius)!=null?o:this.farRadius,this.displayArrowsOnPath=(a=t==null?void 0:t.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(u=t==null?void 0:t.animateArrowsOnPath)!=null?u:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(e){this.mesh&&(this.mesh.visible=e)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,Bc)}set altitude(e){this.mesh&&(this.mesh.position.z=e,T(this,Bc,e))}set complete(e){this.material&&(this.material.uniforms.complete.value=e,this.material.needsUpdate=!0)}};Bc=new WeakMap,l(j1,"PathComponent");var ci=j1;m();m();var H1=class H1 extends dt{};l(H1,"Geometry2DObject3D");var Ls=H1,U1=class U1{constructor(e,t){d(this,"id");d(this,"positionDirty",!0);d(this,"object3d",new Ls);d(this,"components");d(this,"disposed",!1);d(this,"worldPosition",new q);this.id=e.id||ae(),this.components=[e],this.object3d=new Ls,this.object3d.position.copy(t),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parent(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}};l(U1,"Geometry2D");var dr=U1;m();var Rc="mappedin";m();function W1(r){let e=r.min,t=r.max,i=new q(e.x,e.y,e.z),n=new q(t.x,e.y,e.z),o=new q(e.x,t.y,e.z),a=new q(t.x,t.y,e.z);return[i,n,o,a]}l(W1,"getCornersOfBoundingBox");m();function $o(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}l($o,"getPixelRatio");m();function Wn(r,e,t=!1){let i=null,n=0;return function(...o){n++,n===1&&t===!0&&r(...o);let a=l(()=>{(!t||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}l(Wn,"debounce");m();var uE=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&i>0&&!window.MSStream,a=/android/i.test(e);return r={isIpad:o,isMobile:a||n||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),A7=uE.getDeviceType,k7=(()=>{let r,e,t;function i(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let a=A7().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let u=new Error("Failed getting device info");throw u.name="FailedGettingDeviceInfo",u}}l(i,"getInfo");function n(){var a,u;if(!A7().isWindows)return!1;if(t!==void 0)return t;let o=(u=(a=pE())==null?void 0:a.toLowerCase())!=null?u:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return l(n,"shouldDisableOffscreenCanvas"),{getInfo:i,shouldDisableOffscreenCanvas:n,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),pE=k7.getInfo,X1=k7.shouldDisableOffscreenCanvas;m();function Nc(r,e){let t={};for(let i=0;i<e.length;i++){let n=e[i];n in r&&(t[n]=r[n])}return t}l(Nc,"pick");function Z1(r){return Object.keys(r).length===0}l(Z1,"isEmpty");m();var z1=l(r=>e=>{if(!e.includes("mappedin")){let t={};for(let i in r){let n=r[i];e.includes("mappedin")||(r[i]=n)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function hh(r,e,t,i){let n=r*(Math.PI/180),o=i/zr,a=r+o*180/Math.PI,u=t/zr/Math.cos(n),c=e+u*180/Math.PI;return{lat:a,lon:c}}l(hh,"cartesianToGeographic");function fh(r,e,t,i){let n=t*(Math.PI/180),o=i*(Math.PI/180),a=r*(Math.PI/180),u=e*(Math.PI/180),c=n-a,p=o-u,f=zr*p*Math.cos(a),y=zr*c;return{x:f,y}}l(fh,"geographicToCartesian");var Y1=l((r,e)=>{var t;if(r.children&&r.visible)for(let i of r.children){if(i.visible)if((t=i.userData)!=null&&t.entities3D&&i.type==="geometry-group"){e.add(i.userData.entityId);for(let n of i.userData.entities3D.values())e.add(n)}else(i.type==="group-container"||i.type==="custom-geometry"||i instanceof pr)&&e.add(i.userData.entityId);Y1(i,e)}return e},"populateGeometry3DIdsInScene"),q1=l((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let i of r.children)i.visible&&i instanceof Ls&&e.add(i.userData.entityId),q1(i,e);return e},"populateGeometry2DIdsInScene");function $1(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?$1(r[t],e[t]):r[t]=e[t]}return r}l($1,"mergeObjects");function mh(r,e,t,i){let n={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new Ii,a=new q(n.scale,-n.scale,n.scale),u=new Ii().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(a),c=t.elevation;return{id:Rc,type:"custom",renderingMode:"3d",render:(p,f)=>{if(o.fromArray(f),c!==t.elevation){let y=yp.fromLngLat(r.toLngLat(),t.elevation);u.makeTranslation(n.translateX,n.translateY,-y.z).scale(a)}e.projectionMatrix=o.multiply(u),c=t.elevation,i()}}}l(mh,"createCustomLayer");function dE(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}l(dE,"fetchToken");async function F7(r){let e=await dE(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}l(F7,"getRequestHeaders");function B7(r,e=0){let t=3735928559^e,i=1103547991^e;for(let n=0,o;n<r.length;n++)o=r.charCodeAt(n),t=Math.imul(t^o,2654435761),i=Math.imul(i^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}l(B7,"cyrb53");var hE=l(r=>r,"linearEase");function hr(r,e,t,i,n,o=hE){r=Math.max(e,Math.min(r,t));let a=(r-Math.min(e,t))/Math.abs(t-e),u=o(a);return i+u*(n-i)}l(hr,"interpolate");function J1(r,e,t){let i=r*(Math.PI/180)/2,n=e/2;return t*Math.tan(i)/n}l(J1,"getProjectionScaleFactor");function Gc(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}l(Gc,"getGeometryByGeometryId");function R7(r){return new Ab(new jf(r[0][0],r[0][1]),new jf(r[1][0],r[1][1])).getCenter().toArray()}l(R7,"getBoundingBoxCenter");function N7(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof Lb||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}l(N7,"isFiniteBox");m();m();function yh(r){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(r)}l(yh,"_typeof");var fE=/^\s+/,mE=/\s+$/;function W(r,e){if(r=r||"",e=e||{},r instanceof W)return r;if(!(this instanceof W))return new W(r,e);var t=yE(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}l(W,"tinycolor");W.prototype={isDark:l(function(){return this.getBrightness()<128},"isDark"),isLight:l(function(){return!this.isDark()},"isLight"),isValid:l(function(){return this._ok},"isValid"),getOriginalInput:l(function(){return this._originalInput},"getOriginalInput"),getFormat:l(function(){return this._format},"getFormat"),getAlpha:l(function(){return this._a},"getAlpha"),getBrightness:l(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:l(function(){var e=this.toRgb(),t,i,n,o,a,u;return t=e.r/255,i=e.g/255,n=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*u},"getLuminance"),setAlpha:l(function(e){return this._a=X7(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:l(function(){var e=V7(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:l(function(){var e=V7(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+i+"%, "+n+"%)":"hsva("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:l(function(){var e=G7(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:l(function(){var e=G7(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+i+"%, "+n+"%)":"hsla("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:l(function(e){return j7(this._r,this._g,this._b,e)},"toHex"),toHexString:l(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:l(function(e){return CE(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:l(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:l(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:l(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+")"},"toRgbString"),toPercentageRgb:l(function(){return{r:Math.round(Be(this._r,255)*100)+"%",g:Math.round(Be(this._g,255)*100)+"%",b:Math.round(Be(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:l(function(){return this._a==1?"rgb("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%)":"rgba("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:l(function(){return this._a===0?"transparent":this._a<1?!1:LE[j7(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:l(function(e){var t="#"+H7(this._r,this._g,this._b,this._a),i=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=W(e);i="#"+H7(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+i+")"},"toFilter"),toString:l(function(e){var t=!!e;e=e||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:l(function(){return W(this.toString())},"clone"),_applyModification:l(function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:l(function(){return this._applyModification(PE,arguments)},"lighten"),brighten:l(function(){return this._applyModification(TE,arguments)},"brighten"),darken:l(function(){return this._applyModification(wE,arguments)},"darken"),desaturate:l(function(){return this._applyModification(xE,arguments)},"desaturate"),saturate:l(function(){return this._applyModification(SE,arguments)},"saturate"),greyscale:l(function(){return this._applyModification(ME,arguments)},"greyscale"),spin:l(function(){return this._applyModification(IE,arguments)},"spin"),_applyCombination:l(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:l(function(){return this._applyCombination(DE,arguments)},"analogous"),complement:l(function(){return this._applyCombination(EE,arguments)},"complement"),monochromatic:l(function(){return this._applyCombination(OE,arguments)},"monochromatic"),splitcomplement:l(function(){return this._applyCombination(_E,arguments)},"splitcomplement"),triad:l(function(){return this._applyCombination(U7,[3])},"triad"),tetrad:l(function(){return this._applyCombination(U7,[4])},"tetrad")};W.fromRatio=function(r,e){if(yh(r)=="object"){var t={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?t[i]=r[i]:t[i]=Vc(r[i]));r=t}return W(r,e)};function yE(r){var e={r:0,g:0,b:0},t=1,i=null,n=null,o=null,a=!1,u=!1;return typeof r=="string"&&(r=BE(r)),yh(r)=="object"&&(Ji(r.r)&&Ji(r.g)&&Ji(r.b)?(e=gE(r.r,r.g,r.b),a=!0,u=String(r.r).substr(-1)==="%"?"prgb":"rgb"):Ji(r.h)&&Ji(r.s)&&Ji(r.v)?(i=Vc(r.s),n=Vc(r.v),e=bE(r.h,i,n),a=!0,u="hsv"):Ji(r.h)&&Ji(r.s)&&Ji(r.l)&&(i=Vc(r.s),o=Vc(r.l),e=vE(r.h,i,o),a=!0,u="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=X7(t),{ok:a,format:r.format||u,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}l(yE,"inputToRGB");function gE(r,e,t){return{r:Be(r,255)*255,g:Be(e,255)*255,b:Be(t,255)*255}}l(gE,"rgbToRgb");function G7(r,e,t){r=Be(r,255),e=Be(e,255),t=Be(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,u=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=u>.5?c/(2-i-n):c/(i+n),i){case r:o=(e-t)/c+(e<t?6:0);break;case e:o=(t-r)/c+2;break;case t:o=(r-e)/c+4;break}o/=6}return{h:o,s:a,l:u}}l(G7,"rgbToHsl");function vE(r,e,t){var i,n,o;r=Be(r,360),e=Be(e,100),t=Be(t,100);function a(p,f,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(f-p)*6*y:y<1/2?f:y<2/3?p+(f-p)*(2/3-y)*6:p}if(l(a,"hue2rgb"),e===0)i=n=o=t;else{var u=t<.5?t*(1+e):t+e-t*e,c=2*t-u;i=a(c,u,r+1/3),n=a(c,u,r),o=a(c,u,r-1/3)}return{r:i*255,g:n*255,b:o*255}}l(vE,"hslToRgb");function V7(r,e,t){r=Be(r,255),e=Be(e,255),t=Be(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,u=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case r:o=(e-t)/c+(e<t?6:0);break;case e:o=(t-r)/c+2;break;case t:o=(r-e)/c+4;break}o/=6}return{h:o,s:a,v:u}}l(V7,"rgbToHsv");function bE(r,e,t){r=Be(r,360)*6,e=Be(e,100),t=Be(t,100);var i=Math.floor(r),n=r-i,o=t*(1-e),a=t*(1-n*e),u=t*(1-(1-n)*e),c=i%6,p=[t,a,o,o,u,t][c],f=[u,t,t,a,o,o][c],y=[o,o,u,t,t,a][c];return{r:p*255,g:f*255,b:y*255}}l(bE,"hsvToRgb");function j7(r,e,t,i){var n=[Or(Math.round(r).toString(16)),Or(Math.round(e).toString(16)),Or(Math.round(t).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("")}l(j7,"rgbToHex");function CE(r,e,t,i,n){var o=[Or(Math.round(r).toString(16)),Or(Math.round(e).toString(16)),Or(Math.round(t).toString(16)),Or(Z7(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("")}l(CE,"rgbaToHex");function H7(r,e,t,i){var n=[Or(Z7(i)),Or(Math.round(r).toString(16)),Or(Math.round(e).toString(16)),Or(Math.round(t).toString(16))];return n.join("")}l(H7,"rgbaToArgbHex");W.equals=function(r,e){return!r||!e?!1:W(r).toRgbString()==W(e).toRgbString()};W.random=function(){return W.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function xE(r,e){e=e===0?0:e||10;var t=W(r).toHsl();return t.s-=e/100,t.s=gh(t.s),W(t)}l(xE,"_desaturate");function SE(r,e){e=e===0?0:e||10;var t=W(r).toHsl();return t.s+=e/100,t.s=gh(t.s),W(t)}l(SE,"_saturate");function ME(r){return W(r).desaturate(100)}l(ME,"_greyscale");function PE(r,e){e=e===0?0:e||10;var t=W(r).toHsl();return t.l+=e/100,t.l=gh(t.l),W(t)}l(PE,"_lighten");function TE(r,e){e=e===0?0:e||10;var t=W(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),W(t)}l(TE,"_brighten");function wE(r,e){e=e===0?0:e||10;var t=W(r).toHsl();return t.l-=e/100,t.l=gh(t.l),W(t)}l(wE,"_darken");function IE(r,e){var t=W(r).toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,W(t)}l(IE,"_spin");function EE(r){var e=W(r).toHsl();return e.h=(e.h+180)%360,W(e)}l(EE,"_complement");function U7(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=W(r).toHsl(),i=[W(r)],n=360/e,o=1;o<e;o++)i.push(W({h:(t.h+o*n)%360,s:t.s,l:t.l}));return i}l(U7,"polyad");function _E(r){var e=W(r).toHsl(),t=e.h;return[W(r),W({h:(t+72)%360,s:e.s,l:e.l}),W({h:(t+216)%360,s:e.s,l:e.l})]}l(_E,"_splitcomplement");function DE(r,e,t){e=e||6,t=t||30;var i=W(r).toHsl(),n=360/t,o=[W(r)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(W(i));return o}l(DE,"_analogous");function OE(r,e){e=e||6;for(var t=W(r).toHsv(),i=t.h,n=t.s,o=t.v,a=[],u=1/e;e--;)a.push(W({h:i,s:n,v:o})),o=(o+u)%1;return a}l(OE,"_monochromatic");W.mix=function(r,e,t){t=t===0?0:t||50;var i=W(r).toRgb(),n=W(e).toRgb(),o=t/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,e){var t=W(r),i=W(e);return(Math.max(t.getLuminance(),i.getLuminance())+.05)/(Math.min(t.getLuminance(),i.getLuminance())+.05)};W.isReadable=function(r,e,t){var i=W.readability(r,e),n,o;switch(o=!1,n=RE(t),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,e,t){var i=null,n=0,o,a,u,c;t=t||{},a=t.includeFallbackColors,u=t.level,c=t.size;for(var p=0;p<e.length;p++)o=W.readability(r,e[p]),o>n&&(n=o,i=W(e[p]));return W.isReadable(r,i,{level:u,size:c})||!a?i:(t.includeFallbackColors=!1,W.mostReadable(r,["#fff","#000"],t))};var K1=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"},LE=W.hexNames=AE(K1);function AE(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}l(AE,"flip");function X7(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}l(X7,"boundAlpha");function Be(r,e){kE(r)&&(r="100%");var t=FE(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}l(Be,"bound01");function gh(r){return Math.min(1,Math.max(0,r))}l(gh,"clamp01");function Jt(r){return parseInt(r,16)}l(Jt,"parseIntFromHex");function kE(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}l(kE,"isOnePointZero");function FE(r){return typeof r=="string"&&r.indexOf("%")!=-1}l(FE,"isPercentage");function Or(r){return r.length==1?"0"+r:""+r}l(Or,"pad2");function Vc(r){return r<=1&&(r=r*100+"%"),r}l(Vc,"convertToPercentage");function Z7(r){return Math.round(parseFloat(r)*255).toString(16)}l(Z7,"convertDecimalToHex");function W7(r){return Jt(r)/255}l(W7,"convertHexToDecimal");var Dr=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 Ji(r){return!!Dr.CSS_UNIT.exec(r)}l(Ji,"isValidCSSUnit");function BE(r){r=r.replace(fE,"").replace(mE,"").toLowerCase();var e=!1;if(K1[r])r=K1[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Dr.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=Dr.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Dr.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=Dr.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Dr.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=Dr.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Dr.hex8.exec(r))?{r:Jt(t[1]),g:Jt(t[2]),b:Jt(t[3]),a:W7(t[4]),format:e?"name":"hex8"}:(t=Dr.hex6.exec(r))?{r:Jt(t[1]),g:Jt(t[2]),b:Jt(t[3]),format:e?"name":"hex"}:(t=Dr.hex4.exec(r))?{r:Jt(t[1]+""+t[1]),g:Jt(t[2]+""+t[2]),b:Jt(t[3]+""+t[3]),a:W7(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Dr.hex3.exec(r))?{r:Jt(t[1]+""+t[1]),g:Jt(t[2]+""+t[2]),b:Jt(t[3]+""+t[3]),format:e?"name":"hex"}:!1}l(BE,"stringInputToObject");function RE(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}l(RE,"validateWCAG2Parms");var p0=ul(u0());var h0=L.object({rank:L.union([L.enum(["low","medium","high","always-visible"]),L.number()]).optional(),interactive:L.boolean().optional(),appearance:L.object({margin:L.number().min(6).optional(),text:L.object({numLines:L.number().optional(),lineHeight:L.number().optional(),size:L.number().optional(),maxWidth:L.number().optional(),foregroundColor:L.string().optional(),backgroundColor:L.string().optional()}).optional(),marker:L.object({size:L.number().optional(),foregroundColor:L.object({active:L.string().optional(),inactive:L.string().optional()}).optional(),backgroundColor:L.object({active:L.string().optional(),inactive:L.string().optional()}).optional()}).optional()}).optional()});function wS(r,e,t){L.array(L.number()).length(2).parse(r),L.string().parse(e),h0.parse(t||{})}l(wS,"validateLabel");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}}},_D={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}}}},DD="LOW_PRIORITY",MS=4,OD=6,LD=20,AD=2.5,kD=2,FD="cover",PS=.5,BD=6.5,TS={heightAbovePolygon:0,appearance:_D.darkOnLight};var Qo=class Qo{constructor(e,t,i){d(this,"lines",0);d(this,"id");d(this,"rank");d(this,"type","label");d(this,"initialRank");d(this,"contextConfigured",!1);d(this,"fillText");d(this,"newStyle",{});d(this,"opacity",0);d(this,"visibilityNeedsUpdate",!0);d(this,"activeStrategyIndex",-1);d(this,"text");d(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});d(this,"projection",new te);d(this,"_cache",{});d(this,"appearance");d(this,"options");d(this,"visible",!1);d(this,"enabled",!0);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"currentStrategyIndex",-1);d(this,"totalMarkerSize",0);d(this,"dirty",!0);d(this,"collisionDirty",!0);d(this,"lastTextAlign");d(this,"imageHash");d(this,"markerSize",0);d(this,"iconVisible",!1);d(this,"zoomProportion",0);d(this,"dp");d(this,"onStrategySelected",l(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let i=this.style;this.style=this.newStyle,this.newStyle=i,this.iconVisible||(this.opacity=0,this.visibilityNeedsUpdate=!0)},"onStrategySelected"));var o,a;if(this.id=(o=t.id)!=null?o:ae(),this.options=(0,p0.default)({},t,TS),this.text=e,this.dp=(u=1)=>u*i.pixelRatio,typeof t.rank=="string")this.rank=Cs(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let u=Math.trunc(C.env.NODE_ENV==="test"?Qo.testId:Qo.testId*10)/10;Qo.testId+=.001,this.rank=u,this.initialRank=u}let n=(0,p0.default)({},this.options.appearance,TS.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||LD,iconPadding:(a=n.marker.iconPadding)!=null?a:kD,iconFit:n.marker.iconFit||FD,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?PS:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=PS}=this.appearance.marker,t=this.dp();this.zoomProportion<=e&&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(BD)),this.totalMarkerSize=Math.ceil((this.markerSize+AD)/t)}get strategies(){let{width:e,height:t}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(OD,i),o=this.iconVisible?n/2:0,a=[{name:"RIGHT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+n,u/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+e+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+MS,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+n,u/2+n,this.totalMarkerSize/2+e+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-MS,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let u=this.dp();return[t+this.totalMarkerSize/2/u+n,this.totalMarkerSize/2+n,e/2+n,e/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-t-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:DD,getBoundingBox:()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/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}}]:a}updatePosition(){}disable(){this.visible=!1}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((e,t)=>({index:t,boundingBox:e.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};l(Qo,"LabelComponent"),d(Qo,"testId",0);var d0=Qo,ui=d0;function xt(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof dr&&r.components[1]===void 0?(r.components[1]=new bs,r.components[1].dirty=!0):r instanceof Se&&r.components[2]===void 0?(r.components[2]=new bs,r.components[2].dirty=!0):r instanceof Xe&&r.components[1]===void 0&&(r.components[1]=new bs,r.components[1].dirty=!0),!0):(r instanceof dr?r.components[1]=void 0:r instanceof Se?r.components[2]=void 0:r instanceof Xe&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=t.geometry3DMap.get(n),xt(i,e,t);return!0}}return!1}l(xt,"updateInteractivity");function IS(r,e,t){if(!(!(t!=null&&t.color)&&!(t!=null&&t.topColor))){if(t!==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=e.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=t.color||o.color,n.color=t.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=t.topColor||o.topColor,n.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),t.topColor!==void 0&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}l(IS,"updateGroupColor");function ES(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}l(ES,"updateGroupShading");function _S(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}l(_S,"updateImageProps");function DS(r,e){var t;if(e!==void 0&&r.type==="geometry"){let i=r.components[1];if(i.height!==e)return i.height=e,i.dirty=!0,((t=r.parent)==null?void 0:t.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}return!1}l(DS,"updateHeight");function f0(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),e.topColor!==void 0&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}l(f0,"updateColor");function m0(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}l(m0,"updatePosition");function y0(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==e&&r.parent instanceof Xe?((t=r.parent)==null||t.removeEntity(r),e.addEntity(r),!0):!1}l(y0,"updateParent");function OS(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=e)}l(OS,"updateEnabled");function LS(r,e,t){if(e!==void 0&&r.type==="marker"){let i=r.components[0];if(e.contentHTML!==void 0)return i.containerEl.innerHTML=e.contentHTML,!0;if(e.options!=null){try{N1.parse(e.options||{})}catch(n){return A.error(n),!1}return e.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",xt(r,!1,t)):(i.pointerEvents="none",xt(r,e.options.interactive,t)),AS(r,e.options.rank),!0}}return!1}l(LS,"updateMarker");function AS(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Cs(e),!0):!1}l(AS,"updateRank");function kS(r,e,t){var i,n,o,a,u;if(e!==void 0&&r.type==="label"){let c=r.components[0];e.text!==void 0&&(c.text=e.text,c.dirty=!0);try{h0.parse(e.options||{})}catch(p){A.error(p);return}((i=e.options)==null?void 0:i.appearance)!==void 0&&Object.keys((n=e.options)==null?void 0:n.appearance).length>0&&($1(c.appearance,((o=e.options)==null?void 0:o.appearance)||{}),c.dirty=!0),xt(r,(a=e.options)==null?void 0:a.interactive,t),AS(r,(u=e.options)==null?void 0:u.rank)}}l(kS,"updateLabel");function FS(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}l(FS,"updateHoverColor");function g0(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}l(g0,"updateFlipImageToFaceCamera");function ea(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parent;t instanceof Qe&&(t.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(e);return!0}return!1}l(ea,"updateVisibility");function BS(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=e.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=t,o.components[1].dirty=!0))}r.setOpacity(t),i.opacity=t}}l(BS,"updateOpacity");function RS(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}l(RS,"updateGroupTexture");function NS(r,e){if(r.type==="geometry"){let t=!1,i=r.components[1];if((e==null?void 0:e.texture)!=null&&i.texture!==(e==null?void 0:e.texture)&&(i.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&i.topTexture!==(e==null?void 0:e.topTexture)&&(i.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof Ee){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}l(NS,"updateIndividualGeometryTexture");function GS(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.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}l(GS,"updateIndividualGeometryOpacity");function wh(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=e,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}l(wh,"updateAltitude");function v0(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parent;t instanceof Qe&&(t.userData.outlineDirty=!0)}return!0}return!1}l(v0,"updateOutline");function VS(r,e){let{visible:t,color:i}=e,n=r.components[0];n instanceof ci&&(t!=null&&ea(r,t),i!=null&&f0(r,{color:i}),Object.assign(n,b0(e)),Z1(e)||(n.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(n.dirty=!0)))}l(VS,"handlePathUpdate");function b0(r){return Nc(r,RD)}l(b0,"pickPathOptions");var RD=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];m();m();m();m();var S0=class S0 extends Pb{constructor(t){let i=t,n=3,o=n*4;super(new Float32Array(t*o),n,t,fb,hb);d(this,"_width");d(this,"_height");d(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(t,i,n){let o=this.image.data,a=t*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(t){let i=this.image.data,n=t*this._width,o=new _e(i[n],i[n+1],i[n+2]),a=new _e(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(t,i,n){let o=this.image.data,a=t*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}};l(S0,"BatchedPropertiesTexture");var Ih=S0;var jS="#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 HS="#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 VD=-.05,jD=1,M0=class M0 extends Wr{constructor(t,i,n=1){super(t);d(this,"propertiesTexture");d(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});d(this,"showTextures",l(t=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,i,n),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new Ih(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,u=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,f=this.uniforms.uTexture,y=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=jS,o.fragmentShader=HS,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:u,uGradientStart:c,uMinSideAlpha:{value:VD},uMaxSideAlpha:{value:jD},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:f,uRepeatYFactor:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=jr,t.wrapT=jr,t.colorSpace=Ti,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=jr,t.wrapT=jr,t.colorSpace=Ti,this.uniforms.uTopTexture.value=t}setGradientShading(t,i,n){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(t,i,n){this.propertiesTexture.setColor(t,i,n)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,i),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};l(M0,"BatchedStandardMaterial");var Rs=M0;var WD=80;function US(r,e){var u,c;let t=0;for(let p of r)t+=((c=(u=p.components[0])==null?void 0:u.geometry)==null?void 0:c.attributes.position.count)||0;let i=new _e(e.color),n=new Rs({color:i,side:Pi,opacity:e.opacity||1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length),o=new oi(r.length,t,0,n),a;for(let p of r)a=p.components[0],!(!(a instanceof Ee)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=p.id,n.setColor(a.instanceIndex,i,e.topColor?new _e(e.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}l(US,"batchGeometries");function P0(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new wb(r,WD),i=T0(e.color.getHexString()),n=new dp({linewidth:2,color:i,transparent:!0}),o=new oo(t,n);return o.layers.set(1),o}l(P0,"createOutlines");function T0(r){return W(r).darken(30).toRgbString()}l(T0,"darkenColorForOutline");m();function WS(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}l(WS,"scrubMaterial");function Ze(r){for(let e=r.children.length-1;e>=0;e--)Ze(r.children[e]);"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(e){WS(e)}):"material"in r&&typeof r.material<"u"&&WS(r.material)}l(Ze,"destroyObject3D");var zc,w0=class w0{constructor(e){d(this,"rendererState");d(this,"dirty",!0);M(this,zc,!0);this.rendererState=e}get geometries3DDirty(){return s(this,zc)}set geometries3DDirty(e){T(this,zc,e)}update(e,t=!1){var o,a;let i=t&&e>=16&&e<=19,n;if(this.geometries3DDirty){let u;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let p=n.children[0];n.userData.outlineDirty=!1;let f=Gn(n);if(f&&Ze(f),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let y;if(p instanceof oi){let v=[],x,P,b,S;for(let E of n.userData.entities3D)S=this.rendererState.geometry3DMap.get(E),S instanceof Se&&(P=S.components[0],b=S.components[1],P instanceof Ee&&b.visible&&b.outline&&!P.detached&&(x=P==null?void 0:P.geometry,x&&v.push(x)));v.length>0&&(y=Zr(v))}else y=p.geometry;y&&(u=P0(y,p.material),u.position.z=n.altitude,u.userData.outlineOfEntityId=n.userData.entityId);let g;for(let v of n.userData.entities3D.values()){let x=this.rendererState.geometry3DMap.get(v);g=x==null?void 0:x.components[0],g instanceof Ee&&(u&&(x==null?void 0:x.type)==="geometry"&&!g.detached?(x.components[0].outline=u,(o=n.parent)==null||o.add(u)):(x==null?void 0:x.type)==="geometry"&&g.geometry!=null&&g.material!=null&&g.detached&&(g.outline&&Ze(g.outline),g.outline=P0(g.geometry,g.material),(a=n.parent)==null||a.add(g.outline)))}}this.dirty=!0}this.geometries3DDirty=!1}if((i||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let u=hr(e,16,19,0,1),c;for(let p of this.rendererState.geometry3DIdsInScene)if(c=this.rendererState.geometry3DMap.get(p),(c==null?void 0:c.type)==="geometry-group"&&c.components[0]!=null&&c.components[0].outline&&c.visible){let f=Gn(c);if(f&&f.visible){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=u}}else if((c==null?void 0:c.type)==="geometry"&&c.components[0]instanceof Ee&&c.components[0].detached){let f=c.components[0].outline;if(f){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=u}}}this.dirty=!1}};zc=new WeakMap,l(w0,"OutlineInterpolationSystem");var Zc=w0;var I0=class I0 extends dt{constructor(t,i=new Lo){super();d(this,"visible",!0);d(this,"type","geometry-group");d(this,"components");d(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=t}setVisible(t){this.visible=t;let i=Gn(this);i&&(i.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let n of this.children)if(!n.userData.detached){t=n;break}return t instanceof oi?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};l(I0,"GeometryGroupObject3D");var Qe=I0;var Yc=class Yc extends dt{constructor(t){super();d(this,"childrenIds",new Set);d(this,"type","group-container");d(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});d(this,"components",[]);this.userData.entityId=t}addEntity(t){t instanceof Yc?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof dr?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof Qe?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof Se&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Yc?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof dr?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof Qe?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof Se&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};l(Yc,"GroupContainerObject3D");var Xe=Yc;m();var zS=!1;function YS(){zS=!0}l(YS,"enableTestMode");var E0=class E0{constructor(e,t=2){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new _e);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");var i,n;try{this.options=e;let o={canvas:e.canvas,alpha:e.alpha||!1,stencil:!1,antialias:typeof e.antialias=="boolean"?e.antialias:!0,outputColorSpace:Ti,powerPreference:"high-performance",preserveDrawingBuffer:!0};zS?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new _e,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=t===2?new Sb(o):new Mb(o),this.backgroundColor=new _e((i=e.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=e.backgroundAlpha)!=null?n:1}catch(o){A.error(o),e.onWebGLRendererError&&e.onWebGLRendererError(o)}}destroy(){var e,t;this.renderer&&((t=(e=this.renderer).dispose)==null||t.call(e))}render(e,t){this.renderer&&(this.renderer.state.reset(),t.layers.enable(0),t.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(e,t),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(e,t){C.env.NODE_ENV==="test"||!this.renderer||(this.width=e,this.height=t,this.renderer.setSize(e,t,!1))}setBackgroundColor(e,t){this.backgroundColor=e,this.backgroundAlpha=t}domElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}};l(E0,"Renderer");var Eh=E0;m();m();var qS='"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 j(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 q(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function z(n,e){let t=e.x,i=e.y,r=e.x+e.w,c=e.y+e.h,h=n.x,f=n.y,y=n.x+n.w,R=n.y+n.h;return t<y&&h<r&&i<R&&f<c}function a(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var k=4,o=class{constructor(e,t,i,r,c){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");let h=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof c>"u"?null:c,this.x=e-k,this.y=t-k,this.w=i+k*Math.min(h,2),this.h=r+k*Math.min(h,2)}contains(e){return e===this?!1:j(this,e)}intersects(e){return z(this,e)}intersectsPoint(e){return q(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.5)",e.fillRect(this.x,this.y,this.w,this.h)}};var I=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:r}=this.boundary;this.topLeft=new n(new o(e,t,i/2,r/2),this),this.topRight=new n(new o(e+i/2,t,i/2,r/2),this),this.bottomLeft=new n(new o(e,t+r/2,i/2,r/2),this),this.bottomRight=new n(new o(e+i/2,t+r/2,i/2,r/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryRect(e)),a(t,this.topRight.queryRect(e)),a(t,this.bottomLeft.queryRect(e)),a(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryPoint(e)),a(t,this.topRight.queryPoint(e)),a(t,this.bottomLeft.queryPoint(e)),a(t,this.bottomRight.queryPoint(e))),t}insert(e){return this.boundary.contains(e)?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):!1}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,C=10;function X(n,e,t,i,r,c,h="-1"){let f=1/0,y=1/0,R=-1/0,S=-1/0,K=new o(-C,0,5,t),Q=new o(-C,0,e,5),W=new o(e-5,0,e+C,t),Y=new o(0,t-5,e,t+C),F=Z(e,t,i,r,c),V=[K,Q,W,Y],E=new o(-d,-d,e+d*2,t+d*2);for(let s of n)for(let b=0;b<s.bboxes.length;b++){let{boundingBox:P}=s.bboxes[b],[m,T,u,p]=P,[v,x,_,U]=[s.y-m,s.y+T,s.x-u,s.x+p],B=_,D=v,A=U-_,M=x-v;f=Math.min(f,B)-d,y=Math.min(y,D)-d,R=Math.max(R,B+A)+d,S=Math.max(S,D+M)+d,s.bboxes[b].boundingRect=new o(B,D,A,M)}let g={msgId:h,colliders:new Array(n.length),debug:[]},L=new I(new o(f,y,R-f,S-y)),w;for(let s=0;s<n.length;s++)if(w=n[s],g.colliders[s]=[-1,!1],w.enabled){let[b,P,m]=[1/0,-1,void 0];for(let{index:T,boundingRect:u}of w.bboxes){let p=[];if(p=L.queryRect(u).filter(x=>u.intersects(x)),w.shouldCollideWithScreenEdges&&V.forEach(x=>{u.intersects(x)&&p.push(x)}),u.intersects(F)){g.colliders[s]=[T,!0,u];break}if(p.length<=b&&(m=u,P=T,b=p.length),p.length===0){L.insert(u),g.colliders[s]=[T,!E.contains(u),u];break}}w.rank===5&&m!=null&&(L.insert(m),g.colliders[s]=[P,!E.contains(m),m])}else g.colliders[s]=[-1,!1];return g}function Z(n,e,t,i,r){switch(r){case"top-right":return new o(n-t,0,t,i);case"bottom-left":return new o(0,e-i,t,i);case"bottom-right":return new o(n-t,e-i,t,i);case"top-left":return new o(0,0,t,i)}}function O(n){let e=n[0].map(t=>{let i=t[0].map((r,c)=>({index:c,boundingBox:[r[0],r[1],r[2],r[3]]}));return{enabled:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],bboxes:i}});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=O(n.data);self.postMessage(X(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';m();m();m();m();m();function $S(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}l($S,"contains");m();function JS(r,e){let[t,i]=e;return t>=r.x&&t<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}l(JS,"intersectPoint");m();function KS(r,e){let t=e.x,i=e.y,n=e.x+e.w,o=e.y+e.h,a=r.x,u=r.y,c=r.x+r.w,p=r.y+r.h;return t<c&&a<n&&i<p&&u<o}l(KS,"intersects");m();function rn(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}l(rn,"appendItems");m();var _h=4,_0=class _0{constructor(e,t,i,n,o){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");let a=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof o>"u"?null:o,this.x=e-_h,this.y=t-_h,this.w=i+_h*Math.min(a,2),this.h=n+_h*Math.min(a,2)}contains(e){return e===this?!1:$S(this,e)}intersects(e){return KS(this,e)}intersectsPoint(e){return JS(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.5)",e.fillRect(this.x,this.y,this.w,this.h)}};l(_0,"Rectangle");var et=_0;var ta=class ta{constructor(e,t){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(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:n}=this.boundary;this.topLeft=new ta(new et(e,t,i/2,n/2),this),this.topRight=new ta(new et(e+i/2,t,i/2,n/2),this),this.bottomLeft=new ta(new et(e,t+n/2,i/2,n/2),this),this.bottomRight=new ta(new et(e+i/2,t+n/2,i/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(rn(t,this.topLeft.queryRect(e)),rn(t,this.topRight.queryRect(e)),rn(t,this.bottomLeft.queryRect(e)),rn(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(rn(t,this.topLeft.queryPoint(e)),rn(t,this.topRight.queryPoint(e)),rn(t,this.bottomLeft.queryPoint(e)),rn(t,this.bottomRight.queryPoint(e))),t}insert(e){return this.boundary.contains(e)?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):!1}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()}};l(ta,"QuadTree");var pi=ta;m();function QS(r,e,t){let i,n,o,a=null,u=0;t||(t={});let c=l(function(){u=t.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)},"later");return function(){let p=Date.now();!u&&t.leading===!1&&(u=p);let f=e-(p-u);return i=globalThis,n=arguments,f<=0||f>e?(a&&(clearTimeout(a),a=null),u=p,o=r.apply(i,n),a||(i=n=null)):!a&&t.trailing!==!1&&(a=setTimeout(c,f)),o}}l(QS,"throttle");function e6(r){return[r.bboxes.map(t=>[t.boundingBox[0],t.boundingBox[1],t.boundingBox[2],t.boundingBox[3]]),r.enabled?1:0,r.rank===5?1:0,r.x,r.y]}l(e6,"packCollider");var ra=!1,XD=150,O0=class O0 extends J{constructor(t,i,n=new Worker(URL.createObjectURL(new Blob([qS],{type:"text/javascript"})))){super();d(this,"worker");d(this,"debugContext");d(this,"debugCanvas");d(this,"dirty",!0);d(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);d(this,"visibleCollidersQTree",new pi(new et(0,0,0,0)));d(this,"interactiveCollidersQTree",new pi(new et(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",l(()=>{ra=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",l(()=>{ra=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",l(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",l((t,i,n="bottom-left")=>{if(this.dirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let o;for(let a of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(a);u&&(o=u.components[0],this.componentArray.push(o))}this.resize(t,i,n),this.dirty=!1,this.componentArray.sort((a,u)=>u.rank-a.rank)}else this.componentArray.filter(a=>a.collisionDirty===!0).length>0&&this.componentArray.sort((a,u)=>u.rank-a.rank);for(let o=0;o<this.componentArray.length;o++)this.packedMessage&&(this.componentArray[o].collisionDirty||this.packedMessage[0][o]==null?(this.packedMessage[0][o]=e6(this.componentArray[o].toJSON()),this.componentArray[o].collisionDirty=!1):(this.packedMessage[0][o][1]=this.componentArray[o].enabled?1:0,this.packedMessage[0][o][2]=this.componentArray[o].rank===5?1:0,this.packedMessage[0][o][3]=this.componentArray[o].projection.x,this.packedMessage[0][o][4]=this.componentArray[o].projection.y));this.working||this.postMessage()},"update"));d(this,"resolve",l(t=>{if(this.working=!1,this.dirty||!t.data)return;let i=t.data.colliders,n=-1,o=!1,a,u,c;ra&&(this.visibleCollidersQTree=new pi(new et(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new pi(new et(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let p=0;p<this.componentArray.length;p++){let f=this.componentArray[p];i[p]==null||!f.enabled||([n,o,a]=i[p],n!==-1&&!o&&a!=null?(c=new et(a.x,a.y,a.w,a.h,{entityId:f.id}),ra&&this.visibleCollidersQTree.insert(c),u=this.coreState.geometry2DMap.get(f.id),(u==null?void 0:u.components[1])!=null&&this.interactiveCollidersQTree.insert(new et(a.x,a.y,a.w,a.h,{entityId:f.id})),f.visible===!1&&(f.visible=!0,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&(f.activeBoundingBox=c,f.onStrategySelected(n))):(f.visible===!0&&(f.visible=!1,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&f.onStrategySelected(n)))}ra&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",l(()=>{ra&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",l(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=QS(this._postMessage,XD,!1),ra?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};l(O0,"CollisionSystem");var Dh=O0;m();m();m();m();var A0=class A0{constructor(e){d(this,"type");d(this,"event");this.type=0,this.event=e}get timestamp(){return this.event.timeStamp}};l(A0,"Tap");var Oh=A0,k0=class k0{constructor(){d(this,"taps",[])}add(e){this.lastPointerDown&&e.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(e)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===1}get isSingleTapWithOneFinger(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===0}get isDoubleTapWithOneFinger(){var e,t;return this.isDoubleTap&&((e=this.taps[0])==null?void 0:e.type)===0&&((t=this.taps[1])==null?void 0:t.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(e){this.taps=this.taps.filter(t=>e-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};l(k0,"TapsController");var Lh=k0;m();function t6(r){let e=new Set;for(let t of r){let i=t.object;for(;i.parent&&!e.has(i.parent);)i=i.parent,i instanceof Xe&&i.type==="group-container"&&i.visible&&i.components[1]&&e.add(i)}return Array.from(e)}l(t6,"getUniqueIntersectedGroupContainers");function r6(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}l(r6,"arraysEqual");var Ns,F0=class F0 extends J{constructor(t,i,n,o){super();d(this,"raycaster",new Xr);d(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}});d(this,"coreState");d(this,"camera");d(this,"cameraPlane");d(this,"_quadtree",new pi(new et(0,0,0,0)));d(this,"_container");d(this,"lastPointerEvent");d(this,"cursor","grab");d(this,"touchesCount",0);d(this,"hasTouched",!1);M(this,Ns,void 0);d(this,"onPointerMoveRaf",l(t=>{this.lastPointerEvent=t,s(this,Ns)&&cancelAnimationFrame(s(this,Ns)),T(this,Ns,requestAnimationFrame(()=>{this.onPointerMove(t)}))},"onPointerMoveRaf"));d(this,"onPointerMove",l(t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new Lh);d(this,"onPointerDown",l(t=>{t.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:t.timeStamp,clientX:t.clientX,clientY:t.clientY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new Oh(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",l(t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,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(t);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)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new te);d(this,"debugPanel");d(this,"resize",l(()=>{let{top:t,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[t,i]},"resize"));this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=t,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(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let i=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i)return;let{entity3D:n,entity2D:o,position:a,groupContainers:u}=this.intersect(i);(this.handle3DEntityHover(n)||this.handle2DEntityHover(o)||this.handle3DContainerHover(u))&&this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:u}),this.handleCursor()}handleCursor(){let t=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=YD(t,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}handle2DEntityHover(t){let i=this.state.hovered2DEntity!==t;return this.state.hovered2DEntity=t,i}handleClick(t){let i=this.intersect(t);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let t;for(let i of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(i),((t==null?void 0:t.type)==="geometry"||(t==null?void 0:t.type)==="model"||(t==null?void 0:t.type)==="path")&&t.components[2]?t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh):(t==null?void 0:t.type)==="group-container"&&t.components[1]&&!this.cachedHitBoxes.groups.includes(t)&&this.cachedHitBoxes.groups.push(t);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){var x,P;let i=[t.offsetX,t.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(b=>b.intersectsPoint(i)),a=this.state.containerOffset[0],u=this.state.containerOffset[1];this.ndcPoint.x=(t.clientX-u)/this._container.clientWidth*2-1,this.ndcPoint.y=-((t.clientY-a)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[c]=this.getMouseRayIntersects(),p=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(b=>b.object.visible),[f]=p,y=(x=f==null?void 0:f.instanceId)!=null?x:f==null?void 0:f.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(b=>b.object.visible),v;return g!=null&&g.length>0&&(v=t6(g)),{entity2D:((P=o==null?void 0:o.userData)==null?void 0:P.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:y!=null?this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entities[y]):this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entityId),position:Array.isArray(g)&&(g==null?void 0:g.length)>0?g[0].point:c==null?void 0:c.point,groupContainers:v}}handle3DEntityHover(t){this.state.lastHover!==t&&(this.state.lastHover&&n6(this.state.lastHover,!1),t&&n6(t,!0));let i=this.state.hovered3DEntity!==t;return this.state.hovered3DEntity=t,this.state.lastHover=t,i}handle3DContainerHover(t){let i=!r6(this.state.hovered3DContainers,t);return this.state.hovered3DContainers=t,i}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(t.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 t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,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(t,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=t,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};Ns=new WeakMap,l(F0,"InteractionSystem");var qc=F0;function n6(r,e){let t=r.components[2];t&&(t.hover=e,t.dirty=!0)}l(n6,"updateHover");function YD(r,e,t){return e?"grabbing":r?"pointer":t?"grabbing":"grab"}l(YD,"processCursor");m();var B0=class B0 extends J{constructor(){super();d(this,"interpolators",new Map);d(this,"update",l(t=>{for(let[i,n]of this.interpolators)i instanceof Ee?i.setOpacity(n(t)):i instanceof ui?i.enabled=n(t):n(t)},"update"))}addEntity3D(t,i){let[n,o,a,u]=i[1];this.interpolators.set(t,c=>hr(c,n,o,a,u))}addEntity2D(t,i){let[n,o,a]=i[1];this.interpolators.set(t,u=>u<n?o:a)}addAny(t,i){this.interpolators.set(t,i)}destroy(){this.interpolators.clear()}};l(B0,"ZoomInterpolationSystem");var Ah=B0;m();m();var ia,di,kh,Fh,o6,Jc,Bh,Rh,a6,Nh,s6,Kc,Gh,Qc,eu,Vh,N0=class N0{constructor(e){M(this,Fh);M(this,Rh);M(this,Nh);M(this,ia,null);M(this,di,void 0);d(this,"getCurrentSceneGLTF",l(async e=>{let t={onlyVisible:!0,binary:!0,light:!0,scale:1,...e},i=await U(this,Fh,o6).call(this),n=s(this,kh).call(this,t),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let u=JSON.stringify(o,null,2);a=new Blob([u],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));M(this,kh,l(e=>{let{scale:t,light:i,onlyVisible:n}=e,o=new Pa,a=new wi().setFromObject(s(this,di).entityScene);if(s(this,Jc).call(this,s(this,di).entityScene,o,n),i){let u=new fp(16777215,.3*Math.PI);u.position.set(0,Math.max(a.max.x,a.max.y)*t*.5,a.max.y*t*4),u.lookAt(0,0,-1),u.target.position.set(0,0,-1),u.add(u.target),o.add(u)}return o},"#getExportedScene"));M(this,Jc,l((e,t,i)=>{e.material&&(e instanceof Ta?U(this,Rh,a6).call(this,e).forEach(n=>t.add(n)):e instanceof oo&&t.add(U(this,Nh,s6).call(this,e))),e.children.forEach(n=>{(!i||n.visible)&&s(this,Jc).call(this,n,t,i)})},"#processObject3D"));M(this,Bh,l((e,t,i)=>{let n=new _b({color:new _e(e),metalness:0});return n.opacity=t,n.transparent=i,n},"#createStandardMaterial"));M(this,Kc,l(e=>{let{geometry:t,material:i,position:n,rotation:o,quaternion:a,scale:u}=e;if(!(t!=null&&t.isBufferGeometry))return e;let c=t.attributes.position,p=t.attributes.normal,f=t.attributes.uv;return s(this,Gh).call(this,c,p),s(this,eu).call(this,n,u,o,a),f&&s(this,Vh).call(this,f),i!=null&&i.map&&t.type==="PlaneGeometry"&&(e.side=Pi),e},"#convertGeometry"));M(this,Gh,l((e,t)=>{let i=new q,n=new q;for(let o=0;o<e.count;o++)i.fromBufferAttribute(e,o),s(this,Qc).call(this,i),e.setXYZ(o,i.x,i.y,i.z),t&&(n.fromBufferAttribute(t,o),s(this,Qc).call(this,n),t.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));M(this,Qc,l(e=>{let t=e.y;e.y=e.z,e.z=-t},"#convertVector"));M(this,eu,l((e,t,i,n)=>{let o=e.y;e.y=e.z,e.z=-o;let a=t.y;if(t.y=t.z,t.z=a,i instanceof Ma)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let u=n.y;n.set(n.x,n.z,-u,n.w)}},"#convertObjectProperties"));M(this,Vh,l(e=>{for(let t=0;t<e.count;t++){let i=e.getX(t),n=e.getY(t);e.setXY(t,i,n)}},"#convertUVs"));T(this,di,e),s(this,di).entityScene=e.entityScene,s(this,di).geometry3DMap=e.geometry3DMap}destroy(){T(this,ia,null)}};ia=new WeakMap,di=new WeakMap,kh=new WeakMap,Fh=new WeakSet,o6=l(async function(){if(!s(this,ia)){let{GLTFExporter:e}=await import("./GLTFExporter-7AAWGZK4.js");T(this,ia,new e)}return s(this,ia)},"#getGLTFExporter"),Jc=new WeakMap,Bh=new WeakMap,Rh=new WeakSet,a6=l(function(e){var a,u;let t=[],n=((a=e.userData)!=null&&a.entities?Object.values((u=e.userData)==null?void 0:u.entities):[]).map(c=>s(this,di).geometry3DMap.get(c)),o=new Map;return n.forEach(c=>{var v;if(!c||!(c instanceof Se))return;let p=c.components[1],f=c.components[2];if(!p.visible||p.opacity===0)return;let y=f!=null&&f.hover?p.hoverColor||s(this,di).hoverColor:p.color,g="".concat(y,"-").concat(p.opacity,"-").concat(Number(p.visible));o.has(g)||o.set(g,[]),(v=o.get(g))==null||v.push(c)}),o.forEach((c,p)=>{let[f,y,g]=p.split("-"),v=c.reduce((S,E)=>{let I=E.components[0];if(I.type==="custom-geometry")return S;let w=I==null?void 0:I.geometry;return w&&S.push(w),S},[]),x=s(this,Bh).call(this,f,Number(y),e.material.transparent),P=Zr(v,!0),b=new Te(P,x);b.position.copy(e.position),b.rotation.copy(e.rotation),b.scale.copy(e.scale),b.visible=!!g,s(this,eu).call(this,b.position,b.scale,b.rotation,b.quaternion),t.push(s(this,Kc).call(this,b))}),t},"#processBatchedMesh"),Nh=new WeakSet,s6=l(function(e){let t=e.geometry.clone(),i=e.material,n=new jt({color:i.color,side:Pi});n.opacity=i.opacity,n.transparent=i.transparent;let o=new oo(t,n);return o.position.copy(e.position),o.rotation.copy(e.rotation),o.scale.copy(e.scale),o.visible=e.visible,s(this,Kc).call(this,o)},"#processLineSegments"),Kc=new WeakMap,Gh=new WeakMap,Qc=new WeakMap,eu=new WeakMap,Vh=new WeakMap,l(N0,"ExporterSystem");var $c=N0;m();m();m();m();var tu={top:0,bottom:0,left:0,right:0,type:"pixel"};m();m();var qD="gray",$D=.1;function l6(r,e,t){let{color:i=qD,opacity:n=1,altitude:o=0,height:a=$D}=t||{};Array.isArray(n)&&(n=1);let u={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 Hr,p=r.geometry.coordinates[0].map(v=>{let x=e(v[1],v[0]);return u.min.x=Math.min(u.min.x,x.x),u.min.y=Math.min(u.min.y,x.y),u.max.x=Math.max(u.max.x,x.x),u.max.y=Math.max(u.max.y,x.y),x});c.moveTo(p[0].x,p[0].y),p.slice(1).forEach(v=>c.lineTo(v.x,v.y)),c.lineTo(p[0].x,p[0].y);let f=r.geometry.coordinates.slice(1);c.holes=f.map(v=>{let x=v.map(b=>e(b[1],b[0])),P=new fn;return P.moveTo(x[0].x,x[0].y),x.slice(1).forEach(b=>P.lineTo(b.x,b.y)),P.lineTo(x[0].x,x[0].y),P});let y={bevelEnabled:!1,depth:a},g=new Ur(c,y);return g.translate(0,0,o||0),g.userData={style:{color:i,opacity:n}},g}l(l6,"renderPolygonGeometry");m();var JD="gray",KD=.1;function c6(r,e,t){let{color:i=JD,opacity:n=1,altitude:o=0,height:a=KD}=t||{};Array.isArray(n)&&(n=1);let u={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},c={bevelEnabled:!1,depth:a},p=[];r.geometry.coordinates.forEach(y=>{let g=new Hr,v=y[0].map(b=>{let S=e(b[1],b[0]);return u.min.x=Math.min(u.min.x,S.x),u.min.y=Math.min(u.min.y,S.y),u.max.x=Math.max(u.max.x,S.x),u.max.y=Math.max(u.max.y,S.y),S});g.moveTo(v[0].x,v[0].y),v.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(v[0].x,v[0].y);let x=y.slice(1);g.holes=x.map(b=>{let S=b.map(I=>e(I[1],I[0])),E=new fn;return E.moveTo(S[0].x,S[0].y),S.slice(1).forEach(I=>E.lineTo(I.x,I.y)),E.lineTo(S[0].x,S[0].y),E});let P=new Ur(g,c);p.push(P)});let f=Zr(p);return f.translate(0,0,o||0),f.userData={style:{color:i,opacity:n}},f}l(c6,"renderMultiPolygonGeometry");m();m();var j0=ul(b6());function C6(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}l(C6,"JSClipperError");C6.prototype=Error.prototype;j0.default.Error=function(r){throw new C6(r)};var Ft=j0.default;var XL="gray",H0=new Ft.ClipperOffset,Pt=100;function x6(r,e,t){let{color:i=XL,opacity:n=1,width:o=1,join:a="round",cap:u="round",height:c=.01,altitude:p=0}=t||{};Array.isArray(n)&&(n=0);let f=[];for(let P=0;P<r.geometry.coordinates.length-1;P++){let b=e(r.geometry.coordinates[P][1],r.geometry.coordinates[P][0]),S=e(r.geometry.coordinates[P+1][1],r.geometry.coordinates[P+1][0]);f.push([b,S])}H0.AddPaths(f.map(P=>P.map(b=>({X:b.x*Pt,Y:b.y*Pt}))),a==="round"?Ft.JoinType.jsRound:a==="miter"?Ft.JoinType.jsMiter:Ft.JoinType.jsSquare,u==="round"?Ft.EndType.etOpenRound:u==="butt"?Ft.EndType.etOpenButt:Ft.EndType.etOpenSquare);let y=new Ft.PolyTree;H0.Execute(y,o/2*Pt);let g=[],v={bevelEnabled:!1,depth:c};for(let P of y.m_AllPolys){let b=new Hr;if(P.IsHole())continue;let S=P.m_polygon;b.moveTo(S[0].X/Pt,S[0].Y/Pt),S.slice(1).forEach(E=>b.lineTo(E.X/Pt,E.Y/Pt)),b.lineTo(S[0].X/Pt,S[0].Y/Pt),b.holes=P.m_Childs.map(E=>{let I=new fn,w=E.m_polygon;return I.moveTo(w[0].X/Pt,w[0].Y/Pt),w.slice(1).forEach(_=>I.lineTo(_.X/Pt,_.Y/Pt)),I.lineTo(w[0].X/Pt,w[0].Y/Pt),I}),g.push(new Ur(b,v))}let x=Zr(g);return x.translate(0,0,p||0),x.userData={style:{color:i,opacity:n}},H0.Clear(),x}l(x6,"renderLineStringGeometry");m();var Tt=100,ZL=.22,zL=.01;function S6(r,e,t={}){let{width:i=ZL,height:n=zL,color:o="gray",opacity:a=1,altitude:u=0}=t,c={min:{x:1/0,y:1/0,z:u},max:{x:-1/0,y:-1/0,z:u+n}},p={bevelEnabled:!1,depth:n},f=new Ft.ClipperOffset,y=r.geometry.coordinates.map(P=>P.map(b=>e(b[1],b[0])));f.AddPaths(y.map(P=>P.map(b=>({X:b.x*Tt,Y:b.y*Tt}))),Ft.JoinType.jsMiter,Ft.EndType.etOpenRound);let g=new Ft.PolyTree;f.Execute(g,i/2*Tt);let v=[];for(let P of g.m_AllPolys){let b=new Hr;if(P.IsHole())continue;c.min.x=Math.min(c.min.x,P.m_polygon[0].X),c.min.y=Math.min(c.min.y,P.m_polygon[0].Y),c.max.x=Math.max(c.max.x,P.m_polygon[0].X),c.max.y=Math.max(c.max.y,P.m_polygon[0].Y);let S=P.m_polygon;b.moveTo(S[0].X/Tt,S[0].Y/Tt),S.slice(1).forEach(E=>b.lineTo(E.X/Tt,E.Y/Tt)),b.lineTo(S[0].X/Tt,S[0].Y/Tt),b.holes=P.m_Childs.map(E=>{let I=new fn,w=E.m_polygon;return I.moveTo(w[0].X/Tt,w[0].Y/Tt),w.slice(1).forEach(_=>I.lineTo(_.X/Tt,_.Y/Tt)),I.lineTo(w[0].X/Tt,w[0].Y/Tt),I}),v.push(new Ur(b,p))}let x=Zr(v);return x.translate(0,0,u||0),x.userData={style:{color:o,opacity:a}},f.Clear(),x}l(S6,"renderMultiLineStringGeometry");m();var YL=L.object({rotation:L.array(L.number()).length(3).optional(),altitude:L.number().optional(),scale:L.array(L.number()).length(3).optional(),interactive:L.boolean().optional(),id:L.union([L.number(),L.string()]).optional()}),qL=L.object({type:L.enum(["Feature"]),geometry:Os,properties:YL}),$L=L.object({type:L.enum(["FeatureCollection"]),features:L.array(qL)}),JL=L.object({url:L.string(),color:L.string().optional(),opacity:L.number().optional()});function M6(r,e,t){L.union([L.number(),L.string()]).parse(r),$L.parse(e),JL.parse(t)}l(M6,"validateModelGroup");var nu,ou,U0=class U0{constructor(e){d(this,"mesh");d(this,"type","model");d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new _e);d(this,"position",new q);M(this,nu,0);M(this,ou,1);this.feature=e}setOpacity(){}setColor(){}get altitude(){return s(this,nu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,T(this,nu,e))}get opacity(){return s(this,ou)}set opacity(e){var t,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof pp){((t=n.userData)==null?void 0:t.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=hr(e,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}T(this,ou,e)}};nu=new WeakMap,ou=new WeakMap,l(U0,"ModelComponent");var zn=U0;function KL(r){let{color:e,opacity:t,topColor:i,texture:n,topTexture:o}=r;return"".concat(e).concat(t).concat(i||"").concat(n||"").concat(o||"")}l(KL,"generateIndex");var QL=1e4,W0=class W0 extends J{constructor(t,i){super();d(this,"state");d(this,"convertTo3DMapPosition");d(this,"loader");this.state=t,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:t}=await import("./GLTFLoader-S6X2V35B.js");this.loader=new t}createEntityFromFeature(t,i,n){let o=new Ee(i),a=new Se(o,new Er(n));return a.id=t,a}createModelFromFeature(t,i,n){let o=new zn(i),a=new Se(o,new Er(n));return a.id=t,a}populateEntityMesh(t,i){let n=t.components[0];n.geometry=i,n.currentHeight=t.components[1].height,n.dirty=!1}async populateModelGroup(t,i,n){let o=new Ii,a=new Ma,u=new gb,c=new q,p=new pr;return this.loader||await this.getGLTFLoader(),this.loader.load(i,f=>{var v,x,P,b,S,E;f.scene.traverse(I=>{let w=I;if("isMesh"in w&&w.isMesh===!0){let _=new pp(w.geometry,w.material,t.size);_.userData={entities:{}},p.add(_),n.add(p)}});let y=0,g;for(let I of t.values()){g=this.state.geometry3DMap.get(I);let w=g.components[0],_=g.components[0].feature;w.mesh=p,w.instanceIndex=y;let{x:D,y:R,z:V}=this.convertTo3DMapPosition(_.geometry.coordinates[1],_.geometry.coordinates[0],0);w.position.set(D,R,V),a.set(((v=_.properties.rotation)==null?void 0:v[0])||0,((x=_.properties.rotation)==null?void 0:x[1])||0,((P=_.properties.rotation)==null?void 0:P[2])||0),c.set(((b=_.properties.scale)==null?void 0:b[0])||1,((S=_.properties.scale)==null?void 0:S[1])||1,((E=_.properties.scale)==null?void 0:E[2])||1),u.setFromEuler(a),o.compose(w.position,u,c),p.children.forEach(G=>{let Z=G;Z.setMatrixAt(y,o),Z.userData.entities[y]=g.id}),y++}this.publish("model-loaded")}),p}populateEntityGroup(t){let i,n,o,a;for(let u of t.values())a=this.state.geometry3DMap.get(u),a.components[0]instanceof Ee&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=l6(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=c6(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=x6(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=S6(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return t}optimize(t){if(t.visible&&(t instanceof Qe||t instanceof Xe)){for(let o of t.children)this.optimize(o);if(t instanceof Xe||t.userData.dirty===!1)return;let i={};if(!t.userData.modelURL&&t.userData.dirty)try{this.populateEntityGroup(t.userData.entities3D)}catch(o){A.warn(o)}else t.userData.modelURL&&t.userData.dirty&&(this.populateModelGroup(t.userData.entities3D,t.userData.modelURL,t),t.userData.dirty=!1);let n=0;if(t.userData.dirty){let o=0,a;for(let u of t.userData.entities3D.values()){a=this.state.geometry3DMap.get(u);let c=a.components[0],p=a.components[1];if(c instanceof Ee){o++,o>=QL&&(o=0,n++);let f=KL(p)+n;i[f]===void 0&&(i[f]={style:p,entities:[]}),i[f].entities.push(a)}else c.mesh&&c.mesh.parent!==t&&t.add(c.mesh)}for(let u in i){let c=US(i[u].entities,i[u].style);t.add(c),t.userData.outlineDirty=!0,t.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};l(W0,"MeshCreationAndOptimizationSystem");var Xh=W0;m();var X0=class X0{constructor(e,t){d(this,"state");d(this,"dirty",!0);d(this,"domTree");this.state=e,this.domTree=t}update(){if(this.dirty){let e;for(let t of Array.from(this.domTree.children))if(e=this.state.geometry2DMap.get(t.userData.entityId),e){let i=e.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(t),e){let i=e.components[0];i instanceof li&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:e.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};l(X0,"DOMVisibilitySystem");var Zh=X0;m();var Z0=class Z0{constructor(e,t){d(this,"state");d(this,"project");this.state=e,this.project=t}update(){let e;for(let t of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(t),e&&this.project(e.components[0].projection,e.position)}};l(Z0,"TwoDProjectionSystem");var zh=Z0;m();m();var eA=l(function(){let e,t;return i=>{if((!t||!t)&&(e=document.createElement("canvas"),e.width=500*i,e.height=500*i,e.style.width="500px",e.style.height="500px",t=e.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:e,measureCanvasContext:t}}},"createMeasureCanvasContext")(),P6=l(({text:r,size:e,maxWidth:t,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let u="bold ".concat(e*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=eA(i);c.font=u;let p=[],f=r.split(" "),y=0,g=0,v=0;for(;g<f.length;){let S=f[g];if(y===n&&y>0){p[y-1]+="...";break}if(p[y]==null&&(p[y]=S,g++),f.length===1){p[y]=S;break}if(f[g]==null)break;let{width:E}=c.measureText(p[y]+" "+f[g]);E<=t*i?(p[y]+=" "+f[g],g++):y++}p.forEach(S=>{let{width:E}=c.measureText(S);v=Math.max(E,v)});let x=e*i*o,P=p.length*x;return{maxWidth:v,maxHeight:P,lines:p.length,draw:(S,E,I)=>{p.length===1?(a.strokeText&&S.strokeText(p[0],E,I),S.fillText(p[0],E,I)):(a.strokeText&&(S.strokeText(p[0],E,I-x/2),S.strokeText(p[1],E,I+x/2)),S.fillText(p[0],E,I-x/2),S.fillText(p[1],E,I+x/2))}}},"shaveText");m();function T6(r){let e=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?e.src="data:image/svg+xml;base64,".concat(btoa(r)):e.src=r),e}l(T6,"createImage");var tA=4.5,rA=2.5,iA=2,nA=5,au=2.5;var z0=class z0{constructor(e,t){d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"pinCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",l((e,t,i)=>{let n=(e-t)/(i-t),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,u,c,p,f,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&y.components[0]instanceof ui&&!y.disposed){if(f=y.components[0],u=f.appearance.marker.foregroundColor,c=f.appearance.marker.backgroundColor,p=f.markerSize,a="".concat(u.active,"-").concat(u.inactive,"-").concat(c.active,"-").concat(c.inactive,"-").concat(p),this.pinCache[a]||this.prepare(f,a,this.colliderContext),f.appearance.marker.icon&&(!f.imageHash||f.dirty)&&this.cacheImage(f),this.textCache[f.id]==null||f.dirty||this.dirty){f.dirty=!1,f.collisionDirty=!0,this.textCache[f.id]={};let{textDrawFn:v,width:x,height:P}=this.processText(f.text,f.appearance.text.size,f.appearance.text.maxWidth,f.appearance.text.numLines,f.appearance.text.lineHeight);["left","center","right"].forEach(S=>{this.textCache[f.id][S]=this.textToCanvas(v,f.appearance.text.size,S,x,P,f.appearance.text.foregroundColor,f.appearance.text.backgroundColor)}),f.dimensions={width:Math.ceil(x/o),height:Math.ceil(P/o)},f.currentStrategyIndex===-1&&(f.currentStrategyIndex=0);let b=f.strategies[f.currentStrategyIndex];if(b){b.onStrategySelected(f);let S=f.style;f.style=f.newStyle,f.newStyle=S}}f.visible&&f.enabled&&(f.zoomProportion=n,this.draw(f,a,this.colliderContext))}this.dirty=!1},"update"));d(this,"processText",l((e,t,i,n,o)=>{let a=this.state.pixelRatio,{draw:u,maxWidth:c,maxHeight:p}=P6({text:e,size:t,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:u,width:c+au*a*2,height:p+au*a*2}},"processText"));d(this,"textToCanvas",l((e,t,i,n,o,a,u)=>{let c=this.state.pixelRatio,p,f=n,y=o;window.OffscreenCanvas!=null&&!X1()?p=new OffscreenCanvas(f,y):(p=document.createElement("canvas"),p.width=f,p.height=y,p.style.width=f+"px",p.style.height=y+"px");let g=p.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(t*c,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=au*c,g.fillStyle=a,g.strokeStyle=u;let v=i==="left"?0:i==="center"?f/2:f-au*c/2;return e(g,v,(y+au*c/2)/2),p},"textToCanvas"));d(this,"cacheImage",l(e=>{if(!e.appearance.marker.icon)return;let t=B7(e.appearance.marker.icon);if(e.imageHash=t,!this.imagePromiseCache[t]){let i=T6(e.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[t]=i}}},"cacheImage"));d(this,"createPinCanvas",l((e,t,i,n)=>{let o,a=this.state.pixelRatio,u=e.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(u,u):(o=document.createElement("canvas"),o.width=u,o.height=u,o.style.width=u/a+"px",o.style.height=u/a+"px");let c=o.getContext("2d");return c.shadowColor="rgba(0,0,0,0.3)",c.shadowOffsetY=iA*a,c.shadowBlur=nA*a,c.beginPath(),c.arc(u/2,u/2,t/2+rA*a/2,0,2*Math.PI),c.fillStyle=i,c.fill(),c.beginPath(),c.arc(u/2,u/2,t/2,0,2*Math.PI),c.shadowColor="transparent",c.fillStyle=n,c.fill(),o},"createPinCanvas"));d(this,"prepare",l((e,t,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),a=this.createPinCanvas(e,e.iconVisible?e.markerSize:tA*n,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[t]=[o,a]},"prepare"));this.state=e,this.colliderCanvas=t,this.colliderContext=t.getContext("2d")}draw(e,t,i){if(!e.visible)return;i.save(),i.globalAlpha=e.opacity;let n=this.state.pixelRatio,o=e.projection.x*n,a=e.projection.y*n,u=e.style.pinVisibility===1?this.pinCache[t][0]:this.pinCache[t][1];if(i.drawImage(u,o-e.totalMarkerSize*n,a-e.totalMarkerSize*n),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imagePromiseCache[e.imageHash]){let c=this.imagePromiseCache[e.imageHash],p=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,{iconFit:f}=e.appearance.marker,y=p,g=p,v="".concat(e.imageHash,"_").concat(f);if(this.imageDimensionsCache[v])y=this.imageDimensionsCache[v].width,g=this.imageDimensionsCache[v].height;else{let x=c.width*n,P=c.height*n;if(f==="contain"){let b=Math.sqrt(x**2+P**2),S=p/b;y=x*S,g=P*S}if(f==="cover"){let b=p/x,S=p/P,E=Math.max(b,S);y=x*E,g=P*E}}i.save(),i.beginPath(),i.arc(o,a,p/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(c,o-y/2,a-g/2,y,g),i.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&i.drawImage(this.textCache[e.id][e.style.textAlign],o+e.style.left*n,a+e.style.top*n),i.restore()}};l(z0,"TwoDDrawSystem");var Yh=z0;m();m();var Yn=class Yn{constructor(){d(this,"loader");this.loader=new wa}static getInstance(){return Yn.instance||(Yn.instance=new Yn),Yn.instance}getLoader(){return this.loader}};l(Yn,"TextureLoaderSingleton"),d(Yn,"instance");var Y0=Yn,qn=Y0.getInstance();function oA(r,e){let t=r.components[2],i=r.components[1];return t!=null&&t.hover?[i.hoverColor||e,i.hoverColor||e]:[i.color,i.topColor||i.color]}l(oA,"processColor");var su,q0,$0=class $0 extends J{constructor(t){super();M(this,su);d(this,"state");d(this,"textureLoadingCache",new Map);this.state=t}setShading(t,i){t.material&&t.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(t,i,n){i.texture!==t.texture&&i.texture!==""&&U(this,su,q0).call(this,i.texture,t,"texture"),i.topTexture!==t.topTexture&&i.topTexture!==""&&U(this,su,q0).call(this,i.topTexture,t,"topTexture"),(t.texture!=null||t.topTexture!=null)&&(n!=null&&n.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures(),i.texture===""&&t.removeSideTexture(),i.topTexture===""&&t.removeTopTexture())}update(){var a,u,c,p;let t,i,n,o;for(let f of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(f),o instanceof Qe&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let y=o.userData.entities3D.values().next().value,g=this.state.geometry3DMap.get(y);g instanceof Se&&(g.type==="geometry"||g.type==="custom-geometry")&&(t=g.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(t,i.shading));let v,x;for(let P of o.userData.entities3D.values())v=this.state.geometry3DMap.get(P),x=v.components[0],v.type==="geometry"&&x.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(x,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let y=Gn(o);y&&y.material instanceof dp&&(y.material.color.set(T0(i.color)),y.material.needsUpdate=!0);let g=o.getfirstChildEntityId();if(g){let v=this.state.geometry3DMap.get(g),x=v==null?void 0:v.components[0];x instanceof Ee&&this.processTextures(x,i)}i.dirty=!1}}else if(o instanceof Se&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(u=o.components[2])!=null&&u.dirty)){t=o.components[0],i=o.components[1],n=o.components[2];let y=oA(o,this.state.hoverColor);t.setColor(y[0],y[1]),i.visible!==t.visible&&(t.visible=i.visible),i.altitude!==t.altitude&&(t.altitude=i.altitude),i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1,this.processTextures(t,i,n),o.components[2]&&(o.components[2].dirty=!1)}else(o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty)?(t=o.components[0],i=o.components[1],i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1):(o==null?void 0:o.type)==="image"&&((p=o.components[1])!=null&&p.dirty)&&(t=o.components[0],i=o.components[1],i.visible!==t.visible&&(t.visible=i.visible),i.dirty=!1)}destroy(){this.textureLoadingCache.forEach(async t=>{(await t).dispose()}),this.textureLoadingCache.clear()}};su=new WeakSet,q0=l(async function(t,i,n){if(!(!t||!i.showTextures))if(this.textureLoadingCache.has(t)){n==="topTexture"?i.topTexture=await this.textureLoadingCache.get(t):i.texture=await this.textureLoadingCache.get(t),i.showTextures();return}else{let o=new Promise((a,u)=>{qn.getLoader().load(t,c=>{n==="topTexture"?i.topTexture=c:i.texture=c,i.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{A.error("Failed to load texture: ".concat(t)),u("Failed to load texture: ".concat(t))})});this.textureLoadingCache.set(t,o)}},"#loadTexture"),l($0,"DrawSystem");var qh=$0;m();var J0=class J0 extends J{constructor(t){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"duration",500);d(this,"update",l(()=>{this.animating.clear();let t,i;for(let n of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(n),t&&(i=t.components[0],i instanceof ui&&i.visibilityNeedsUpdate&&(i.visible?this.animating.set(i,i.opacity):(i.opacity=0,i.visibilityNeedsUpdate=!1)));this.startTime=performance.now(),this.publish("animate:2d")},"update"));d(this,"playAnimations");this.state=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[i,n]of this.animating.entries()){let o=(t-this.startTime)/this.duration;i.opacity=hr(o,0,1,n,1),t-this.startTime>=this.duration&&(i.visible=!0,i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};l(J0,"TwoDVisibilitySystem");var $h=J0;m();var K0=class K0 extends J{constructor(t,i,n,o,a,u,c){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",l((t=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)!=null)if(t)this.commitRenderState(),this.paint();else{if(this.frameId)return;this.frameId=requestAnimationFrame(()=>{var n;((n=this.renderer)==null?void 0:n.renderer)!=null&&this.mode==="standalone"&&(this.commitRenderState(),this.paint())})}},"update"));d(this,"animate2D",l(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",l(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));d(this,"updateEntities2D",l(()=>{this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=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())})},"updateEntities2D"));d(this,"commitRenderState",l(()=>{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(),q1(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.dirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),Y1(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()),this.systems.polygonLabelSystem.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.dirty=!1,this.systems.cameraSystem.zoomDirty=!1},"commitRenderState"));this.renderer=t,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=u,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 t;(t=this.renderer)!=null&&t.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.dirty=!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)}};l(K0,"RenderSystem");var Jh=K0;m();var Q0=class Q0{constructor(e){d(this,"rendererState");this.rendererState=e}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(t),e instanceof Xe&&e.components[0]){let i=e.components[0];if(i.dirty){for(let n of e.children)(n instanceof Qe||n instanceof Xe)&&(n.userData.entityId!==e.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};l(Q0,"StackSystem");var Kh=Q0;m();m();m();var He=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 e=1.70158;return r===1?1:r*r*((e+1)*r-e)},Out:function(r){var e=1.70158;return r===0?0:--r*r*((e+1)*r+e)+1},InOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)}}),Bounce:Object.freeze({In:function(r){return 1-He.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?He.Bounce.In(r*2)*.5:He.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(e){return Math.pow(e,r)},Out:function(e){return 1-Math.pow(1-e,r)},InOut:function(e){return e<.5?Math.pow(e*2,r)/2:(1-Math.pow(2-e*2,r))/2+.5}}}}),lu=l(function(){return performance.now()},"now"),tv=function(){function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return l(r,"Group"),r.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var n=0,o=t;n<o.length;n++){var a=o[n];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,n=e;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(e){return!e.isPlaying()})},r.prototype.update=function(e,t){e===void 0&&(e=lu()),t===void 0&&(t=!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=!t;o&&o.update(e,a)===!1&&!t&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),js={Linear:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=js.Utils.Linear;return e<0?o(r[0],r[1],i):e>1?o(r[t],r[t-1],t-i):o(r[n],r[n+1>t?t:n+1],i-n)},Bezier:function(r,e){for(var t=0,i=r.length-1,n=Math.pow,o=js.Utils.Bernstein,a=0;a<=i;a++)t+=n(1-e,i-a)*n(e,a)*r[a]*o(i,a);return t},CatmullRom:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=js.Utils.CatmullRom;return r[0]===r[t]?(e<0&&(n=Math.floor(i=t*(1+e))),o(r[(n-1+t)%t],r[n],r[(n+1)%t],r[(n+2)%t],i-n)):e<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):e>1?r[t]-(o(r[t],r[t],r[t-1],r[t-1],i-t)-r[t]):o(r[n?n-1:0],r[n],r[t<n+1?t:n+1],r[t<n+2?t:n+2],i-n)},Utils:{Linear:function(r,e,t){return(e-r)*t+r},Bernstein:function(r,e){var t=js.Utils.Factorial;return t(r)/t(e)/t(r-e)},Factorial:function(){var r=[1];return function(e){var t=1;if(r[e])return r[e];for(var i=e;i>1;i--)t*=i;return r[e]=t,t}}(),CatmullRom:function(r,e,t,i,n){var o=(t-r)*.5,a=(i-e)*.5,u=n*n,c=n*u;return(2*e-2*t+o+a)*c+(-3*e+3*t-2*o-a)*u+o*n+e}}},w6=function(){function r(){}return l(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),ev=new tv,Bt=function(){function r(e,t){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=He.Linear.None,this._interpolationFunction=js.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=w6.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=ev,ev.add(this))}return l(r,"Tween"),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(e,t){if(t===void 0&&(t=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=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},r.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},r.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},r.prototype.start=function(e,t){if(e===void 0&&(e=lu()),t===void 0&&(t=!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=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){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,t)}return this},r.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},r.prototype._setupProperties=function(e,t,i,n,o){for(var a in i){var u=e[a],c=Array.isArray(u),p=c?"array":typeof u,f=!c&&Array.isArray(i[a]);if(!(p==="undefined"||p==="function")){if(f){var y=i[a];if(y.length===0)continue;for(var g=[u],v=0,x=y.length;v<x;v+=1){var P=this._handleRelativeValue(u,y[v]);if(isNaN(P)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(P)}f&&(i[a]=g)}if((p==="object"||c)&&u&&!f){t[a]=c?[]:{};var b=u;for(var S in b)t[a][S]=b[S];n[a]=c?[]:{};var y=i[a];if(!this._isDynamic){var E={};for(var S in y)E[S]=y[S];i[a]=y=E}this._setupProperties(b,t[a],y,n[a],o)}else(typeof t[a]>"u"||o)&&(t[a]=u),c||(t[a]*=1),f?n[a]=i[a].slice().reverse():n[a]=t[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(e){return e===void 0&&(e=lu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},r.prototype.resume=function(e){return e===void 0&&(e=lu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},r.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},r.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},r.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},r.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},r.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},r.prototype.easing=function(e){return e===void 0&&(e=He.Linear.None),this._easingFunction=e,this},r.prototype.interpolation=function(e){return e===void 0&&(e=js.Linear),this._interpolationFunction=e,this},r.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},r.prototype.onStart=function(e){return this._onStartCallback=e,this},r.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},r.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},r.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},r.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},r.prototype.onStop=function(e){return this._onStopCallback=e,this},r.prototype.update=function(e,t){var i=this,n;if(e===void 0&&(e=lu()),t===void 0&&(t=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<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=e-this._startTime,u=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*u,p=l(function(){if(i._duration===0||a>c)return 1;var P=Math.trunc(a/u),b=a-P*u,S=Math.min(b/i._duration,1);return S===0&&a===i._duration?1:S},"calculateElapsedPortion"),f=p(),y=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,y),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((a-this._duration)/u)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);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+=u*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,x=this._chainedTweens.length;v<x;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(e,t,i,n){for(var o in i)if(t[o]!==void 0){var a=t[o]||0,u=i[o],c=Array.isArray(e[o]),p=Array.isArray(u),f=!c&&p;f?e[o]=this._interpolationFunction(u,n):typeof u=="object"&&u?this._updateProperties(e[o],a,u,n):(u=this._handleRelativeValue(a,u),typeof u=="number"&&(e[o]=a+(u-a)*n))}},r.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},r.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],i=this._valuesEnd[e];typeof i=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(i):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},r.autoStartOnUpdate=!1,r}();var hte=w6.nextId,hi=ev,fte=hi.getAll.bind(hi),mte=hi.removeAll.bind(hi),yte=hi.add.bind(hi),gte=hi.remove.bind(hi),vte=hi.update.bind(hi);m();m();m();var I6=l((r,e)=>(e-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),E6=l((r,e)=>new te(r.clientX-e.offsetLeft,r.clientY-e.offsetTop),"getTouchPos"),rv=l((r,e)=>Math.atan2(e.y-r.y,e.x-r.x),"angle"),cu=l((r,e)=>Math.sqrt((e.y-r.y)**2+(e.x-r.x)**2),"distance"),iv=l((r,e)=>new te((r.x+e.x)/2,(r.y+e.y)/2),"average"),nv=l(r=>{let e=0,{wheelDelta:t,detail:i}=r;return t!==void 0?e=t:i!==void 0&&(e=-i),e},"getScrollDelta");var ov=class ov{constructor(e,t){d(this,"input1");d(this,"input2");d(this,"lastAngle");d(this,"lastDistance");d(this,"totalDistance");d(this,"first");d(this,"second");this.input1=e,this.input2=t,this.lastAngle=rv(e,t),this.lastDistance=cu(e,t),this.totalDistance=0,this.first=e,this.second=t}update(e,t){let i=cu(e,t);this.input1=e,this.input2=t;let n=rv(e,t);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(cu(this.first,e)+cu(this.second,t))/2,this.first=iv(this.first,e),this.second=iv(this.second,t)}};l(ov,"InputSet");var Qh=ov;m();var av=class av{constructor(e,t,i){d(this,"touch");d(this,"camera");d(this,"cameraPlane");d(this,"viewCoordinate");d(this,"snapHolderMatrix");d(this,"snapCamera");d(this,"cameraPosition");d(this,"raycaster");d(this,"worldCoordinate");d(this,"snapshotted",!1);this.touch=e,this.camera=t,this.cameraPlane=i,this.viewCoordinate={x:e.x,y:e.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 e=new te(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Xr,this.raycaster.setFromCamera(e,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(e,t){this.camera=e,this.snapCamera=e.clone(),this.snapHolderMatrix=e.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(e){this.viewCoordinate={x:e.x,y:e.y}}reUnproject(){var i,n;let e=new te(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(e,this.snapCamera);let t=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};l(av,"TouchAnchor");var uu=av;var Lr={};P8(Lr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>aA,CLIPPING_RADIUS:()=>pu,CONTROL_OPTIONS:()=>tf,DEFAULT_BEARING:()=>pA,DEFAULT_MAX_ZOOM_LEVEL:()=>cA,DEFAULT_MIN_ZOOM_LEVEL:()=>pv,DEFAULT_PITCH:()=>uA,DEFAULT_ZOOM_LEVEL:()=>lA,EVENTS:()=>of,MAPLIBRE_TILE_SIZE:()=>ef,MAX_LAT:()=>lv,MAX_MERCATOR_ZOOM_LEVEL:()=>nf,MIN_LAT:()=>sv,MIN_MERCATOR_ZOOM_LEVEL:()=>rf,ROOM_MERCATOR_ZOOM_LEVEL:()=>sA,TWO_PI:()=>cv,WHEEL_ZOOM_MULTIPLIER:()=>uv,ZRANGE:()=>Hs});m();var ef=512,sv=-85.051129,lv=85.051129,pu=1e4,tf={chain:"chain",cancel:"cancel"},cv=Math.PI*2,Hs=100,uv=1e4,rf=0,nf=24,aA=17,sA=20,of=["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"],lA=18,pv=12,cA=22,uA=0,pA=0;var af=!1,dA=!1;var sf,lf=class lf extends J{constructor(t,i,n,o,a){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);M(this,sf,pv);d(this,"zoomSpeed",5);d(this,"rotateSpeed",100);d(this,"enabled",!0);d(this,"enableZoom",!0);d(this,"enablePan",!0);d(this,"enablePedestal",!1);d(this,"maxPedestal",1/0);d(this,"minPedestal",0);d(this,"enableRotate",!0);d(this,"minZoomAltitude",0);d(this,"maxZoomAltitude",1/0);d(this,"ignoreZoomLimits",!1);d(this,"zoomFactor",1);d(this,"panBounds",{min:new q(1/0,1/0),max:new q(-1/0,-1/0),center:new q(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:cp.RIGHT,ZOOM:cp.MIDDLE,PAN:cp.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new Xr);d(this,"rendererState");d(this,"options");d(this,"state",-1);d(this,"intersection");d(this,"viewState",null);d(this,"tweens",new Map);d(this,"clock",new Ob(!0));d(this,"coords",{mouse:new te,rotateStart:new te,rotateEnd:new te,rotateDelta:new te,panStart:new q,panCameraStart:new q,panEnd:new q,panDelta:new q,initialShiftPos:new te,initialPedestal:0,floorAnchor:new q});d(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});d(this,"scrollTimer",null);d(this,"lastWheelTime",0);d(this,"resetZoom",!1);d(this,"zoomStart");d(this,"pedestalScaleFactor",1);d(this,"isUserZooming",!1);d(this,"stayInsideBounds",!0);d(this,"userInteracting",!1);d(this,"raycastToFloor",l(t=>{this.raycaster.setFromCamera(t,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new q},"raycastToFloor"));d(this,"isUserInteracting",l(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",l(()=>new q(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",l(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",l((t,i)=>{isNaN(t)||isNaN(i)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",l(()=>{(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"))},"postRender"));d(this,"isCameraMoving",l(()=>this.state!==-1,"isCameraMoving"));d(this,"setPosition",l((t,i)=>{t===void 0||i===void 0||isNaN(t)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",l((t,i)=>{let n=t-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 u=Math.atan2(o,n),c={x:Math.cos(u)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(u)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=t,this.orbit.position.y=i},"updateCameraPosition"));d(this,"tilt",l(t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+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")},"tilt"));d(this,"zoomIn",l((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},t,i,n)},"zoomIn"));d(this,"zoomOut",l((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},t,i,n)},"zoomOut"));d(this,"getRotation",l(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",l(()=>{let t=Array.from(this.tweens.keys()),i=t[t.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",l((t,i,n,o,a,u)=>{let c={mode:tf.cancel,...u},p={},f={},y=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(p.x=y.x,f.x=t.position.x),t.position.y!==void 0&&(p.y=y.y,f.y=t.position.y),t.position.z!==void 0&&(p.z=y.z,f.z=t.position.z)),t.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.zoom=t.zoom:f.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let I=p.rotation=this.getRotation(),w=t.rotation%(2*Math.PI),_=w-I;if(Math.abs(_)>Math.PI){let D=_<0?1:-1;f.rotation=w+2*Math.PI*D}else f.rotation=w}t.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=t.tilt:f.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==f.zoom,v=p.rotation!==f.rotation,x=p.tilt!==f.tilt,P=new Bt(p).to(f,C.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(P),this.publish("multi-end",{zooming:g,rotating:v,tilting:x}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,P.state=7,this.publish("multi-start",{zooming:g,rotating:v,tilting:x})),this.publish("change")});this.rendererState.tweenGroup.add(P);let b=Array.from(this.tweens.entries()),S=b[b.length-1],E=!1;return S!=null&&(c.mode===tf.chain?(E=!0,S[0].chain(P)):(typeof S[1]=="function"&&S[1](),this.completeTween(S[0]))),this.tweens.set(P,a),n?P.easing(n):P.easing(He.Quadratic.In),!t.doNotAutoStart&&!E&&(P.start(),this.publish("change")),P.cameraAnimation=!0,P},"animateCamera"));d(this,"setMulti",l((t,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let u=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),u=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.z,!0),u=!0)),u&&this.publish("position-updated");let c={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;p!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>pu&&(this.camera.near=i-pu,this.camera.far=i+pu):(this.camera.near=i/Hs,this.camera.far=i*Hs),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 p=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));d(this,"getZoomScaledMin",l(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",l(()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)},"getZoomScaledMax"));d(this,"setRotation",l((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(t%cv);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},"setRotation"));d(this,"setZoomAltitude",l(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/Hs,this.camera.far=i*Hs,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",l(t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))},"setZoomLevel"));d(this,"getZoomAltitude",l(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",l(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",l((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;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},"setTilt"));d(this,"getTilt",l(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",l(t=>{this.cameraPlane.position.z=t},"setCameraPlaneElevation"));d(this,"zoom",l(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-t;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")},"zoom"));d(this,"getProjectionScaleFactor",l((t,i,n)=>J1(t,i,n),"getProjectionScaleFactor"));d(this,"update",l(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",l((t,i=!1)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,i&&(this.publishPedestalChangeEvent(t),this.publish("pedestal-change",{pedestal:t})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",l(()=>{for(let t of of)t.endsWith("start")?this.off(t,this.setUserInteracting):t.endsWith("end")&&this.off(t,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",l(()=>{let t=af?2e3:1e10,i=af?100:1,n=new yr(t,t,i,i),o=new jt({color:0,wireframe:af,visible:af}),a=new Te(n,o);return this.scene.add(a),a},"createCameraPlane"));d(this,"addEventListeners",l(()=>{let{domElement:t}=this.renderer;for(let i of of)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",l(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",l(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",l(()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",l(t=>{t.preventDefault()},"onContextMenu"));d(this,"onMouseUp",l(()=>{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}},"onMouseUp"));d(this,"onMouseMove",l(t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}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(t)},"onMouseMove"));d(this,"onTouchStart",l(t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new Qh(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",l(t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.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(t);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let u=i.y<o.y&&n.y<a.y,c=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||u)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}},"onTouchMove"));d(this,"onTouchEnd",l(t=>{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}t.touches.length?this.onTouchStart(t):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",l(t=>{let i=Object.hasOwn(t,"x")?new te(t.x,t.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")},"handleTouchMovePan"));d(this,"handleTouchStartDolly",l(()=>{let t=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-t/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new uu(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new uu(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")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",l(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.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")},"handleMouseMovePan"));d(this,"handleTouchStartTilt",l(t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",l(t=>{this.handleMouseMovePedestal(t.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",l(t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.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)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",l(()=>{let t=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.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,t),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));d(this,"handleTouchEnd",l(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));d(this,"handleTouchStartPan",l(t=>{let i=Object.hasOwn(t,"x")?new te(t.x,t.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")},"handleTouchStartPan"));d(this,"handleTouchStartPedestal",l(t=>{this.handleMouseDownPedestal(t.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",l(t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",l(t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(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(t))},"onMouseWheel"));d(this,"handleMouseWheel",l(t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),n=i-nv(t)*i/uv*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")},"handleMouseWheel"));d(this,"setCameraFromTransformMatrix",l(t=>{this.orbit.updateMatrixWorld();let i=new Ma;i.setFromRotationMatrix(t,"ZYX");let n=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new q(0,0,1);a.applyEuler(i),a.setLength(n);let u=new q;u.setFromMatrixPosition(t),u.sub(a),this.enablePan&&this.setPosition(u.x,u.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-o)},"setCameraFromTransformMatrix"));d(this,"makeTransformFromTouchAnchors",l((t,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=t.worldCoordinate,a=i.worldCoordinate,u=t.reUnproject(),c=i.reUnproject();if(!u||!c||!o||!a)return null;let p=t.viewCoordinate,f=i.viewCoordinate,y=a.x-o.x,g=a.y-o.y,v=Math.atan2(g,y),x=c.x-u.x,P=c.y-u.y,b=Math.atan2(P,x),S=I6(v,b),E=new Ii;E.makeRotationZ(-S);let I=E.clone();I.multiply(t.snapHolderMatrix);let w=l((x8,S8,M8)=>x8.elements[(S8-1)*4+M8-1],"m"),_=w(n,1,1)*w(I,1,1)-p.x*w(n,3,4)*w(I,3,1),D=w(n,1,1)*w(I,1,2)-p.x*w(n,3,4)*w(I,3,2),R=w(n,1,1)*w(I,1,3)-p.x*w(n,3,4)*w(I,3,3),V=o.x*_+o.y*D+o.z*R,G=w(n,2,2)*w(I,2,1)-p.y*w(n,3,4)*w(I,3,1),Z=w(n,2,2)*w(I,2,2)-p.y*w(n,3,4)*w(I,3,2),z=w(n,2,2)*w(I,2,3)-p.y*w(n,3,4)*w(I,3,3),ce=o.x*G+o.y*Z+o.z*z,ve=w(n,1,1)*w(I,1,1)-f.x*w(n,3,4)*w(I,3,1),Re=w(n,1,1)*w(I,1,2)-f.x*w(n,3,4)*w(I,3,2),Ve=w(n,1,1)*w(I,1,3)-f.x*w(n,3,4)*w(I,3,3),it=a.x*ve+a.y*Re+a.z*Ve,mr=w(n,2,2)*w(I,2,1)-f.y*w(n,3,4)*w(I,3,1),Ae=w(n,2,2)*w(I,2,2)-f.y*w(n,3,4)*w(I,3,2),qe=w(n,2,2)*w(I,2,3)-f.y*w(n,3,4)*w(I,3,3),je=a.x*mr+a.y*Ae+a.z*qe,Gt=Math.abs(ve-_),Mi=Math.abs(Re-D),Dt=Math.abs(Ve-R),Vt=Math.abs(ve-G),no=Math.abs(Re-Z),xa=Math.abs(Ve-z),de=Math.abs(mr-_),Ce=Math.abs(Ae-D),ke=Math.abs(qe-R),tr=Math.abs(mr-G),Sa=Math.abs(Ae-Z),ll=Math.abs(qe-z),Vr=Math.min(Gt+Mi+Dt,Vt+no+xa),hn=Math.min(de+Ce+ke,tr+Sa+ll);Vr<hn&&(ve=mr,Re=Ae,Ve=qe,it=je);let cl=G*R-_*z,Rf=Z*R-D*z,lb=ce*R-V*z,Nf=ve*z-G*Ve,Gf=Re*z-Z*Ve,cb=it*z-ce*Ve,y8=(cb*Rf-lb*Gf)/(Nf*Rf-cl*Gf),g8=(cb*cl-lb*Nf)/(Gf*cl-Rf*Nf),ub=Z*_-D*G,v8=z*_-R*G,b8=ce*_-V*G,pb=Re*G-Z*ve,C8=Ve*G-z*ve,db=((it*G-ce*ve)*ub-b8*pb)/(C8*ub-v8*pb),lp=I.clone();return lp.elements[12]=y8,lp.elements[13]=g8,lp.elements[14]=db,db>0?lp:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",l(()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",l(t=>{this.touch.touches=[];for(let i=0,n=t.touches.length;i<n;i++){let o=t.touches[i],a=E6(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]},"touchToScene"));d(this,"canScrollZoom",l(t=>{let i=nv(t),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",l(t=>{let i=this.getMousePos(t);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},"mouseToScene"));d(this,"getMousePos",l(t=>({x:t.offsetX,y:t.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",l(t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",l(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",l(t=>{let i=new te(t.clientX,t.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=J1(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",l(t=>{let i={x:t.clientX,y:t.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)},"handleMouseMovePedestal"));d(this,"handleMouseMoveRotate",l(t=>{this.coords.rotateEnd.set(t.clientX,t.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")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",Wn(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",l(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setUserInteracting",l(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",l(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",l(t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",l(t=>{let[,i]=this.center,o=t*2*Math.tan(ye.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ye.degToRad(i))*2*Math.PI*zr/o;return ye.clamp(Math.log2(a/512),rf,nf)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",l(t=>{let[,i]=this.center,n=ye.clamp(t,rf,nf),o=Math.pow(2,n),a=ye.clamp(i,sv,lv),u=o*512;return Math.cos(ye.degToRad(a))*Math.PI*2*zr/u*this.options.canvasHeight/2/Math.tan(ye.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",l(t=>{t.isPlaying()?t.stop():t.end(),this.rendererState.tweenGroup.remove(t),this.tweens.delete(t)},"completeTween"));d(this,"debugContainer",new dt);this.camera=t,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t)}get defaultMinZoomLevel(){return s(this,sf)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t)}get scrollPercent(){let t=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,t),(n-t)/(i-t)*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,u,c;let t=this.getPosition(),{lat:i,lon:n}=hh((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(c=(u=this.rendererState.center)==null?void 0:u[0])!=null?c:0,t.x,t.y);return[n,i]}setCenter(t,i){var a,u,c,p;let{x:n,y:o}=fh((u=(a=this.rendererState.center)==null?void 0:a[1])!=null?u:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,i,t);this.setPosition(n,o)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(t=>t.cameraAnimation)}focusOn(t,i){dA&&(this.debugContainer&&Ze(this.debugContainer),t.forEach(b=>{let S=new Te(new up(2,2,2),new jt({color:65280}));S.position.copy(b),this.debugContainer.add(S),this.scene.add(this.debugContainer)}));let n=i.curve,o=i.callback,a=i.cancelledCallback,u=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,c=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,f=this.options.canvasHeight,y;i.duration!==void 0?y=i.duration:C.env.TESTING==="true"?y=0:y=200;let g=i.padding,v=this.getRotation(),x=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let P=hA(t,{canvasHeight:f,paddingOption:g,canvasWidth:p,minZoom:u,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(v),this.setTilt(x),this.animateCamera({position:P.position,tilt:i.tilt,rotation:i.rotation,zoom:P.zoom},y,n,o,a)}resize(t,i){this.options.canvasWidth=t,this.options.canvasHeight=i}};sf=new WeakMap,l(lf,"CameraSystem"),d(lf,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Us=lf;function hA(r,{canvasWidth:e,orbit:t,paddingOption:i,canvasHeight:n,minZoom:o,maxZoom:a,camera:u,position:c}){let p={zoom:o,position:c};if(r.length===0)return p;for(let hn of Us.CAMERA_FRAME_PADDING_SIDES)typeof i[hn]!="number"&&(i[hn]=0);let f=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*e,right:i.right*e,type:"pixel"}:i;if(f.left+f.right>=e||f.top+f.bottom>=n)return p;t.updateMatrixWorld();let y=u.matrixWorldInverse,g=u.fov*(Math.PI/180)/2,v=g,P=Math.atan(Math.tan(g)*(e/n)),b=new q(1/0,1/0,1/0),S=new q(-1/0,-1/0,-1/0),E=new wi().setFromPoints(r),I;for(let hn=0,cl=r.length;hn<cl;hn++)I=r[hn].clone(),I.applyMatrix4(y),b.min(I),S.max(I);let w=S.x-b.x,_=S.y-b.y,D=e-f.left-f.right,R=n-f.top-f.bottom,V=(S.x+b.x)/2,G=(S.y+b.y)/2,Z=w/D,z=_/R,ce=o,ve=a,Re=ce*Math.tan(P)*2,Ve=ve*Math.tan(P)*2,it=Re/e,mr=Ve/e,Ae=Math.max(Z,z);Ae=ye.clamp(Ae,it,mr);let qe=D*Ae,je=R*Ae,Gt={min:{x:V-qe/2-f.left*Ae,y:G-je/2-f.bottom*Ae},max:{x:V+qe/2+f.right*Ae,y:G+je/2+f.top*Ae}},Mi=(Gt.min.x+Gt.max.x)/2,Dt=(Gt.min.y+Gt.max.y)/2,Vt=E.getCenter(new q),no=Math.abs(Mi-Gt.min.x),xa=Math.abs(Dt-Gt.min.y),de=no/Math.tan(P),Ce=xa/Math.tan(v),ke=new q;ke.set(Mi,Dt,S.z+Math.max(de,Ce)),ke.applyMatrix4(u.matrixWorld);let tr=new q;tr.set(Mi,Dt,S.z),tr.applyMatrix4(u.matrixWorld);let Sa=new q().subVectors(tr,ke),ll=(Vt.z-ke.z)/Sa.z,Vr=new q().copy(ke).add(Sa.clone().multiplyScalar(ll));return tr.set(Vr.x,Vr.y,Vr.z),ke.sub(tr),{position:Vr,zoom:ke.length()}}l(hA,"getCameraFrameForPoints");m();var fA=300,dv=class dv{constructor(e){d(this,"state");this.state=e}update(e){var n;let t,i;for(let o of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(o),t&&(i=t.components[0],i&&"containerEl"in i&&i.containerEl!=null&&((i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&(i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.projection.y,"px)")),i.visible===!0?i.containerEl.style.pointerEvents=e?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate&&(i.animation&&i.animation.cancel(),i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:fA,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)))}};l(dv,"DOMDrawSystem");var cf=dv;m();var hv=class hv{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};l(hv,"StackComponent");var uf=hv;m();var fv=class fv extends J{constructor(t,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",l(t=>{t.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 li&&n.firstElementChild){let{width:u,height:c}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(u,c)}}}),this.publish("dimensions-update")},"updateDimensions"));this.state=t,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let t;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(t=this.state.geometry2DMap.get(o),(i=t.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 t of this.observers.values())t.disconnect();this.observers.clear()}};l(fv,"DOMResizeSystem");var pf=fv;m();var mA=0,yA=90;function nn(r,e,t,i){return(r<e||r>t)&&A.warn(i),Math.min(t,Math.max(e,r))}l(nn,"clampWithWarning");var Ws={linear:He.Linear.None,"ease-in":He.Quadratic.In,"ease-out":He.Quadratic.Out,"ease-in-out":He.Quadratic.InOut},X,ee,Xs,du,fi,mv=class mv{constructor(e,t,i,n){M(this,X,void 0);M(this,ee,void 0);M(this,Xs,void 0);M(this,du,void 0);M(this,fi,void 0);T(this,X,e),T(this,ee,t),T(this,Xs,i),T(this,du,n),s(this,ee).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,ee).cameraSystem.setCameraPlaneElevation(o),s(this,du).position.z=o})}get center(){return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?s(this,X).map.getCenter().toArray():s(this,ee).cameraSystem.center}setCenter(e){var t;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(t=s(this,X).map)==null||t.setCenter(e),s(this,ee).interactionSystem.handleHover();return}s(this,ee).cameraSystem.setCenter(e[0],e[1]),s(this,ee).interactionSystem.handleHover()}get zoomLevel(){var e;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e=s(this,X).map)==null?void 0:e.getZoom():s(this,ee).cameraSystem.getZoomLevel()}setZoomLevel(e){var t;s(this,X).mode==="outdoors-overlay"&&s(this,X).map&&((t=s(this,X).map)==null||t.setZoom(e)),s(this,ee).cameraSystem.setZoomLevel(nn(e,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,ee).cameraSystem.isAnimating}cancelAnimation(){s(this,ee).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,ee).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,ee).cameraSystem.minZoomLevel}setAutoMinZoomLevel(e){s(this,ee).panBoundsSystem.autoMinZoomLevel=e,e&&(s(this,ee).panBoundsSystem.dirty=!0,s(this,ee).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,ee).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(e,t=!1){var n;t&&this.setAutoMinZoomLevel(!1);let i=nn(e,Lr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Lr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,ee).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,X).map)==null||n.setMinZoom(i)}setMaxZoomLevel(e){var i;let t=nn(e,this.minZoomLevel,Lr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Lr.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,ee).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),(i=s(this,X).map)==null||i.setMaxZoom(t)}get maxPitch(){var e;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e=s(this,X).map)==null?void 0:e.getMaxPitch():ye.radToDeg(s(this,ee).cameraSystem.maxTilt)}get minPitch(){var e;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e=s(this,X).map)==null?void 0:e.getMinPitch():ye.radToDeg(s(this,ee).cameraSystem.minTilt)}setMinPitch(e){var i;let t=Math.max(mA,e);(i=s(this,X).map)==null||i.setMinPitch(t),s(this,ee).cameraSystem.minTilt=ye.degToRad(t)}setMaxPitch(e){var i;let t=Math.min(yA,e);(i=s(this,X).map)==null||i.setMaxPitch(t),s(this,ee).cameraSystem.maxTilt=ye.degToRad(t)}get bearing(){var e;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e=s(this,X).map)==null?void 0:e.getBearing():ye.radToDeg(s(this,ee).cameraSystem.getRotation())}setBearing(e){var t;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(t=s(this,X).map)==null||t.setBearing(e);return}s(this,ee).cameraSystem.setRotation(ye.degToRad(e))}get pitch(){var e;return s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e=s(this,X).map)==null?void 0:e.getPitch():ye.radToDeg(s(this,ee).cameraSystem.getTilt())}setPitch(e){var t;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map){(t=s(this,X).map)==null||t.setPitch(e);return}s(this,ee).cameraSystem.setTilt(ye.degToRad(nn(e,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,ee).cameraSystem.getPedestal()}setElevation(e){s(this,ee).cameraSystem.setPedestal(e,!0)}animateElevation(e,t){return s(this,fi)&&s(this,fi).stop(),new Promise(i=>{T(this,fi,new Bt({elevation:this.elevation}).to({elevation:e},(t==null?void 0:t.duration)||300).easing(Ws[(t==null?void 0:t.easing)||"ease-in-out"]).onUpdate(({elevation:n})=>{this.setElevation(n)}).onComplete(()=>{s(this,fi)&&s(this,X).getTweenGroup().remove(s(this,fi)),i()}).start()),s(this,fi).cameraAnimation=!0,s(this,X).getTweenGroup().add(s(this,fi)),s(this,X).render()})}get insetsPadding(){return s(this,Xs).insetsPadding}get panMode(){return s(this,ee).cameraSystem.enablePan===!1&&s(this,ee).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&(e==="default"?(s(this,ee).cameraSystem.enablePan=!0,s(this,ee).cameraSystem.enablePedestal=!1):(s(this,ee).cameraSystem.enablePan=!1,s(this,ee).cameraSystem.enablePedestal=!0))}setInsetPadding(e){s(this,Xs).insetsPadding=Object.assign({},tu,e)}animateTo(e){var a;if(s(this,X).mode==="outdoors-overlay"&&s(this,X).map)return(a=s(this,X).map)==null||a.flyTo({center:e.center,zoom:e.zoomLevel,bearing:e.bearing,pitch:e.pitch,duration:e.duration}),Promise.resolve();let t=e.center?s(this,X).convertTo3DMapPosition(e.center[1],e.center[0],e.center[2]||this.elevation):void 0,i=e.zoomLevel!==void 0?s(this,ee).cameraSystem.convertZoomLevelToAltitude(nn(e.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=e.bearing!==void 0?ye.degToRad(e.bearing):void 0,o=e.pitch!==void 0?ye.degToRad(nn(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;return new Promise(u=>{s(this,ee).cameraSystem.animateCamera({position:t,zoom:i,rotation:n,tilt:o},e.duration||0,Ws[e.easing||"ease-in-out"],()=>{s(this,ee).interactionSystem.handleHover(),u()},u)})}focusOn(e,t){var i,n;return e==null||!Array.isArray(e)||e.length<=0?(A.error("focusOn coordinates are invalid:",e),Promise.resolve()):s(this,X).mode==="outdoors-overlay"&&s(this,X).map?(e.length===1?(i=s(this,X).map)==null||i.flyTo({center:e[0],duration:(t==null?void 0:t.duration)||s(this,X).map.getBearing(),animate:!0,bearing:(t==null?void 0:t.bearing)===void 0?s(this,X).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?s(this,X).map.getPitch():t==null?void 0:t.pitch,zoom:(t==null?void 0:t.maxZoomLevel)||s(this,X).map.getMaxZoom()}):(n=s(this,X).map)==null||n.fitBounds(e,{duration:t==null?void 0:t.duration,animate:!0,bearing:(t==null?void 0:t.bearing)===void 0?s(this,X).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?s(this,X).map.getPitch():t==null?void 0:t.pitch,zoom:(t==null?void 0:t.maxZoomLevel)||s(this,X).map.getMaxZoom()}),s(this,ee).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{s(this,ee).cameraSystem.focusOn(e.map(a=>s(this,X).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:s(this,ee).cameraSystem.convertZoomLevelToAltitude(nn(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:s(this,ee).cameraSystem.convertZoomLevelToAltitude(nn(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},tu,t==null?void 0:t.padding):this.insetsPadding,curve:Ws[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ye.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ye.degToRad(nn(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,duration:t==null?void 0:t.duration,callback:()=>{s(this,ee).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};X=new WeakMap,ee=new WeakMap,Xs=new WeakMap,du=new WeakMap,fi=new WeakMap,l(mv,"Camera");var df=mv;m();var _6="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 D6="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}";m();var O6=4.291666666666667,L6=15,A6=25,k6=43/60;m();var F6=["horizontal","icon"],bA=new Map([[F6[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>'],[F6[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>']]),CA=/<svg([^>]*)>/g;function B6(r,e,t,i){let n=bA.get(r);return n?n.replace(CA,'<svg$1 width="'.concat(t,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(e,';">')):""}l(B6,"getLogoIcon");var R6=!1,Me,Zs,zs,ut,wt,sa,Ar,mi,kr,yi,yv=class yv extends J{constructor(t,i,n){super();M(this,Me,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});M(this,Zs,void 0);M(this,zs,void 0);M(this,ut,void 0);M(this,wt,void 0);M(this,sa,void 0);M(this,Ar,0);M(this,mi,0);M(this,kr,0);M(this,yi,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",l((t,i)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:t,y:i},center:{x:t/2,y:i/2},top:{x:t/2,y:0},bottom:{x:t/2,y:i},left:{x:0,y:i/2},right:{x:t,y:i/2}})[s(this,Me).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",l(()=>{var n,o,a,u;let t=s(this,Me).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[s(this,Me).position];let i={top:(n=t.top)!=null?n:0,right:(o=t.right)!=null?o:0,bottom:(a=t.bottom)!=null?a:0,left:(u=t.left)!=null?u:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));T(this,Me,Object.assign({},s(this,Me),n)),T(this,zs,t),T(this,Zs,i),T(this,kr,i.canvasWidth),T(this,yi,i.canvasHeight)}get color(){return s(this,Me).color==="light"?"white":"#293136"}get iconName(){return s(this,Me).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Me).iconOnly?L6:75}get defaultWidth(){return s(this,Me).iconOnly?A6:150}get aspectRatio(){return s(this,Me).iconOnly?k6:O6}get options(){return{...s(this,Me)}}set options(t){T(this,Me,{padding:t.padding||s(this,Me).padding,position:t.position||s(this,Me).position,iconOnly:t.iconOnly||s(this,Me).iconOnly,color:t.color||s(this,Me).color,scale:t.scale||s(this,Me).scale,onClick:s(this,Me).onClick,visible:s(this,Me).visible})}get icon(){return B6(this.iconName,this.color,s(this,Ar)*s(this,Zs).pixelRatio,s(this,mi)*s(this,Zs).pixelRatio)}setSize(t,i){s(this,wt)&&(s(this,wt).uniforms.uSize.value.x=t,s(this,wt).uniforms.uSize.value.y=i)}setXY(t,i){s(this,wt)&&(s(this,wt).uniforms.uSize.value.w=t,s(this,wt).uniforms.uSize.value.z=i)}get width(){return s(this,Ar)}get height(){return s(this,mi)}getPositionAlignedOffset(t,i){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-t,y:-i},center:{x:-(t/2),y:-(i/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-t,y:-(i/2)}}[s(this,Me).position]}show(){s(this,Me).visible=!0,this.dirty=!0}hide(){s(this,Me).visible=!1,s(this,ut)&&(s(this,zs).remove(s(this,ut)),Ze(s(this,ut))),T(this,ut,void 0),s(this,wt)&&s(this,wt).dispose(),T(this,wt,void 0),T(this,sa,void 0)}insertIntoQuadTree(t){s(this,sa)!=null&&typeof s(this,Me).onClick=="function"&&t.insert(s(this,sa))}resize(t,i){if(s(this,Me).visible!==!0)return;T(this,kr,t),T(this,yi,i);let n=this.getPositionAlignedCanvasCoordinates(s(this,kr),s(this,yi)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,Ar),s(this,mi)),u=Math.min(s(this,kr)-s(this,Ar),Math.max(0,n.x+o.x+a.x)),c=Math.min(s(this,yi)-s(this,mi),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,Ar)/s(this,kr),s(this,mi)/s(this,yi)),this.setXY(u/s(this,kr),c/s(this,yi)),T(this,sa,new et(u,c,s(this,Ar),s(this,mi),{entityId:"watermark"}))}update(){this.dirty&&s(this,Me).visible===!0&&(T(this,Ar,Math.min(s(this,kr),Math.max(this.minWidth,this.defaultWidth*s(this,Me).scale))),T(this,mi,s(this,Ar)/this.aspectRatio),qn.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),t=>{if(T(this,wt,new dl({uniforms:{uTexture:{value:t},uSize:{value:new yb(0,0,0,0)},uOpacity:{value:.7}},vertexShader:_6,fragmentShader:D6,depthWrite:!1,depthTest:!1,defines:{debug:R6},wireframe:R6,transparent:!0,visible:!0})),s(this,ut))s(this,ut).material=s(this,wt),s(this,ut).material.needsUpdate=!0;else{let i=new yr(2,2,1,1);T(this,ut,new Te(i,s(this,wt))),s(this,ut).position.set(0,0,-1),s(this,ut).frustumCulled=!1,s(this,ut).renderOrder=999;let n=new up(1,1,1),o=new Te(n,new jt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.layers.set(1),s(this,ut).add(o),s(this,zs).add(s(this,ut))}this.resize(s(this,kr),s(this,yi)),this.publish("texture-loaded")})),this.dirty=!1}destroy(){this.hide()}};Me=new WeakMap,Zs=new WeakMap,zs=new WeakMap,ut=new WeakMap,wt=new WeakMap,sa=new WeakMap,Ar=new WeakMap,mi=new WeakMap,kr=new WeakMap,yi=new WeakMap,l(yv,"WatermarkSystem");var hf=yv;m();var gv=100,MA=!1,vv=class vv extends J{constructor(t,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!1);d(this,"autoMinZoomLevel",!0);this.state=t,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new wi,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new q(0,0,0),new q(gv*2,gv*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(gv))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let t of this.state.geometry2DMap.values())t.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(t.position),t.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new q),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new vb).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,MA&&this.state.entityScene.parent instanceof Pa&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Te(new Ib(this.cameraSystem.panBounds.radius),new jt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};l(vv,"PanBoundsSystem");var ff=vv;m();var N6="\xA9 Mappedin",PA="https://info.mappedin.com/feedback",bv=["top-left","top-right","bottom-left","bottom-right"],TA=640,wA=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>","getAttributionButtonIcon"),G6={custom:[],position:"bottom-right"},Cv=class Cv{constructor(e){d(this,"controlContainerEl");d(this,"controlPositions");d(this,"compact");d(this,"attribContainerEl");d(this,"attribInnerEl");d(this,"attribButtonEl");d(this,"feedbackLinkEl");d(this,"attribHTML",N6);d(this,"customAttributions",[]);d(this,"toggleAttribution",l(e=>{this.attribContainerEl!=null&&(e.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",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),e.appendChild(this.controlContainerEl),this.controlPositions=bv.reduce((t,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),t[i]=n,t},{})}addAttributionControl(e=G6){let t=e.position&&bv.includes(e.position)?e.position:G6.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(t)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].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=wA(),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=PA,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),e.custom&&(this.customAttributions=e.custom),this.updateAttributionDisplay()}updateAttribution(e){if(!e.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=[N6],i=e.style.sourceCaches;for(let n in i){let o=i[n];if(o.used||o.usedForTerrain){let a=o.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t=t.filter(n=>String(n).trim()),t=t.filter((n,o)=>{for(let a=o+1;a<t.length;a++)if(t[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=t.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let e=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=e)}resizeAttribution(e){this.attribContainerEl&&(e<=TA||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(e){this.resizeAttribution(e)}updateData(e){this.updateAttribution(e)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};l(Cv,"HTMLControlsSystem");var mf=Cv;m();var hu,xv=class xv{constructor(e,t){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new _e);M(this,hu,0);this.mesh=new pr,this.feature=e,this.builder=t}get visible(){return this.mesh.visible}set visible(e){this.mesh.visible=e}setOpacity(){}setColor(){}get position(){var e;return(e=this.mesh)==null?void 0:e.position}get altitude(){return s(this,hu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,T(this,hu,e))}};hu=new WeakMap,l(xv,"CustomGeometryComponent");var Ys=xv;m();var Sv=class Sv{constructor(e,t){d(this,"state");d(this,"convertTo3DMapPosition");this.state=e,this.convertTo3DMapPosition=t}update(){let e,t;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(e=n.components[0],t=n.components[1],e.dirty&&t.visible!==!1&&(e.position.copy(this.convertTo3DMapPosition(e.feature.geometry.coordinates[1],e.feature.geometry.coordinates[0],t.altitude)),e.builder.setup(e.mesh),e.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),e.dirty=!1),t.visible!==!1&&e.builder.update(e.mesh))}}};l(Sv,"CustomGeometrySystem");var yf=Sv;m();m();var Mv=class Mv extends Te{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};l(Mv,"EntityMesh");var gf=Mv,IA=L.object({flipImageToFaceCamera:L.boolean().optional(),url:L.string()}),EA=L.object({type:L.enum(["Feature"]),properties:L.object({width:L.number(),height:L.number(),rotation:L.number().min(0).max(360).optional(),verticalOffset:L.number().optional()}),geometry:Os});function V6(r,e,t){L.union([L.number(),L.string()]).parse(r),EA.parse(e),IA.parse(t)}l(V6,"validateImage");var Pv=class Pv{constructor(e){d(this,"mesh",new pr);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new q);this.feature=e}get visible(){var e,t;return(t=(e=this.mesh)==null?void 0:e.visible)!=null?t:!1}set visible(e){this.mesh&&(this.mesh.visible=e)}};l(Pv,"ImageComponent");var vf=Pv;var j6=Math.PI*2,H6=Math.PI/2,U6=Math.PI*1.5,_A=.01,DA=!1,Tv=class Tv extends J{constructor(t,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"imageLoadingCache",new Map);this.rendererState=t,this.convertTo3DMapPosition=i}createImageMesh(t,i,n,o=0,a){var y,g;let u=new Wr({transparent:!0,depthWrite:!1,side:Pi}),c=new yr(n.width,n.height),p=new gf(c);p.visible=!1,(y=this.getOrDownloadImage(i))==null||y.then(v=>{u.map=v,u.needsUpdate=!0,u.map.colorSpace=Ti,p.visible=!0,this.publish("image-loaded")}),p.userData.entityId=t,p.material=u;let f=this.convertTo3DMapPosition(a);if(DA){let v=new Te(new yr(n.width,n.height),new Wr({color:"gray"}));p.add(v);let x=new mp;p.add(x),x.scale.set(10,10,10)}return p.renderOrder=1,p.position.set(f.x,f.y,o+_A),p.rotation.z=-ye.degToRad((g=n.rotation)!=null?g:0),p}getOrDownloadImage(t){if(this.imageLoadingCache.has(t))return this.imageLoadingCache.get(t);{let i=new Promise(n=>{qn.getLoader().load(t,o=>{n(o)})});return this.imageLoadingCache.set(t,i),i}}flipIfNeeded(t,i){let o=(t.imageMesh.rotation.z-i+j6)%j6;(o>H6&&o<U6||o<-H6&&o>-U6)&&(t.imageMesh.rotation.z=t.imageMesh.rotation.z-Math.PI)}update(t){var a,u,c,p,f;let i,n,o;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(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,t);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&&((u=n.feature.properties)==null?void 0:u.image.position)!=null){let g=this.createImageMesh(y,(c=n.feature.properties)==null?void 0:c.image.path,(p=n.feature.properties)==null?void 0:p.image,o.height,(f=n.feature.properties)==null?void 0:f.image.position);n.mesh.parent.add(g),n.imageMesh=g}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,t))}}};l(Tv,"ImageSystem");var bf=Tv;m();var OA=!1,$n,wv=class wv extends J{constructor(t,i){super();d(this,"cameraDirty",!0);d(this,"focusablesDirty",!0);d(this,"state");d(this,"camera");d(this,"debugEl",null);d(this,"raycasters",[]);d(this,"collisions",new Map);d(this,"focusableEntities",new Set);M(this,$n,void 0);d(this,"update",l(()=>{s(this,$n)&&cancelAnimationFrame(s(this,$n)),T(this,$n,requestAnimationFrame(()=>{this.updateRaf()}))},"update"));this.state=t,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new te(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new te(t.x/1.2,t.y/1.2),n=new te(t.x+(t.x-i.x),i.y),o=new te(i.x,t.y+(t.y-i.y)),a=new te(n.x,o.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=[t,i,n,o,a].map((u,c)=>{if(OA){let v=document.createElement("div");v.style.position="absolute",v.style.top=u.y+"px",v.style.left=u.x+"px",v.style.width="10px",v.style.height="10px",v.style.backgroundColor="red",this.debugEl.append(v)}let p=u.x/this.state.canvasWidth*2-1,f=-(u.y/this.state.canvasHeight)*2+1,y=new te(p,f),g=new Xr;return g.setFromCamera(y,this.camera),[g,y,c===0?10:c<5?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(t=i.components[0],t instanceof Ee&&t.focusable&&t.geometry!=null)){if(t.focusMesh==null){let o=new Te(t.geometry);o.userData={entityId:i.id},t.focusMesh=o}this.focusableEntities.add(t.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",null);return}this.collisions.clear();for(let[o,a]of this.raycasters)o.setFromCamera(a,this.camera);let t=null,i,n=-1/0;for(let[o,a,u]of this.raycasters)o.intersectObjects(Array.from(this.focusableEntities.values())).forEach(p=>{if((p==null?void 0:p.object)!=null&&"isMesh"in p.object&&(p!=null&&p.object.isMesh)){i=p.object.userData.entityId,this.collisions.has(i)||this.collisions.set(i,0);let f=this.collisions.get(i)+u;this.collisions.set(i,f),f>n&&(t=i,n=f)}});this.publish("geometry-in-focus",t),this.cameraDirty=!1}destroy(){s(this,$n)&&cancelAnimationFrame(s(this,$n)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};$n=new WeakMap,l(wv,"GeometryInFocusSystem");var Cf=wv;m();var Iv=class Iv{constructor(e){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"handleRender",l(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let e=[],t=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)e.push(["!=",["id"],n.id]);e.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...e])}),this.dirty=!1)},"handleRender"));d(this,"handleStyleChange",l(e=>{var t,i;if(this.map&&e&&e.dataType==="style"&&e.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(t=e==null?void 0:e.style)==null?void 0:t.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));e&&(this.map=e,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(e,t){this.centerPoint=e;for(let i of t)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let e of this.userHiddenLayers)this.map.getLayer(e)&&this.hiddenLayersInStyle.add(e)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};l(Iv,"OutdoorLayers");var xf=Iv;m();m();m();var Ev="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 _v='#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 W6="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 FA=new wa;function X6(r,e,t){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:u}=e,{color:c}=t,p=!0,f=0,y=1/0,g=e.displayArrowsOnPath,v=!u,x=!0,P=g,b=i/2+BA,S=0;r[0].z+=b;for(let de=1;de<r.length;++de){r[de].z+=b;let Ce=r[de].x-r[de-1].x,ke=r[de].z-r[de-1].z;if(u)S+=Math.sqrt(Ce*Ce+ke*ke);else{let tr=r[de].y-r[de-1].y;S+=Math.sqrt(Ce*Ce+tr*tr+ke*ke)}}if(!u){let de=b-.01;r.push(r[r.length-1].clone().setZ(de)),r.unshift(r[0].clone().setZ(de))}let E=new mb;P&&(E=FA.load(W6),E.colorSpace=Ti);let I=new _e(c),w=new _e(o),_={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new te(1,1)},cameraParameters:{type:"v2",value:new te(f,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:I},pathLength:{type:"f",value:S},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:f},farZoom:{type:"f",value:y},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:u},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:E},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:x},opacityMultiplier:{type:"f",value:1}},D=new Tb(r);D.curveType="catmullrom",D.tension=0;let R=30,V=8,G=R*r.length,Z=new Eb(D,G,i,V,!1),z=new Float32Array(Z.attributes.position.count);for(let de=r.length;de<z.length;de++)z[de]=de;Z.setAttribute("vertexIndex",new pl(z,1));let ce=new Float32Array(Z.attributes.position.count),ve=new pl(ce,1);for(let de=0;de<=G;de++)for(let Ce=0;Ce<=V;++Ce)ve.setX(de*(V+1)+Ce,de/G);Z.setAttribute("pathDistance",ve);let Re=new Float32Array(Z.attributes.normal.count*3),Ve=new pl(Re,3);for(let de=0;de<G;de++){let Ce=Z.tangents[de];for(let ke=0;ke<=V;++ke)Ve.setXYZ(de*(V+1)+ke,Ce.x,Ce.y,Ce.z)}Z.setAttribute("pathTangent",Ve);let it=new Float32Array(Z.attributes.normal.count*3),mr=new pl(it,3);for(let de=0;de<G;de++){let Ce=Z.tangents[de];var Ae,qe,je;u?(Ae=Ce.x*Ce.y,qe=-1+Ce.y*Ce.y,je=Ce.z*Ce.y):(Ae=-Ce.x*Ce.z,qe=-Ce.y*Ce.z,je=1-Ce.z*Ce.z);let ke=Math.sqrt(Ae*Ae+qe*qe+je*je);ke===0&&(ke=1);let tr=Ae/ke,Sa=qe/ke,ll=je/ke;for(let Vr=0;Vr<=V;++Vr)mr.setXYZ(de*(V+1)+Vr,tr,Sa,ll)}Z.setAttribute("pathNormal",mr);let Gt=new dl({uniforms:_,vertexShader:Ev,fragmentShader:_v});Gt.transparent=!0,Gt.alphaTest=.5,_.resolution.value.x=1,_.resolution.value.y=1,_.vertexes.value=z.length,_.arrowTexture.value.wrapS=jr,_.arrowTexture.value.wrapT=jr,_.arrowTexture.value.anisotropy=16,_.complete.value=a;let Mi=new Te(Z,Gt),Dt=Mi.clone(),Vt={..._,opacityMultiplier:{type:"f",value:.25}};Vt.complete.value=1,Dt.material=new dl({uniforms:Vt,vertexShader:Ev,fragmentShader:_v}),Dt.material.transparent=!0,Dt.material.alphaTest=.5,Dt.material.depthWrite=!1,Dt.material.depthTest=!1,Dt.renderOrder=1,Vt.resolution.value.x=1,Vt.resolution.value.y=1,Vt.vertexes.value=z.length,Vt.arrowTexture.value.wrapS=jr,Vt.arrowTexture.value.wrapT=jr,Vt.arrowTexture.value.anisotropy=16,Vt.complete.value=a,Mi.userData=Dt.userData=e.mesh.userData;let no=e.mesh;no.add(Mi),no.add(Dt),Z.computeBoundingBox();let xa=new q;return Z.boundingBox.getCenter(xa),{mesh:no,material:Gt,center:xa}}l(X6,"buildPath");var BA=.15;var Dv=class Dv extends J{constructor(t,i,n){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");this.rendererState=t,this.convertTo3DMapPosition=i,this.getParentContainer=n}update(t,i,n){let o,a=!1;for(let u of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(u),o&&o.type==="path"&&o.components[0].type==="path"){let c=o.components[0],p=o.components[1],f=c.isVertical&&this.altitudeDirty;if(!(c instanceof ci))continue;if(c.dirty||f){if(c.mesh.parent!=null)for(let g=c.mesh.children.length-1;g>=0;g--)Ze(c.mesh.children[0]);let y=[];if(c.feature.features.forEach(g=>{let v=g.geometry.coordinates[2]||0,x;if(g.properties.parentId&&(x=this.getParentContainer(g.properties.parentId,!0),x!=null&&x.altitude!=null&&(v+=x.altitude,c.isVertical=!0)),!g.properties.parentId||x!=null&&x.visible){let P=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],v);y.push(P)}}),y.length>1){let{mesh:g,material:v,center:x}=X6(y,c,{color:p.color});c.mesh=g,c.material=v,c.position=x}c.dirty=!1}p.dirty&&(c.mesh.children.forEach(y=>{y.material.uniforms.color.value.set(p.color),y.material.needsUpdate=!0}),c.mesh.position.z=p.altitude,p.dirty=!1),c.material&&(c.mesh.children.forEach(y=>{let g=y.material.uniforms;g.nearZoom.value=t,g.farZoom.value=i,g.cameraParameters.value.x=n,c.materialDirty&&(g.nearRadius.value=c.nearRadius,g.displayArrowsOnPath.value=c.displayArrowsOnPath,g.farRadius.value=c.farRadius,g.pulseColor.value.set(c.accentColor),g.complete.value=c.completeFraction),y.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(y=>{y.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,y.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};l(Dv,"PathSystem");var fu=Dv;m();var ze,qs,Fr,Ov=class Ov{constructor(e){d(this,"rendererState");d(this,"dirty",!1);M(this,ze,void 0);M(this,qs,void 0);M(this,Fr,void 0);this.rendererState=e}updateOne(e){var t;if(e instanceof Se&&e.components[0]instanceof Ee&&e.components[1]instanceof Er&&e.parent instanceof Qe&&(T(this,ze,e.components[0]),T(this,Fr,e.components[1]),s(this,ze).detached&&s(this,ze).dirty&&s(this,ze).geometry!=null&&s(this,ze).material!=null)){T(this,qs,e.parent),(t=s(this,ze).mesh)==null||t.setVisibleAt(s(this,ze).instanceIndex,!1);let i=new _e(s(this,Fr).color),n=new Rs({color:i,side:Pi,opacity:s(this,Fr).opacity||1,transparent:s(this,Fr).opacity!==void 0?s(this,Fr).opacity<1:!1},1,s(this,ze).material.repeatYFactor),o=new oi(1,s(this,ze).geometry.attributes.position.count||0,0,n);o.addGeometry(s(this,ze).geometry),o.userData={entities:{0:e.id},detached:!0},s(this,ze).instanceIndex=0,s(this,ze).material.setColor(s(this,ze).instanceIndex,i,s(this,Fr).topColor?new _e(s(this,Fr).topColor):i),s(this,ze).mesh=o,s(this,ze).material=n,s(this,qs).add(o),s(this,ze).dirty=!1}}update(){if(!this.dirty)return;let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.dirty=!1,this.cleanup()}cleanup(){T(this,ze,void 0),T(this,qs,void 0),T(this,Fr,void 0)}};ze=new WeakMap,qs=new WeakMap,Fr=new WeakMap,l(Ov,"MeshDetachmentSystem");var Sf=Ov;m();m();function Z6(r,e,t){var i;if(r.geometry!=null){let n=e||1e-4,o=n/r.currentHeight,a=n/t;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}}l(Z6,"updateHeight");var la,Jn,Lv=class Lv{constructor(e){d(this,"rendererState");d(this,"dirty",!1);M(this,la,void 0);M(this,Jn,void 0);this.rendererState=e}updateOne(e){var t;e instanceof Se&&e.type==="geometry"&&((t=e.components[1])!=null&&t.dirty)&&(T(this,la,e.components[0]),T(this,Jn,e.components[1]),e.type==="geometry"&&s(this,Jn).height!==s(this,la).currentHeight&&Z6(s(this,la),s(this,Jn).height,s(this,Jn).initialHeight))}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.cleanup()}cleanup(){T(this,la,void 0),T(this,Jn,void 0)}};la=new WeakMap,Jn=new WeakMap,l(Lv,"MeshModificationSystem");var Mf=Lv;m();var mu,Av=class Av{constructor(e){M(this,mu,void 0);T(this,mu,e)}update(){var e;(e=s(this,mu)._subscribers["pre-render"])==null||e.forEach(t=>t())}};mu=new WeakMap,l(Av,"PreRenderSystem");var Pf=Av;m();var RA=!1,NA=.01,kv=class kv{constructor(e,t){d(this,"rendererState");d(this,"convertTo3DMapPosition");this.rendererState=e,this.convertTo3DMapPosition=t}createTextAreaMesh(e,t,i){var c;let n=new yr(t.maxWidth,t.maxHeight),o=new jt({color:void 0,transparent:!0}),a=new Te(n,o),u=new dt;if(u.position.copy(this.convertTo3DMapPosition(t.position)),u.add(a),a.position.x=-t.maxWidth/2,a.position.z=i+NA,a.visible=!1,RA){let p=qn.getLoader().load("https://wwr-pro.s3.amazonaws.com/logos/0066/7413/logo.gif",y=>{let g=t.maxWidth/t.maxHeight,x=y.image.width/y.image.height/g;y.wrapS=Vf,y.wrapT=Vf,a.scale.set(1,1/x,1);let P=(a.rotation.z+Math.PI)%(Math.PI*2)-Math.PI;Math.abs(P)>Math.PI/2&&(a.rotation.z+=Math.PI,a.scale.x*=-1),a.visible=!0});o.map=p;let f=new mp;u.add(f),f.scale.set(10,10,10)}return u.rotation.z=Math.PI/2,u.rotation.z-=ye.degToRad((c=t.rotation)!=null?c:0),u.userData.entityId=e,u}flipIfNeeded(e,t){}update(e){var o,a,u;let t,i,n;for(let c of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(c),(t==null?void 0:t.type)==="geometry"){if(i=t.components[0],n=t.components[1],(o=i.feature.properties)!=null&&o.textArea&&n.showTextLabel&&i.textAreaMesh==null&&i.mesh!=null&&i.mesh.parent!=null&&((a=i.feature.properties)==null?void 0:a.textArea.position)!=null){let p=this.createTextAreaMesh(c,(u=i.feature.properties)==null?void 0:u.textArea,n.height+n.altitude);i.mesh.add(p),i.textAreaMesh=p}i.textAreaMesh&&(n.showTextLabel&&!i.textAreaMesh.visible?i.textAreaMesh.visible=!0:!n.showTextLabel&&i.textAreaMesh.visible&&(i.textAreaMesh.visible=!1),n.flipTextToFaceCamera&&this.flipIfNeeded(i,e))}}};l(kv,"PolygonLabelSystem");var Tf=kv;var z6=new Xr;var{DEFAULT_PITCH:Nv,DEFAULT_BEARING:Gv,DEFAULT_ZOOM_LEVEL:Vv,DEFAULT_MIN_ZOOM_LEVEL:GA,DEFAULT_MAX_ZOOM_LEVEL:VA}=Lr,jA=ye.radToDeg(.698132),Rt,Ue,yu,$s,Kn,ca,Js,gu,Bv,k,Pe,Br,Ne,gi,Kt,O,vu,Ye,Le,wf,Y6,If,q6,Ef,$6,Qn,bu,Cu,Ks,_f,xu,Su,Mu,Qs,Pu,Rv,ua,Tu,It,Et,jv=class jv extends J{constructor(t,i={}){var g,v,x,P,b,S,E,I,w,_;super();M(this,gu);M(this,wf);M(this,If);M(this,Ef);M(this,Pu);d(this,"options");d(this,"container");M(this,Rt,void 0);M(this,Ue,void 0);M(this,yu,void 0);M(this,$s,void 0);M(this,Kn,void 0);M(this,ca,void 0);M(this,Js,void 0);d(this,"rendererDomElement");M(this,k,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Xe("__scene"),hoverColor:"red",insetsPadding:tu,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new tv});d(this,"camera");M(this,Pe,void 0);M(this,Br,void 0);M(this,Ne,void 0);M(this,gi,void 0);M(this,Kt,void 0);M(this,O,{});M(this,vu,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");M(this,Ye,l(()=>{s(this,O).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));M(this,Le,l(()=>{s(this,O).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));M(this,Qn,"standalone");M(this,bu,l(t=>Math.trunc(t*10)/10,"#round10"));M(this,Cu,l(()=>{s(this,O).twoDDrawSystem.dirty=!0,U(this,gu,Bv).call(this,$o()),s(this,O).watermarkSystem.dirty=!0,this.render()},"#handlePixelRatioChange"));M(this,Ks,l(()=>{s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,U(this,gu,Bv).call(this,$o()),s(this,Qs).call(this),U(this,Ef,$6).call(this),s(this,O).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,O).cameraSystem.dirty=!0,s(this,O).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,O).htmlControlsSystem.resize(this.canvasWidth),s(this,O).geometryInFocusSystem.resize(),s(this,O).interactionSystem.resize(),this.render()},"#handleWindowResize"));M(this,_f,l(()=>{this.renderSync()},"#renderFull"));M(this,xu,new q);M(this,Su,l((t,i)=>{let n=this.mode==="standalone"?s(this,Ue):this.viewCamera;if(s(this,Ue).position.z+this.camera.elevation>i.z){s(this,xu).copy(i);let o=s(this,xu).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,u=(-o.y+1)/2*this.canvasHeight-0/2,c=s(this,bu).call(this,a),p=s(this,bu).call(this,u);t.x=c,t.y=p}else t.x=-1e3,t.y=-1e3},"#project"));M(this,Mu,l((t,i)=>{s(this,Kt).setBufferSize(t,i),s(this,Ue).aspect=t/i,s(this,Ue).updateProjectionMatrix(),s(this,Ue).updateMatrixWorld(!0),s(this,$s).x=t,s(this,$s).y=i},"#setBufferSize"));M(this,Qs,l(()=>{var a;let t=s(this,k).canvasWidth=this.rendererDomElement.clientWidth,i=s(this,k).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(t*this.resolutionScale),o=Math.floor(i*this.resolutionScale);s(this,Mu).call(this,n,o),(a=this.map)==null||a.resize(),s(this,k).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",l((t,i=!0)=>{if(!t)return i?s(this,k).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let n=s(this,k).geometry3DMap.get(t);return n instanceof Xe?n:(A.warn("Parent (".concat(typeof t=="object"?t.id:t,") is not a valid container, adding to scene")),i?s(this,k).entityScene:void 0)}else if(t.type==="group-container"){let n=s(this,k).geometry3DMap.get(t.id);if(n instanceof Xe)return n}return i?s(this,k).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",l(()=>{s(this,O).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",l(()=>{s(this,O).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",l((t,i)=>{var c;let n=t/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new te(n,o);z6.setFromCamera(a,s(this,Ue).clone());let u=(c=z6.intersectObject(s(this,Kn),!1)[0])==null?void 0:c.point;return u!=null?this.convert3DMapPositionToCoordinate(u):void 0},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",l(t=>{let i=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),n=new te;return s(this,Su).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",l(t=>{var o,a,u,c;let{lat:i,lon:n}=hh((a=(o=s(this,k).center)==null?void 0:o[1])!=null?a:0,(c=(u=s(this,k).center)==null?void 0:u[0])!=null?c:0,t.x,t.y);return[n,i,t.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",l((t,i)=>{s(this,Kt).setBackgroundColor(t,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",l(()=>{let t=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(t,i);return n==null||o==null?void 0:bp(n,o)/t},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",l((t,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,O).outdoorLayersSystem.hideLayersUnderPoint(t,i),this.render())},"hideOutdoorLayersUnderPoint"));M(this,ua,new xb);M(this,Tu,new Ii);d(this,"render",l(()=>{s(this,O).renderSystem!=null&&(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay")?this.map.triggerRepaint():s(this,O).renderSystem.update())},"render"));d(this,"renderSync",l(()=>{s(this,O).renderSystem.update(!0)},"renderSync"));M(this,It,Wn(()=>{this.publish("user-interaction-start",void 0)},0,!0));M(this,Et,Wn(()=>{this.publish("user-interaction-end",void 0)},0,!0));d(this,"on",l((t,i)=>{super.on(t,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&C.env.NODE_ENV!=="test"&&(A.warn('"'.concat(t,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(t))},"on"));d(this,"off",l((t,i)=>{super.off(t,i)},"off"));d(this,"getCursor",l(()=>s(this,O).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",l(()=>{s(this,O).cameraSystem.off("user-dolly-start",s(this,It)),s(this,O).cameraSystem.off("user-pan-start",s(this,It)),s(this,O).cameraSystem.off("user-rotate-start",s(this,It)),s(this,O).cameraSystem.off("user-zoom-start",s(this,It)),s(this,O).cameraSystem.off("user-tilt-start",s(this,It)),s(this,O).cameraSystem.off("user-pedestal-start",s(this,It)),s(this,O).cameraSystem.off("user-dolly-end",s(this,Et)),s(this,O).cameraSystem.off("user-pan-end",s(this,Et)),s(this,O).cameraSystem.off("user-rotate-end",s(this,Et)),s(this,O).cameraSystem.off("user-zoom-end",s(this,Et)),s(this,O).cameraSystem.off("user-tilt-end",s(this,Et)),s(this,O).cameraSystem.off("user-pedestal-end",s(this,Et)),s(this,O).renderSystem.off("measure-canvas",s(this,Qs)),this.remove("__scene"),s(this,Ye).call(this),s(this,Le).call(this),this.renderSync(),s(this,O).renderSystem.destroy(),s(this,O).zoomInterpolationSystem.destroy(),s(this,O).cameraSystem.off("change",this.render),s(this,O).pathSystem.off("animate:path",this.render),s(this,O).cameraSystem.dispose(),s(this,O).exporterSystem.destroy(),s(this,O).outdoorLayersSystem.destroy(),s(this,O).drawSystem.destroy(),window.removeEventListener("resize",s(this,Ks),!1),s(this,vu).removeEventListener("change",s(this,Cu)),s(this,ca)&&s(this,ca).disconnect(),this._subscribers={},s(this,Kt).destroy(),s(this,Rt).traverse(t=>{Ze(t),"dispose"in t&&typeof t.dispose=="function"&&t.dispose()}),T(this,Rt,void 0),s(this,O).htmlControlsSystem.destroy(),s(this,O).collisionSystem.destroy(),s(this,O).domMutationSystem.destroy(),s(this,O).geometryInFocusSystem.destroy(),T(this,O,void 0),s(this,Qn)!=="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,gi)),this.container.removeChild(s(this,Pe)),T(this,Kt,void 0)},"destroy"));if(!t.clientWidth||!t.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&&(T(this,Qn,i.mode),this.map=i.map),s(this,k).entityScene.addEventListener("childadded",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),s(this,k).entityScene.addEventListener("childremoved",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),s(this,k).geometry3DMap.set(s(this,k).entityScene.userData.entityId,s(this,k).entityScene),i.center&&(s(this,k).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=t,U(this,wf,Y6).call(this),U(this,If,q6).call(this),s(this,O).htmlControlsSystem=new mf(this.container),s(this,Qn)!=="outdoors-overlay"&&s(this,O).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),C.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),T(this,Kt,new Eh({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(g=i.gl)==null?void 0:g.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,Le).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(v=i.backgroundAlpha)!=null?v:1})),T(this,Rt,new Pa),s(this,Rt).add(s(this,k).entityScene);let n=window.__THREE_DEVTOOLS__;C.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Rt)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Kt)}))),T(this,Ue,new Cb(jA,this.aspect,50,1e5)),T(this,yu,new bb),s(this,Ue).renderOrder=999;let o=new dt;o.add(s(this,Ue)),T(this,Js,new dt),s(this,Js).add(o),s(this,Rt).add(s(this,Js)),s(this,Ue).updateProjectionMatrix(),s(this,Ue).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,Kt).domElement(),T(this,$s,new te);let a=new yr(1e6,1e6),u=new jt({color:0,visible:!1});T(this,Kn,new Te(a,u)),s(this,Rt).add(s(this,Kn)),(x=i.gl)!=null&&x.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,Ks),!1),s(this,vu).addEventListener("change",s(this,Cu)),typeof ResizeObserver=="function"&&((P=C.env)==null?void 0:P.NODE_ENV)!=="test"&&(T(this,ca,new ResizeObserver(Wn(()=>{s(this,Ks).call(this)},0))),(b=s(this,ca))==null||b.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=(S=globalThis.MappedinDebug)!=null&&S.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(E=globalThis.MappedinDebug)!=null&&E.TEST_IOS?"1920px":"100%",C.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,p=this.canvasHeight;s(this,O).watermarkSystem=new hf(s(this,Ue),s(this,k),i==null?void 0:i.watermark),s(this,O).watermarkSystem.on("texture-loaded",this.render),s(this,k).shouldMeasureCanvas=!0,s(this,k).pixelRatio=this.resolutionScale,s(this,Mu).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let f=new fp(16777215,.3*Math.PI);f.position.set(-150,-150,350),s(this,Rt).add(f);let y=new Db(16777215,.741*Math.PI);s(this,Rt).add(y),s(this,O).cameraSystem=new Us(s(this,Ue),s(this,Rt),s(this,Kt).renderer,s(this,k),{mode:this.mode,canvasHeight:p,canvasWidth:c}),s(this,O).cameraSystem.on("user-dolly-start",s(this,It)),s(this,O).cameraSystem.on("user-pan-start",s(this,It)),s(this,O).cameraSystem.on("user-rotate-start",s(this,It)),s(this,O).cameraSystem.on("user-zoom-start",s(this,It)),s(this,O).cameraSystem.on("user-tilt-start",s(this,It)),s(this,O).cameraSystem.on("user-pedestal-start",s(this,It)),s(this,O).cameraSystem.on("user-dolly-end",s(this,Et)),s(this,O).cameraSystem.on("user-pan-end",s(this,Et)),s(this,O).cameraSystem.on("user-rotate-end",s(this,Et)),s(this,O).cameraSystem.on("user-zoom-end",s(this,Et)),s(this,O).cameraSystem.on("user-tilt-end",s(this,Et)),s(this,O).cameraSystem.on("user-pedestal-end",s(this,Et)),s(this,O).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,O).geometryInFocusSystem&&(s(this,O).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,O).pathSystem=new fu(s(this,k),this.convertTo3DMapPosition,this.getParentContainer),s(this,O).pathSystem.on("animate:path",this.render),s(this,O).panBoundsSystem=new ff(s(this,k),s(this,O).cameraSystem),s(this,O).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:R,convertAltitudeToZoomLevel:V}=s(this,O).cameraSystem;if(s(this,O).panBoundsSystem.autoMinZoomLevel){let G=R*Math.PI/180,Z=Math.tan(G/2),z=V(D.radius/Z);this.camera.setMinZoomLevel(z)}}),this.camera=new df(this,s(this,O),s(this,k),s(this,Kn)),this.camera.setZoomLevel((I=i.zoomLevel)!=null?I:Vv),this.camera.setBearing((w=i.bearing)!=null?w:Gv),this.camera.setPitch((_=i.pitch)!=null?_:Nv),this.camera.setMaxZoomLevel(VA),this.camera.setMinZoomLevel(GA),s(this,O).domVisiblitySystem=new Zh(s(this,k),s(this,gi)),s(this,O).domMutationSystem=new pf(s(this,k),s(this,gi)),s(this,O).domMutationSystem.on("dimensions-update",()=>{s(this,O).collisionSystem.dirty=!0,this.render()}),s(this,O).domDrawSystem=new cf(s(this,k)),s(this,O).collisionSystem=new Dh(s(this,Br),s(this,k)),s(this,O).twoDDrawSystem=new Yh(s(this,k),s(this,Ne)),s(this,O).interactionSystem=new qc(this.rendererDomElement,s(this,k),s(this,Ue),s(this,Kn)),s(this,O).interactionSystem.on("hover",this.render),s(this,O).interactionSystem.on("click",D=>{var R,V,G,Z,z,ce;if(((R=D.entity2D)==null?void 0:R.id)==="watermark"&&typeof s(this,O).watermarkSystem.options.onClick=="function"){s(this,O).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(V=D.entity3D)==null?void 0:V.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof ci?[D.entity3D.id]:[],markers:((Z=D.entity2D)==null?void 0:Z.components[0])instanceof li?[D.entity2D.id]:[],models:((z=D.entity3D)==null?void 0:z.components[0])instanceof zn?[D.entity3D.id]:[],labels:((ce=D.entity2D)==null?void 0:ce.components[0])instanceof ui?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ve=>ve.userData.entityId):[],pointerEvent:D.pointerEvent})}),s(this,O).interactionSystem.on("hover",D=>{var R,V,G,Z,z,ce;D.position&&((R=D.entity2D)==null?void 0:R.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(V=D.entity3D)==null?void 0:V.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof ci?[D.entity3D.id]:[],markers:((Z=D.entity2D)==null?void 0:Z.components[0])instanceof li?[D.entity2D.id]:[],models:((z=D.entity3D)==null?void 0:z.components[0])instanceof zn?[D.entity3D.id]:[],labels:((ce=D.entity2D)==null?void 0:ce.components[0])instanceof ui?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ve=>ve.userData.entityId):[]})}),s(this,O).geometryInFocusSystem=new Cf(s(this,k),s(this,Ue)),s(this,O).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),s(this,O).twoDVisiblitySystem=new $h(s(this,k)),s(this,O).drawSystem=new qh(s(this,k)),s(this,O).drawSystem.on("texture-loaded",this.render),s(this,O).stackSystem=new Kh(s(this,k)),s(this,O).twoDProjectionSystem=new zh(s(this,k),s(this,Su)),s(this,O).zoomInterpolationSystem=new Ah,s(this,O).exporterSystem=new $c(s(this,k)),s(this,O).meshOptimizationSystem=new Xh(s(this,k),this.convertTo3DMapPosition),s(this,O).meshOptimizationSystem.on("model-loaded",this.render),s(this,O).meshDetachmentSystem=new Sf(s(this,k)),s(this,O).meshModificationSystem=new Mf(s(this,k)),s(this,O).customGeometrySystem=new yf(s(this,k),this.convertTo3DMapPosition),s(this,O).outlineInterpolationSystem=new Zc(s(this,k)),s(this,O).renderSystem=new Jh(s(this,Kt),s(this,k),this.mode,s(this,Rt),s(this,Ue),this.viewCamera,s(this,O)),s(this,O).preRenderSystem=new Pf(this),s(this,O).imageSystem=new bf(s(this,k),this.convertTo3DMapPosition),s(this,O).polygonLabelSystem=new Tf(s(this,k),this.convertTo3DMapPosition),s(this,O).imageSystem.on("image-loaded",this.render),s(this,O).renderSystem.on("measure-canvas",s(this,Qs)),s(this,O).outdoorLayersSystem=new xf(this.map),s(this,_f).call(this)}get viewCamera(){return s(this,yu)}get canvasWidth(){return s(this,k).canvasWidth}get canvasHeight(){return s(this,k).canvasHeight}get resolutionScale(){var t,i;return(i=(t=this.map)==null?void 0:t._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:$o()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,Qn)}addGroupContainer(t,i,n){var o;if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let a=new Xe(t);a.addEventListener("childadded",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),a.addEventListener("childremoved",()=>{s(this,Le).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&&xt(a,i.interactive,s(this,k)),s(this,k).geometry3DMap.set(t,a),(o=this.getParentContainer(n))==null||o.addEntity(a),s(this,Le).call(this),this.render()}else A.error("Group container with ID '".concat(t,"' already exists. The group container cannot be added."));return{id:t,type:"group-container"}}addStackContainer(t,i,n){var o;if(s(this,k).geometry3DMap.has(t))A.error("Stack container with ID '".concat(t,"' already exists. The stack container cannot be added."));else{let a=new Xe(t);a.addEventListener("childadded",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),a.addEventListener("childremoved",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),a.components[0]=new uf,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),s(this,k).geometry3DMap.set(t,a),(o=this.getParentContainer(n))==null||o.addEntity(a)}return{id:t,type:"stack-container"}}addCustomGeometry(t,i,n,o,a){var u;if(s(this,k).geometry3DMap.has(t))A.error("Custom geometry with ID '".concat(t,"' already exists. The custom geometry cannot be added."));else{let c=new Ys(i,n),p=new Se(c,new Er(o));p.id=t,c.mesh.userData={entityId:t,type:"custom-geometry"},s(this,k).geometry3DMap.set(p.id,p),(u=this.getParentContainer(a))==null||u.addEntity(p),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,i,n,o){var a,u;if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let c=new Qe(t,new Lo(n));c.addEventListener("childadded",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),c.addEventListener("childremoved",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),c.userData.dirty=!0,s(this,k).geometry3DMap.set(t,c);for(let p of i.features){if(!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(p.geometry.type))continue;let f=p.id||p.properties.id||ae(),{visible:y,...g}=n||{color:eh},v=s(this,O).meshOptimizationSystem.createEntityFromFeature(f,p,g);s(this,k).geometry3DMap.set(f,v),c.userData.entities3D.add(f)}c.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(n==null?void 0:n.altitude)!=null&&c.setAltitude(n.altitude),(u=this.getParentContainer(o))==null||u.addEntity(c),s(this,Le).call(this),this.render()}else A.error("Geometry group with ID '".concat(t,"' already exists. The geometry group cannot be added."));return s(this,O).outlineInterpolationSystem.dirty=!0,{id:t,type:"geometry-group"}}addImage(t,i,n,o){var a;try{V6(t,i,n)}catch(u){A.error(u);return}if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let u=new vf(i),c=new Se(u,new Er(n));c.id=t||ae(),u.mesh.userData={entityId:c.id,type:"path"},s(this,k).geometry3DMap.set(c.id,c),(a=this.getParentContainer(o))==null||a.addEntity(c),s(this,Le).call(this),this.render()}else A.error("Image with ID '".concat(t,"' already exists. The image cannot be added."));return{id:t,type:"image"}}addModelGroup(t,i,n,o){var a;try{M6(t,i,n)}catch(u){A.error(u);return}if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let u=new Qe(t,new Lo(n));u.addEventListener("childadded",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),u.addEventListener("childremoved",()=>{s(this,Le).call(this),s(this,Ye).call(this)}),s(this,k).geometry3DMap.set(t,u),u.userData.dirty=!0,u.userData.modelURL=n.url;for(let c of i.features){let p=c.id||c.properties.id||ae(),f=s(this,O).meshOptimizationSystem.createModelFromFeature(p,c,n);c.properties.interactive!==void 0&&xt(f,c.properties.interactive,s(this,k)),s(this,k).geometry3DMap.set(p,f),u.userData.entities3D.add(p)}(a=this.getParentContainer(o))==null||a.addEntity(u),s(this,Le).call(this),this.render()}else A.error("Model group with ID '".concat(t,"' already exists. The model group cannot be added."));return{id:t,type:"geometry-group"}}addMarker2D(t,i,n,o){var u;let a=n==null?void 0:n.id;try{O7(t,i,n||{})}catch(c){A.error(c);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let c=U(this,Pu,Rv).call(this,t,new li(i,n));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&xt(c,n==null?void 0:n.interactive,s(this,k)),(u=this.getParentContainer(o))==null||u.addEntity(c),this.render()}else A.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addLabel2D(t,i,n,o){var u;let a=n==null?void 0:n.id;try{wS(t,i,n||{})}catch(c){A.error(c);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let c=U(this,Pu,Rv).call(this,t,new ui(i,n||{},s(this,k)));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&xt(c,n==null?void 0:n.interactive,s(this,k)),(u=this.getParentContainer(o))==null||u.addEntity(c),s(this,Ye).call(this),this.render()}else A.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(t,i={},n){var u,c;try{L7(t,i||{})}catch(p){A.error(p);return}let o=new ci(t,b0(i)),a=new Se(o,new Er({color:(u=i==null?void 0:i.color)!=null?u:"#ff834c"}));return a.id=(i==null?void 0:i.id)||ae(),o.mesh.userData={entityId:a.id,type:"path"},s(this,k).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&xt(a,i==null?void 0:i.interactive,s(this,k)),(c=this.getParentContainer(n))==null||c.addEntity(a),s(this,Le).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(t){s(this,O).watermarkSystem.options=t,s(this,O).watermarkSystem.dirty=!0,s(this,O).collisionSystem.dirty=!0,this.render()}remove(t){var n;let i;if(typeof t=="string"||typeof t=="number"?(i=s(this,k).geometry2DMap.get(t),i==null&&(i=s(this,k).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(i=s(this,k).geometry2DMap.get(t.id),i==null&&(i=s(this,k).geometry3DMap.get(t.id))):i=t,i!=null){if(i.type==="custom-geometry")s(this,k).geometry3DMap.delete(i.id),i.object3d&&Ze(i.object3d);else if(i.type==="group-container"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);Ze(i)}else if(i.type==="geometry-group"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);Ze(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),Ze(i.object3d)),o.outline&&Ze(o.outline),"focusMesh"in o&&o.focusMesh!=null&&Ze(o.focusMesh),s(this,k).geometry3DMap.delete(i.id)}else i.type==="marker"||i.type==="label"?(i.object3d&&Ze(i.object3d),i.type==="label"&&delete s(this,O).twoDDrawSystem.textCache[i.id],s(this,k).geometry2DMap.delete(i.id)):i.type==="image"&&(i.object3d&&Ze(i.object3d),s(this,k).geometry3DMap.delete(i.id));s(this,Le).call(this),s(this,Ye).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(t){return s(this,O).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){(s(this,O).renderSystem.threeDdirty||s(this,O).renderSystem.twoDdirty)&&this.renderSync();let i=new wi;if(t==null)i.setFromObject(s(this,k).entityScene);else{let n=Gc(s(this,k),t);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Ee?o.geometry:void 0;o.mesh instanceof Ta&&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(N7(i))return W1(i).map(this.convert3DMapPositionToCoordinate)}getState(t){var n;if(t==null)return{type:"map-view",hoverColor:s(this,k).hoverColor};let i=Gc(s(this,k),t);if((i==null?void 0:i.type)==="custom-geometry"){let o=i.components[0],a=i.components[1];return{id:i.id,type:"custom-geometry",visible:a.visible,altitude:a.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(o.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let o=[];for(let u of i.userData.entities3D.values()){let c=this.getState(u);((c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model")&&o.push(c)}let a=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:a.opacity,color:a.color,altitude:i.altitude,topColor:a.topColor,outline:a.outline,shading:a.shading,texture:a.texture,topTexture:a.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(u=>s(this,k).geometry3DMap.get(u)).every(u=>u&&u.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(u=>this.getState(u)).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(o=>this.getState(o)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let o=i.components[0],a=i.object3d.parent,u=a==null?void 0:a.userData.entityId;return{id:i.id,type:"label",text:o.text||"",parent:{id:u,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:o.enabled,initialRank:Pc(o.initialRank),options:{rank:Pc(o.rank),appearance:o.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let o=i.components[0],a=i.object3d.parent,u=a==null?void 0:a.userData.entityId;return{id:i.id,type:"marker",enabled:o.enabled,parent:{id:u,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),element:o.containerEl,initialRank:Pc(o.initialRank),options:{rank:Pc(o.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:o,hoverColor:a,initialColor:u,topColor:c}=i.components[1],p=i.components[0],f=i.components[1];return{id:i.id,type:"geometry",opacity:f.opacity,color:o,focusable:p.focusable,topColor:c,initialColor:u,hoverColor:a,height:f.height,visible:f.visible,outline:f.outline,showImage:f.showImage,texture:f.texture,topTexture:f.topTexture,flipImageToFaceCamera:f.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(p.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let o=i.components[0],a=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(o.position),interactive:a!=null}}else if((i==null?void 0:i.type)==="path"){let o=i.components[0],a=i.components[2],u=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(o.position),visible:u.visible,interactive:a!=null,completeFraction:o.completeFraction,color:u.color,accentColor:o.accentColor,nearRadius:o.nearRadius,farRadius:o.farRadius,animateArrowsOnPath:o.animateArrowsOnPath,displayArrowsOnPath:o.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let o=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(o.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else return}}setState(t,i){var o;if(typeof t=="object"&&"hoverColor"in t&&i==null){s(this,k).hoverColor=(o=t.hoverColor)!=null?o:s(this,k).hoverColor;return}let n=Gc(s(this,k),t);if(n!=null){if(n.type==="custom-geometry"){let a=s(this,k).geometry3DMap.get(n.id);if(a instanceof Se&&a.components[0]instanceof Ys){let u=i;ea(n,u.visible),wh(n,u.altitude),m0(n,u.position,this.convertTo3DMapPosition),y0(n,this.getParentContainer(u.parent,!1))}}else if(n.type==="model"||n.type==="path"){let a=i;xt(n,a.interactive,s(this,k))&&s(this,Le).call(this),n.type==="path"&&(wh(n,a.altitude),VS(n,a))}else if(n.type==="group-container"){let a=i;ea(n,a.visible)&&(s(this,O).outlineInterpolationSystem.dirty=!0,s(this,O).pathSystem.altitudeDirty=!0),wh(n,a.altitude)&&(s(this,O).pathSystem.altitudeDirty=!0),xt(n,a.interactive,s(this,k))&&s(this,Le).call(this)}else if(n.type==="geometry-group"){let a=i;ea(n,a.visible)&&(s(this,O).outlineInterpolationSystem.dirty=!0),IS(n,s(this,k),a)&&(s(this,O).outlineInterpolationSystem.dirty=!0),v0(n,a.outline)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),a.altitude!=null&&(n.setAltitude(a.altitude),n.userData.outlineDirty=!0),RS(n,a),ES(n,a.shading),BS(n,s(this,k),a.opacity),xt(n,a.interactive,s(this,k))&&(s(this,Le).call(this),s(this,Ye).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Ee){let a=i;ea(n,a.visible)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),v0(n,a.outline)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),_S(n,a),a.focusable!=null&&(n.components[0].focusable=a.focusable,s(this,O).geometryInFocusSystem.focusablesDirty=!0),GS(n,a.opacity)&&(s(this,O).meshDetachmentSystem.dirty=!0,s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),g0(n,a.flipImageToFaceCamera),DS(n,a.height)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),NS(n,a)&&(s(this,O).meshDetachmentSystem.dirty=!0),f0(n,a),FS(n,a.hoverColor),xt(n,a.interactive,s(this,k))}s(this,Le).call(this)}else if(n.type==="label"||n.type==="marker"){let a=i;kS(n,i,s(this,k)),LS(n,i,s(this,k))&&s(this,Ye).call(this),m0(n,a.position,this.convertTo3DMapPosition),y0(n,this.getParentContainer(a.parent,!1))&&(s(this,Ye).call(this),s(this,O).panBoundsSystem.dirty=!0),OS(n,a.enabled)}else if(n.type==="image"){let a=i;ea(n,a.visible),g0(n,a.flipImageToFaceCamera)}this.render()}}convertTo3DMapPosition(t,i,n=0,o){var c,p,f,y,g;if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],(c=t[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:u}=fh((f=(p=s(this,k).center)==null?void 0:p[1])!=null?f:0,(g=(y=s(this,k).center)==null?void 0:y[0])!=null?g:0,t,i);return o?(o.set(a,u,n),o):new q(a,u,n)}get backgroundColor(){return s(this,Kt).backgroundColor}getCenter(t){let i=Array.isArray(t)?t:this.getBoundingArea(t);return i?R7(i):void 0}isInView(t){let i=Gc(s(this,k),t);if(s(this,Tu).identity().multiply(s(this,Ue).projectionMatrix).multiply(s(this,Ue).matrixWorldInverse),s(this,ua).setFromProjectionMatrix(s(this,Tu)),i instanceof dr)return s(this,ua).containsPoint(i.position);if(i instanceof Se){let n=i==null?void 0:i.components[0];if(n instanceof Ys||n instanceof zn)return s(this,ua).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Ee){let o=new wi(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,ua).intersectsBox(o)}}return!1}getSystems(){return s(this,O)}getInternalState(){return s(this,k)}getTweenGroup(){return s(this,k).tweenGroup}};Rt=new WeakMap,Ue=new WeakMap,yu=new WeakMap,$s=new WeakMap,Kn=new WeakMap,ca=new WeakMap,Js=new WeakMap,gu=new WeakSet,Bv=l(function(t){var i;s(this,Qn)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(t)),s(this,k).pixelRatio=this.resolutionScale},"#setResolutionScale"),k=new WeakMap,Pe=new WeakMap,Br=new WeakMap,Ne=new WeakMap,gi=new WeakMap,Kt=new WeakMap,O=new WeakMap,vu=new WeakMap,Ye=new WeakMap,Le=new WeakMap,wf=new WeakSet,Y6=l(function(){T(this,Pe,document.createElement("div")),s(this,Pe).classList.add("mappedin__smart-collision-engine__container"),T(this,Br,document.createElement("canvas")),s(this,Br).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,Pe)),T(this,Ne,document.createElement("canvas")),s(this,Ne).classList.add("mappedin__smart-collision-engine__container"),s(this,Ne).width=s(this,Pe).clientWidth*this.resolutionScale,s(this,Ne).height=s(this,Pe).clientHeight*this.resolutionScale,s(this,Ne).style.width=s(this,Pe).clientWidth+"px",s(this,Ne).style.height=s(this,Pe).clientHeight+"px",s(this,Pe).appendChild(s(this,Br)),s(this,Pe).appendChild(s(this,Ne)),s(this,Br).width=s(this,Pe).clientWidth,s(this,Br).height=s(this,Pe).clientHeight,s(this,Ne).width=s(this,Pe).clientWidth*this.resolutionScale,s(this,Ne).height=s(this,Pe).clientHeight*this.resolutionScale,s(this,Ne).style.width=s(this,Pe).clientWidth+"px",s(this,Ne).style.height=s(this,Pe).clientHeight+"px"},"#renderEntity2DContainer"),If=new WeakSet,q6=l(function(){T(this,gi,document.createElement("div")),s(this,gi).classList.add("mappedin-2d-entities"),Object.assign(s(this,gi).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,gi))},"#renderEntityDOMContainer"),Ef=new WeakSet,$6=l(function(){s(this,Ne).width=s(this,Pe).clientWidth*this.resolutionScale,s(this,Ne).height=s(this,Pe).clientHeight*this.resolutionScale,s(this,Ne).style.width=s(this,Pe).clientWidth+"px",s(this,Ne).style.height=s(this,Pe).clientHeight+"px",s(this,Br).width=s(this,Pe).clientWidth,s(this,Br).height=s(this,Pe).clientHeight,s(this,Ne).width=s(this,Pe).clientWidth*this.resolutionScale,s(this,Ne).height=s(this,Pe).clientHeight*this.resolutionScale,s(this,Ne).style.width=s(this,Pe).clientWidth+"px",s(this,Ne).style.height=s(this,Pe).clientHeight+"px",s(this,O).collisionSystem.dirty=!0},"#resizeCollisionCanvas"),Qn=new WeakMap,bu=new WeakMap,Cu=new WeakMap,Ks=new WeakMap,_f=new WeakMap,xu=new WeakMap,Su=new WeakMap,Mu=new WeakMap,Qs=new WeakMap,Pu=new WeakSet,Rv=l(function(t,i,n){let o=new dr(i,this.convertTo3DMapPosition(t[1],t[0],t[2]||n||0));return s(this,k).geometry2DMap.set(o.id,o),o},"#createEntity2D"),ua=new WeakMap,Tu=new WeakMap,It=new WeakMap,Et=new WeakMap,l(jv,"Core");var Fv=jv,wu=Fv;m();function HA(r,e){UA(r,e)(r.getScene(),e),WA(r,e),e.addFolder("Export").add({export:async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),u=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let p=window.URL.createObjectURL(u);c.href=p,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(p)}},"export");let n=e.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)}l(HA,"mountSceneGraphVisualizer");function UA(r,e){let t=e;return l(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 u={get height(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{height:c})},set flipImageToFaceCamera(c){let p=r.getState(n.id);(p==null?void 0:p.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 p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.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 p=r.getState(n.id);(p==null?void 0:p.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 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 p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:c})},set interactive(c){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(n,{interactive:c}),t.controllersRecursive().forEach(f=>f.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 p=r.getState(n.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:c})},focus:()=>{}};a.add(u,"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(u,"visible"),n.type==="image"?a.add(u,"flipImageToFaceCamera"):(a.add(u,"interactive"),n.type==="path"&&a.add(u,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(u,"color"),a.add(u,"outline"))),n.type==="geometry"&&a.add(u,"height")}else if(n.type==="marker"){let u={get interactive(){var p;let c=r.getState(n.id);return(c==null?void 0:c.type)==="marker"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},focus:()=>{}};a.add(u,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="marker"&&r.camera.focusOn([c.position])}),a.add(u,"interactive")}else if(n.type==="label"){let u={get interactive(){var p;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c})},get"Text Color"(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(n.id,{text:u.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.size:10},set"Text Size"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.iconSize:10},set"Icon Size"(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var p,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(c){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var p,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(c){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var p,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(c){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var p,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(c){var f,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,inactive:c}}}}})},focus:()=>{}};a.add(u,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="label"&&r.camera.focusOn([c.position])}),a.add(u,"interactive"),a.add(u,"text"),a.add(u,"Text Size",10,50),a.add(u,"Icon Size",10,50),a.addColor(u,"Text Color"),a.addColor(u,"Active Background Color"),a.addColor(u,"Inactive Background Color"),a.addColor(u,"Active Foreground Color"),a.addColor(u,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let u={get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{opacity:c})},set visible(c){let p=r.getState(n.id);(p==null?void 0:p.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 p=r.getState(n.id);(p==null?void 0:p.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 p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(n,{interactive:c}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.start)!=null?f:0},set shadingStart(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:c}})},get shadingEnd(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.end)!=null?f:0},set shadingEnd(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:c}})},get shadingIntensity(){var p,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.intensity)!=null?f:0},set shadingIntensity(c){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:c}})}};a.add(u,"visible"),a.add(u,"opacity",0,1,.1),a.add(u,"interactive"),a.add(u,"outline"),a.add(u,"shadingStart",0,1,.1),a.add(u,"shadingEnd",0,1,.1),a.add(u,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let u={set visible(c){let p=r.getState(n.id);(p==null?void 0:p.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 p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:c}),t.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(u,"visible"),a.add(u,"interactive")}if(a.close(),n.children)for(let u of n.children.values())i(u,a)},"parseChild")}l(UA,"createParseChild");function WA(r,e){let t=e.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(i,"padding",0,100,1),t.add(i,"scale",.5,1.5,.1),t.add(i,"color",["dark","light"]),t.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(i,"iconOnly"),t.onChange(()=>{r.updateWatermark(i)})}l(WA,"createWatermarkChild");var J6="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",XA="https://auth.mappedin.com/oauth2/token";async function K6(r,e){var t,i,n,o,a;if((t=e==null?void 0:e.outdoorView)!=null&&t.enabled&&((i=e==null?void 0:e.outdoorView)!=null&&i.headers)){let{Map:u,MercatorCoordinate:c}=await import("./outdoor-context-v4-KPYNV3QK.js"),p=e.outdoorView.headers;p==null&&(p=await F7(XA));let f=e.center||[0,0],y=new u({container:r,style:e.outdoorView.style||J6,center:f,attributionControl:!1,zoom:(n=e.zoomLevel)!=null?n:Vv,pitch:(o=e.pitch)!=null?o:Nv,bearing:(a=e.bearing)!=null?a:Gv,transformRequest:z1(p),trackResize:!1,pixelRatio:$o(),antialias:typeof e.antialias=="boolean"?e.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,v=new wu(r,{center:f,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:e.watermark,attribution:e.attribution,antialias:e.antialias}),x={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(v.camera.minZoomLevel),y.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",w=>{x.center=w.center,x.zoom=w.zoomLevel,x.bearing=w.bearing,x.pitch=w.pitch,y.jumpTo(x)});let P=c.fromLngLat(f,0),b=mh(P,v.viewCamera,v.camera,()=>{v.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(b),v.renderSync())});let S=!1,E=!1;y.on("idle",()=>{y&&(S||(v.publish("outdoor-view-loaded"),S=!0),E||(E=!0,v.publish("outdoor-style-loaded")))});let I=l(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",w=>{y&&w&&w.dataType==="style"&&w.type==="styledata"&&(E=!1),I(w)}),y.on("sourcedata",I),y.on("terrain",I),y.on("error",w=>{var _;if(((_=w.error)==null?void 0:_.url)===J6){A.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}A.warn(w)}),v}else return new wu(r,e)}l(K6,"createRenderer");var Q6=50,ZA=1e3,Ge,Rr,el,vi,Nr,_t,Eu,tl,pa,_u,Hv,da,Du,Ou,Lu,Au,on,Df,e8,ku,eo,Fu,Uv,Wv=class Wv extends J{constructor({currentMapGetter:t}){super();M(this,_u);M(this,Df);M(this,Fu);M(this,Ge,void 0);M(this,Rr,Q6);M(this,el,0);M(this,vi,void 0);M(this,Nr,!1);M(this,_t,[]);M(this,Eu,0);M(this,tl,!1);M(this,pa,"collapsed");d(this,"expandedFactor",0);M(this,da,"all-floors");M(this,Du,l(()=>{let t=s(this,Ge).call(this);if(s(this,Eu)===this.expandedFactor||t==null||!s(this,Nr))return;T(this,Eu,this.expandedFactor);let i=hr(this.expandedFactor,0,1,0,s(this,Rr)),o=hr(this.expandedFactor,0,.1,0,1)===0;s(this,_t).forEach((a,u)=>{t.renderer.setState(a.containerId,{visible:o?a.id===t.currentFloorId:!0,altitude:i*u})}),this.expandedFactor===0?(T(this,Nr,!1),t.renderer.camera.setPanMode("default"),s(this,eo)&&s(this,eo).call(this)):this.expandedFactor===1&&(T(this,Nr,!1),s(this,eo)&&s(this,eo).call(this))},"#handlePreRender"));M(this,Ou,l(()=>{var t,i,n;this.expanded&&T(this,el,(i=(t=s(this,Ge).call(this))==null?void 0:t.renderer.camera.elevation)!=null?i:0),(n=s(this,Ge).call(this))==null||n.renderer.on("user-interaction-end",s(this,Au))},"#handleUserInteractionStart"));M(this,Lu,l(()=>{var i;let t=s(this,Ge).call(this);if(t!=null&&this.expanded&&s(this,tl)&&!s(this,Nr)){let n=[1/0,t.currentFloorId];for(let o=0;o<s(this,_t).length;o++){let a=s(this,_t)[o],u=Math.abs(((i=t.renderer.camera.elevation)!=null?i:0)-o*s(this,Rr));u<s(this,Rr)/3&&(n[0]=u,n[1]=a.id)}n[1]!==t.currentFloorId&&(t.currentFloorId=n[1],s(this,_t).forEach(o=>{t.renderer.setState(o.containerId,{visible:s(this,da)==="all-floors"?!0:t.currentFloor.id===o.id})}),t.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:t.currentFloorId}))}},"#determineCurrentMapBasedOnElevation"));M(this,Au,l(()=>{var i,n;let t=s(this,Ge).call(this);if(this.expanded&&t&&s(this,el)!==((i=t.renderer.camera.elevation)!=null?i:0)){let o=[1/0,t.currentFloorId,0];for(let a=0;a<s(this,_t).length;a++){let u=s(this,_t)[a],c=Math.abs(((n=t.renderer.camera.elevation)!=null?n:0)-a*s(this,Rr));c<o[0]&&(o[0]=c,o[1]=u.id,o[2]=a*s(this,Rr))}s(this,tl)&&U(this,Df,e8).call(this,o[2]),T(this,el,0),t.renderer.off("user-interaction-end",s(this,Au))}},"#handleUserInteractionEnd"));M(this,on,null);M(this,ku,null);M(this,eo,void 0);T(this,Ge,t);let i=s(this,Ge).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,Ou)),i.renderer.on("camera-change",s(this,Lu)),i.renderer.on("pre-render",s(this,Du)))}get state(){return s(this,pa)}get expanded(){return s(this,pa)!=="collapsed"}get gapBelowFloors(){return s(this,Rr)}get includedFloors(){var t;return(t=s(this,_u,Hv))!=null&&t.api.mapData?s(this,_t).map(i=>{var n,o;return(o=(n=s(this,_u,Hv))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,da)}setFloorVisiblityMode(t){T(this,da,t);let i=s(this,Ge).call(this);i!=null&&s(this,_t).forEach(n=>{i.renderer.setState(n.containerId,{visible:s(this,da)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(t){T(this,tl,t)}async expand(t){var n,o,a;let i=s(this,Ge).call(this);if(i!=null)return T(this,Rr,(n=t==null?void 0:t.distanceBetweenFloors)!=null?n:Q6),T(this,_t,(t==null?void 0:t.includedFloors)!=null&&(t==null?void 0:t.includedFloors.length)>0?t==null?void 0:t.includedFloors.map(u=>i.floorsById.get(u.id)).filter(Boolean):i.currentFloorStack.floorObjects),s(this,_t).sort((u,c)=>u.elevation-c.elevation),s(this,_t).length<=1||this.expanded===!0?Promise.resolve():(T(this,Nr,!0),i.api.Camera.setPanMode((o=t==null?void 0:t.cameraPanMode)!=null?o:"elevation"),this.changeFloorOnElevationChanges((a=t==null?void 0:t.changeFloorOnElevationChanges)!=null?a:!0),U(this,Fu,Uv).call(this,"expand",t).then(()=>{T(this,pa,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{T(this,Nr,!1)}))}async collapse(t){let i=s(this,Ge).call(this);if(i!=null)return this.expanded===!0?(T(this,Nr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),U(this,Fu,Uv).call(this,"collapse",t).then(()=>{T(this,pa,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{T(this,Nr,!1)})):Promise.resolve()}destroy(){let t=s(this,Ge).call(this);t!=null&&(t.renderer.off("user-interaction-start",s(this,Ou)),t.renderer.off("camera-change",s(this,Lu)),t.renderer.off("pre-render",s(this,Du)))}};Ge=new WeakMap,Rr=new WeakMap,el=new WeakMap,vi=new WeakMap,Nr=new WeakMap,_t=new WeakMap,Eu=new WeakMap,tl=new WeakMap,pa=new WeakMap,_u=new WeakSet,Hv=l(function(){return s(this,Ge).call(this)},"#currentMap"),da=new WeakMap,Du=new WeakMap,Ou=new WeakMap,Lu=new WeakMap,Au=new WeakMap,on=new WeakMap,Df=new WeakSet,e8=l(function(t){var n,o,a;s(this,on)&&s(this,on).stop();let i=s(this,Ge).call(this);i!=null&&(T(this,on,new Bt({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:t},150).easing(He.Quadratic.Out).onComplete(()=>{var u;s(this,on)&&((u=s(this,Ge).call(this))==null||u.renderer.getTweenGroup().remove(s(this,on)))}).onUpdate(({elevation:u})=>{i.renderer.camera.setElevation(u)}).start()),(o=s(this,Ge).call(this))==null||o.renderer.getTweenGroup().add(s(this,on)),(a=s(this,Ge).call(this))==null||a.renderer.render())},"#animateElevationTo"),ku=new WeakMap,eo=new WeakMap,Fu=new WeakSet,Uv=l(function(t,i){var u,c,p,f;s(this,vi)&&s(this,vi).stop();let n=s(this,Ge).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,_t).indexOf(n.currentFloor)*s(this,Rr),a=(u=n.renderer.camera.elevation)!=null?u:0;return T(this,ku,new Promise(y=>{T(this,eo,y)})),T(this,vi,new Bt({percentExpanded:this.expandedFactor}).to({percentExpanded:t==="expand"?1:0},(c=i==null?void 0:i.duration)!=null?c:ZA).easing(Ws[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:y})=>{this.expandedFactor=y,n.renderer.camera.setElevation(t==="expand"?o*y:a*y)}).onComplete(()=>{var y;s(this,vi)&&((y=s(this,Ge).call(this))==null||y.renderer.getTweenGroup().remove(s(this,vi)))}).start()),s(this,vi).cameraAnimation=!0,(p=s(this,Ge).call(this))==null||p.renderer.getTweenGroup().add(s(this,vi)),(f=s(this,Ge).call(this))==null||f.renderer.render(),s(this,ku)},"#animate"),l(Wv,"StackedMaps");var Iu=Wv;m();var Xv=class Xv{constructor(e,t,i){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"footprint");d(this,"containerId");var o;this.id=e.id,this.externalId=e.externalId,this.name=e.name,this.type=e.type,this.metadata=e.metadata,this.footprint=e.footprint,this.floorIds=(o=e.floors)!=null?o:e.maps;let n=i.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=n.id.toString()}get defaultFloor(){return this.floorObjects.length===0&&A.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor.")),this.floorObjects.reduce((e,t)=>Math.abs(t.elevation)<Math.abs(e.elevation)?t:e)}addFloor(e){if(this.floorObjectsByElevation.has(e.elevation)){A.error("Floor with same elevation ".concat(e.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(e.id,") will not be added."));return}e.load(),this.floorObjects.push(e),this.floorObjectsByElevation.set(e.elevation,e)}};l(Xv,"FloorStackObject");var Bu=Xv;var zA={linear:He.Linear.None,easeIn:He.Quadratic.In,easeOut:He.Quadratic.Out,easeInOut:He.Quadratic.InOut},Zv=class Zv extends J{constructor(t,i,n,o){var p,f;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"styleMap");d(this,"StackedMaps");d(this,"animations",new Map);d(this,"Models",{add:(t,i,n)=>{let{floorId:o,...a}=n,u=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addModelGroup(t,{type:"FeatureCollection",features:i.map(p=>{var f;return{type:"Feature",properties:{id:ae(),rotation:(f=p.rotation)==null?void 0:f.map(y=>y*(Math.PI/180)),scale:p.scale,interactive:p.interactive},geometry:{type:"Point",coordinates:ri(p.target)}}})},{url:a.url},u.id);if(c==null)throw new Error("error creating model");return this.renderer.getState(c).children},remove:(t,i)=>{this.renderer.remove(t),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});d(this,"Images",{add:(t,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...u}=n,c=o?this.floorsById.get(o):this.currentFloor,p={type:"Feature",properties:u,geometry:{type:"Point",coordinates:t}};return this.renderer.addImage(ae(),p,{url:i,flipImageToFaceCamera:a!=null?a:!1},c.id)},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});d(this,"Markers",{add:(t,i,n)=>this.renderer.addMarker2D(ri(t),i,n,t.floorId),remove:t=>{this.renderer.remove(t)},getContentEl:t=>{let i=this.renderer.getState(t);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(t,i,n)=>{let o=this.renderer.getState(t);if(!o){A.error('Failed to retrieve state for Marker with id "'.concat(t,'".'));return}if(o.type!=="marker"){A.error('Geometry with id "'.concat(t,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:n!=null?n:this.currentFloorId})},animateTo:(t,i,n,o)=>{let a=this.renderer.getState(t);if(!a)return A.error('Failed to retrieve state for Marker with id "'.concat(t,'".')),Promise.resolve();if(a.type!=="marker")return A.error('Geometry with id "'.concat(t,'" is not of type "marker".')),Promise.resolve();let u={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(t);let c=new Bt({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},u.duration).easing(zA[u.easing]).onUpdate(({lon:p,lat:f})=>{this.renderer.getState(t)?this.Markers.setPosition(t,[p,f],n):this.cancelAnimation(t)}).start();return this.renderer.getTweenGroup().add(c),this.renderer.render(),this.animations.set(t,c),Vg(c).then(()=>{this.animations.delete(t)})}});d(this,"Exporter",{getCurrentSceneGLTF:async t=>this.renderer.getCurrentSceneGLTF(t)});d(this,"Shapes",{add:(t,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=ae();return this.renderer.addGeometryGroup(a,t,i,o.id),a},remove:t=>(this.renderer.remove(t.id),t.id)});d(this,"Labels",{all:({onCreate:t})=>{for(let i of Object.entries(this.mvf.space)){let[n,o]=i;o&&o.features.forEach(a=>{var y,g,v;let u=(y=this.api.getMapData())==null?void 0:y.getById("space",a.properties.id);if(!u)return;let c=(g=this.styleMap[a.properties.id])==null?void 0:g.showImage,p=(v=a.properties.details)==null?void 0:v.images,f={};if(c&&p&&p.length>0&&(f={marker:{icon:p[0].url}}),a.properties.center&&a.properties.externalId!==""){let x=this.renderer.addLabel2D(a.properties.center,a.properties.externalId,{id:a.properties.id+"-label",appearance:f},n);x&&t(x.id,a.properties.externalId,u)}})}},add:(t,i,n={})=>{let{floorId:o,...a}=n,u=o?this.floorsById.get(o):this.currentFloor,c=this.renderer.addLabel2D(t,i,a,u.containerId);if(!c)throw new Error("label creating failed");return c},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});d(this,"Paths",{add:(t,i)=>{var p;let n=[],o=t[0].floorId||"root",a=0;for(let f of t){let{floorId:y="root",latitude:g,longitude:v}=f;y!==o&&(a++,o=y),n[a]==null&&n.push({floorId:y,coordinates:[]}),n[a].coordinates.push([v,g])}let u=n.reduce((f,{floorId:y,coordinates:g},v)=>{if(v!==0){let P=n[v-1],b=g[0],S=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:P.floorId},geometry:{type:"Point",coordinates:P.coordinates[P.coordinates.length-1]}},{type:"Feature",properties:{parentId:y},geometry:{type:"Point",coordinates:b}}]},i,this.id);S&&f.push(S)}let x=this.renderer.addPath({type:"FeatureCollection",features:g.map(P=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:P}}))},i,y);return x&&f.push(x),f},[]),c=new Bt({fraction:0}).to({fraction:1},(p=i==null?void 0:i.drawDuration)!=null?p:1e3).onUpdate(({fraction:f})=>{u.forEach(y=>{this.renderer.setState(y.id,{completeFraction:f})})}).start();return this.renderer.getTweenGroup().add(c),this.renderer.render(),this.animations.set(u[0].id.toString(),c),{paths:u,animation:Vg(c).then(()=>{this.animations.delete(u[0].id.toString())})}},remove:t=>{t.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});this.renderer=o.core,this.api=o,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.StackedMaps=new Iu({currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{},this.api=o;let a=Jx(this.mvf["styles.json"]||{});if(this.styleMap=a,!i){this.id!=="outdoors-container"&&A.warn("Map (".concat(this.id,") created with no data."));let y=new Bu({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(y.id,y),this.currentFloorStackId=y.id;let g=new xc(y.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,n!=null?n:{});y.addFloor(g),this.floorsById.set(g.id,g),this.setFloor(g.id);return}let u=i.getMVFFeatureByType("floor-stack");(u==null||u.length===0)&&A.throw("MVF does not contain any Floor Stacks.");for(let y of u){let g=new Bu(y,this.id,this.renderer);if(g.floorIds.length!==0){for(let v of g.floorIds){let x=i.getMVFFeatureById("floor",v);if(x!=null){let P=this.mvf.space[x.id],b=this.mvf.obstruction[x.id];if((P==null||P.features.length===0)&&(b==null||b.features.length===0))continue;let S=new xc(g.id,x,this.renderer,n!=null?n:{},this.mvf,a);g.addFloor(S),this.floorsById.set(S.id,S)}}this.floorStacksById.set(y.id,g),this.currentFloorStackId||(this.currentFloorStackId=y.id)}}let c=(f=this.mvf.enterprise)==null?void 0:f.venue.defaultMap;if(n!=null&&n.initialFloor){let y=Xl(n.initialFloor);y&&this.floorsById.has(y)?c=y:A.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let t=this.floorStacksById.get(this.currentFloorStackId);return t||A.throw('Floor stack with id "'.concat(this.currentFloorStackId,'" not found')),t}setFloorStack(t){if(this.currentFloorStackId===t)return;let i=this.floorStacksById.get(t);if(i==null){A.error("Invalid floor stack passed to setFloorStack (".concat(t,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){A.error("Floor stack (".concat(t,") 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 t=this.floorsById.get(this.currentFloorId);return t||A.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),t}get floors(){return Array.from(this.floorsById.values())}setFloor(t,i){if(this.currentFloorId!==t){if(!this.floorsById.has(t)){A.error("Invalid floor passed to setFloor (".concat(t,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}this.publish("floor-change-start",{floorId:t}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.currentFloorStack.floorObjects.forEach(n=>{n.id!==t&&this.renderer.setState(n.containerId,{visible:!1})}),this.currentFloorId=t,this.currentFloorStackId=this.currentFloor.floorStackId,this.renderer.setState(this.currentFloor.containerId,{visible:!0}),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(t){let i=this.animations.get(t);i&&(i.stop(),this.animations.delete(t),this.renderer.getTweenGroup().remove(i))}};l(Zv,"GeojsonApiMapObject");var Ru=Zv;m();var Gr,Gu,zv=class zv{constructor({currentMapGetter:e}){M(this,Gr,new Map);M(this,Gu,void 0);T(this,Gu,e)}get currentMap(){return s(this,Gu).call(this)}getById(e){return s(this,Gr).get(e)}add(e,t,i){let n=mt(e);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,t,{...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 u=o.Markers.getContentEl(a.id.toString());if(!u)throw new Error("marker component should exist");let c=new Ui(a.id.toString(),u,e);return s(this,Gr).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(e){var i;let t=s(this,Gr).get(e.id);t&&((i=this.currentMap)==null||i.Markers.remove(t.entityId),s(this,Gr).delete(e.id.toString()))}removeAll(){let e=[];return s(this,Gr).forEach(({marker:t})=>{this.remove(t),e.push(t),s(this,Gr).delete(t.id.toString())}),e}setPosition(e,t){var a;let i=mt(t);if(!i){A.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){A.error("Cannot determine the current map.");return}let o=s(this,Gr).get(e.id);if(!o){A.error('Cannot find the Marker with id "'.concat(e.id,'".'));return}n.Markers.setPosition(o.entityId,ri(i),(a=i.floorId)!=null?a:n.currentFloorId)}animateTo(e,t,i){var u;let n=mt(t);if(!n)return A.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return A.error("Cannot determine the current map."),Promise.resolve();let a=s(this,Gr).get(e.id);return a?o.Markers.animateTo(a.entityId,ri(n),(u=n.floorId)!=null?u:o.currentFloorId,i):(A.error('Cannot find the Marker with id "'.concat(e.id,'".')),Promise.resolve())}};Gr=new WeakMap,Gu=new WeakMap,l(zv,"Markers");var Nu=zv;m();var an,ju,Yv=class Yv{constructor({currentMapGetter:e}){M(this,an,new Map);M(this,ju,void 0);T(this,ju,e)}get currentMap(){return s(this,ju).call(this)}getById(e){return s(this,an).get(e)}add(e,t,i){let n=mt(e);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(ri(n),t,{...i,floorId:n.floorId});if(!a)throw new Error("image component should exist");let u=new ac(a.id.toString(),t,e);return s(this,an).set(u.id,{image:u,entityId:a.id.toString()}),u}remove(e){var i;let t=s(this,an).get(e.id);t&&((i=this.currentMap)==null||i.Images.remove(t.entityId),s(this,an).delete(e.id.toString()))}removeAll(){let e=[];return s(this,an).forEach(({image:t})=>{this.remove(t),e.push(t),s(this,an).delete(t.id.toString())}),e}};an=new WeakMap,ju=new WeakMap,l(Yv,"Images");var Vu=Yv;m();var bi,Uu,qv=class qv{constructor({currentMapGetter:e}){M(this,bi,new Map);M(this,Uu,void 0);T(this,Uu,e)}get currentMap(){return s(this,Uu).call(this)}getById(e){return s(this,bi).get(e)}add(e,t){let i=Array.isArray(e)?e:[e],n=i.reduce((u,c)=>{var f;let p=mt(c.target);return p?(u.has(p.floorId)||u.set(p.floorId,[]),(f=u.get(p.floorId))==null||f.push({...c,target:p}),u):(A.error("Cannot determine coordinate from options."),u)},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((u,c)=>{let p=ae();o.Models.add(p,u,{...t,floorId:c}).forEach(({id:y})=>{let g=new cc(y.toString(),p);s(this,bi).set(g.id,{model:g,entityId:y.toString(),groupId:p}),a.push(g)})}),a}remove(e){var i;let t=s(this,bi).get(e.id);t&&((i=this.currentMap)==null||i.Models.remove(t.entityId,t.groupId),s(this,bi).delete(e.id.toString()))}removeAll(){let e=[];return s(this,bi).forEach(({model:t})=>{var n;let i=s(this,bi).get(t.id);i&&(e.push(t),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,bi).delete(t.id.toString()))}),e}};bi=new WeakMap,Uu=new WeakMap,l(qv,"Models");var Hu=qv;m();var Ci,Xu,$v=class $v{constructor({currentMapGetter:e}){M(this,Ci,new Map);M(this,Xu,void 0);T(this,Xu,e)}get currentMap(){return s(this,Xu).call(this)}getById(e){return s(this,Ci).get(e)}add(e,t){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=i.Paths.add(e,t),o=n.paths.map(u=>u.id.toString()),a=new Eo(ae(),n.animation,e);for(let u of o)s(this,Ci).set(u,{path:a,entityIds:o});return s(this,Ci).set(a.id,{path:a,entityIds:o}),a}remove(e){var i;let t=s(this,Ci).get(e.id);t&&((i=this.currentMap)==null||i.Paths.remove(t.entityIds),s(this,Ci).delete(e.id),t.entityIds.forEach(n=>s(this,Ci).delete(n)))}removeAll(){let e=[];return s(this,Ci).forEach(({path:t})=>{this.remove(t),e.push(t)}),e}};Ci=new WeakMap,Xu=new WeakMap,l($v,"Paths");var Wu=$v;m();var d8=ul(u0(),1);m();var Jv="#2266ff",YA="#808080",t8="#f5f5f5";var r8={radius:10,color:Jv,inactiveColor:YA,heading:{color:Jv,opacity:.7},accuracyRing:{color:Jv,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var i8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var n8=l((r,e,t=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=t/Math.tan(r/2),n=t/Math.sin(r/2),o=n+e,a=10,u=new Hr;u.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let c=0;c<a;c++)u.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++)u.lineTo(-(t*Math.sin(Math.PI/-2+Math.PI/a*c)),t*Math.cos(Math.PI/-2+Math.PI/a*c));return new Ur(u,{depth:.1,bevelEnabled:!1,UVGenerator:$A(e)})},"createSectorGeometry"),Kv=l((r,e,t)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))/t;return n>1?n=1:n<0&&(n=0),new te(0,n)},"generateRadialUV"),$A=l(r=>({generateTopUV:(e,t,i,n,o)=>{let a=t[i*3],u=t[i*3+1],c=t[n*3],p=t[n*3+1],f=t[o*3],y=t[o*3+1];return[Kv(a,u,r),Kv(c,p,r),Kv(f,y,r)]},generateSideWallUV:()=>[new te(0,1),new te(0,1),new te(0,1),new te(0,1)]}),"radialUVGenerator");function o8(r,e){if(e==null)return r;let t={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 e&&(t.latitude=(e==null?void 0:e.latitude)==null||e.latitude==="device"?r==null?void 0:r.latitude:e.latitude),"longitude"in e&&(t.longitude=e.longitude==null||e.longitude==="device"?r==null?void 0:r.longitude:e.longitude),"accuracy"in e&&(t.accuracy=e.accuracy==="device"?r==null?void 0:r.accuracy:e.accuracy),"floor"in e&&(t.floor=e.floor==="device"?r==null?void 0:r.floor:e.floor),"heading"in e&&(t.heading=e.heading==="device"?r==null?void 0:r.heading:e.heading),t}l(o8,"getPositionWithOverrides");function JA([r,e],[t,i],[n,o]){let a=t-r,u=i-e,c=a**2+u**2;if(c===0)return;let p=((n-r)*a+(o-e)*u)/c,f;p<=0?f=[r,e]:p>=1?f=[t,i]:f=[r+p*a,e+p*u];let y=bp([n,o],f);return{proportion:Math.max(0,Math.min(1,p)),intersection:f,distance:y}}l(JA,"getPointLineIntersection");function a8(r,e){if(r==null||r.length<2)return;let t=Number.MAX_SAFE_INTEGER,i,n=0,o=0;for(let a=0;a<r.length-1;a++){let u=r[a],c=r[a+1],p=JA(u,c,e);p!=null&&p.distance<t&&(t=p.distance,i=p.intersection,n=a,o=p.proportion)}if(i)return{intersection:i,distance:t,segmentIndex:n,proportion:o}}l(a8,"findBlueDotOnPath");function s8(r,e){let t=new Wr({color:r,opacity:e,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=n8(Math.PI/6,n,i);new wa().load(i8,u=>{t.alphaMap=u,t.needsUpdate=!0});let a=new Te(o,t);return a.position.z=-.05,a.renderOrder=0,a}l(s8,"createHeadingCone");function l8(r,e){let t=new hp(1,1,.05,32),i=new Wr({transparent:!0,color:r,opacity:e,depthTest:!1,depthWrite:!1}),n=new Te(t,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}l(l8,"createAccuracyRing");function c8(r){let e=new hp(.35,.35,.07,32),t=new Wr({transparent:!0,color:t8,depthTest:!1,depthWrite:!1}),i=new Te(e,t);i.renderOrder=2;let n=new hp(.35*.8,.35*.8,.01,32),o=new Wr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Te(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}}l(c8,"createBlueDot");var h8=ul(u8(),1);var ha,sn,Qt,er,ln,fa,ma,ya,We,Nt,Zu,cn,zu,Yu,qu,$u,Lf,xi,un,Af,ga,Ju,Si,Qv=class Qv extends J{constructor(t,i){super();this.core=t;this.geoJSONApi=i;M(this,ha,null);d(this,"geometry");M(this,sn,void 0);M(this,Qt,void 0);M(this,er,void 0);M(this,ln,void 0);M(this,fa,void 0);M(this,ma,void 0);M(this,ya,void 0);M(this,We,r8);M(this,Nt,1);M(this,Zu,void 0);M(this,cn,void 0);d(this,"state","disabled");d(this,"following",!1);M(this,zu,l(t=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",t)},"#getFloorByFloorId"));M(this,Yu,l(t=>{var n;let i;if(t!=null){let o=(n=this.geoJSONApi.currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(t);i=o?s(this,zu).call(this,o.id):void 0}return i},"#getFloorByFloorLevel"));M(this,qu,l(t=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=t.children;if(s(this,Lf).call(this),n.scale.set(s(this,Nt),s(this,Nt),s(this,Nt)),n.position.z=.07/2*s(this,Nt),o.scale.set(s(this,Nt),s(this,Nt),s(this,Nt)),o.position.z=.07*s(this,Nt),this.state==="active"){o.material.color.set(s(this,We).color);let u=this.accuracy;u!=null?(i.visible=!0,s(this,ma)&&s(this,ma).stop(),T(this,ma,new Bt({scale:i.scale.x}).to({scale:u/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(s(this,ma))):i.visible=!1;let c=this.heading;c!=null?(a.visible=!0,s(this,ya)&&s(this,ya).stop(),T(this,ya,new Bt({rotation:a.rotation.z}).to({rotation:-ye.degToRad(c)},150).onUpdate(({rotation:p})=>{a.rotation.z=p}).start()),this.core.getTweenGroup().add(s(this,ya)),a.scale.set(s(this,Nt),s(this,Nt),1)):a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,We).inactiveColor),a.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));M(this,$u,l(t=>{var a,u;let i;try{i=rk.parse(o8(t,s(this,Qt)))}catch(c){s(this,xi).call(this,"error"),A.error("BlueDot: Position parse failed",c instanceof L.ZodError?c.message:String(c)),this.publish("error");return}s(this,We).debug&&A.log("BlueDot: Parsed position",i),T(this,er,i),s(this,xi).call(this,"position-update"),s(this,ln)&&clearTimeout(s(this,ln)),typeof s(this,We).timeout=="number"&&s(this,We).timeout<1/0&&T(this,ln,setTimeout(()=>{s(this,We).debug&&A.log("BlueDot: Position timed out after ".concat(s(this,We).timeout,"ms")),s(this,xi).call(this,"timeout"),this.core.render()},s(this,We).timeout)),(u=this.geoJSONApi.getMapDataInternal())==null||u.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 p=l8(s(this,We).accuracyRing.color,s(this,We).accuracyRing.opacity),{outerMesh:f,innerMesh:y}=c8(s(this,We).color),g=s8(s(this,We).heading.color,s(this,We).heading.opacity);c.add(p),p.visible=!1,c.add(f),c.add(y),c.add(g),g.visible=!1,s(this,qu).call(this,c)},update:s(this,qu)},{visible:!0},n);else{let c=this.core.getState(this.geometry);o=[c.position[0],c.position[1]]}s(this,fa)&&s(this,fa).stop(),T(this,fa,new Bt(o).to([i.longitude,i.latitude],1e3).easing(He.Cubic.Out).onUpdate(c=>{if(this.geometry){let p={position:[c[0],c[1]]};p.parent=n,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(s(this,fa)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",l(t=>{var i,n,o,a,u;if(this.state!=="disabled"){try{tk.parse(t)}catch(c){s(this,xi).call(this,"error"),A.error("BlueDot: Browser sent invalid position",c instanceof L.ZodError?c.message:String(c)),this.publish("error");return}T(this,sn,{latitude:(i=t.coords)==null?void 0:i.latitude,longitude:(n=t.coords)==null?void 0:n.longitude,accuracy:(o=t.coords)==null?void 0:o.accuracy,heading:(a=t.coords)==null?void 0:a.heading,floor:s(this,Yu).call(this,(u=t.coords)==null?void 0:u.floorLevel)}),s(this,$u).call(this,s(this,sn))}},"onPositionUpdate"));d(this,"onPositionError",l(t=>{var i;switch(s(this,xi).call(this,"error"),t.code){case t.PERMISSION_DENIED:A.error("Geolocation permission denied by the user.",t),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:A.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:A.error("Geolocation request timed out.",t);break;default:A.error("An unknown geolocation error occurred.",t);break}this.publish("error",t)},"onPositionError"));M(this,Lf,l(()=>{var i;let t=Math.round(this.core.camera.zoomLevel*1e5);if(t!==s(this,Zu)){T(this,Zu,t);let n=(i=this.core.getMetresPerPixel())!=null?i:1;T(this,Nt,Math.max(s(this,We).radius/(.35/n),1))}},"#updateScale"));M(this,xi,l(t=>{let i=ek[this.state].actions[t];if(i){switch(s(this,We).debug&&A.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(t)),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:t}),this.state=i)}else A.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(t))},"#transitionAction"));M(this,un,void 0);M(this,Af,l(()=>{if(s(this,un)==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);T(this,un,(0,h8.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,un)},"#getSimplifiedDirections"));M(this,ga,l(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,Si)&&(this.off("position-update",s(this,Si)),T(this,Si,void 0)),this.following=!1,T(this,un,void 0),this.core.off("user-interaction-start",s(this,ga)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,Ju)),this.publish("follow-change",{following:!1})},"#cancelFollow"));M(this,Ju,l(()=>{T(this,un,void 0)},"#pathChangeHandler"));M(this,Si,void 0);d(this,"follow",l((t,i)=>{var o,a,u,c;if(t===!1){s(this,ga).call(this);return}t!=="position-only"&&(i==null?void 0:i.bearing)!=null&&A.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(t,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:t==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(u=i==null?void 0:i.duration)!=null?u:1e3,easing:(c=i==null?void 0:i.easing)!=null?c:"ease-in-out"};this.following?s(this,Si)&&this.off("position-update",s(this,Si)):(this.following=!0,this.core.on("user-interaction-start",s(this,ga)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,Ju))),T(this,Si,p=>{let{coordinate:f,heading:y,floor:g}=p;if(n.center=[f.longitude,f.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),T(this,un,void 0)),t==="position-and-heading")n.bearing=y!=null?y:void 0;else if(t==="position-and-path-direction"){let v=s(this,Af).call(this);if(v!=null){let x=a8(v,[f.longitude,f.latitude]);if(x!=null){let P=v[x.segmentIndex],b=v[x.segmentIndex+1];n.bearing=Rb(P,b)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,Si)),this.publish("follow-change",{following:!0,mode:t})},"follow"))}get heading(){var t;return(t=s(this,er))==null?void 0:t.heading}get accuracy(){var t;return(t=s(this,er))==null?void 0:t.accuracy}get coordinate(){var t,i;if(s(this,er)!=null)return(s(this,cn)==null||((t=this.floor)==null?void 0:t.id)!==s(this,cn).floorId||s(this,er).latitude!==s(this,cn).latitude||s(this,er).longitude!==s(this,cn).longitude)&&T(this,cn,new ue(s(this,er).latitude,s(this,er).longitude,(i=this.floor)==null?void 0:i.id)),s(this,cn)}get floor(){var t;return(t=s(this,er))==null?void 0:t.floor}enable(t){T(this,We,(0,d8.default)({},t,s(this,We))),s(this,xi).call(this,"enable"),this.watchDevicePosition(s(this,We).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,ln)&&(clearTimeout(s(this,ln)),T(this,ln,void 0)),this.following&&s(this,ga).call(this),this.watchDevicePosition(!1),T(this,er,void 0),T(this,Qt,void 0),s(this,xi).call(this,"disable")}watchDevicePosition(t){if(s(this,ha)&&(navigator.geolocation.clearWatch(s(this,ha)),T(this,ha,null)),s(this,sn)&&T(this,sn,void 0),t){if(this.state==="disabled"){A.warn("BlueDot must be enabled before watching browser position.");return}T(this,ha,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t){var n,o;t==null?T(this,Qt,void 0):"coords"in t?T(this,Qt,Object.assign({},s(this,Qt),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:s(this,Yu).call(this,t.coords.floorLevel)})):(T(this,Qt,Object.assign({},s(this,Qt),t)),"floorOrFloorId"in t&&(s(this,Qt).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?s(this,zu).call(this,t.floorOrFloorId):t.floorOrFloorId)),(((n=s(this,Qt))==null?void 0:n.latitude)!=null&&((o=s(this,Qt))==null?void 0:o.longitude)!=null||s(this,sn)!=null)&&s(this,$u).call(this,s(this,sn))}};ha=new WeakMap,sn=new WeakMap,Qt=new WeakMap,er=new WeakMap,ln=new WeakMap,fa=new WeakMap,ma=new WeakMap,ya=new WeakMap,We=new WeakMap,Nt=new WeakMap,Zu=new WeakMap,cn=new WeakMap,zu=new WeakMap,Yu=new WeakMap,qu=new WeakMap,$u=new WeakMap,Lf=new WeakMap,xi=new WeakMap,un=new WeakMap,Af=new WeakMap,ga=new WeakMap,Ju=new WeakMap,Si=new WeakMap,l(Qv,"BlueDot");var il=Qv,ek={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"}}},tk=L.object({coords:L.object({latitude:L.number(),longitude:L.number(),accuracy:L.number(),altitude:L.number().optional().nullable(),altitudeAccuracy:L.number().optional().nullable(),heading:L.number().optional().nullable(),speed:L.number().optional().nullable(),floorLevel:L.number().optional().nullable()}),timestamp:L.number()}),rk=L.object({latitude:L.number(),longitude:L.number(),floor:L.custom().optional(),accuracy:L.number().optional(),heading:L.number().optional().nullable()});m();var pn,Qu,eb=class eb{constructor({currentMapGetter:e}){M(this,pn,new Map);M(this,Qu,void 0);T(this,Qu,e)}get currentMap(){return s(this,Qu).call(this)}getById(e){return s(this,pn).get(e)}add(e,t,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(e,t||{},{floorId:i==null?void 0:i.id}),a=new Rn(o);return s(this,pn).set(a.id,a),a}remove(e){var i;s(this,pn).get(e.id)&&((i=this.currentMap)==null||i.Shapes.remove(e),s(this,pn).delete(e.id.toString()))}removeAll(){let e=[];return s(this,pn).forEach(t=>{this.remove(t),e.push(t.id),s(this,pn).delete(t.id.toString())}),e}};pn=new WeakMap,Qu=new WeakMap,l(eb,"Shapes");var Ku=eb;m();var tp,tb=class tb{constructor({currentMapGetter:e}){M(this,tp,void 0);T(this,tp,e)}get currentMap(){return s(this,tp).call(this)}setFromStyleCollection(e){var t,i,n;for(let o in e)for(let a of((t=this.currentMap)==null?void 0:t.floors)||[])if(e[o]!=null){if(a.layers.has(o)&&"color"in e[o]){let u=a.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(u,{color:e[o].color})}if(o===_n&&!(Qr in e)){let u=a.layers.get(Qr);u&&"color"in e[o]&&((n=this.currentMap)==null||n.renderer.setState(u,{color:e[o].color}))}}}};tp=new WeakMap,l(tb,"Style");var ep=tb;m();var rb={opacity:1},pt,rp,ip,ro,dn,np,ib,kf,f8,nb=class nb{constructor(e,t){M(this,np);M(this,kf);M(this,pt,void 0);M(this,rp,void 0);M(this,ip,{opacity:"initial"});M(this,ro,{opacity:new Map});M(this,dn,new Set);T(this,pt,e),T(this,rp,t||[]);let i=s(this,pt).map;i&&i.on("idle",()=>{s(this,ro).opacity.size||U(this,np,ib).call(this,i)})}setStyle(e){var t,i;if(s(this,pt).map){(t=s(this,pt).map)==null||t.setStyle(e),s(this,dn).size&&(s(this,dn).clear(),this.hide()),U(this,kf,f8).call(this),U(this,np,ib).call(this,s(this,pt).map),this.setOpacity(s(this,ip).opacity),(i=s(this,pt).map)==null||i.moveLayer(Rc);for(let[n,o]of s(this,rp)||[])s(this,pt).hideOutdoorLayersUnderPoint(n,o)}}get map(){return s(this,pt).map}get enabled(){return!!s(this,pt).map}get visible(){return s(this,dn).size===0}show(){let e=s(this,pt).map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(i=>{s(this,dn).has(i.id)&&e.setLayoutProperty(i.id,"visibility","visible")}),s(this,dn).clear())}hide(e=[]){let t=s(this,pt).map;if(!t)return;let i=t.getStyle().layers;i&&i.forEach(n=>{let o=t.getLayoutProperty(n.id,"visibility");!e.includes(n.id)&&o!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),s(this,dn).add(n.id))})}setOpacity(e,t=[]){var o;let i=s(this,pt).map;if(!i)return;let n=(o=s(this,pt).map)==null?void 0:o.getStyle().layers;n&&i.once("idle",()=>{n.forEach(a=>{let u=i.getLayoutProperty(a.id,"visibility");if(!t.includes(a.id)&&u!=="none")try{let c=s(this,ro).opacity.get(a.id);c!==void 0&&(a.id==="background"||(a.type==="symbol"?(i.setPaintProperty(a.id,"icon-opacity",e==="initial"?c[0]:e),i.setPaintProperty(a.id,"text-opacity",e==="initial"?c[1]:e)):i.setPaintProperty(a.id,"".concat(a.type,"-opacity"),e==="initial"?c[0]:e)),s(this,ip).opacity=e)}catch(c){A.warn("Error setting opacity:",c)}})})}};pt=new WeakMap,rp=new WeakMap,ip=new WeakMap,ro=new WeakMap,dn=new WeakMap,np=new WeakSet,ib=l(function(e){let t=e.getStyle().layers;t&&t.forEach(i=>{var o,a,u;e.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,ro).opacity.set(i.id,[(o=e.getPaintProperty(i.id,"icon-opacity"))!=null?o:rb.opacity,(a=e.getPaintProperty(i.id,"text-opacity"))!=null?a:rb.opacity]):s(this,ro).opacity.set(i.id,[(u=e.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?u:rb.opacity,void 0])))})},"#setInitialStyle"),kf=new WeakSet,f8=l(function(){Object.values(s(this,ro)).forEach(e=>e.clear())},"#clearInitialStyle"),l(nb,"Outdoor");var nl=nb;var Ff=.05,ob=class ob{constructor(e,t){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",l(()=>{this.core.render()},"update"));this.core=e,this.mapView=t,this.Camera=new gc(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new Ru("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i;let n=new uc(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=l(c=>p=>{var E,I,w;let f=[],y=[],g=[],v=[];p.labels.forEach(_=>{let D=this.Labels.getById(_.toString());D&&f.push(D.label)}),p.markers.forEach(_=>{let D=this.Markers.getById(_.toString())||this.Navigation.getMarkerById(_.toString());D&&y.push(D.marker)}),p.models.forEach(_=>{let D=this.Models.getById(_.toString());D&&g.push(D.model)}),p.paths.forEach(_=>{let D=this.Paths.getById(_.toString())||this.Navigation.getPathById(_.toString());D&&v.push(D.path)});let x=p.geometry[0],P;x&&(P=(E=this.getMapDataInternal())==null?void 0:E.getById("space",x)),P||(P=(I=this.getMapDataInternal())==null?void 0:I.getById("object",x));let b=p.containers.reduce((_,D)=>{var V;let R=(V=this.getMapDataInternal())==null?void 0:V.getById("floor",D);return R&&Bi.is(R)&&_.push(R),_},[]),S={coordinate:new ue(p.coordinate[1],p.coordinate[0],(w=b==null?void 0:b[0])==null?void 0:w.id),spaces:P&&Xt.is(P)?[P]:[],objects:P&&Zt.is(P)?[P]:[],markers:y,labels:f,models:g,paths:v,floors:b};"pointerEvent"in p&&(S.pointerEvent=p.pointerEvent),this.mapView.publish(c,S)},"createHandler");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 Nu(a),this.Models=new Hu(a),this.Labels=new bc(a),this.Exporter=new vc(a),this.Paths=new Wu(a),this.Navigation=new pc(this.core,this,a.currentMapGetter),this.BlueDot=new il(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 nl(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 Vu(a),this.Shapes=new Ku(a),this.Style=new ep(a);let u=new Kd(t,this.mapDataExternal);this.auto=u.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(e,t){if(e==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(_n);o&&this.core.setState(o,Ng(t,this.core.getState(o)))});return}else if(e==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Qr);o&&this.core.setState(o,Ng(t,this.core.getState(o)))});return}else if(e==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(za);o&&this.core.setState(o,Rd(t,this.core.getState(o)))});return}else if(e==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(Ya);o&&this.core.setState(o,Rd(t,this.core.getState(o)))});return}let i=typeof e=="string"?this.getMapDataObject(e):e;if(i){if(Fn.is(i))return this.core.setState(i.id,Zx({...t,type:"label"},this.core.getState(i.id)));if(Ui.is(i))return this.core.setState(i.id,zx({...t,type:"marker"},this.core.getState(i.id)));(Xt.is(i)||Zt.is(i))&&this.core.setState(i.id,Yx({...t,type:"geometry"},this.core.getState(i.id))),or.is(i)&&this.core.setState(i.id,Rd({...t,type:"doors"},this.core.getState(i.id))),Rn.is(i)&&this.core.setState(i.id,Nc(t,["altitude","color","opacity"]))}}getMapDataObject(e){var t;return(t=this.getMapDataInternal())==null?void 0:t.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return _a(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(i=>{var y,g,v;let n;try{n=_a(e)}catch(x){A.error("Error adding map",x),i(e);return}this.mapDataExternal[e.mapName]=e;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ue(a[1],a[0])});let u=o["manifest.geojson"].features[0].properties.name,c=new Ru("mapObject-".concat(u),n,t,this),p=this.core.getBoundingArea(c.currentFloor.id);p==null&&A.error("Could not determine bounding box for map:",c.currentFloor.id);let f=(g=(y=t==null?void 0:t.outdoorView)==null?void 0:y.layersHiddenByGeometry)!=null?g:[];if(f.length>0){let x=(v=this.core.getCenter(p))!=null?v:a;this.core.hideOutdoorLayersUnderPoint(x,f),this.hiddenOutdoorGeometries.push([x,f])}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=e,(t==null?void 0:t.zoomLevel)!=null?(this.core.camera.setZoomLevel(t.zoomLevel),i(e)):this.core.mode!=="outdoors-overlay"&&p?this.core.camera.focusOn(p,{duration:Ix,padding:{top:Ff*this.core.canvasHeight,left:Ff*this.core.canvasWidth,right:Ff*this.core.canvasWidth,bottom:Ff*this.core.canvasHeight}}).then(()=>{i(e)}):i(e)})}setFloor(e,t){return this.currentMap.setFloor(Xl(e),t)}setFloorStack(e){return this.currentMap.setFloorStack(Xl(e))}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){var i,n,o;let e=(n=(i=this.currentMap)==null?void 0:i.currentFloorStack)==null?void 0:n.id;e||A.throw("Missing currentFloorStack.");let t=(o=this.mapData)==null?void 0:o.getById("floor-stack",e);return t||A.throw("FloorStack was not found in map data."),t}get currentFloor(){var i,n;let e=(i=this.currentMap)==null?void 0:i.currentFloor.id;if(!e)throw new Error("Missing currentFloor object from GeoJsonApi");let t=(n=this.mapData)==null?void 0:n.getById("floor",e);if(!t)throw new Error("Missing currentFloor");return t}getState(e){var n,o;let t=Kx(e,this),i=this.core.getState(t);if(i)if(["interior-walls","exterior-walls"].includes(e)){let{color:a,topColor:u,texture:c,topTexture:p,visible:f}=i;return{type:"walls",visible:f,color:a,topColor:u,texture:c?{url:c}:void 0,topTexture:p?{url:p}:void 0}}else if(["interior-doors","exterior-doors"].includes(e)){let{color:a,topColor:u,texture:c,topTexture:p,visible:f,opacity:y}=i;return{type:"doors",visible:f,color:a,topColor:u,opacity:y,texture:c?{url:c}:void 0,topTexture:p?{url:p}: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;return{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:new ue(i.position[1],i.position[0],a.toString())}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="geometry-group"&&e&&typeof e!="string"&&Rn.is(e)){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(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return(e==null?void 0:e.type)==="map-view"?e.hoverColor:void 0}createCoordinate(e,t,i){return new ue(e,t,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(e,t,i){let n=this.core.projectScreenXYToCoordinate(e,t);return n?new ue(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(e){return this.core.isInView(typeof e=="string"?e:e.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()}};l(ob,"GeoJsonApi");var op=ob;m();var ap,re,va,ab=class ab extends J{constructor(t){super();M(this,ap,{});M(this,re,void 0);M(this,va,void 0);d(this,"Camera");d(this,"Labels");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",l(()=>{s(this,re).core.render()},"update"));d(this,"getDirections",l((t,i,n)=>{var o;return(o=s(this,re).getMapData())==null?void 0:o.getDirections(t,i,n)},"getDirections"));d(this,"getDirectionsMultiDestination",l((t,i,n)=>{var o;return(o=s(this,re).getMapData())==null?void 0:o.getDirectionsMultiDestination(t,i,n)},"getDirectionsMultiDestination"));d(this,"on",l((t,i)=>{super.on(t,i)},"on"));d(this,"off",l((t,i)=>{super.off(t,i)},"off"));T(this,va,t);let i=new op(t,this);T(this,re,i),this.Camera=s(this,re).Camera,T(this,ap,s(this,re).mapDataExternal),this.Markers=s(this,re).Markers,this.Models=s(this,re).Models,this.Labels=s(this,re).Labels,this.Exporter=s(this,re).Exporter,this.Paths=s(this,re).Paths,this.Navigation=s(this,re).Navigation,this.BlueDot=s(this,re).BlueDot,this.Shapes=s(this,re).Shapes,this.Style=s(this,re).Style,this.auto=s(this,re).auto,this.Outdoor=s(this,re).Outdoor,this.Images=s(this,re).Images,s(this,va).container.dataset.version=C.env.npm_package_version}get StackedMaps(){return s(this,re).currentMap.StackedMaps}updateState(t,i){return s(this,re).updateState(t,i)}getMapData(){return s(this,ap)}getDimensions(){return{width:s(this,va).canvasWidth,height:s(this,va).canvasHeight}}expand(t){var i;return(i=s(this,re).currentMap)==null?void 0:i.StackedMaps.expand(t)}collapse(t){var i;return(i=s(this,re).currentMap)==null?void 0:i.StackedMaps.collapse(t)}addMap(t,i){return s(this,re).addMap(t,i)}setFloor(t){return s(this,re).setFloor(t)}setFloorStack(t){return s(this,re).setFloorStack(t)}get currentFloorStack(){return s(this,re).currentFloorStack}get currentFloor(){return s(this,re).currentFloor}updateWatermark(t){s(this,re).updateWatermark(t)}getState(t){return s(this,re).getState(t)}setHoverColor(t){s(this,re).setHoverColor(t)}getHoverColor(){return s(this,re).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return s(this,re).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return s(this,re).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return s(this,re).isInView(t)}getDistance(t,i){var n;return(n=s(this,re).getMapData())==null?void 0:n.getDistance(t,i)}createCoordinate(t,i,n){return s(this,re).createCoordinate(t,i,n)}createCoordinateFromScreenCoordinate(t,i,n){return s(this,re).createCoordinateFromScreenCoordinate(t,i,n)}auto(){this.Labels.all()}get __core(){if(C.env.INTERNAL==="true")return s(this,re).core;throw new Error("__core is not available.")}clear(){s(this,re).clear()}destroy(){s(this,re).destroy()}async enableDebug(t={}){let{Inspector:i}=await import("./inspector-H3FZ2HUK.js");await new i(this,s(this,re)).enable(t)}};ap=new WeakMap,re=new WeakMap,va=new WeakMap,l(ab,"MapView");var ol=ab;m();m();var sb=class sb extends J{constructor(t){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",l(()=>{!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()))},"handleStyleChange"));d(this,"handleMove",l(()=>{if(!this.map)return;let[t,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(t,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ye.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ye.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",l(t=>{A.warn(t)},"handleError"));this.origin=t}onAdd(t){this.origin=this.origin||t.getCenter().toArray(),this.gl=t.painter.context.gl,this.core=new wu(t._container,{center:this.origin,zoomLevel:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),gl:this.gl,map:t,mode:"outdoors-overlay"}),this.map=t,this.core.camera.setMinZoomLevel(t.getMinZoom()),this.core.camera.setMaxZoomLevel(t.getMaxZoom()),this.core.camera.setMinPitch(t.getMinPitch()),this.core.camera.setMaxPitch(t.getMaxPitch()),this.map.on("error",this.handleError);let i=yp.fromLngLat(this.origin,0);return this.layer=mh(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}};l(sb,"MapLibreOverlay");var Bf=sb;var ba,al,io,Ca,sp=class sp extends J{constructor(t,i,n){super();M(this,ba,void 0);M(this,al,void 0);M(this,io,void 0);M(this,Ca,void 0);d(this,"on",l((t,i)=>{super.on(t,i)},"on"));d(this,"off",l((t,i)=>{super.off(t,i)},"off"));T(this,Ca,new Bf(t)),T(this,ba,i),T(this,al,n)}onAdd(t){var o,a;let i=s(this,Ca).onAdd(t),n={...Zl,...(o=s(this,al))!=null?o:{},outdoorView:{token:s(this,ba).outdoorViewToken,...(a=s(this,al))==null?void 0:a.outdoorView}};return T(this,io,new ol(s(this,Ca).core)),s(this,io).addMap(s(this,ba),n).then(()=>{this.publish("loaded",{mapView:s(this,io),mapData:s(this,ba)})}),i}onRemove(){s(this,io)&&s(this,io).clear(),sp.instance=null,s(this,Ca).onRemove()}};ba=new WeakMap,al=new WeakMap,io=new WeakMap,Ca=new WeakMap,l(sp,"MappedinMapLibreOverlay"),d(sp,"instance");var sl=sp;var ece=l(async(r,e)=>{let t,i=lo();e&&i.updateByUserOption(e);try{e&&(t=(await xl({...e,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){A.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new ls(r,{outdoorViewToken:t,languagePacks:e==null?void 0:e.languagePacks,env:i});return new xp(n)},"hydrateMapDataFromMVF"),m8=!1;function tce(r){m8=r}l(tce,"setUseEnterpriseAPI");var rce=l(async(r,e)=>{var p,f,y,g;let t={...e||{}},i,n=lo();n.updateByUserOption(t);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(p=r.options)==null?void 0:p.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await Mp(r.main);i=Sp(v),o.languagePacks=[];for(let x of(f=r.languagePacks)!=null?f:[])x.localePack instanceof Uint8Array&&o.languagePacks.push({language:x.language,localePack:await Cl(x.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(y=r.languagePacks)!=null?y:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(o.binaryBundle=r.main)}else i=r;let a;if("accessToken"in t)a=t.accessToken;else if("key"in t&&"secret"in t){t.baseAuthUri=n.getBaseAuthUri(o.enterprise);let v=await xl(t,o.enterprise);a=(v==null?void 0:v.accessToken)||""}o.outdoorViewToken=a,o.env=n;let u=new ls(i,o);a&&u.Analytics.init({accessToken:a,mapId:t.mapId,key:"key"in t?t.key:void 0,secret:"secret"in t?t.secret:void 0,...t.analytics,baseUri:n.getAnalyticsBaseUri(),context:(g=t.analytics)==null?void 0:g.context});let c=new xp(u);if("language"in t)try{await c.changeLanguage(t.language)}catch{}return c},"hydrateMapData"),ik=l(async r=>{var x;let e=m8,t,i=lo();i.updateByUserOption(r);let n={...r};if("accessToken"in n){t=n.accessToken;let{aud:P,sub:b}=vp(t);(Ex.some(S=>P.includes(S))||b&&b.startsWith("client"))&&(e=!0)}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(e=!0),n.baseAuthUri=i.getBaseAuthUri(e),t=(await xl(n,e)).accessToken;else throw new Error("Missing key or secret.");n.baseUri=i.getBaseUri(e);let o=performance.now(),a,u;if(e){let P={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0"},b=await Qf(P);a=b.compressed,u=b.localePacks}else a=await em(n,t);let c=performance.now(),p=await Mp(a),f=Sp(p),y=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(f);let g=new ls(f,{env:i,outdoorViewToken:t,enterprise:e,localePacksUrls:u,binaryBundle:a}),v=new xp(g,{search:r.search});if(g.Analytics.init({accessToken:t,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:(x=n.analytics)==null?void 0:x.context}),g.Analytics.sendGetMapDataEvent({parseDuration:y-c,downloadDuration:c-o,viewId:n.viewId}),"language"in n)try{await v.changeLanguage(n.language)}catch{}return v},"getMapData"),ice=ik,nce=l((r,e)=>{sl.instance!=null&&A.warn("Only a single map venue is supported at this time.");let t=new sl([r.mapCenter.longitude,r.mapCenter.latitude],r,e);return sl.instance=t,t},"createMapLibreOverlay"),nk=l(async(r,e,t)=>{var p,f,y,g,v,x,P,b,S;let i=performance.now(),n=ng(t,e);try{t&&ig(t)}catch(E){if(E instanceof Error&&E.name==="MissingOutdoorViewToken")A.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw E}let o=_x((p=e.outdoorViewToken)!=null?p:""),a=_a(e);(f=n.outdoorView)!=null&&f.style&&a.envControl.updateTileServerBaseUrl((y=n.outdoorView)==null?void 0:y.style);let u=await K6(r,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(g=n.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=n.style)==null?void 0:v.backgroundColor,outdoorView:(x=n.outdoorView)!=null&&x.token?{headers:{"x-mappedin-tiles-key":(P=n.outdoorView)==null?void 0:P.token},style:e.getEnv().tileServerUri,enabled:!!((b=n.outdoorView)!=null&&b.enabled)}:void 0,watermark:{...n.watermark,visible:!o.remove_watermark},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((S=n.antialiasing)!=null&&S.enabled),accessToken:e.outdoorViewToken}),c=new ol(u);return await c.addMap(e,n),_a(e).Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:c.getDimensions()}),c},"show3dMapGeojson"),oce=nk;export{kb as a,T8 as b,Nb as c,J as d,ue as e,Pd as f,Jr as g,or as h,Xt as i,Bi as j,Ni as k,Zt as l,Td as m,Kr as n,En as o,wd as p,Tr as q,Id as r,mg as s,Sp as t,Mp as u,u0 as v,L as w,Nd as x,Gd as y,YS as z,HA as A,ece as B,tce as C,rce as D,ik as E,ice as F,nce as G,nk as H,oce as I};