@mappedin/mappedin-js 6.17.1 → 6.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as Gl,b as Ul,c as qa,d as yi,e as bi,f as df,g as $o,h as vi,i as Ii,j as uf,k as hf,l as Sp,m as gf,n as mf,o as Mp,p as yf,q as bf,r as vf,s as Op,x as Df}from"./chunk-MCLERQTU.js";import{A as tt,B as ff,E as Ep,I as If,J as Tf,K as Sf,L as Mf,O as yo,P as Ti,Q as xp,R as Ef,S as xf,T as Cf,U as Cp,V as _p,W as Pp,X as wp,_ as _f,aa as Hl,d as A,da as Dp,e as Ee,ea as Ap,f as Rl,fa as Pf,g as af,ga as wf,i as cr,ia as W1,ja as Fp,k as gi,l as Vl,m as Ja,p as jl,q as sf,s as lf,t as Yr,u as Tp,vc as Of,w as cf,x as pf,y as mi}from"./chunk-USECXCBB.js";import{a as m,b as C}from"./chunk-KNYR4VGD.js";import{a as k,b as z,c as qt,e as Je,g as Nl,h as f,i,j as M,k as E,l as Y}from"./chunk-FQILVVN4.js";var vd=Je((yd,bd)=>{m();(function(o,t){typeof yd=="object"&&typeof bd<"u"?bd.exports=t():typeof define=="function"&&define.amd?define(t):(o=typeof globalThis<"u"?globalThis:o||self,o.polygonClipping=t())})(yd,(function(){"use strict";function o(w,u){var g={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},v,S,T,L;return L={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function F(R){return function(te){return j([R,te])}}function j(R){if(v)throw new TypeError("Generator is already executing.");for(;g;)try{if(v=1,S&&(T=R[0]&2?S.return:R[0]?S.throw||((T=S.return)&&T.call(S),0):S.next)&&!(T=T.call(S,R[1])).done)return T;switch(S=0,T&&(R=[R[0]&2,T.value]),R[0]){case 0:case 1:T=R;break;case 4:return g.label++,{value:R[1],done:!1};case 5:g.label++,S=R[1],R=[0];continue;case 7:R=g.ops.pop(),g.trys.pop();continue;default:if(T=g.trys,!(T=T.length>0&&T[T.length-1])&&(R[0]===6||R[0]===2)){g=0;continue}if(R[0]===3&&(!T||R[1]>T[0]&&R[1]<T[3])){g.label=R[1];break}if(R[0]===6&&g.label<T[1]){g.label=T[1],T=R;break}if(T&&g.label<T[2]){g.label=T[2],g.ops.push(R);break}T[2]&&g.ops.pop(),g.trys.pop();continue}R=u.call(w,g)}catch(te){R=[6,te],S=0}finally{v=T=0}if(R[0]&5)throw R[1];return{value:R[0]?R[1]:void 0,done:!0}}}var t=(function(){function w(u,g){this.next=null,this.key=u,this.data=g,this.left=null,this.right=null}return w})();function e(w,u){return w>u?1:w<u?-1:0}function r(w,u,g){for(var v=new t(null,null),S=v,T=v;;){var L=g(w,u.key);if(L<0){if(u.left===null)break;if(g(w,u.left.key)<0){var F=u.left;if(u.left=F.right,F.right=u,u=F,u.left===null)break}T.left=u,T=u,u=u.left}else if(L>0){if(u.right===null)break;if(g(w,u.right.key)>0){var F=u.right;if(u.right=F.left,F.left=u,u=F,u.right===null)break}S.right=u,S=u,u=u.right}else break}return S.right=u.left,T.left=u.right,u.left=v.right,u.right=v.left,u}function n(w,u,g,v){var S=new t(w,u);if(g===null)return S.left=S.right=null,S;g=r(w,g,v);var T=v(w,g.key);return T<0?(S.left=g.left,S.right=g,g.left=null):T>=0&&(S.right=g.right,S.left=g,g.right=null),S}function a(w,u,g){var v=null,S=null;if(u){u=r(w,u,g);var T=g(u.key,w);T===0?(v=u.left,S=u.right):T<0?(S=u.right,u.right=null,v=u):(v=u.left,u.left=null,S=u)}return{left:v,right:S}}function s(w,u,g){return u===null?w:(w===null||(u=r(w.key,u,g),u.left=w),u)}function l(w,u,g,v,S){if(w){v(""+u+(g?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+S(w)+"\n");var T=u+(g?" ":"\u2502 ");w.left&&l(w.left,T,!1,v,S),w.right&&l(w.right,T,!0,v,S)}}var c=(function(){function w(u){u===void 0&&(u=e),this._root=null,this._size=0,this._comparator=u}return w.prototype.insert=function(u,g){return this._size++,this._root=n(u,g,this._root,this._comparator)},w.prototype.add=function(u,g){var v=new t(u,g);this._root===null&&(v.left=v.right=null,this._size++,this._root=v);var S=this._comparator,T=r(u,this._root,S),L=S(u,T.key);return L===0?this._root=T:(L<0?(v.left=T.left,v.right=T,T.left=null):L>0&&(v.right=T.right,v.left=T,T.right=null),this._size++,this._root=v),this._root},w.prototype.remove=function(u){this._root=this._remove(u,this._root,this._comparator)},w.prototype._remove=function(u,g,v){var S;if(g===null)return null;g=r(u,g,v);var T=v(u,g.key);return T===0?(g.left===null?S=g.right:(S=r(u,g.left,v),S.right=g.right),this._size--,S):g},w.prototype.pop=function(){var u=this._root;if(u){for(;u.left;)u=u.left;return this._root=r(u.key,this._root,this._comparator),this._root=this._remove(u.key,this._root,this._comparator),{key:u.key,data:u.data}}return null},w.prototype.findStatic=function(u){for(var g=this._root,v=this._comparator;g;){var S=v(u,g.key);if(S===0)return g;S<0?g=g.left:g=g.right}return null},w.prototype.find=function(u){return this._root&&(this._root=r(u,this._root,this._comparator),this._comparator(u,this._root.key)!==0)?null:this._root},w.prototype.contains=function(u){for(var g=this._root,v=this._comparator;g;){var S=v(u,g.key);if(S===0)return!0;S<0?g=g.left:g=g.right}return!1},w.prototype.forEach=function(u,g){for(var v=this._root,S=[],T=!1;!T;)v!==null?(S.push(v),v=v.left):S.length!==0?(v=S.pop(),u.call(g,v),v=v.right):T=!0;return this},w.prototype.range=function(u,g,v,S){for(var T=[],L=this._comparator,F=this._root,j;T.length!==0||F;)if(F)T.push(F),F=F.left;else{if(F=T.pop(),j=L(F.key,g),j>0)break;if(L(F.key,u)>=0&&v.call(S,F))return this;F=F.right}return this},w.prototype.keys=function(){var u=[];return this.forEach(function(g){var v=g.key;return u.push(v)}),u},w.prototype.values=function(){var u=[];return this.forEach(function(g){var v=g.data;return u.push(v)}),u},w.prototype.min=function(){return this._root?this.minNode(this._root).key:null},w.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},w.prototype.minNode=function(u){if(u===void 0&&(u=this._root),u)for(;u.left;)u=u.left;return u},w.prototype.maxNode=function(u){if(u===void 0&&(u=this._root),u)for(;u.right;)u=u.right;return u},w.prototype.at=function(u){for(var g=this._root,v=!1,S=0,T=[];!v;)if(g)T.push(g),g=g.left;else if(T.length>0){if(g=T.pop(),S===u)return g;S++,g=g.right}else v=!0;return null},w.prototype.next=function(u){var g=this._root,v=null;if(u.right){for(v=u.right;v.left;)v=v.left;return v}for(var S=this._comparator;g;){var T=S(u.key,g.key);if(T===0)break;T<0?(v=g,g=g.left):g=g.right}return v},w.prototype.prev=function(u){var g=this._root,v=null;if(u.left!==null){for(v=u.left;v.right;)v=v.right;return v}for(var S=this._comparator;g;){var T=S(u.key,g.key);if(T===0)break;T<0?g=g.left:(v=g,g=g.right)}return v},w.prototype.clear=function(){return this._root=null,this._size=0,this},w.prototype.toList=function(){return h(this._root)},w.prototype.load=function(u,g,v){g===void 0&&(g=[]),v===void 0&&(v=!1);var S=u.length,T=this._comparator;if(v&&I(u,g,0,S-1,T),this._root===null)this._root=p(u,g,0,S),this._size=S;else{var L=b(this.toList(),d(u,g),T);S=this._size+S,this._root=y({head:L},0,S)}return this},w.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(w.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),w.prototype.toString=function(u){u===void 0&&(u=function(v){return String(v.key)});var g=[];return l(this._root,"",!0,function(v){return g.push(v)},u),g.join("")},w.prototype.update=function(u,g,v){var S=this._comparator,T=a(u,this._root,S),L=T.left,F=T.right;S(u,g)<0?F=n(g,v,F,S):L=n(g,v,L,S),this._root=s(L,F,S)},w.prototype.split=function(u){return a(u,this._root,this._comparator)},w.prototype[Symbol.iterator]=function(){var u,g,v;return o(this,function(S){switch(S.label){case 0:u=this._root,g=[],v=!1,S.label=1;case 1:return v?[3,6]:u===null?[3,2]:(g.push(u),u=u.left,[3,5]);case 2:return g.length===0?[3,4]:(u=g.pop(),[4,u]);case 3:return S.sent(),u=u.right,[3,5];case 4:v=!0,S.label=5;case 5:return[3,1];case 6:return[2]}})},w})();function p(w,u,g,v){var S=v-g;if(S>0){var T=g+Math.floor(S/2),L=w[T],F=u[T],j=new t(L,F);return j.left=p(w,u,g,T),j.right=p(w,u,T+1,v),j}return null}function d(w,u){for(var g=new t(null,null),v=g,S=0;S<w.length;S++)v=v.next=new t(w[S],u[S]);return v.next=null,g.next}function h(w){for(var u=w,g=[],v=!1,S=new t(null,null),T=S;!v;)u?(g.push(u),u=u.left):g.length>0?(u=T=T.next=g.pop(),u=u.right):v=!0;return T.next=null,S.next}function y(w,u,g){var v=g-u;if(v>0){var S=u+Math.floor(v/2),T=y(w,u,S),L=w.head;return L.left=T,w.head=w.head.next,L.right=y(w,S+1,g),L}return null}function b(w,u,g){for(var v=new t(null,null),S=v,T=w,L=u;T!==null&&L!==null;)g(T.key,L.key)<0?(S.next=T,T=T.next):(S.next=L,L=L.next),S=S.next;return T!==null?S.next=T:L!==null&&(S.next=L),v.next}function I(w,u,g,v,S){if(!(g>=v)){for(var T=w[g+v>>1],L=g-1,F=v+1;;){do L++;while(S(w[L],T)<0);do F--;while(S(w[F],T)>0);if(L>=F)break;var j=w[L];w[L]=w[F],w[F]=j,j=u[L],u[L]=u[F],u[F]=j}I(w,u,g,F,S),I(w,u,F+1,v,S)}}let x=(w,u)=>w.ll.x<=u.x&&u.x<=w.ur.x&&w.ll.y<=u.y&&u.y<=w.ur.y,_=(w,u)=>{if(u.ur.x<w.ll.x||w.ur.x<u.ll.x||u.ur.y<w.ll.y||w.ur.y<u.ll.y)return null;let g=w.ll.x<u.ll.x?u.ll.x:w.ll.x,v=w.ur.x<u.ur.x?w.ur.x:u.ur.x,S=w.ll.y<u.ll.y?u.ll.y:w.ll.y,T=w.ur.y<u.ur.y?w.ur.y:u.ur.y;return{ll:{x:g,y:S},ur:{x:v,y:T}}},O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let U=O*O,H=(w,u)=>{if(-O<w&&w<O&&-O<u&&u<O)return 0;let g=w-u;return g*g<U*w*u?0:w<u?-1:1};class V{constructor(){this.reset()}reset(){this.xRounder=new N,this.yRounder=new N}round(u,g){return{x:this.xRounder.round(u),y:this.yRounder.round(g)}}}class N{constructor(){this.tree=new c,this.round(0)}round(u){let g=this.tree.add(u),v=this.tree.prev(g);if(v!==null&&H(g.key,v.key)===0)return this.tree.remove(u),v.key;let S=this.tree.next(g);return S!==null&&H(g.key,S.key)===0?(this.tree.remove(u),S.key):u}}let q=new V,B=11102230246251565e-32,J=134217729,se=(3+8*B)*B;function W(w,u,g,v,S){let T,L,F,j,R=u[0],te=v[0],D=0,G=0;te>R==te>-R?(T=R,R=u[++D]):(T=te,te=v[++G]);let Q=0;if(D<w&&G<g)for(te>R==te>-R?(L=R+T,F=T-(L-R),R=u[++D]):(L=te+T,F=T-(L-te),te=v[++G]),T=L,F!==0&&(S[Q++]=F);D<w&&G<g;)te>R==te>-R?(L=T+R,j=L-T,F=T-(L-j)+(R-j),R=u[++D]):(L=T+te,j=L-T,F=T-(L-j)+(te-j),te=v[++G]),T=L,F!==0&&(S[Q++]=F);for(;D<w;)L=T+R,j=L-T,F=T-(L-j)+(R-j),R=u[++D],T=L,F!==0&&(S[Q++]=F);for(;G<g;)L=T+te,j=L-T,F=T-(L-j)+(te-j),te=v[++G],T=L,F!==0&&(S[Q++]=F);return(T!==0||Q===0)&&(S[Q++]=T),Q}function ie(w,u){let g=u[0];for(let v=1;v<w;v++)g+=u[v];return g}function Ie(w){return new Float64Array(w)}let ve=(3+16*B)*B,he=(2+12*B)*B,X=(9+64*B)*B*B,$=Ie(4),me=Ie(8),ee=Ie(12),oe=Ie(16),ue=Ie(4);function ye(w,u,g,v,S,T,L){let F,j,R,te,D,G,Q,le,de,Pe,Te,Ne,ot,Ye,ft,Re,nt,it,jt=w-S,Pt=g-S,Gt=u-T,Qe=v-T;Ye=jt*Qe,G=J*jt,Q=G-(G-jt),le=jt-Q,G=J*Qe,de=G-(G-Qe),Pe=Qe-de,ft=le*Pe-(Ye-Q*de-le*de-Q*Pe),Re=Gt*Pt,G=J*Gt,Q=G-(G-Gt),le=Gt-Q,G=J*Pt,de=G-(G-Pt),Pe=Pt-de,nt=le*Pe-(Re-Q*de-le*de-Q*Pe),Te=ft-nt,D=ft-Te,$[0]=ft-(Te+D)+(D-nt),Ne=Ye+Te,D=Ne-Ye,ot=Ye-(Ne-D)+(Te-D),Te=ot-Re,D=ot-Te,$[1]=ot-(Te+D)+(D-Re),it=Ne+Te,D=it-Ne,$[2]=Ne-(it-D)+(Te-D),$[3]=it;let lr=ie(4,$),Xo=he*L;if(lr>=Xo||-lr>=Xo||(D=w-jt,F=w-(jt+D)+(D-S),D=g-Pt,R=g-(Pt+D)+(D-S),D=u-Gt,j=u-(Gt+D)+(D-T),D=v-Qe,te=v-(Qe+D)+(D-T),F===0&&j===0&&R===0&&te===0)||(Xo=X*L+se*Math.abs(lr),lr+=jt*te+Qe*F-(Gt*R+Pt*j),lr>=Xo||-lr>=Xo))return lr;Ye=F*Qe,G=J*F,Q=G-(G-F),le=F-Q,G=J*Qe,de=G-(G-Qe),Pe=Qe-de,ft=le*Pe-(Ye-Q*de-le*de-Q*Pe),Re=j*Pt,G=J*j,Q=G-(G-j),le=j-Q,G=J*Pt,de=G-(G-Pt),Pe=Pt-de,nt=le*Pe-(Re-Q*de-le*de-Q*Pe),Te=ft-nt,D=ft-Te,ue[0]=ft-(Te+D)+(D-nt),Ne=Ye+Te,D=Ne-Ye,ot=Ye-(Ne-D)+(Te-D),Te=ot-Re,D=ot-Te,ue[1]=ot-(Te+D)+(D-Re),it=Ne+Te,D=it-Ne,ue[2]=Ne-(it-D)+(Te-D),ue[3]=it;let Ll=W(4,$,4,ue,me);Ye=jt*te,G=J*jt,Q=G-(G-jt),le=jt-Q,G=J*te,de=G-(G-te),Pe=te-de,ft=le*Pe-(Ye-Q*de-le*de-Q*Pe),Re=Gt*R,G=J*Gt,Q=G-(G-Gt),le=Gt-Q,G=J*R,de=G-(G-R),Pe=R-de,nt=le*Pe-(Re-Q*de-le*de-Q*Pe),Te=ft-nt,D=ft-Te,ue[0]=ft-(Te+D)+(D-nt),Ne=Ye+Te,D=Ne-Ye,ot=Ye-(Ne-D)+(Te-D),Te=ot-Re,D=ot-Te,ue[1]=ot-(Te+D)+(D-Re),it=Ne+Te,D=it-Ne,ue[2]=Ne-(it-D)+(Te-D),ue[3]=it;let Bl=W(Ll,me,4,ue,ee);Ye=F*te,G=J*F,Q=G-(G-F),le=F-Q,G=J*te,de=G-(G-te),Pe=te-de,ft=le*Pe-(Ye-Q*de-le*de-Q*Pe),Re=j*R,G=J*j,Q=G-(G-j),le=j-Q,G=J*R,de=G-(G-R),Pe=R-de,nt=le*Pe-(Re-Q*de-le*de-Q*Pe),Te=ft-nt,D=ft-Te,ue[0]=ft-(Te+D)+(D-nt),Ne=Ye+Te,D=Ne-Ye,ot=Ye-(Ne-D)+(Te-D),Te=ot-Re,D=ot-Te,ue[1]=ot-(Te+D)+(D-Re),it=Ne+Te,D=it-Ne,ue[2]=Ne-(it-D)+(Te-D),ue[3]=it;let vp=W(Bl,ee,4,ue,oe);return oe[vp-1]}function Le(w,u,g,v,S,T){let L=(u-T)*(g-S),F=(w-S)*(v-T),j=L-F,R=Math.abs(L+F);return Math.abs(j)>=ve*R?j:-ye(w,u,g,v,S,T,R)}let Me=(w,u)=>w.x*u.y-w.y*u.x,ze=(w,u)=>w.x*u.x+w.y*u.y,Ce=(w,u,g)=>{let v=Le(w.x,w.y,u.x,u.y,g.x,g.y);return v>0?-1:v<0?1:0},vt=w=>Math.sqrt(ze(w,w)),Vt=(w,u,g)=>{let v={x:u.x-w.x,y:u.y-w.y},S={x:g.x-w.x,y:g.y-w.y};return Me(S,v)/vt(S)/vt(v)},fo=(w,u,g)=>{let v={x:u.x-w.x,y:u.y-w.y},S={x:g.x-w.x,y:g.y-w.y};return ze(S,v)/vt(S)/vt(v)},Ho=(w,u,g)=>u.y===0?null:{x:w.x+u.x/u.y*(g-w.y),y:g},Tn=(w,u,g)=>u.x===0?null:{x:g,y:w.y+u.y/u.x*(g-w.x)},hi=(w,u,g,v)=>{if(u.x===0)return Tn(g,v,w.x);if(v.x===0)return Tn(w,u,g.x);if(u.y===0)return Ho(g,v,w.y);if(v.y===0)return Ho(w,u,g.y);let S=Me(u,v);if(S==0)return null;let T={x:g.x-w.x,y:g.y-w.y},L=Me(T,u)/S,F=Me(T,v)/S,j=w.x+F*u.x,R=g.x+L*v.x,te=w.y+F*u.y,D=g.y+L*v.y,G=(j+R)/2,Q=(te+D)/2;return{x:G,y:Q}};class qe{static compare(u,g){let v=qe.comparePoints(u.point,g.point);return v!==0?v:(u.point!==g.point&&u.link(g),u.isLeft!==g.isLeft?u.isLeft?1:-1:dt.compare(u.segment,g.segment))}static comparePoints(u,g){return u.x<g.x?-1:u.x>g.x?1:u.y<g.y?-1:u.y>g.y?1:0}constructor(u,g){u.events===void 0?u.events=[this]:u.events.push(this),this.point=u,this.isLeft=g}link(u){if(u.point===this.point)throw new Error("Tried to link already linked events");let g=u.point.events;for(let v=0,S=g.length;v<S;v++){let T=g[v];this.point.events.push(T),T.point=this.point}this.checkForConsuming()}checkForConsuming(){let u=this.point.events.length;for(let g=0;g<u;g++){let v=this.point.events[g];if(v.segment.consumedBy===void 0)for(let S=g+1;S<u;S++){let T=this.point.events[S];T.consumedBy===void 0&&v.otherSE.point.events===T.otherSE.point.events&&v.segment.consume(T.segment)}}}getAvailableLinkedEvents(){let u=[];for(let g=0,v=this.point.events.length;g<v;g++){let S=this.point.events[g];S!==this&&!S.segment.ringOut&&S.segment.isInResult()&&u.push(S)}return u}getLeftmostComparator(u){let g=new Map,v=S=>{let T=S.otherSE;g.set(S,{sine:Vt(this.point,u.point,T.point),cosine:fo(this.point,u.point,T.point)})};return(S,T)=>{g.has(S)||v(S),g.has(T)||v(T);let{sine:L,cosine:F}=g.get(S),{sine:j,cosine:R}=g.get(T);return L>=0&&j>=0?F<R?1:F>R?-1:0:L<0&&j<0?F<R?-1:F>R?1:0:j<L?-1:j>L?1:0}}}let Wo=0;class dt{static compare(u,g){let v=u.leftSE.point.x,S=g.leftSE.point.x,T=u.rightSE.point.x,L=g.rightSE.point.x;if(L<v)return 1;if(T<S)return-1;let F=u.leftSE.point.y,j=g.leftSE.point.y,R=u.rightSE.point.y,te=g.rightSE.point.y;if(v<S){if(j<F&&j<R)return 1;if(j>F&&j>R)return-1;let D=u.comparePoint(g.leftSE.point);if(D<0)return 1;if(D>0)return-1;let G=g.comparePoint(u.rightSE.point);return G!==0?G:-1}if(v>S){if(F<j&&F<te)return-1;if(F>j&&F>te)return 1;let D=g.comparePoint(u.leftSE.point);if(D!==0)return D;let G=u.comparePoint(g.rightSE.point);return G<0?1:G>0?-1:1}if(F<j)return-1;if(F>j)return 1;if(T<L){let D=g.comparePoint(u.rightSE.point);if(D!==0)return D}if(T>L){let D=u.comparePoint(g.rightSE.point);if(D<0)return 1;if(D>0)return-1}if(T!==L){let D=R-F,G=T-v,Q=te-j,le=L-S;if(D>G&&Q<le)return 1;if(D<G&&Q>le)return-1}return T>L?1:T<L||R<te?-1:R>te?1:u.id<g.id?-1:u.id>g.id?1:0}constructor(u,g,v,S){this.id=++Wo,this.leftSE=u,u.segment=this,u.otherSE=g,this.rightSE=g,g.segment=this,g.otherSE=u,this.rings=v,this.windings=S}static fromRing(u,g,v){let S,T,L,F=qe.comparePoints(u,g);if(F<0)S=u,T=g,L=1;else if(F>0)S=g,T=u,L=-1;else throw new Error("Tried to create degenerate segment at [".concat(u.x,", ").concat(u.y,"]"));let j=new qe(S,!0),R=new qe(T,!1);return new dt(j,R,[v],[L])}replaceRightSE(u){this.rightSE=u,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let u=this.leftSE.point.y,g=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:u<g?u:g},ur:{x:this.rightSE.point.x,y:u>g?u:g}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(u){return u.x===this.leftSE.point.x&&u.y===this.leftSE.point.y||u.x===this.rightSE.point.x&&u.y===this.rightSE.point.y}comparePoint(u){if(this.isAnEndpoint(u))return 0;let g=this.leftSE.point,v=this.rightSE.point,S=this.vector();if(g.x===v.x)return u.x===g.x?0:u.x<g.x?1:-1;let T=(u.y-g.y)/S.y,L=g.x+T*S.x;if(u.x===L)return 0;let F=(u.x-g.x)/S.x,j=g.y+F*S.y;return u.y===j?0:u.y<j?-1:1}getIntersection(u){let g=this.bbox(),v=u.bbox(),S=_(g,v);if(S===null)return null;let T=this.leftSE.point,L=this.rightSE.point,F=u.leftSE.point,j=u.rightSE.point,R=x(g,F)&&this.comparePoint(F)===0,te=x(v,T)&&u.comparePoint(T)===0,D=x(g,j)&&this.comparePoint(j)===0,G=x(v,L)&&u.comparePoint(L)===0;if(te&&R)return G&&!D?L:!G&&D?j:null;if(te)return D&&T.x===j.x&&T.y===j.y?null:T;if(R)return G&&L.x===F.x&&L.y===F.y?null:F;if(G&&D)return null;if(G)return L;if(D)return j;let Q=hi(T,this.vector(),F,u.vector());return Q===null||!x(S,Q)?null:q.round(Q.x,Q.y)}split(u){let g=[],v=u.events!==void 0,S=new qe(u,!0),T=new qe(u,!1),L=this.rightSE;this.replaceRightSE(T),g.push(T),g.push(S);let F=new dt(S,L,this.rings.slice(),this.windings.slice());return qe.comparePoints(F.leftSE.point,F.rightSE.point)>0&&F.swapEvents(),qe.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),v&&(S.checkForConsuming(),T.checkForConsuming()),g}swapEvents(){let u=this.rightSE;this.rightSE=this.leftSE,this.leftSE=u,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let g=0,v=this.windings.length;g<v;g++)this.windings[g]*=-1}consume(u){let g=this,v=u;for(;g.consumedBy;)g=g.consumedBy;for(;v.consumedBy;)v=v.consumedBy;let S=dt.compare(g,v);if(S!==0){if(S>0){let T=g;g=v,v=T}if(g.prev===v){let T=g;g=v,v=T}for(let T=0,L=v.rings.length;T<L;T++){let F=v.rings[T],j=v.windings[T],R=g.rings.indexOf(F);R===-1?(g.rings.push(F),g.windings.push(j)):g.windings[R]+=j}v.rings=null,v.windings=null,v.consumedBy=g,v.leftSE.consumedBy=g.leftSE,v.rightSE.consumedBy=g.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let u=this.prev.consumedBy||this.prev;this._beforeState=u.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let u=this.beforeState();this._afterState={rings:u.rings.slice(0),windings:u.windings.slice(0),multiPolys:[]};let g=this._afterState.rings,v=this._afterState.windings,S=this._afterState.multiPolys;for(let F=0,j=this.rings.length;F<j;F++){let R=this.rings[F],te=this.windings[F],D=g.indexOf(R);D===-1?(g.push(R),v.push(te)):v[D]+=te}let T=[],L=[];for(let F=0,j=g.length;F<j;F++){if(v[F]===0)continue;let R=g[F],te=R.poly;if(L.indexOf(te)===-1)if(R.isExterior)T.push(te);else{L.indexOf(te)===-1&&L.push(te);let D=T.indexOf(R.poly);D!==-1&&T.splice(D,1)}}for(let F=0,j=T.length;F<j;F++){let R=T[F].multiPoly;S.indexOf(R)===-1&&S.push(R)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let u=this.beforeState().multiPolys,g=this.afterState().multiPolys;switch(ut.type){case"union":{let v=u.length===0,S=g.length===0;this._isInResult=v!==S;break}case"intersection":{let v,S;u.length<g.length?(v=u.length,S=g.length):(v=g.length,S=u.length),this._isInResult=S===ut.numMultiPolys&&v<S;break}case"xor":{let v=Math.abs(u.length-g.length);this._isInResult=v%2===1;break}case"difference":{let v=S=>S.length===1&&S[0].isSubject;this._isInResult=v(u)!==v(g);break}default:throw new Error("Unrecognized operation type found ".concat(ut.type))}return this._isInResult}}class zo{constructor(u,g,v){if(!Array.isArray(u)||u.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=g,this.isExterior=v,this.segments=[],typeof u[0][0]!="number"||typeof u[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let S=q.round(u[0][0],u[0][1]);this.bbox={ll:{x:S.x,y:S.y},ur:{x:S.x,y:S.y}};let T=S;for(let L=1,F=u.length;L<F;L++){if(typeof u[L][0]!="number"||typeof u[L][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let j=q.round(u[L][0],u[L][1]);j.x===T.x&&j.y===T.y||(this.segments.push(dt.fromRing(T,j,this)),j.x<this.bbox.ll.x&&(this.bbox.ll.x=j.x),j.y<this.bbox.ll.y&&(this.bbox.ll.y=j.y),j.x>this.bbox.ur.x&&(this.bbox.ur.x=j.x),j.y>this.bbox.ur.y&&(this.bbox.ur.y=j.y),T=j)}(S.x!==T.x||S.y!==T.y)&&this.segments.push(dt.fromRing(T,S,this))}getSweepEvents(){let u=[];for(let g=0,v=this.segments.length;g<v;g++){let S=this.segments[g];u.push(S.leftSE),u.push(S.rightSE)}return u}}class Xa{constructor(u,g){if(!Array.isArray(u))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new zo(u[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let v=1,S=u.length;v<S;v++){let T=new zo(u[v],this,!1);T.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=T.bbox.ll.x),T.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=T.bbox.ll.y),T.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=T.bbox.ur.x),T.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=T.bbox.ur.y),this.interiorRings.push(T)}this.multiPoly=g}getSweepEvents(){let u=this.exteriorRing.getSweepEvents();for(let g=0,v=this.interiorRings.length;g<v;g++){let S=this.interiorRings[g].getSweepEvents();for(let T=0,L=S.length;T<L;T++)u.push(S[T])}return u}}class ho{constructor(u,g){if(!Array.isArray(u))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof u[0][0][0]=="number"&&(u=[u])}catch(v){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let v=0,S=u.length;v<S;v++){let T=new Xa(u[v],this);T.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=T.bbox.ll.x),T.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=T.bbox.ll.y),T.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=T.bbox.ur.x),T.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=T.bbox.ur.y),this.polys.push(T)}this.isSubject=g}getSweepEvents(){let u=[];for(let g=0,v=this.polys.length;g<v;g++){let S=this.polys[g].getSweepEvents();for(let T=0,L=S.length;T<L;T++)u.push(S[T])}return u}}class go{static factory(u){let g=[];for(let v=0,S=u.length;v<S;v++){let T=u[v];if(!T.isInResult()||T.ringOut)continue;let L=null,F=T.leftSE,j=T.rightSE,R=[F],te=F.point,D=[];for(;L=F,F=j,R.push(F),F.point!==te;)for(;;){let G=F.getAvailableLinkedEvents();if(G.length===0){let de=R[0].point,Pe=R[R.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(de.x,",")+" ".concat(de.y,"]. Last matching segment found ends at")+" [".concat(Pe.x,", ").concat(Pe.y,"]."))}if(G.length===1){j=G[0].otherSE;break}let Q=null;for(let de=0,Pe=D.length;de<Pe;de++)if(D[de].point===F.point){Q=de;break}if(Q!==null){let de=D.splice(Q)[0],Pe=R.splice(de.index);Pe.unshift(Pe[0].otherSE),g.push(new go(Pe.reverse()));continue}D.push({index:R.length,point:F.point});let le=F.getLeftmostComparator(L);j=G.sort(le)[0].otherSE;break}g.push(new go(R))}return g}constructor(u){this.events=u;for(let g=0,v=u.length;g<v;g++)u[g].segment.ringOut=this;this.poly=null}getGeom(){let u=this.events[0].point,g=[u];for(let R=1,te=this.events.length-1;R<te;R++){let D=this.events[R].point,G=this.events[R+1].point;Ce(D,u,G)!==0&&(g.push(D),u=D)}if(g.length===1)return null;let v=g[0],S=g[1];Ce(v,u,S)===0&&g.shift(),g.push(g[0]);let T=this.isExteriorRing()?1:-1,L=this.isExteriorRing()?0:g.length-1,F=this.isExteriorRing()?g.length:-1,j=[];for(let R=L;R!=F;R+=T)j.push([g[R].x,g[R].y]);return j}isExteriorRing(){if(this._isExteriorRing===void 0){let u=this.enclosingRing();this._isExteriorRing=u?!u.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let u=this.events[0];for(let S=1,T=this.events.length;S<T;S++){let L=this.events[S];qe.compare(u,L)>0&&(u=L)}let g=u.segment.prevInResult(),v=g?g.prevInResult():null;for(;;){if(!g)return null;if(!v)return g.ringOut;if(v.ringOut!==g.ringOut)return v.ringOut.enclosingRing()!==g.ringOut?g.ringOut:g.ringOut.enclosingRing();g=v.prevInResult(),v=g?g.prevInResult():null}}}class Sn{constructor(u){this.exteriorRing=u,u.poly=this,this.interiorRings=[]}addInterior(u){this.interiorRings.push(u),u.poly=this}getGeom(){let u=[this.exteriorRing.getGeom()];if(u[0]===null)return null;for(let g=0,v=this.interiorRings.length;g<v;g++){let S=this.interiorRings[g].getGeom();S!==null&&u.push(S)}return u}}class Al{constructor(u){this.rings=u,this.polys=this._composePolys(u)}getGeom(){let u=[];for(let g=0,v=this.polys.length;g<v;g++){let S=this.polys[g].getGeom();S!==null&&u.push(S)}return u}_composePolys(u){let g=[];for(let v=0,S=u.length;v<S;v++){let T=u[v];if(!T.poly)if(T.isExteriorRing())g.push(new Sn(T));else{let L=T.enclosingRing();L.poly||g.push(new Sn(L)),L.poly.addInterior(T)}}return g}}class Fl{constructor(u){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dt.compare;this.queue=u,this.tree=new c(g),this.segments=[]}process(u){let g=u.segment,v=[];if(u.consumedBy)return u.isLeft?this.queue.remove(u.otherSE):this.tree.remove(g),v;let S=u.isLeft?this.tree.add(g):this.tree.find(g);if(!S)throw new Error("Unable to find segment #".concat(g.id," ")+"[".concat(g.leftSE.point.x,", ").concat(g.leftSE.point.y,"] -> ")+"[".concat(g.rightSE.point.x,", ").concat(g.rightSE.point.y,"] ")+"in SweepLine tree.");let T=S,L=S,F,j;for(;F===void 0;)T=this.tree.prev(T),T===null?F=null:T.key.consumedBy===void 0&&(F=T.key);for(;j===void 0;)L=this.tree.next(L),L===null?j=null:L.key.consumedBy===void 0&&(j=L.key);if(u.isLeft){let R=null;if(F){let D=F.getIntersection(g);if(D!==null&&(g.isAnEndpoint(D)||(R=D),!F.isAnEndpoint(D))){let G=this._splitSafely(F,D);for(let Q=0,le=G.length;Q<le;Q++)v.push(G[Q])}}let te=null;if(j){let D=j.getIntersection(g);if(D!==null&&(g.isAnEndpoint(D)||(te=D),!j.isAnEndpoint(D))){let G=this._splitSafely(j,D);for(let Q=0,le=G.length;Q<le;Q++)v.push(G[Q])}}if(R!==null||te!==null){let D=null;R===null?D=te:te===null?D=R:D=qe.comparePoints(R,te)<=0?R:te,this.queue.remove(g.rightSE),v.push(g.rightSE);let G=g.split(D);for(let Q=0,le=G.length;Q<le;Q++)v.push(G[Q])}v.length>0?(this.tree.remove(g),v.push(u)):(this.segments.push(g),g.prev=F)}else{if(F&&j){let R=F.getIntersection(j);if(R!==null){if(!F.isAnEndpoint(R)){let te=this._splitSafely(F,R);for(let D=0,G=te.length;D<G;D++)v.push(te[D])}if(!j.isAnEndpoint(R)){let te=this._splitSafely(j,R);for(let D=0,G=te.length;D<G;D++)v.push(te[D])}}}this.tree.remove(g)}return v}_splitSafely(u,g){this.tree.remove(u);let v=u.rightSE;this.queue.remove(v);let S=u.split(g);return S.push(v),u.consumedBy===void 0&&this.tree.add(u),S}}let kl=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,$a=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Mn{run(u,g,v){ut.type=u,q.reset();let S=[new ho(g,!0)];for(let D=0,G=v.length;D<G;D++)S.push(new ho(v[D],!1));if(ut.numMultiPolys=S.length,ut.type==="difference"){let D=S[0],G=1;for(;G<S.length;)_(S[G].bbox,D.bbox)!==null?G++:S.splice(G,1)}if(ut.type==="intersection")for(let D=0,G=S.length;D<G;D++){let Q=S[D];for(let le=D+1,de=S.length;le<de;le++)if(_(Q.bbox,S[le].bbox)===null)return[]}let T=new c(qe.compare);for(let D=0,G=S.length;D<G;D++){let Q=S[D].getSweepEvents();for(let le=0,de=Q.length;le<de;le++)if(T.insert(Q[le]),T.size>kl)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let L=new Fl(T),F=T.size,j=T.pop();for(;j;){let D=j.key;if(T.size===F){let Q=D.segment;throw new Error("Unable to pop() ".concat(D.isLeft?"left":"right"," SweepEvent ")+"[".concat(D.point.x,", ").concat(D.point.y,"] from segment #").concat(Q.id," ")+"[".concat(Q.leftSE.point.x,", ").concat(Q.leftSE.point.y,"] -> ")+"[".concat(Q.rightSE.point.x,", ").concat(Q.rightSE.point.y,"] from queue."))}if(T.size>kl)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(L.segments.length>$a)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let G=L.process(D);for(let Q=0,le=G.length;Q<le;Q++){let de=G[Q];de.consumedBy===void 0&&T.insert(de)}F=T.size,j=T.pop()}q.reset();let R=go.factory(L.segments);return new Al(R).getGeom()}}let ut=new Mn;var Ya={union:function(w){for(var u=arguments.length,g=new Array(u>1?u-1:0),v=1;v<u;v++)g[v-1]=arguments[v];return ut.run("union",w,g)},intersection:function(w){for(var u=arguments.length,g=new Array(u>1?u-1:0),v=1;v<u;v++)g[v-1]=arguments[v];return ut.run("intersection",w,g)},xor:function(w){for(var u=arguments.length,g=new Array(u>1?u-1:0),v=1;v<u;v++)g[v-1]=arguments[v];return ut.run("xor",w,g)},difference:function(w){for(var u=arguments.length,g=new Array(u>1?u-1:0),v=1;v<u;v++)g[v-1]=arguments[v];return ut.run("difference",w,g)}};return Ya}))});var Wr=Je(sr=>{"use strict";m();sr.__esModule=!0;sr.extend=sy;sr.indexOf=hv;sr.escapeExpression=gv;sr.isEmpty=mv;sr.createFrame=yv;sr.blockParams=bv;sr.appendContextPath=vv;var pv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},dv=/[&<>"'`=]/g,uv=/[&<>"'`=]/;function fv(o){return pv[o]}function sy(o){for(var t=1;t<arguments.length;t++)for(var e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&(o[e]=arguments[t][e]);return o}var Su=Object.prototype.toString;sr.toString=Su;var Tu=function(t){return typeof t=="function"};Tu(/x/)&&(sr.isFunction=Tu=function(o){return typeof o=="function"&&Su.call(o)==="[object Function]"});sr.isFunction=Tu;var ly=Array.isArray||function(o){return o&&typeof o=="object"?Su.call(o)==="[object Array]":!1};sr.isArray=ly;function hv(o,t){for(var e=0,r=o.length;e<r;e++)if(o[e]===t)return e;return-1}function gv(o){if(typeof o!="string"){if(o&&o.toHTML)return o.toHTML();if(o==null)return"";if(!o)return o+"";o=""+o}return uv.test(o)?o.replace(dv,fv):o}function mv(o){return!o&&o!==0?!0:!!(ly(o)&&o.length===0)}function yv(o){var t=sy({},o);return t._parent=o,t}function bv(o,t){return o.path=t,o}function vv(o,t){return(o?o+".":"")+t}});var yn=Je((Xc,cy)=>{"use strict";m();Xc.__esModule=!0;var Mu=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Eu(o,t){var e=t&&t.loc,r=void 0,n=void 0,a=void 0,s=void 0;e&&(r=e.start.line,n=e.end.line,a=e.start.column,s=e.end.column,o+=" - "+r+":"+a);for(var l=Error.prototype.constructor.call(this,o),c=0;c<Mu.length;c++)this[Mu[c]]=l[Mu[c]];Error.captureStackTrace&&Error.captureStackTrace(this,Eu);try{e&&(this.lineNumber=r,this.endLineNumber=n,Object.defineProperty?(Object.defineProperty(this,"column",{value:a,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:s,enumerable:!0})):(this.column=a,this.endColumn=s))}catch(p){}}Eu.prototype=new Error;Xc.default=Eu;cy.exports=Xc.default});var dy=Je(($c,py)=>{"use strict";m();$c.__esModule=!0;var xu=Wr();$c.default=function(o){o.registerHelper("blockHelperMissing",function(t,e){var r=e.inverse,n=e.fn;if(t===!0)return n(this);if(t===!1||t==null)return r(this);if(xu.isArray(t))return t.length>0?(e.ids&&(e.ids=[e.name]),o.helpers.each(t,e)):r(this);if(e.data&&e.ids){var a=xu.createFrame(e.data);a.contextPath=xu.appendContextPath(e.data.contextPath,e.name),e={data:a}}return n(t,e)})};py.exports=$c.default});var fy=Je((Yc,uy)=>{"use strict";m();Yc.__esModule=!0;function Iv(o){return o&&o.__esModule?o:{default:o}}var yl=Wr(),Tv=yn(),Sv=Iv(Tv);Yc.default=function(o){o.registerHelper("each",function(t,e){if(!e)throw new Sv.default("Must pass iterator to #each");var r=e.fn,n=e.inverse,a=0,s="",l=void 0,c=void 0;e.data&&e.ids&&(c=yl.appendContextPath(e.data.contextPath,e.ids[0])+"."),yl.isFunction(t)&&(t=t.call(this)),e.data&&(l=yl.createFrame(e.data));function p(I,x,_){l&&(l.key=I,l.index=x,l.first=x===0,l.last=!!_,c&&(l.contextPath=c+I)),s=s+r(t[I],{data:l,blockParams:yl.blockParams([t[I],I],[c+I,null])})}if(t&&typeof t=="object")if(yl.isArray(t))for(var d=t.length;a<d;a++)a in t&&p(a,a,a===t.length-1);else if(typeof Symbol=="function"&&t[Symbol.iterator]){for(var h=[],y=t[Symbol.iterator](),b=y.next();!b.done;b=y.next())h.push(b.value);t=h;for(var d=t.length;a<d;a++)p(a,a,a===t.length-1)}else(function(){var I=void 0;Object.keys(t).forEach(function(x){I!==void 0&&p(I,a-1),I=x,a++}),I!==void 0&&p(I,a-1,!0)})();return a===0&&(s=n(this)),s})};uy.exports=Yc.default});var gy=Je((Zc,hy)=>{"use strict";m();Zc.__esModule=!0;function Mv(o){return o&&o.__esModule?o:{default:o}}var Ev=yn(),xv=Mv(Ev);Zc.default=function(o){o.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new xv.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};hy.exports=Zc.default});var vy=Je((Jc,by)=>{"use strict";m();Jc.__esModule=!0;function Cv(o){return o&&o.__esModule?o:{default:o}}var my=Wr(),_v=yn(),yy=Cv(_v);Jc.default=function(o){o.registerHelper("if",function(t,e){if(arguments.length!=2)throw new yy.default("#if requires exactly one argument");return my.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||my.isEmpty(t)?e.inverse(this):e.fn(this)}),o.registerHelper("unless",function(t,e){if(arguments.length!=2)throw new yy.default("#unless requires exactly one argument");return o.helpers.if.call(this,t,{fn:e.inverse,inverse:e.fn,hash:e.hash})})};by.exports=Jc.default});var Ty=Je((qc,Iy)=>{"use strict";m();qc.__esModule=!0;qc.default=function(o){o.registerHelper("log",function(){for(var t=[void 0],e=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)t.push(arguments[r]);var n=1;e.hash.level!=null?n=e.hash.level:e.data&&e.data.level!=null&&(n=e.data.level),t[0]=n,o.log.apply(o,t)})};Iy.exports=qc.default});var My=Je((Qc,Sy)=>{"use strict";m();Qc.__esModule=!0;Qc.default=function(o){o.registerHelper("lookup",function(t,e,r){return t&&r.lookupProperty(t,e)})};Sy.exports=Qc.default});var xy=Je((Kc,Ey)=>{"use strict";m();Kc.__esModule=!0;function Pv(o){return o&&o.__esModule?o:{default:o}}var bl=Wr(),wv=yn(),Ov=Pv(wv);Kc.default=function(o){o.registerHelper("with",function(t,e){if(arguments.length!=2)throw new Ov.default("#with requires exactly one argument");bl.isFunction(t)&&(t=t.call(this));var r=e.fn;if(bl.isEmpty(t))return e.inverse(this);var n=e.data;return e.data&&e.ids&&(n=bl.createFrame(e.data),n.contextPath=bl.appendContextPath(e.data.contextPath,e.ids[0])),r(t,{data:n,blockParams:bl.blockParams([t],[n&&n.contextPath])})})};Ey.exports=Kc.default});var Cu=Je(ep=>{"use strict";m();ep.__esModule=!0;ep.registerDefaultHelpers=zv;ep.moveHelperToHooks=Xv;function di(o){return o&&o.__esModule?o:{default:o}}var Dv=dy(),Av=di(Dv),Fv=fy(),kv=di(Fv),Lv=gy(),Bv=di(Lv),Nv=vy(),Rv=di(Nv),Vv=Ty(),jv=di(Vv),Gv=My(),Uv=di(Gv),Hv=xy(),Wv=di(Hv);function zv(o){Av.default(o),kv.default(o),Bv.default(o),Rv.default(o),jv.default(o),Uv.default(o),Wv.default(o)}function Xv(o,t,e){o.helpers[t]&&(o.hooks[t]=o.helpers[t],e||(o.helpers[t]=void 0))}});var _y=Je((tp,Cy)=>{"use strict";m();tp.__esModule=!0;var $v=Wr();tp.default=function(o){o.registerDecorator("inline",function(t,e,r,n){var a=t;return e.partials||(e.partials={},a=function(s,l){var c=r.partials;r.partials=$v.extend({},c,e.partials);var p=t(s,l);return r.partials=c,p}),e.partials[n.args[0]]=n.fn,a})};Cy.exports=tp.default});var Py=Je(_u=>{"use strict";m();_u.__esModule=!0;_u.registerDefaultDecorators=qv;function Yv(o){return o&&o.__esModule?o:{default:o}}var Zv=_y(),Jv=Yv(Zv);function qv(o){Jv.default(o)}});var Pu=Je((rp,wy)=>{"use strict";m();rp.__esModule=!0;var Qv=Wr(),Na={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if(typeof t=="string"){var e=Qv.indexOf(Na.methodMap,t.toLowerCase());e>=0?t=e:t=parseInt(t,10)}return t},log:function(t){if(t=Na.lookupLevel(t),typeof console<"u"&&Na.lookupLevel(Na.level)<=t){var e=Na.methodMap[t];console[e]||(e="log");for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];console[e].apply(console,n)}}};rp.default=Na;wy.exports=rp.default});var wu=Je(vl=>{"use strict";m();vl.__esModule=!0;vl.createProtoAccessControl=rI;vl.resultIsAllowed=oI;vl.resetLoggedProperties=iI;function Kv(o){return o&&o.__esModule?o:{default:o}}var Oy=Wr(),eI=Pu(),tI=Kv(eI),op=Object.create(null);function rI(o){var t=Object.create(null);t.__proto__=!1,Oy.extend(t,o.allowedProtoProperties);var e=Object.create(null);return e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1,e.__lookupSetter__=!1,Oy.extend(e,o.allowedProtoMethods),{properties:{whitelist:t,defaultValue:o.allowProtoPropertiesByDefault},methods:{whitelist:e,defaultValue:o.allowProtoMethodsByDefault}}}function oI(o,t,e){return Dy(typeof o=="function"?t.methods:t.properties,e)}function Dy(o,t){return o.whitelist[t]!==void 0?o.whitelist[t]===!0:o.defaultValue!==void 0?o.defaultValue:(nI(t),!1)}function nI(o){op[o]!==!0&&(op[o]=!0,tI.default.log("error",'Handlebars: Access has been denied to resolve the property "'+o+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}function iI(){Object.keys(op).forEach(function(o){delete op[o]})}});var Fu=Je(co=>{"use strict";m();co.__esModule=!0;co.HandlebarsEnvironment=Au;function Ay(o){return o&&o.__esModule?o:{default:o}}var ui=Wr(),aI=yn(),Ou=Ay(aI),sI=Cu(),lI=Py(),cI=Pu(),np=Ay(cI),pI=wu(),dI="4.7.9";co.VERSION=dI;var uI=8;co.COMPILER_REVISION=uI;var fI=7;co.LAST_COMPATIBLE_COMPILER_REVISION=fI;var hI={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};co.REVISION_CHANGES=hI;var Du="[object Object]";function Au(o,t,e){this.helpers=o||{},this.partials=t||{},this.decorators=e||{},sI.registerDefaultHelpers(this),lI.registerDefaultDecorators(this)}Au.prototype={constructor:Au,logger:np.default,log:np.default.log,registerHelper:function(t,e){if(ui.toString.call(t)===Du){if(e)throw new Ou.default("Arg not supported with multiple helpers");ui.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(ui.toString.call(t)===Du)ui.extend(this.partials,t);else{if(typeof e>"u")throw new Ou.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(ui.toString.call(t)===Du){if(e)throw new Ou.default("Arg not supported with multiple decorators");ui.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){pI.resetLoggedProperties()}};var gI=np.default.log;co.log=gI;co.createFrame=ui.createFrame;co.logger=np.default});var ky=Je((ip,Fy)=>{"use strict";m();ip.__esModule=!0;function ku(o){this.string=o}ku.prototype.toString=ku.prototype.toHTML=function(){return""+this.string};ip.default=ku;Fy.exports=ip.default});var Ly=Je(Lu=>{"use strict";m();Lu.__esModule=!0;Lu.wrapHelper=mI;function mI(o,t){if(typeof o!="function")return o;var e=function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=t(n),o.apply(this,arguments)};return e}});var Gy=Je(bn=>{"use strict";m();bn.__esModule=!0;bn.checkRevision=SI;bn.template=MI;bn.wrapProgram=ap;bn.resolvePartial=EI;bn.invokePartial=xI;bn.noop=Vy;function yI(o){return o&&o.__esModule?o:{default:o}}function bI(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e]);return t.default=o,t}var vI=Wr(),Ra=bI(vI),II=yn(),jo=yI(II),Go=Fu(),By=Cu(),TI=Ly(),Ny=wu();function SI(o){var t=o&&o[0]||1,e=Go.COMPILER_REVISION;if(!(t>=Go.LAST_COMPATIBLE_COMPILER_REVISION&&t<=Go.COMPILER_REVISION))if(t<Go.LAST_COMPATIBLE_COMPILER_REVISION){var r=Go.REVISION_CHANGES[e],n=Go.REVISION_CHANGES[t];throw new jo.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+n+").")}else throw new jo.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+o[1]+").")}function MI(o,t){if(!t)throw new jo.default("No environment passed to template");if(!o||!o.main)throw new jo.default("Unknown template object: "+typeof o);o.main.decorator=o.main_d,t.VM.checkRevision(o.compiler);var e=o.compiler&&o.compiler[0]===7;function r(s,l,c){c.hash&&(l=Ra.extend({},l,c.hash),c.ids&&(c.ids[0]=!0)),s=t.VM.resolvePartial.call(this,s,l,c),c.hooks=this.hooks,c.protoAccessControl=this.protoAccessControl;var p=t.VM.invokePartial.call(this,s,l,c);if(p==null&&t.compile&&(c.partials[c.name]=t.compile(s,o.compilerOptions,t),p=c.partials[c.name](l,c)),p!=null){if(c.indent){for(var d=p.split("\n"),h=0,y=d.length;h<y&&!(!d[h]&&h+1===y);h++)d[h]=c.indent+d[h];p=d.join("\n")}return p}else throw new jo.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var n={strict:function(l,c,p){if(!l||!(c in l))throw new jo.default('"'+c+'" not defined in '+l,{loc:p});return n.lookupProperty(l,c)},lookupProperty:function(l,c){var p=l[c];if(p==null||Object.prototype.hasOwnProperty.call(l,c)||Ny.resultIsAllowed(p,n.protoAccessControl,c))return p},lookup:function(l,c){for(var p=l.length,d=0;d<p;d++){var h=l[d]&&n.lookupProperty(l[d],c);if(h!=null)return h}},lambda:function(l,c){return typeof l=="function"?l.call(c):l},escapeExpression:Ra.escapeExpression,invokePartial:r,fn:function(l){var c=o[l];return c.decorator=o[l+"_d"],c},programs:[],program:function(l,c,p,d,h){var y=this.programs[l],b=this.fn(l);return c||h||d||p?y=ap(this,l,b,c,p,d,h):y||(y=this.programs[l]=ap(this,l,b)),y},data:function(l,c){for(;l&&c--;)l=l._parent;return l},mergeIfNeeded:function(l,c){var p=l||c;return l&&c&&l!==c&&(p=Ra.extend({},c,l)),p},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:o.compiler};function a(s){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=l.data;a._setup(l),!l.partial&&o.useData&&(c=CI(s,c));var p=void 0,d=o.useBlockParams?[]:void 0;o.useDepths&&(l.depths?p=s!=l.depths[0]?[s].concat(l.depths):l.depths:p=[s]);function h(y){return""+o.main(n,y,n.helpers,n.partials,c,d,p)}return h=jy(o.main,h,n,l.depths||[],c,d),h(s,l)}return a.isTop=!0,a._setup=function(s){if(s.partial)n.protoAccessControl=s.protoAccessControl,n.helpers=s.helpers,n.partials=s.partials,n.decorators=s.decorators,n.hooks=s.hooks;else{var l={};Ry(l,t.helpers,n),Ry(l,s.helpers,n),n.helpers=l,o.usePartial&&(n.partials=n.mergeIfNeeded(s.partials,t.partials)),(o.usePartial||o.useDecorators)&&(n.decorators=Ra.extend({},t.decorators,s.decorators)),n.hooks={},n.protoAccessControl=Ny.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||e;By.moveHelperToHooks(n,"helperMissing",c),By.moveHelperToHooks(n,"blockHelperMissing",c)}},a._child=function(s,l,c,p){if(o.useBlockParams&&!c)throw new jo.default("must pass block params");if(o.useDepths&&!p)throw new jo.default("must pass parent depths");return ap(n,s,o[s],l,0,c,p)},a}function ap(o,t,e,r,n,a,s){function l(c){var p=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],d=s;return s&&c!=s[0]&&!(c===o.nullContext&&s[0]===null)&&(d=[c].concat(s)),e(o,c,o.helpers,o.partials,p.data||r,a&&[p.blockParams].concat(a),d)}return l=jy(e,l,o,s,r,a),l.program=t,l.depth=s?s.length:0,l.blockParams=n||0,l}function EI(o,t,e){return o?!o.call&&!e.name&&(e.name=o,o=sp(e.partials,o)):e.name==="@partial-block"?o=sp(e.data,"partial-block"):o=sp(e.partials,e.name),o}function xI(o,t,e){var r=sp(e.data,"partial-block");e.partial=!0,e.ids&&(e.data.contextPath=e.ids[0]||e.data.contextPath);var n=void 0;if(e.fn&&e.fn!==Vy&&(function(){e.data=Go.createFrame(e.data);var a=e.fn;n=e.data["partial-block"]=function(l){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=Go.createFrame(c.data),c.data["partial-block"]=r,a(l,c)},a.partials&&(e.partials=Ra.extend({},e.partials,a.partials))})(),o===void 0&&n&&(o=n),o===void 0)throw new jo.default("The partial "+e.name+" could not be found");if(o instanceof Function)return o(t,e)}function Vy(){return""}function sp(o,t){if(o&&Object.prototype.hasOwnProperty.call(o,t))return o[t]}function CI(o,t){return(!t||!("root"in t))&&(t=t?Go.createFrame(t):{},t.root=o),t}function jy(o,t,e,r,n,a){if(o.decorator){var s={};t=o.decorator(t,s,e,r&&r[0],n,a,r),Ra.extend(t,s)}return t}function Ry(o,t,e){t&&Object.keys(t).forEach(function(r){var n=t[r];o[r]=_I(n,e)})}function _I(o,t){var e=t.lookupProperty;return TI.wrapHelper(o,function(r){return r.lookupProperty=e,r})}});var Hy=Je((lp,Uy)=>{"use strict";m();lp.__esModule=!0;lp.default=function(o){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;o.noConflict=function(){return globalThis.Handlebars===o&&(globalThis.Handlebars=t),o}};Uy.exports=lp.default});var Yy=Je((cp,$y)=>{"use strict";m();cp.__esModule=!0;function Nu(o){return o&&o.__esModule?o:{default:o}}function Ru(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e]);return t.default=o,t}var PI=Fu(),Wy=Ru(PI),wI=ky(),OI=Nu(wI),DI=yn(),AI=Nu(DI),FI=Wr(),Bu=Ru(FI),kI=Gy(),zy=Ru(kI),LI=Hy(),BI=Nu(LI);function Xy(){var o=new Wy.HandlebarsEnvironment;return Bu.extend(o,Wy),o.SafeString=OI.default,o.Exception=AI.default,o.Utils=Bu,o.escapeExpression=Bu.escapeExpression,o.VM=zy,o.template=function(t){return zy.template(t,o)},o}var Il=Xy();Il.create=Xy;BI.default(Il);Il.default=Il;cp.default=Il;$y.exports=cp.default});var Jy=Je((B8,Zy)=>{m();Zy.exports=Yy().default});m();m();m();m();m();var Af="mi-session-data",Ff="mi-local-data",Wl="id",zl="deviceId",xn,Sr,Mr,Xl=class Xl{constructor(){M(this,Sr);M(this,Mr);try{let t=sessionStorage.getItem(Af);t?E(this,Sr,JSON.parse(t)):E(this,Sr,{[Wl]:Ee()})}catch(t){E(this,Sr,{[Wl]:Ee()})}try{let t=localStorage.getItem(Ff);t?E(this,Mr,JSON.parse(t)):E(this,Mr,{[zl]:Ee()})}catch(t){E(this,Mr,{[zl]:Ee()})}i(this,Sr)[Wl]||(i(this,Sr)[Wl]=Ee()),i(this,Mr)[zl]||(i(this,Mr)[zl]=Ee())}static getInstance(){return i(this,xn)||E(this,xn,new Xl),i(this,xn)}static ___clearInstance(){E(this,xn,void 0)}saveSessionData(t,e){i(this,Sr)[t]=e;try{return sessionStorage.setItem(Af,JSON.stringify(i(this,Sr))),!0}catch(r){return!1}}loadSessionData(t){let e=i(this,Sr)[t];if(e!=null)return e}saveLocalData(t,e){i(this,Mr)[t]=e;try{return localStorage.setItem(Ff,JSON.stringify(i(this,Mr))),!0}catch(r){return!1}}loadLocalData(t){let e=i(this,Mr)[t];if(e!=null)return e}};xn=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,M(Xl,xn);var Er=Xl;m();m();var Si=o=>o!=null;var z1=(function(){let t=globalThis.fetch;return{fetch(...e){if(!Si(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}})(),kf=z1.fetch;var Vf=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap"],Lf=Vf[0],jf="https://api-gateway.mappedin.com/track-analytics/a/",Gf="deny-watchposition",Uf="load-mapview",Hf="load-mapdata",Wf="change-language",zf="query-directions";var Zr,pr,bo,Lp,$l,Mi=class{constructor(){M(this,bo);M(this,Zr,Object.freeze({}));M(this,pr);f(this,"oneTimeEventsSent",new Set);f(this,"sendGetDirectionsEvent",af((t,e,r)=>{let n={start:t,end:e,type:"location_to_location"};return r!==void 0&&(n.accessible=r),this.sendAnalyticEvent(zf,n)},2500));E(this,pr,Y(this,bo,$l).call(this,i(this,Zr)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){E(this,Zr,{}),E(this,pr,Y(this,bo,$l).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return E(this,Zr,Object.freeze(Object.assign({},i(this,Zr),t))),E(this,pr,Y(this,bo,$l).call(this,t)),Y(this,bo,Lp).call(this,i(this,pr)),i(this,pr)}updateState(t){let e=k({},t);e.mapId&&(e.analyticsBaseUrl=kp(z(k({},i(this,pr)),{mapId:e.mapId}))),e.context&&(e.context=Rf(e.context)),e.baseUri&&(e.analyticsBaseUrl=kp({baseUri:e.baseUri,mapId:i(this,pr).mapId})),Object.assign(i(this,pr),e),this.handleStateUpdate(t),Y(this,bo,Lp).call(this,e)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:r}=this.getState();return!!(t&&e)||!!r}getState(){return i(this,pr)}getContext(){return this.getState().context||i(this,Zr).context||Lf}getSessionId(){return this.getState().sessionId||i(this,Zr).sessionId||Nf()}getDeviceId(){return this.getState().deviceId||i(this,Zr).deviceId||Bf()}sendAnalyticEvent(t,e={}){let r=this.getState(),n=X1(r.analyticsBaseUrl,t),a={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(r.logEvents&&A.log("Analytics.track",n,a),!r.sendEvents)return Promise.resolve();if(!this.authReady)return A.warn("Auth needs to be ready to send analytics.");let s=k(z(k({},e),{g:r.geolocationMode,sdk_version:r.version}),r.externalId?{externalId:r.externalId}:{});return r.userPosition&&Object.assign(s,r.userPosition),a["Content-Type"]="application/json",r.accessToken?a.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.secret&&r.key&&(a["x-mappedin-key"]=btoa(r.key),a["x-mappedin-secret"]=btoa(r.secret)),kf(n,{method:"POST",mode:"cors",headers:a,body:JSON.stringify(s)})}capture(t,e){if(Y1.includes(t))return A.warn("".concat(t," event is sent internally.")),Promise.resolve();let r=$1.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(r,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(Hf,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(Wf,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Gf)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(Uf,{type:"3d",firstRenderDuration:t,width:e.width,height:e.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Zr=new WeakMap,pr=new WeakMap,bo=new WeakSet,Lp=function(t){t.sessionId&&Er.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&Er.getInstance().saveLocalData("deviceId",t.deviceId)},$l=function(t){var r,n,a,s;let e=(r=t.baseUri)!=null?r:jf;return{baseUri:e,analyticsBaseUrl:kp(z(k({},t),{baseUri:e})),version:t.version||((n=C==null?void 0:C.env)==null?void 0:n.npm_package_version)||"v6",deviceId:t.deviceId||Bf(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Nf(),platformString:t.platformString||"",context:Rf(t.context)||Lf,geolocationMode:!1,sendEvents:(a=t.sendEvents)!=null?a:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret,externalId:t.externalId}};function kp({mapId:o,baseUri:t=jf}){return"".concat(t).concat(o,"/")}function Bf(){return Er.getInstance().loadLocalData("deviceId")}function Nf(){return Er.getInstance().loadSessionData("id")}function X1(o,t){return o+t}function Rf(o){return Vf.find(t=>t===o)}var $1=["$select-location","$select-category","$query-suggest","$query-search"],Y1=[Uf,Hf,zf,Gf,Wf],ZT=new Mi,dr,Qa=class{constructor(t){M(this,dr);f(this,"capture");f(this,"updateState");E(this,dr,t),this.capture=i(this,dr).capture.bind(i(this,dr)),this.updateState=i(this,dr).updateState.bind(i(this,dr))}getState(){let n=i(this,dr).getState(),{sessionId:t,deviceId:e}=n;return qt(n,["sessionId","deviceId"])}getContext(){return i(this,dr).getContext()}getSessionId(){return i(this,dr).getSessionId()}getDeviceId(){return i(this,dr).getDeviceId()}};dr=new WeakMap;m();m();var es,ts,rs,Ka=class{constructor(t,e,{enabled:r=!1}={}){M(this,es);f(this,"searchInstance");M(this,ts);M(this,rs);f(this,"enabled",!1);E(this,es,t),E(this,ts,e),E(this,rs,()=>{var n;(n=this.searchInstance)==null||n.then(a=>a.populate())}),r&&this.enable()}async query(t,e={}){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(t,e)}catch(r){return A.error("Search.query failed due to",r),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(r){return A.error("Search.suggest failed due to",r),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-I66JHO4D.js").then(({InternalSearch:t})=>new t(i(this,es)))),i(this,ts).on("language-change",i(this,rs)),await this.searchInstance)}};es=new WeakMap,ts=new WeakMap,rs=new WeakMap;var Xf={"enterprise-location":"location-profile","enterprise-category":"location-category"},$f={"location-profile":"enterprise-location","location-category":"enterprise-category"},Yf=new WeakMap,Cn,Ve,Bp=class{constructor(t,{search:e}={}){M(this,Cn);M(this,Ve);f(this,"Analytics");f(this,"Search");f(this,"Query");f(this,"internal");f(this,"on",(t,e)=>{i(this,Cn).on(t,e)});f(this,"off",(t,e)=>{i(this,Cn).off(t,e)});f(this,"__LEGACY_GET_DIRECTIONS_SYNC",(t,e,r)=>i(this,Ve).__LEGACY_GET_DIRECTIONS_SYNC(t,e,r));f(this,"getDirections",(t,e,r)=>i(this,Ve).getDirections(t,e,r));f(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(t,e,r)=>i(this,Ve).__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,e,r));f(this,"getDirectionsMultiDestination",(t,e,r)=>i(this,Ve).getDirectionsMultiDestination(t,e,r));E(this,Cn,new cr),E(this,Ve,t),Yf.set(this,t),this.Analytics=new Qa(t.Analytics),this.Query=t.Query,this.internal=t,this.Search=new Ka(this,t,{enabled:e==null?void 0:e.enabled}),i(this,Ve).on("language-change",r=>{i(this,Cn).publish("language-change",r)})}getEnv(){return i(this,Ve).getEnv()}getAccessToken(){var t;return(t=i(this,Ve).tokenManager)==null?void 0:t.getAccessToken().token}get mapName(){return i(this,Ve).mapName}get mapId(){var t;return(t=i(this,Ve).getMapDataOptions)==null?void 0:t.mapId}get isEnterpriseMode(){return i(this,Ve).enterpriseMode}get mapCenter(){return i(this,Ve).mapCenter}get organizationId(){return i(this,Ve).organizationId}get outdoorViewToken(){return i(this,Ve).outdoorViewToken}getByType(t){let e=i(this,Ve).getByType(t);if(Array.isArray(e)&&e.length===0){let r=this.isEnterpriseMode;!r&&t in Xf?A.warn("MappedinSDK: getByType('".concat(t,"') returned 0 results. ")+"This is a Maker map (API key starts with 'mik_'). "+"Use '".concat(Xf[t],"' instead. ")+"See https://developer.mappedin.com/web-sdk/getting-started"):r&&t in $f&&A.warn("MappedinSDK: getByType('".concat(t,"') returned 0 results. ")+"This is an Enterprise map. "+"Use '".concat($f[t],"' instead. ")+"See https://developer.mappedin.com/web-sdk/getting-started")}return e}getById(t,e){return i(this,Ve).getById(t,e)}getByExternalId(t,e){return i(this,Ve).getByExternalId(t,e)}getGeoJSON(t){return t.geoJSON}async changeLanguage(t){return i(this,Ve).changeLanguage(t)}get currentLanguage(){return i(this,Ve).currentLanguage}get naturalBearing(){var t;return(t=i(this,Ve).naturalBearing)!=null?t:0}getDistance(t,e){return i(this,Ve).getDistance(t,e)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return i(this,Ve).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return i(this,Ve).toJSONBundle({downloadLanguagePacks:t})}};Cn=new WeakMap,Ve=new WeakMap;var os=Bp;function ns(o){let t=Yf.get(o);if(!t)throw new Error("MapDataInternal not found");return t}m();m();m();m();m();function Ei(o){return o.endsWith("/")?o:"".concat(o,"/")}m();var xi="https://app.mappedin.com/",Zf="https://auth.mappedin.com/",Jf=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"}),Z1=Object.freeze(z(k({},Jf),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),J1=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"}),q1=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"}),Q1=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),K1={eu:J1,us:Jf,"us-enterprise":Z1,"us-staging-enterprise":q1,"us-staging-self-serve":Q1};function qf(o){return K1[o]}m();m();var eb=o=>{let t=Date.now();return o-t},Yl=(o,t)=>eb(o)<=t*60*1e3;var Kf=10,eh=Kf*60*1e3,Qf="accessTokens";async function is(o,t=!1){let e="".concat(o.key),r=Er.getInstance(),n=(r==null?void 0:r.loadSessionData(Qf))||{},a=Math.floor(Date.now()/1e3);if(n[e]&&!Yl(n[e].expiresTimestamp*1e3,Kf))return n[e];let s=t?await tb(o,a):await rb(o,a),l=z(k({},n),{[e]:s});return r==null||r.saveSessionData(Qf,l),s}async function tb(o,t){var a;let e;o.customAuthUri?e=o.customAuthUri:e="".concat((a=o.baseAuthUri)!=null?a:Zf,"oauth2/token");let r;try{r=await Qt()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:o.key,client_secret:o.secret})})}catch(s){let l=s instanceof Error?s.message:String(s);throw new Error("Failed to fetch enterprise access token from ".concat(e,": ").concat(l))}if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText,": ").concat(await r.text()));let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}async function rb(o,t){let e;o.customAuthUri?e=o.customAuthUri:e="".concat(o.baseAuthUri?Ei(o.baseAuthUri):xi,"api/v1/api-key/token");let r;try{r=await Qt()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:o.key,secret:o.secret})})}catch(a){let s=a instanceof Error?a.message:String(a);throw new Error("Failed to fetch access token from ".concat(e,": ").concat(s))}if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText,": ").concat(await r.text()));let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}m();var rh=10,oh=rh*60*1e3,th="miSasTokens";async function Np(o,t){let e="".concat(t,"__").concat(o.mapId),r=Er.getInstance(),n=(r==null?void 0:r.loadSessionData(th))||{};if(n[e]&&!Yl(n[e].expires,rh))return n[e];let a=await ob(o,t),s=z(k({},n),{[e]:{token:a.token,expires:new Date(a.expires).getTime()}});return r==null||r.saveSessionData(th,s),a}async function ob(o,t){let e="".concat(o.baseUri?Ei(o.baseUri):xi,"api/v1/venue/").concat(o.mapId,"/sas-token"),r=await Qt()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText,": ").concat(await r.text()));let n=await r.json();return{token:n.token,expires:new Date(n.expires).getTime()}}m();var Kt=Uint8Array,_n=Uint16Array,nh=Uint32Array,ih=new Kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ah=new Kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),nb=new Kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sh=function(o,t){for(var e=new _n(31),r=0;r<31;++r)e[r]=t+=1<<o[r-1];for(var n=new nh(e[30]),r=1;r<30;++r)for(var a=e[r];a<e[r+1];++a)n[a]=a-e[r]<<5|r;return[e,n]},lh=sh(ih,2),ch=lh[0],ib=lh[1];ch[28]=258,ib[258]=28;var ph=sh(ah,0),ab=ph[0],G2=ph[1],Gp=new _n(32768);for(Fe=0;Fe<32768;++Fe)vo=(Fe&43690)>>>1|(Fe&21845)<<1,vo=(vo&52428)>>>2|(vo&13107)<<2,vo=(vo&61680)>>>4|(vo&3855)<<4,Gp[Fe]=((vo&65280)>>>8|(vo&255)<<8)>>>1;var vo,Fe,as=(function(o,t,e){for(var r=o.length,n=0,a=new _n(t);n<r;++n)o[n]&&++a[o[n]-1];var s=new _n(t);for(n=0;n<t;++n)s[n]=s[n-1]+a[n-1]<<1;var l;if(e){l=new _n(1<<t);var c=15-t;for(n=0;n<r;++n)if(o[n])for(var p=n<<4|o[n],d=t-o[n],h=s[o[n]-1]++<<d,y=h|(1<<d)-1;h<=y;++h)l[Gp[h]>>>c]=p}else for(l=new _n(r),n=0;n<r;++n)o[n]&&(l[n]=Gp[s[o[n]-1]++]>>>15-o[n]);return l}),ss=new Kt(288);for(Fe=0;Fe<144;++Fe)ss[Fe]=8;var Fe;for(Fe=144;Fe<256;++Fe)ss[Fe]=9;var Fe;for(Fe=256;Fe<280;++Fe)ss[Fe]=7;var Fe;for(Fe=280;Fe<288;++Fe)ss[Fe]=8;var Fe,dh=new Kt(32);for(Fe=0;Fe<32;++Fe)dh[Fe]=5;var Fe;var sb=as(ss,9,1);var lb=as(dh,5,1),Rp=function(o){for(var t=o[0],e=1;e<o.length;++e)o[e]>t&&(t=o[e]);return t},xr=function(o,t,e){var r=t/8|0;return(o[r]|o[r+1]<<8)>>(t&7)&e},Vp=function(o,t){var e=t/8|0;return(o[e]|o[e+1]<<8|o[e+2]<<16)>>(t&7)},cb=function(o){return(o+7)/8|0},Hp=function(o,t,e){(t==null||t<0)&&(t=0),(e==null||e>o.length)&&(e=o.length);var r=new(o.BYTES_PER_ELEMENT==2?_n:o.BYTES_PER_ELEMENT==4?nh:Kt)(e-t);return r.set(o.subarray(t,e)),r};var pb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Cr=function(o,t,e){var r=new Error(t||pb[o]);if(r.code=o,Error.captureStackTrace&&Error.captureStackTrace(r,Cr),!e)throw r;return r},db=function(o,t,e){var r=o.length;if(!r||e&&e.f&&!e.l)return t||new Kt(0);var n=!t||e,a=!e||e.i;e||(e={}),t||(t=new Kt(r*3));var s=function(vt){var Vt=t.length;if(vt>Vt){var fo=new Kt(Math.max(Vt*2,vt));fo.set(t),t=fo}},l=e.f||0,c=e.p||0,p=e.b||0,d=e.l,h=e.d,y=e.m,b=e.n,I=r*8;do{if(!d){l=xr(o,c,1);var x=xr(o,c+1,3);if(c+=3,x)if(x==1)d=sb,h=lb,y=9,b=5;else if(x==2){var H=xr(o,c,31)+257,V=xr(o,c+10,15)+4,N=H+xr(o,c+5,31)+1;c+=14;for(var q=new Kt(N),B=new Kt(19),J=0;J<V;++J)B[nb[J]]=xr(o,c+J*3,7);c+=V*3;for(var se=Rp(B),W=(1<<se)-1,ie=as(B,se,1),J=0;J<N;){var Ie=ie[xr(o,c,W)];c+=Ie&15;var _=Ie>>>4;if(_<16)q[J++]=_;else{var ve=0,he=0;for(_==16?(he=3+xr(o,c,3),c+=2,ve=q[J-1]):_==17?(he=3+xr(o,c,7),c+=3):_==18&&(he=11+xr(o,c,127),c+=7);he--;)q[J++]=ve}}var X=q.subarray(0,H),$=q.subarray(H);y=Rp(X),b=Rp($),d=as(X,y,1),h=as($,b,1)}else Cr(1);else{var _=cb(c)+4,O=o[_-4]|o[_-3]<<8,U=_+O;if(U>r){a&&Cr(0);break}n&&s(p+O),t.set(o.subarray(_,U),p),e.b=p+=O,e.p=c=U*8,e.f=l;continue}if(c>I){a&&Cr(0);break}}n&&s(p+131072);for(var me=(1<<y)-1,ee=(1<<b)-1,oe=c;;oe=c){var ve=d[Vp(o,c)&me],ue=ve>>>4;if(c+=ve&15,c>I){a&&Cr(0);break}if(ve||Cr(2),ue<256)t[p++]=ue;else if(ue==256){oe=c,d=null;break}else{var ye=ue-254;if(ue>264){var J=ue-257,Le=ih[J];ye=xr(o,c,(1<<Le)-1)+ch[J],c+=Le}var Me=h[Vp(o,c)&ee],ze=Me>>>4;Me||Cr(3),c+=Me&15;var $=ab[ze];if(ze>3){var Le=ah[ze];$+=Vp(o,c)&(1<<Le)-1,c+=Le}if(c>I){a&&Cr(0);break}n&&s(p+131072);for(var Ce=p+ye;p<Ce;p+=4)t[p]=t[p-$],t[p+1]=t[p+1-$],t[p+2]=t[p+2-$],t[p+3]=t[p+3-$];p=Ce}}e.l=d,e.p=oe,e.b=p,e.f=l,d&&(l=1,e.m=y,e.d=h,e.n=b)}while(!l);return p==t.length?t:Hp(t,0,p)};var ub=new Kt(0);var Jr=function(o,t){return o[t]|o[t+1]<<8},_r=function(o,t){return(o[t]|o[t+1]<<8|o[t+2]<<16|o[t+3]<<24)>>>0},jp=function(o,t){return _r(o,t)+_r(o,t+4)*4294967296};function fb(o,t){return db(o,t)}var Up=typeof TextDecoder<"u"&&new TextDecoder,hb=0;try{Up.decode(ub,{stream:!0}),hb=1}catch(o){}var gb=function(o){for(var t="",e=0;;){var r=o[e++],n=(r>127)+(r>223)+(r>239);if(e+n>o.length)return[t,Hp(o,e-1)];n?n==3?(r=((r&15)<<18|(o[e++]&63)<<12|(o[e++]&63)<<6|o[e++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):n&1?t+=String.fromCharCode((r&31)<<6|o[e++]&63):t+=String.fromCharCode((r&15)<<12|(o[e++]&63)<<6|o[e++]&63):t+=String.fromCharCode(r)}};function mb(o,t){if(t){for(var e="",r=0;r<o.length;r+=16384)e+=String.fromCharCode.apply(null,o.subarray(r,r+16384));return e}else{if(Up)return Up.decode(o);var n=gb(o),a=n[0],s=n[1];return s.length&&Cr(8),a}}var yb=function(o,t){return t+30+Jr(o,t+26)+Jr(o,t+28)},bb=function(o,t,e){var r=Jr(o,t+28),n=mb(o.subarray(t+46,t+46+r),!(Jr(o,t+8)&2048)),a=t+46+r,s=_r(o,t+20),l=e&&s==4294967295?vb(o,a):[s,_r(o,t+24),_r(o,t+42)],c=l[0],p=l[1],d=l[2];return[Jr(o,t+10),c,p,n,a+Jr(o,t+30)+Jr(o,t+32),d]},vb=function(o,t){for(;Jr(o,t)!=1;t+=4+Jr(o,t+2));return[jp(o,t+12),jp(o,t+4),jp(o,t+20)]};function Wp(o,t){for(var e={},r=o.length-22;_r(o,r)!=101010256;--r)(!r||o.length-r>65558)&&Cr(13);var n=Jr(o,r+8);if(!n)return{};var a=_r(o,r+16),s=a==4294967295||n==65535;if(s){var l=_r(o,r-12);s=_r(o,l)==101075792,s&&(n=_r(o,l+32),a=_r(o,l+48))}for(var c=t&&t.filter,p=0;p<n;++p){var d=bb(o,a,s),h=d[0],y=d[1],b=d[2],I=d[3],x=d[4],_=d[5],O=yb(o,_);a=x,(!c||c({name:I,size:y,originalSize:b,compression:h}))&&(h?h==8?e[I]=fb(o.subarray(O,O+y),new Kt(b)):Cr(14,"unknown compression type "+h):e[I]=Hp(o,O,O+y))}return e}var uh=globalThis.fetch,hh,Tb=(hh=C==null?void 0:C.env)==null?void 0:hh.npm_package_version;function Qt(){if(uh==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return uh}var zp={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function gh(o){var e;let t=k(k({},zp),o);return t.headers=z(k({},t.headers),{"mappedin-sdk-version":Tb}),t.things=[],"platformString"in o&&(t.headers=z(k({},t.headers),{"mappedin-platform-version":o.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}function Sb(o,t,e=!1){let r={language:o.language,clientId:o.clientId,clientSecret:o.clientSecret};e&&delete r.language;let{headers:n}=o;n["Content-Type"]=n["Content-Type"]||"text/json",o.accessToken?n.Authorization="Bearer ".concat(o.accessToken):o.noAuth||o.clientId&&o.clientSecret&&(n["x-mappedin-key"]=btoa(o.clientId),n["x-mappedin-secret"]=btoa(o.clientSecret));let a={method:"GET",headers:n};return o.secure&&(t+="&withcdntoken"),{req:a,url:t}}async function Mb(o,t,e=!1){let r=Sb(o,t,e),n=await Qt()(r.url,r.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}var Eb=o=>{let t=o!=null&&typeof o=="object"&&"perspectives"in o&&o.perspectives!=null&&typeof o.perspectives=="object"?o.perspectives:null;if(t==null||Object.keys(t).length===0)return A.warn("No perspectives available in response!"),null;let e={};for(let[r,n]of Object.entries(t)){let a="url"in n&&typeof n.url=="string"?n.url:null,s="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(a==null||s==null){A.warn("Perspective ".concat(r," is missing url or locale_packs!"));continue}e[r]={url:a,locale_packs:s}}return e};async function xb(o,t="exports/mvf/1/bundle"){var p,d;let e=gh(k(k({baseUri:"https://api-gateway.mappedin.com/"},zp),o)),r="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((p=e.version)!=null?p:"2.0.0");e.headers["Content-Type"]="application/zip";let n=await Mb(e,r),a=n.url,s=n.locale_packs,l=(d=e.perspective)!=null?d:zp.perspective,c=Eb(n);if(l!=null&&l!==""&&c!=null){let h=c[l];h==null?A.warn("Perspective ".concat(l," not found in response! Loading default perspective instead.")):(A.log('Loading perspective "'.concat(l,'"')),a=h.url,s=h.locale_packs)}return{url:a,localePacks:s,updated_at:n.updated_at}}var Ci=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function Xp(o,{signal:t}){let e=await(await Qt()(o,{signal:t})).arrayBuffer();return new Uint8Array(e)}async function _i(o){let t=Wp(o),e={};if(t["enterprise/"]!=null){e.enterprise={};let r=t["enterprise/locations.json"];r&&(e.enterprise.locations=JSON.parse(Ci().decode(r)));let n=t["enterprise/locationInstances.json"];n&&(e.enterprise.locationInstances=JSON.parse(Ci().decode(n)));let a=t["enterprise/categories.json"];a&&(e.enterprise.categories=JSON.parse(Ci().decode(a)))}return t["floorstack.json"]&&(e["floorstack.json"]=JSON.parse(Ci().decode(t["floorstack.json"]))),t["floor.geojson"]&&(e["floor.geojson"]=JSON.parse(Ci().decode(t["floor.geojson"]))),t["manifest.json"]&&(e["manifest.geojson"]=JSON.parse(Ci().decode(t["manifest.json"]))),e}async function mh(o,{signal:t}){try{let e=await(await Qt()(o,{signal:t})).arrayBuffer();if(t.aborted)return;let r=new Uint8Array(e);return await _i(r)}catch(e){let r=new Error("downloadLanguagePack failed");throw r.cause=e,r}}function Cb(o){let{mvfVersion:t,useDraftData:e}=o;if(t==="3.0.0")return e?"exports/mvf3-draft/1/bundle":"exports/mvf3/1/bundle";if(t==null||t==="2.0.0")return e?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle";if(t==="2.0.0-c")return e?"exports/mvf2c-draft/1/bundle":"exports/mvf2c/1/bundle";throw new Error("Unsupported MVF version: ".concat(t))}async function $p(o){return new Promise(async(t,e)=>{try{let r=Cb(o),{url:n,localePacks:a}=await xb(o,r),s=await Qt()(n).then(c=>c.arrayBuffer()),l=new Uint8Array(s);t({compressed:l,localePacks:a})}catch(r){e(r)}})}async function Yp(o,t){return new Promise(async(e,r)=>{try{let{url:n}=await _b(o,t),a=await Qt()(n).then(l=>l.arrayBuffer()),s=new Uint8Array(a);e(s)}catch(n){r(n)}})}async function _b(o,t){let e=new URL("".concat(o.baseUri?Ei(o.baseUri):xi,"api/v1/venue/").concat(o.mapId,"/mvf"));o.viewId&&e.searchParams.set("configId",o.viewId),o.mvfVersion&&e.searchParams.set("version",o.mvfVersion);let r=await Qt()(e.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText));return r.json()}function yh(o){return Sp(o)}function Pb(o){if(o==null||typeof o!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in o?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in o?"floorstack.json":"mapstack.json"in o?"mapstack.json":"mapstack.geojson"];"styles.json"in o&&t.push("styles.json"),"shapes.json"in o&&t.push("shapes.json"),"navigationFlags.json"in o&&t.push("navigationFlags.json"),"annotation-symbols.json"in o&&t.push("annotation-symbols.json");for(let e of t)if(o[e]==null||o[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function Zp(o){return new Promise(async(t,e)=>{try{if(o==null||typeof o!="object")throw new Error("Error parsing data! Unzipping failed.");if(o[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let r=Wp(o);if(!Pb(r))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},a=Object.keys(r);for(let s of a){if(r[s].length===0)continue;let l=s.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){n[l[0]]=r[s];continue}if(l[0]==="image"){A.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[l[0]]==null&&(n[l[0]]={}),n[l[0]][l[1]]=r[s]}t(n)}catch(r){e(r)}})}function Yo(){let o="us",t={};function e(){return wb(qf(o),t)}return{updateByUserOption(r){var n,a;r.environment&&(o=r.environment),r.baseUri&&(t.baseUri=r.baseUri),r.baseAuthUri&&(t.baseAuthUri=r.baseAuthUri),(n=r.analytics)!=null&&n.baseUri&&(t.analyticsBaseUri=(a=r.analytics)==null?void 0:a.baseUri)},updateTileServerBaseUrl(r){t.tileServerUri=r},updateEnvironment(r){o=r},setEnterprise(r){(o==="us"||o==="us-enterprise")&&(o=r?"us-enterprise":"us")},getBaseUri(){return e().baseUri},getBaseAuthUri(){return e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){o="us",t={}},__getState:e}}function wb(o,t){return k(k({},o),t)}var Zl=o=>{var e,r;let t=Object.values((r=(e=o["floorstack.json"])!=null?e:o["mapstack.json"])!=null?r:{});return t.length===1?[]:t.filter(n=>n.type!=="Outdoor").map(n=>n.id.replace("fs_","").replace("ms_",""))},fh=async o=>{let t=performance.now(),e,r=mf.decompressUnsafeSync(o);r.isOk()?e=r.unwrap():A.error("MVFv3 decompression failed!");let n;if(e)try{n=gf(e)}catch(a){A.error("MVFv3 to MVFv2 conversion failed!",a)}if(A.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),!n)throw new Error("Failed to parse MVFv2 from MVFv3!");return{mvf2:n,mvf3:e}};async function Jl(o,t="2.0.0"){switch(t){case"2.0.0":case"2.0.0-c":try{let e=performance.now(),r=await Zp(o),n=Sp(r);return A.log("Parsed MVFv2 in ".concat(performance.now()-e,"ms")),{mvf2:n}}catch(e){return A.error("MVFv2 parsing failed! Trying MVFv3."),fh(o)}case"3.0.0":return fh(o);default:throw new Error("Unsupported MVF version: ".concat(t))}}m();m();function Ob(o,t,e){e===void 0&&(e={});for(var r=$o(o),n=vi(t),a=0;a<n.length-1;a++){var s=!1;if(e.ignoreEndVertices&&(a===0&&(s="start"),a===n.length-2&&(s="end"),a===0&&a+1===n.length-1&&(s="both")),Db(n[a],n[a+1],r,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Db(o,t,e,r,n){var a=e[0],s=e[1],l=o[0],c=o[1],p=t[0],d=t[1],h=e[0]-l,y=e[1]-c,b=p-l,I=d-c,x=h*I-y*b;if(n!==null){if(Math.abs(x)>n)return!1}else if(x!==0)return!1;if(r){if(r==="start")return Math.abs(b)>=Math.abs(I)?b>0?l<a&&a<=p:p<=a&&a<l:I>0?c<s&&s<=d:d<=s&&s<c;if(r==="end")return Math.abs(b)>=Math.abs(I)?b>0?l<=a&&a<p:p<a&&a<=l:I>0?c<=s&&s<d:d<s&&s<=c;if(r==="both")return Math.abs(b)>=Math.abs(I)?b>0?l<a&&a<p:p<a&&a<l:I>0?c<s&&s<d:d<s&&s<c}else return Math.abs(b)>=Math.abs(I)?b>0?l<=a&&a<=p:p<=a&&a<=l:I>0?c<=s&&s<=d:d<=s&&s<=c;return!1}var bh=Ob;m();function Ab(o,t){t===void 0&&(t={});var e=mi(o),r=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return gi([r,n],t.properties,t)}var Pi=Ab;m();m();function Fb(o,t,e){e===void 0&&(e={});var r=$o(o),n=$o(t),a=Yr(n[1]-r[1]),s=Yr(n[0]-r[0]),l=Yr(r[1]),c=Yr(n[1]),p=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(l)*Math.cos(c);return sf(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),e.units)}var Zo=Fb;function ql(o,t){return t===void 0&&(t={}),pf(o,function(e,r){var n=r.geometry.coordinates;return e+Zo(n[0],n[1],t)},0)}m();m();m();function Ql(o,t,e){if(e===void 0&&(e={}),e.final===!0)return kb(o,t);var r=$o(o),n=$o(t),a=Yr(r[0]),s=Yr(n[0]),l=Yr(r[1]),c=Yr(n[1]),p=Math.sin(s-a)*Math.cos(c),d=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(s-a);return lf(Math.atan2(p,d))}function kb(o,t){var e=Ql(t,o);return e=(e+180)%360,e}function Lb(o,t,e){e===void 0&&(e={});var r=gi([1/0,1/0],{dist:1/0}),n=0;return cf(o,function(a){for(var s=vi(a),l=0;l<s.length-1;l++){var c=gi(s[l]);c.properties.dist=Zo(t,c,e);var p=gi(s[l+1]);p.properties.dist=Zo(t,p,e);var d=Zo(c,p,e),h=Math.max(c.properties.dist,p.properties.dist),y=Ql(c,p),b=Mp(t,h,y+90,e),I=Mp(t,h,y-90,e),x=yf(Ja([b.geometry.coordinates,I.geometry.coordinates]),Ja([c.geometry.coordinates,p.geometry.coordinates])),_=null;x.features.length>0&&(_=x.features[0],_.properties.dist=Zo(t,_,e),_.properties.location=n+Zo(c,_,e)),c.properties.dist<r.properties.dist&&(r=c,r.properties.index=l,r.properties.location=n),p.properties.dist<r.properties.dist&&(r=p,r.properties.index=l+1,r.properties.location=n+d),_&&_.properties.dist<r.properties.dist&&(r=_,r.properties.index=l),n+=d}}),r}var ls=Lb;function Bb(o,t,e){var r=vi(e);if(uf(e)!=="LineString")throw new Error("line must be a LineString");var n=ls(e,o),a=ls(e,t),s;n.properties.index<=a.properties.index?s=[n,a]:s=[a,n];for(var l=[s[0].geometry.coordinates],c=s[0].properties.index+1;c<s[1].properties.index+1;c++)l.push(r[c]);return l.push(s[1].geometry.coordinates),Ja(l,e.properties)}var Jp=Bb;var Nb=1e-7;function qp(o){return{type:"Point",coordinates:o}}function Rb(o,t){let{coordinates:e}=t.geometry,{coordinates:r}=o.geometry,n=e.map(a=>ls(o,qp(a)));return r.reduce((a,s)=>{let l=Jp(qp(s),n[0],o),c=Jp(qp(s),n[1],o),p=ql(l)<ql(c)?l:c;return p.properties=z(k({},o.properties),{entrances:[]}),a.concat([p])},[])}function Qp(o,t){return t.reduce((e,r)=>{let n={epsilon:Nb},a=e.obstructions.findIndex(l=>bh(Pi(r),l,n)),s=e.obstructions[a];if(s){let[l,c]=Rb(s,r);e.entrances.push(r),e.obstructions.splice(a,1,l,c)}return e},{obstructions:[o],entrances:[]})}m();m();m();var st=class{constructor(t){f(this,"id");this.id=t}};m();m();var Io,wi=class wi{constructor(t,e,r){f(this,"__type",wi.__type);f(this,"id",Ee());f(this,"latitude");f(this,"longitude");f(this,"floorId");f(this,"verticalOffset");M(this,Io,{});var n;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(n=t.verticalOffset)!=null?n:0;else{if(e==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=e,this.floorId=r,this.verticalOffset=0}}static is(t){return t.__type===wi.__type}get anchorTarget(){return this}get focusTarget(){return this}get navigationTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{__type:wi.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}get geoJSON(){if(i(this,Io).geoJSON!=null)return i(this,Io).geoJSON;let t=[this.longitude,this.latitude];return this.verticalOffset!==0&&t.push(this.verticalOffset),i(this,Io).geoJSON={type:"Feature",properties:null,geometry:{type:"Point",coordinates:t}},i(this,Io).geoJSON}toGeoJSON(){return this.geoJSON.geometry}destroy(){for(let t of globalThis.Object.keys(i(this,Io)))delete i(this,Io)[t]}};Io=new WeakMap,f(wi,"__type","coordinate");var Kp=wi,re=Kp;function ed(o){var n,a,s,l,c,p;let t=((a=(n=o.enterprise)==null?void 0:n.locations)==null?void 0:a.reduce((d,h)=>(d[h.id]=h,d),{}))||{};for(let d of((s=o.enterprise)==null?void 0:s.locationInstances)||[])t[d.id]=d;let e={};for(let d of o["floorstack.json"]||[])e[d.id]=d;let r={};for(let d of((l=o["floor.geojson"])==null?void 0:l.features)||[])d.properties&&d.properties.id&&(r[d.properties.id]=d.properties);return{type:"downloaded",data:o,optimized:{"enterprise-location":t,"enterprise-category":((p=(c=o.enterprise)==null?void 0:c.categories)==null?void 0:p.reduce((d,h)=>(d[h.id]=h,d),{}))||{},"floor-stack":e,floor:r}}}var Vb=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function vh(o){return Vb.test(o)}function Ih(o){let t=o.split("?")[1];return!!(t!=null&&t.includes("sv="))}function Mt(o,t){var r;let e=((r=o==null?void 0:o.properties)==null?void 0:r.id)||"unknown";if(o.geometry==null)return A.error('Cannot get the center coordinate for "'.concat(e,'" because it has no geometry.')),new re({latitude:0,longitude:0,floorId:t});try{if(o.geometry.type==="LineString"){let[[n,a],[s,l]]=o.geometry.coordinates,c=(n+s)/2,p=(a+l)/2;return new re({latitude:p,longitude:c,floorId:t})}else if(o.geometry.type==="Point"){let[n,a]=o.geometry.coordinates;return new re({latitude:a,longitude:n,floorId:t})}else if(o.geometry.type==="Polygon"){let n=o;if(n.properties.center!=null){let[a,s]=n.properties.center;return new re({latitude:s,longitude:a,floorId:t})}}}catch(n){}try{let[n,a]=Pi(o).geometry.coordinates;return new re({latitude:a,longitude:n,floorId:t})}catch(n){return A.error('Failed to get center coordinate for "'.concat(e,'" ').concat(n instanceof Error?n.stack:"")),new re({latitude:0,longitude:0,floorId:t})}}function Th(o,t){return t&&(o.flags[t.index]&1<<t.bit)!==0}function Kl(o,t){var a;let e=(a=o.instanceLocationsByPolygonId)==null?void 0:a[t];if(e)return[e];let r=[],n=o.mvfLocationsByGeometryId[t];if(n)for(let s of n){let l=o.getById("enterprise-location",s.id);l&&r.push(l)}return r}var er,ht,Pn,To,Oi=class Oi extends st{constructor(e,r){super(r.mvfData.properties.id);f(this,"__type",Oi.__type);M(this,er);M(this,ht,{});M(this,Pn);M(this,To);E(this,er,e),E(this,Pn,r.floorId),E(this,To,r.mvfData)}static is(e){return e.__type===Oi.__type}get locations(){return i(this,ht).locations?i(this,ht).locations:(i(this,ht).locations=(i(this,er).locationIdsByNodeId[this.id]||[]).map(e=>i(this,er).getById("enterprise-location",e)).filter(Boolean),i(this,ht).locations)}get space(){var e;return i(this,er).getById("space",(e=i(this,er).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get object(){var e;return i(this,er).getById("object",(e=i(this,er).objectIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=i(this,er).getById("floor",i(this,Pn));if(e==null)throw new Error("Floor ".concat(i(this,Pn)," not found!"));return e}get coordinate(){return i(this,ht).coordinate==null&&(i(this,ht).coordinate=Mt(i(this,To),i(this,Pn))),i(this,ht).coordinate}get externalId(){var e;return(e=i(this,To).properties.externalId)!=null?e:""}get neighbors(){if(i(this,ht).neighbors==null){let e=i(this,To).properties.neighbors.map(r=>{let n=i(this,er).getById("node",r.id);if(n==null)throw new Error("Node ".concat(r.id," not found!"));return n});i(this,ht).neighbors=e}return i(this,ht).neighbors}get navigationFlags(){if(i(this,ht).navigationFlags==null){let e=[],r=i(this,To).properties.flags;if(r!=null&&r.length>0)for(let[n,a]of Object.entries(i(this,er).navigationFlags))r.length>a.index&&r[a.index]!=null&&Th({flags:r},a)&&e.push(n);i(this,ht).navigationFlags=Object.freeze(e)}return i(this,ht).navigationFlags}get geoJSON(){return z(k({},i(this,To)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this}toJSON(){return{__type:Oi.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(i(this,ht)))delete i(this,ht)[e]}};er=new WeakMap,ht=new WeakMap,Pn=new WeakMap,To=new WeakMap,f(Oi,"__type","node");var td=Oi,ur=td;m();m();m();m();var cs,So,Di=class Di extends st{constructor(e){super(String(Ee()));f(this,"__type",Di.__type);M(this,cs,{});M(this,So);E(this,So,e.mvfData)}static is(e){return e.__type===Di.__type}get url(){return i(this,So).url}get name(){if("displayName"in i(this,So))return i(this,So).displayName;if("label"in i(this,So))return i(this,So).label}toJSON(){return{__type:Di.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(i(this,cs)))delete i(this,cs)[e]}};cs=new WeakMap,So=new WeakMap,f(Di,"__type","hyperlink");var rd=Di,wn=rd;m();m();function ps(o){var t;return typeof o=="string"?o:(t=o==null?void 0:o.id)!=null?t:""}function Sh(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var jb=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,Gb=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,Ub=o=>jb.test(o)||Gb.test(o),Hb=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,Wb=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,zb=o=>Ub(o)?!1:Hb.test(o)||Wb.test(o),Ai=o=>{var s;if(!zb(o))return null;let t="";o.startsWith("https://")?(t="https://",o=o.slice(8)):o.startsWith("http://")&&(t="http://",o=o.slice(7));let[e,r,n]=o.split("/"),a=(s=n.split(".").pop())!=null?s:"";return{origin:t+e,mapId:r,fileName:n,fileType:a}};function od(o){return o.reduce((t,e,r)=>r===0?t:t+yi(o[r-1].toGeoJSON().coordinates,e.toGeoJSON().coordinates),0)}function Mo(o){return o!=null&&typeof o=="object"&&"__type"in o&&o.__type!==null&&typeof o.__type=="string"}function nd(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function Mh(o){return Mo(o)&&nd(o)}var ds,Jo,On,Fi=class Fi extends st{constructor(e){super(String(Ee()));f(this,"__type",Fi.__type);M(this,ds,{});M(this,Jo);M(this,On);E(this,Jo,e.mvfData),E(this,On,e.mapData)}static is(e){return e.__type===Fi.__type}get url(){let e=i(this,Jo).url;if(i(this,On).tokenManager==null)return e;let r=Ai(i(this,Jo).url);if(r==null)return e;let n=r.mapId;try{if(i(this,On).tokenManager.isEnterpriseMode())return e;let a=i(this,On).tokenManager.getSasToken(n).token;if(a==null||a==="")throw new Error("SAS token empty!");return"".concat(e,"?").concat(a)}catch(a){return r.fileType!=="svg"&&A.error("Error getting SAS token for image",{error:a,url:e}),e}}get name(){return i(this,Jo).altText}get altText(){return i(this,Jo).altText}toJSON(){return{__type:Fi.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(i(this,ds)))delete i(this,ds)[e]}};ds=new WeakMap,Jo=new WeakMap,On=new WeakMap,f(Fi,"__type","image");var id=Fi,qr=id;m();var Dn,Pr=class{constructor(t,e){f(this,"id");M(this,Dn);this.id=t}get geoJSONBoundingBox(){return i(this,Dn)?i(this,Dn):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(E(this,Dn,mi(this.geoJSON)),i(this,Dn))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Dn=new WeakMap;var ki,Eo,xo,lt=class extends Pr{constructor(e,r){super(r.properties.id,e);M(this,ki);M(this,Eo);M(this,xo,{});E(this,ki,e),E(this,Eo,r)}get externalId(){var e;return(e=i(this,Eo).properties.externalId)!=null?e:""}get name(){var r,n,a,s;let e=(n=(r=i(this,Eo).properties.details)==null?void 0:r.name)!=null?n:"";return e===""&&(e=(s=(a=this.locationProfiles.find(l=>l.name&&l.name.length>0))==null?void 0:a.name)!=null?s:""),e}get icon(){var e;return(e=this.locationProfiles.find(r=>r.icon!=null&&r.icon.url!=null&&r.icon.url.length>0))==null?void 0:e.icon}get description(){var r,n,a,s;let e=(n=(r=i(this,Eo).properties.details)==null?void 0:r.description)!=null?n:"";return e===""&&(e=(s=(a=this.locationProfiles.find(l=>l.description&&l.description.length>0))==null?void 0:a.description)!=null?s:""),e}get images(){var r,n,a,s,l;if(i(this,xo).images!=null)return i(this,xo).images;let e=(a=(n=(r=i(this,Eo).properties.details)==null?void 0:r.images)==null?void 0:n.map(c=>new qr({mvfData:c,mapData:i(this,ki)})))!=null?a:[];return(e==null||e.length===0)&&(e=(l=(s=this.locationProfiles.find(c=>c.images.length>0))==null?void 0:s.images)!=null?l:[]),i(this,xo).images=e,e}get links(){var r,n,a,s,l;if(i(this,xo).links!=null)return i(this,xo).links;let e=(a=(n=(r=i(this,Eo).properties.details)==null?void 0:r.links)==null?void 0:n.map(c=>new wn({mvfData:c})))!=null?a:[];return(e==null||e.length===0)&&(e=(l=(s=this.locationProfiles.find(c=>c.links.length>0))==null?void 0:s.links)!=null?l:[]),i(this,xo).links=e,e}get locationProfiles(){var e;return(e=i(this,ki).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}_serializeDetailedMapData(){return{externalId:this.externalId,name:this.name,description:this.description,images:this.images,links:this.links,locationProfiles:this.locationProfiles}}};ki=new WeakMap,Eo=new WeakMap,xo=new WeakMap;m();var fs,wr,An,us=class us{constructor(t,e,r,n){M(this,fs);M(this,wr);M(this,An);f(this,"target");f(this,"__type",us.__type);E(this,fs,t),E(this,wr,e),this.target=r,E(this,An,n)}static is(t){return t.__type===us.__type}get id(){return i(this,fs)}get url(){if(i(this,An)==null)return i(this,wr);let t=Ai(i(this,wr));if(t==null)return i(this,wr);let e=t.mapId;try{if(i(this,An).isEnterpriseMode())return i(this,wr);let r=i(this,An).getSasToken(e).token;if(r==null||r==="")throw new Error("SAS token empty!");return"".concat(i(this,wr),"?").concat(r)}catch(r){return t.fileType!=="svg"&&A.error("Error getting SAS token for image",{error:r,url:i(this,wr)}),i(this,wr)}}};fs=new WeakMap,wr=new WeakMap,An=new WeakMap,f(us,"__type","image-3d");var tr=us;m();m();function qo(o){let t;if(re.is(o))t=o;else if(Ht.is(o))t=o.coordinates[0];else if(Co.is(o))if(o.spaces.length>0)t=o.spaces[0].center;else return;else if(It.is(o))if(o.coordinates.length>0)t=o.coordinates[0];else return;else if("center"in o&&re.is(o.center))t=o.center;else if("coordinate"in o&&re.is(o.coordinate))t=o.coordinate;else return;return t}m();m();var hs={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building-outline","building-top","building","building-wall","building-buffer"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:"auto",footprintColor:"#ffffff"},disableUpdateStateValidation:!1},Qr="ExteriorWalls",Qo="Walls",Eh=0,Li="InteriorDoors",Bi="ExteriorDoors",$e="GeometryLayer",Kr="LabelsLayer",Or="MarkersLayer",gs="FootprintLayer",Fn="OcclusionLayer",kn="AreasLayer",Ni="ImagesLayer",Ln="FacadesLayer",eo="PathsLayer",Dr="ModelsLayer";var xh=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com","https://staging.mappedin.com","https://mappedin-staging.auth0.com/userinfo","https://mappedin.com","https://mappedin.auth0.com/userinfo"],Xb={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var $b=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),Yb=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function ad(o){var t,e;(t=o.outdoorView)!=null&&t.enabled&&!((e=o.outdoorView)!=null&&e.token)&&A.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function sd(o,t){var n,a,s,l,c,p,d;let e=((n=o==null?void 0:o.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,r=z(k(k({},hs),o),{outdoorView:k({enabled:((a=o==null?void 0:o.outdoorView)==null?void 0:a.enabled)===void 0?!!e:(s=o==null?void 0:o.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(l=hs.outdoorView)==null?void 0:l.layersHiddenByGeometry},o==null?void 0:o.outdoorView),bearing:(p=(c=o==null?void 0:o.bearing)!=null?c:t.naturalBearing)!=null?p:0,imagePlacementOptions:k(k({},hs.imagePlacementOptions),o==null?void 0:o.imagePlacementOptions),multiFloorView:k(k({},hs.multiFloorView),o==null?void 0:o.multiFloorView),disableUpdateStateValidation:(d=o==null?void 0:o.disableUpdateStateValidation)!=null?d:!1});return e&&r.outdoorView&&(r.outdoorView.token=e),r}function Ch(o){let t={remove_watermark:!1};if(o)try{let e=Gl(o);Object.assign(t,e.capabilities)}catch(e){A.error("Error decoding capabilities from token",e)}return t}function _h(o){let t=Object.fromEntries(Object.entries(o).filter(([e])=>$b.has(e)));return t.outdoorView&&(t.outdoorView=Object.fromEntries(Object.entries(t.outdoorView).filter(([e])=>Yb.has(e)))),t}var Bn,Nn,_o,Rn,ec,Ph,Ri=class Ri extends lt{constructor(e,r){super(e,r.mvfData);M(this,ec);f(this,"__type",Ri.__type);M(this,Bn);M(this,Nn);M(this,_o,{});M(this,Rn);E(this,Bn,e),E(this,Nn,r.floorId),E(this,Rn,r.mvfData)}static is(e){return e.__type===Ri.__type}get center(){return i(this,_o).center==null&&(i(this,_o).center=Mt(i(this,Rn),i(this,Nn))),i(this,_o).center}get floor(){let e=i(this,Bn).getById("floor",i(this,Nn));if(e==null)throw new Error("Floor ".concat(i(this,Nn)," not found!"));return e}get images3D(){var n;let e=(n=i(this,Bn).floorImagesByAnchorId.get(this.id))!=null?n:[],r=Y(this,ec,Ph).call(this);return r?[...e,r]:e}get geoJSON(){return z(k({},i(this,Rn)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:Ri.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Bn=new WeakMap,Nn=new WeakMap,_o=new WeakMap,Rn=new WeakMap,ec=new WeakSet,Ph=function(){let e=i(this,Rn).properties;if(e.image!=null)return i(this,_o).polygonImage==null&&(i(this,_o).polygonImage=new tr("".concat(this.id,"-polygon-image-").concat(Ee()),e.image.path,this,i(this,Bn).tokenManager)),i(this,_o).polygonImage},f(Ri,"__type","area");var ld=Ri,fr=ld;m();var Vn,Po,jn,Ko,Vi=class Vi extends lt{constructor(e,r){super(e,r.mvfData);f(this,"__type",Vi.__type);M(this,Vn);M(this,Po);M(this,jn);M(this,Ko);E(this,Po,{}),E(this,Ko,r.mvfData),E(this,Vn,e),E(this,jn,r.floorId)}static is(e){return e.__type===Vi.__type}get floor(){let e=i(this,Vn).getById("floor",i(this,jn));if(e==null)throw new Error("Floor ".concat(i(this,jn)," not found!"));return e}get center(){return i(this,Po).center==null&&(i(this,Po).center=Mt(i(this,Ko),i(this,jn))),i(this,Po).center}get isExterior(){var n;if(i(this,Ko).properties.isExterior!==void 0)return i(this,Ko).properties.isExterior;let e=i(this,Vn).obstructionIdByEntranceId[this.id],r=i(this,Vn).getMVFFeatureById("obstruction",e);return(n=r==null?void 0:r.properties.footprintComponent)!=null?n:!1}get geoJSON(){return z(k({},i(this,Ko)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:Vi.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(i(this,Po)))delete i(this,Po)[e]}};Vn=new WeakMap,Po=new WeakMap,jn=new WeakMap,Ko=new WeakMap,f(Vi,"__type","door");var cd=Vi,wt=cd;m();var to,Gn,rt,en,tc,wh,ji=class ji extends lt{constructor(e,r){super(e,r.mvfData);M(this,tc);f(this,"__type",ji.__type);M(this,to);M(this,Gn);M(this,rt,{});M(this,en);E(this,to,e),E(this,Gn,r.floorId),E(this,en,r.mvfData)}static is(e){return e.__type===ji.__type}get type(){return Jb(i(this,en).properties.kind)}get enterpriseLocations(){return i(this,rt).enterpriseLocations!=null?i(this,rt).enterpriseLocations:(i(this,rt).enterpriseLocations=Kl(i(this,to),this.id),i(this,rt).enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=i(this,to).getById("floor",i(this,Gn));if(e==null)throw new Error("Floor ".concat(i(this,Gn)," not found!"));return e}get doors(){var r,n;if(i(this,rt).doors)return i(this,rt).doors;i(this,rt).doors=[];let e=(n=(r=i(this,to).entranceNodeIdsBySpaceId)==null?void 0:r[this.id])!=null?n:[];for(let a of e){let s=i(this,to).doorsByNodeId[a];s&&i(this,rt).doors.push(s)}return i(this,rt).doors}get images3D(){var n;let e=(n=i(this,to).floorImagesByAnchorId.get(this.id))!=null?n:[],r=Y(this,tc,wh).call(this);return r?[...e,r]:e}get center(){return i(this,rt).center==null&&(i(this,rt).center=Mt(i(this,en),i(this,Gn))),i(this,rt).center}get geoJSON(){return z(k({},i(this,en)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:ji.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(i(this,rt)))delete i(this,rt)[e]}};to=new WeakMap,Gn=new WeakMap,rt=new WeakMap,en=new WeakMap,tc=new WeakSet,wh=function(){let e=i(this,en).properties;if(e.image!=null)return i(this,rt).polygonImage==null&&(i(this,rt).polygonImage=new tr("".concat(this.id,"-polygon-image-").concat(Ee()),e.image.path,this,i(this,to).tokenManager)),i(this,rt).polygonImage},f(ji,"__type","space");var pd=ji,Zb=["room","hallway","exterior","void","gate","otb"];function Jb(o){if(o==null||o==="default")return"room";let t=o.toLowerCase();return Zb.includes(t)?t:"room"}var Ze=pd;m();var hr,Ae,Wt,Ui,rc,Gi=class Gi extends Pr{constructor(e,r){super(r.mvfData.properties.id,e);M(this,Ui);f(this,"__type",Gi.__type);M(this,hr);M(this,Ae,{});M(this,Wt);E(this,hr,e),E(this,Wt,r.mvfData)}static is(e){return e.__type===Gi.__type}get focusTarget(){return this}get name(){var r;if(!("name"in i(this,Wt).properties))return(r=i(this,Wt).properties.externalId)!=null?r:"";let e=Y(this,Ui,rc).call(this,"name");return typeof e=="string"?e:""}get shortName(){var r;if(!("shortName"in i(this,Wt).properties))return(r=i(this,Wt).properties.externalId)!=null?r:"";let e=Y(this,Ui,rc).call(this,"shortName");return typeof e=="string"?e:""}get subtitle(){let e=Y(this,Ui,rc).call(this,"subtitle");return typeof e=="string"?e:""}get externalId(){var e;return(e=i(this,Wt).properties.externalId)!=null?e:""}get elevation(){return i(this,Wt).properties.elevation}get maxHeight(){return i(this,Wt).properties.maxHeight}get spaces(){if(i(this,Ae).spaces==null){let e=i(this,hr).spaces.filter(r=>r.floor.id===this.id);i(this,Ae).spaces=e}return i(this,Ae).spaces}get spacesOpenToBelow(){if(i(this,Ae).spacesOpenToBelow==null){let e=[];for(let r of this.spaces)(r.type==="void"||r.type==="otb")&&e.push(r);i(this,Ae).spacesOpenToBelow=e}return i(this,Ae).spacesOpenToBelow}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=i(this,Wt).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(i(this,Ae).objects==null){let e=i(this,hr).objects.filter(r=>r.floor.id===this.id);i(this,Ae).objects=e}return i(this,Ae).objects}get connections(){if(i(this,Ae).connections==null){let e=i(this,hr).connections.filter(r=>r.floors.includes(this));i(this,Ae).connections=e}return i(this,Ae).connections}get doors(){if(i(this,Ae).doors==null){let e=i(this,hr).doors.filter(r=>r.floor.id===this.id);i(this,Ae).doors=e}return i(this,Ae).doors}get annotations(){if(i(this,Ae).annotations==null){let e=i(this,hr).annotations.filter(r=>r.floor.id===this.id);i(this,Ae).annotations=e}return i(this,Ae).annotations}get pois(){if(i(this,Ae).pois==null){let e=i(this,hr).pointsOfInterest.filter(r=>r.floor.id===this.id);i(this,Ae).pois=e}return i(this,Ae).pois}get floorStack(){if(i(this,Ae).floorStack==null){let e=i(this,hr).floorStacks.find(r=>r.floors.includes(this));i(this,Ae).floorStack=e}return i(this,Ae).floorStack}get center(){return i(this,Ae).center==null&&(i(this,Ae).center=Mt(i(this,Wt),this.id)),i(this,Ae).center}toJSON(){return{__type:Gi.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,maxHeight:this.maxHeight,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(i(this,Ae)))delete i(this,Ae)[e]}};hr=new WeakMap,Ae=new WeakMap,Wt=new WeakMap,Ui=new WeakSet,rc=function(e){let r=i(this,Wt).properties[e];return i(this,hr).getPropTranslation(this.__type,e,this.id,r)},f(Gi,"__type","floor");var dd=Gi,zt=dd;m();var Wi,Ar,tn,Hi=class Hi extends lt{constructor(e,r){super(e,{type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:r.mvfData});f(this,"__type",Hi.__type);M(this,Wi);M(this,Ar);M(this,tn);E(this,Ar,{}),E(this,Wi,e),E(this,tn,r.mvfData)}static is(e){return e.__type===Hi.__type}get accessible(){var e;return(e=i(this,tn).accessible)!=null?e:!1}get type(){var e;return(e=i(this,tn).type)!=null?e:"unknown"}get extra(){return i(this,tn).extra}get coordinates(){if(i(this,Ar).coordinates==null){i(this,Ar).coordinates=[];for(let e of this.nodes)i(this,Ar).coordinates.some(r=>r.isEqual(e.coordinate))||i(this,Ar).coordinates.push(e.coordinate)}return i(this,Ar).coordinates}get nodes(){return i(this,tn).nodes.map(e=>i(this,Wi).getById("node",e)).filter(Si)}get floors(){return this.coordinates.map(e=>e.floorId?i(this,Wi).getById("floor",e.floorId):void 0).filter(Si)}get focusTarget(){return this.coordinates}get navigationTarget(){return this.coordinates}toJSON(){return{__type:Hi.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(i(this,Ar)))delete i(this,Ar)[e]}};Wi=new WeakMap,Ar=new WeakMap,tn=new WeakMap,f(Hi,"__type","connection");var ud=Hi,It=ud;m();var rn,Un,Ot,on,oc,Oh,zi=class zi extends lt{constructor(e,r){super(e,r.mvfData);M(this,oc);f(this,"__type",zi.__type);M(this,rn);M(this,Un);M(this,Ot,{});M(this,on);E(this,rn,e),E(this,Un,r.floorId),E(this,on,r.mvfData)}static is(e){return e.__type===zi.__type}get type(){let e=i(this,on).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get enterpriseLocations(){return i(this,Ot).enterpriseLocations!=null?i(this,Ot).enterpriseLocations:(i(this,Ot).enterpriseLocations=Kl(i(this,rn),this.id),i(this,Ot).enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=i(this,rn).getById("floor",i(this,Un));if(e==null)throw new Error("Floor ".concat(i(this,Un)," not found!"));return e}get center(){return i(this,Ot).center==null&&(i(this,Ot).center=Mt(i(this,on),i(this,Un))),i(this,Ot).center}get images3D(){var n;let e=(n=i(this,rn).floorImagesByAnchorId.get(this.id))!=null?n:[],r=Y(this,oc,Oh).call(this);return r?[...e,r]:e}get geoJSON(){return z(k({},i(this,on)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get navigationTarget(){return this}toJSON(){return{__type:zi.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(i(this,Ot)))i(this,Ot)[e]=null}};rn=new WeakMap,Un=new WeakMap,Ot=new WeakMap,on=new WeakMap,oc=new WeakSet,Oh=function(){let e=i(this,on).properties;if(e.image!=null)return i(this,Ot).polygonImage==null&&(i(this,Ot).polygonImage=new tr("".concat(this.id,"-polygon-image-").concat(Ee()),e.image.path,this,i(this,rn).tokenManager)),i(this,Ot).polygonImage},f(zi,"__type","object");var fd=zi,Xt=fd;m();var $i,Hn,nn,Yi,Xi=class Xi extends lt{constructor(e,r){super(e,r.mvfData);f(this,"__type",Xi.__type);M(this,$i);M(this,Hn);M(this,nn,{});M(this,Yi);E(this,$i,e),E(this,Yi,r.mvfData),E(this,Hn,r.floorId)}static is(e){return e.__type===Xi.__type}get navigationTarget(){return this.coordinate}get floor(){let e=i(this,$i).getById("floor",i(this,Hn));if(e==null)throw new Error("Floor ".concat(i(this,Hn)," not found!"));return e}get coordinate(){return i(this,nn).coordinate==null&&(i(this,nn).coordinate=Mt(i(this,Yi),i(this,Hn))),i(this,nn).coordinate}get geoJSON(){return z(k({},i(this,Yi)),{properties:null})}get images3D(){var e;return(e=i(this,$i).floorImagesByAnchorId.get(this.id))!=null?e:[]}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Xi.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in i(this,nn))i(this,nn)[e]=null}};$i=new WeakMap,Hn=new WeakMap,nn=new WeakMap,Yi=new WeakMap,f(Xi,"__type","point-of-interest");var hd=Xi,rr=hd;m();var Ji,Wn,Fr,zn,Xn,ms,md,Zi=class Zi extends lt{constructor(e,r){var n;super(e,r.mvfData);M(this,ms);f(this,"__type",Zi.__type);M(this,Ji);M(this,Wn);M(this,Fr,{});M(this,zn);M(this,Xn);E(this,Ji,e),E(this,Wn,r.floorId),E(this,zn,r.mvfData),E(this,Xn,(n=r.symbol)!=null?n:{url:"",name:""})}static is(e){return e.__type===Zi.__type}get group(){return Y(this,ms,md).call(this).group}get type(){return Y(this,ms,md).call(this).type}get coordinate(){return i(this,Fr).coordinate==null&&(i(this,Fr).coordinate=Mt(i(this,zn),i(this,Wn))),i(this,Fr).coordinate}get floor(){let e=i(this,Ji).getById("floor",i(this,Wn));if(e==null)throw new Error("Floor ".concat(i(this,Wn)," not found!"));return e}get name(){return super.name||i(this,Xn).name||""}get icon(){return i(this,Fr).icon==null&&(i(this,Fr).icon=super.icon||new qr({mvfData:{url:i(this,Xn).url,altText:i(this,Xn).name},mapData:i(this,Ji)})),i(this,Fr).icon}get geoJSON(){return z(k({},i(this,zn)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this.coordinate}toJSON(){return{__type:Zi.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(i(this,Fr)))delete i(this,Fr)[e]}};Ji=new WeakMap,Wn=new WeakMap,Fr=new WeakMap,zn=new WeakMap,Xn=new WeakMap,ms=new WeakSet,md=function(){let[e,r]=i(this,zn).properties.symbolId.split("--");return{group:e,type:r}},f(Zi,"__type","annotation");var gd=Zi,kr=gd;m();m();var Dh=Nl(vd(),1);function qb(o,t,e){e===void 0&&(e={});var r=Ii(o),n=Ii(t),a=Dh.default.union(r.coordinates,n.coordinates);return a.length===0?null:a.length===1?Vl(a[0],e.properties):jl(a,e.properties)}var Ah=qb;var an,Et,Lr,Qi,ys,Td,qi=class qi extends Pr{constructor(e,r){super(r.mvfData.id,e);M(this,ys);f(this,"__type",qi.__type);M(this,an);M(this,Et,{});M(this,Lr);M(this,Qi);E(this,an,e),E(this,Lr,r.mvfData),E(this,Qi,r.facadeId)}static is(e){return e.__type===qi.__type}get type(){return i(this,Lr).type}get name(){let e=Y(this,ys,Td).call(this,"name");return typeof e=="string"?e:""}get shortName(){let e=Y(this,ys,Td).call(this,"shortName");return typeof e=="string"?e:""}get externalId(){var e;return(e=i(this,Lr).externalId)!=null?e:""}get floors(){var e,r;if(i(this,Et).floors==null){let n=((r=(e=i(this,Lr).floors)!=null?e:i(this,Lr).maps)!=null?r:[]).reduce((a,s)=>{let l=i(this,an).floorsById[s];return l&&a.push(l),a},[]);n.length===0&&A.error("Floor stack ".concat(this.id," has no floors")),i(this,Et).floors=n.sort((a,s)=>a.elevation-s.elevation)}return i(this,Et).floors}get defaultFloor(){if(i(this,Et).defaultFloor!=null)return i(this,Et).defaultFloor;let e=i(this,Lr).defaultFloor?i(this,an).getById("floor",i(this,Lr).defaultFloor):void 0;return i(this,Et).defaultFloor=e||this.floors.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r),i(this,Et).defaultFloor}get facade(){return i(this,Qi)?i(this,an).facadesById[i(this,Qi)]:void 0}get focusTarget(){return this}get geoJSON(){if(i(this,Et).geoJSON!=null)return i(this,Et).geoJSON;let e=null;for(let r of this.floors){let n=r.geoJSON;e==null?e=n:e=Ah(e,n)}return i(this,Et).geoJSON=e!=null?e:{type:"Feature",properties:null,geometry:{type:"Polygon",coordinates:[]}},i(this,Et).geoJSON}toJSON(){return{__type:qi.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(i(this,Et)))delete i(this,Et)[e]}};an=new WeakMap,Et=new WeakMap,Lr=new WeakMap,Qi=new WeakMap,ys=new WeakSet,Td=function(e){return i(this,an).getPropTranslation(this.__type,e,this.id,i(this,Lr)[e])},f(qi,"__type","floor-stack");var Id=qi,Ki=Id;m();var ta,$n,ra,ro,ea=class ea extends Pr{constructor(e,r){super(r.mvfData.id,e);f(this,"__type",ea.__type);M(this,ta);M(this,$n);M(this,ra);M(this,ro,{});E(this,ta,r.mvfData),E(this,$n,e),E(this,ra,r.floorStackId)}static is(e){return e.__type===ea.__type}get floorStack(){return i(this,$n).getById("floor-stack",i(this,ra))}get spaces(){if(!i(this,ro).spaces){i(this,ro).spaces=[];for(let e of i(this,ta).spaces){let r=i(this,$n).getById("space",e.spaceId);r&&i(this,ro).spaces.push(r)}}return i(this,ro).spaces}get center(){if(!i(this,ro).center){let e={type:"FeatureCollection",features:[]};for(let n of this.spaces){let a=i(this,$n).mvfSpacesById[n.id];a&&e.features.push(a)}if(e.features.length===0)throw new tt("No geometry found for facade!");let r=Pi(e);i(this,ro).center=new re({latitude:r.geometry.coordinates[1],longitude:r.geometry.coordinates[0],floorId:i(this,ta).spaces[0].floorId})}return i(this,ro).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{id:this.id,__type:ea.__type,floorStackId:i(this,ra),floorStack:this.floorStack,spaces:this.spaces}}};ta=new WeakMap,$n=new WeakMap,ra=new WeakMap,ro=new WeakMap,f(ea,"__type","facade");var Sd=ea,gt=Sd;m();var Qb=new Set(["wall","area"]),Kb=new Set(["desk-entrance"]),e0=o=>{var e;let t={};for(let r of(e=o==null?void 0:o.locations)!=null?e:[])t[r.id]=r;return{mvf3LocationsById:t}},t0=(o,t,e)=>{var p,d,h,y,b,I,x,_,O,U,H;let r={},n={},a={},s={},l={},c={};for(let V of t["location.json"]||[]){let N=new Co(o,{mvf2Data:V,mvf3Data:e[V.id]});if(r[V.id]=N,V.externalId&&(s[V.externalId]==null&&(s[V.externalId]=[]),s[V.externalId].push(N)),V.categories)for(let B of V.categories)l[B]==null&&(l[B]=[]),l[B].push(N);let q=[...(d=(p=V.obstructions)==null?void 0:p.map(B=>B.id))!=null?d:[],...(y=(h=V.spaces)==null?void 0:h.map(B=>B.id))!=null?y:[],...(I=(b=V.annotations)==null?void 0:b.map(B=>B.id))!=null?I:[],...(x=V.connections)!=null?x:[],...(O=(_=V.entrances)==null?void 0:_.map(B=>B.id))!=null?O:[],...(H=(U=V.areas)==null?void 0:U.map(B=>B.id))!=null?H:[]];for(let B of q)B&&(c[B]==null&&(c[B]=[]),c[B].push(N))}for(let V of t["category.json"]||[]){let N=new ic(o,{mvfData:V});n[V.id]=N,V.parent&&(a[V.parent]==null&&(a[V.parent]=[]),a[V.parent].push(N))}return{locationCategoriesByParentId:a,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:s,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:c}},r0=(o,t)=>{let e={},r={},n={},a={},s={},l={},c={},p={},d={},h=globalThis.Object.keys(o.space);for(let y of h){let b=o.space[y];if(b!=null){for(let I of b.features)if(d[I.properties.id]=y,l[I.properties.id]=I,I.properties.kind==="desk-entrance"&&(s[I.properties.externalId]==null&&(s[I.properties.externalId]=[]),s[I.properties.externalId].push(...I.properties.destinationNodes)),!m0(I))if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let x=new rr(t,{floorId:y,mvfData:I});n[I.properties.id]=x,p[y]||(p[y]=[]),p[y].push(I),I.properties.externalId&&(a[I.properties.externalId]==null&&(a[I.properties.externalId]=[]),a[I.properties.externalId].push(x))}else if(I.geometry.type==="Point")A.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let x=new Ze(t,{floorId:y,mvfData:I});e[I.properties.id]=x,I.properties.externalId&&(r[I.properties.externalId]==null&&(r[I.properties.externalId]=[]),r[I.properties.externalId].push(x)),c[y]||(c[y]=[]),c[y].push(I)}}}return{spacesById:e,spacesByExternalId:r,poisById:n,poisByExternalId:a,objectEntranceNodeIdsByObstructionId:s,mvfSpacesById:l,mvfSpacesByFloorId:c,mvfPoisByFloorId:p}},o0=(o,t)=>{var s,l;let e={},r={},n={},a={};for(let c of o["node.geojson"].features){n[c.properties.id]=c;let p=new ur(t,{mvfData:c,floorId:(s=c.properties.floor)!=null?s:c.properties.map});e[c.properties.id]=p,c.properties.externalId&&(r[c.properties.externalId]==null&&(r[c.properties.externalId]=[]),r[c.properties.externalId].push(p));let d=(l=c.properties.floor)!=null?l:c.properties.map;a[d]||(a[d]=[]),a[d].push(c)}return{nodesById:e,nodesByExternalId:r,mvfNodesById:n,mvfNodesByFloorId:a}},n0=(o,t)=>{var l,c;let e={},r={},n={},a={},s=globalThis.Object.keys(o.obstruction);for(let p of s){let d=o.obstruction[p];if(d!=null)for(let h of d.features){n[h.properties.id]=h;for(let b of h.properties.entrances)a[b]=h.properties.id;if(Qb.has((c=(l=h.properties.kind)==null?void 0:l.toLowerCase())!=null?c:""))continue;let y=new Xt(t,{floorId:p,mvfData:h});e[h.properties.id]=y,h.properties.externalId&&(r[h.properties.externalId]==null&&(r[h.properties.externalId]=[]),r[h.properties.externalId].push(y))}}return{objectsById:e,objectsByExternalId:r,mvfObstructionById:n,obstructionIdByEntranceId:a}},i0=(o,t)=>{let e={},r={},n={};if("floor.geojson"in o&&o["floor.geojson"]!=null)for(let a of o["floor.geojson"].features){n[a.properties.id]=a.properties;let s=new zt(t,{mvfData:a});e[a.properties.id]=s,a.properties.externalId&&(r[a.properties.externalId]==null&&(r[a.properties.externalId]=[]),r[a.properties.externalId].push(s))}else for(let a of o["map.geojson"]){n[a.id]=a;let s=new zt(t,{mvfData:{properties:a}});e[a.id]=s}return{floorsById:e,floorsByExternalId:r,mvfFloorsById:n}},a0=(o,t)=>{var c;let e={},r={},n={},a={},s={},l=o["floorstack.json"]||o["mapstack.json"]||o["mapstack.geojson"];if(l!=null)for(let p of l){let d=(c=o.facade)==null?void 0:c[p.id],h=new Ki(t,{mvfData:p,facadeId:d==null?void 0:d.id});if(e[p.id]=h,p.externalId&&(r[p.externalId]==null&&(r[p.externalId]=[]),r[p.externalId].push(h)),n[p.id]=p,d){let y=new gt(t,{mvfData:d,floorStackId:p.id});a[d.id]=y;for(let b of d.spaces)s[b.spaceId]=y}}return{floorStacksById:e,floorStacksByExternalId:r,mvfFloorStacksById:n,facadesById:a,facadesBySpaceId:s}},s0=(o,t)=>{let e={},r={},n=o["connection.json"].reduce((a,s)=>{if(s.nodes.forEach(c=>a[c]=s),r[s.id]=s,s.type==="door")return a;let l=new It(t,{mvfData:s});return e[s.id]=l,a},{});return{connectionsById:e,mvfConnectionsById:r,mvfConnectionsByNodeId:n}},l0=(o,t)=>{let e={},r={},n={},a={},s={},l=globalThis.Object.keys(o.entrance);for(let c of l){let p=o.entrance[c];if(p!=null)for(let d of p.features){a[d.properties.id]=d;let h=new wt(t,{floorId:c,mvfData:d});d.properties.node&&(n[d.properties.node]=h),e[d.properties.id]=h,d.properties.externalId&&(r[d.properties.externalId]==null&&(r[d.properties.externalId]=[]),r[d.properties.externalId].push(h)),s[c]||(s[c]=[]),s[c].push(d)}}return{doorsById:e,doorsByExternalId:r,doorsByNodeId:n,mvfEntrancesById:a,mvfEntrancesByFloorId:s}},c0=(o,t,e)=>{var r;if(o.textAreas!=null)for(let n in o.textAreas){let a=(r=o.textAreas[n])==null?void 0:r.features;if(a!=null){for(let s of a)if("anchorId"in s.properties){let l=s==null?void 0:s.properties,c=t[l.anchorId]||e[l.anchorId];if(c!=null&&l!=null){let p=c.properties;p.textArea=l,p.textArea&&(p.textArea.position=s.geometry.coordinates)}}}}},p0=(o,t,e,r)=>{var n;if(o.floorImages!=null)for(let a in o.floorImages){let s=(n=o.floorImages[a])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||e[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let d=p.properties;d.image=c,d.image&&(d.image.position=l.geometry.coordinates)}}}}},d0=(o,t)=>{var r,n;if(((r=o.enterprise)==null?void 0:r.enterpriseStyles)==null)return;let e=(n=o.enterprise)==null?void 0:n.enterpriseStyles;for(let a in e){let s=e[a];s.geometryAnchors.forEach(l=>{let c=t[l.geometryId];if(c!=null){let p=c.properties;p.style={styleId:a,edgeOffset:s.edgeOffset}}})}},u0=(o,t,e)=>{if(!(o.enterprise==null||o.enterprise.textures==null))for(let r of o.enterprise.textures)for(let n of r.geometryAnchors){let a=t[n.geometryId]||e[n.geometryId];if(a!=null){let s=a.properties;s.textures==null&&(s.textures=[]),s.textures.push(r)}}},f0=(o,t)=>{let e={},r={},n={};if(o.annotation==null)return{annotationsById:e,mvfAnnotationsById:r,mvfAnnotationsByFloorId:n};let a=o["annotation-symbols.json"]||{},s=globalThis.Object.keys(o.annotation);for(let l of s){let c=o.annotation[l];if(c!=null)for(let p of c.features){r[p.properties.id]=p;let d=new kr(t,{floorId:l,mvfData:p,symbol:a[p.properties.symbolId]});e[p.properties.id]=d,n[l]||(n[l]=[]),n[l].push(p)}}return{annotationsById:e,mvfAnnotationsById:r,mvfAnnotationsByFloorId:n}},h0=(o,t)=>{let e={},r={},n={};if(o.area==null)return{areasById:e,areasByExternalId:r,mvfAreasById:n};let a=globalThis.Object.keys(o.area);for(let s of a){let l=o.area[s];if(l!=null)for(let c of l.features){n[c.properties.id]=c;let p=new fr(t,{floorId:s,mvfData:c});e[c.properties.id]=p,c.properties.externalId&&(r[c.properties.externalId]==null&&(r[c.properties.externalId]=[]),r[c.properties.externalId].push(p))}}return{areasById:e,areasByExternalId:r,mvfAreasById:n}},g0=(o,t)=>{var s;let e={},r={},n={},a={};for(let l in o){let c=o[l];if(c==null)continue;let p=(s=c.properties.destinationNodes)!=null?s:[];if(p.length<1)continue;let d=[];for(let h of p)t[h]!=null&&d.push(h),r[h]==null&&(r[h]=[]),r[h].push(c.properties.id),c.properties.kind==="desk-entrance"&&(n[h]==null&&(n[h]=[]),n[h].push(c.properties.externalId));d.length>0&&(e[l]=d),a[l]=p}return{entranceNodeIdsBySpaceId:e,spaceIdsByNodeId:r,objectIdsByNodeId:n,destinationNodesIdsBySpaceId:a}},Fh=(o,t)=>{var U,H,V,N,q,B,J,se,W,ie,Ie,ve,he,X;let e={},r={},n={},a={},s=((H=(U=o.enterprise)==null?void 0:U.locations)!=null?H:[]).reduce(($,me)=>($[me.id]=me,$),{}),l={},c={},p={},d={},h={},y={},b=((V=o.enterprise)==null?void 0:V.venue)||{},I={},x={},_={};for(let $ of(q=(N=o.enterprise)==null?void 0:N.categories)!=null?q:[]){let me=new nc(t,{mvfData:$});l[$.id]=me,$.externalId&&(c[$.externalId]==null&&(c[$.externalId]=[]),c[$.externalId].push(me)),p[$.id]=$,$.locations.forEach(ee=>{h[ee]==null&&(h[ee]=[]),h[ee].push($.id)})}let O={};for(let $ of(J=(B=o.enterprise)==null?void 0:B.locationInstances)!=null?J:[]){let me=s[$.parent],ee=Object.keys(me),oe={};for(let Le of ee)oe[Le]=void 0;let ue=k(z(k({},oe),{polygons:[],nodes:[]}),$);O[ue.parent]==null&&(O[ue.parent]=[]);let ye=new Ht(t,{mvfData:ue,categoryIds:((W=(se=o.enterprise)==null?void 0:se.categoryPriorities)==null?void 0:W[ue.id])||h[ue.id],parentId:$.parent});O[ue.parent].push(ye);for(let Le of(ie=$.polygons)!=null?ie:[])_[Le.id]=ye;I[ue.id]=$,x[ue.id]=ye,$.externalId&&(a[$.externalId]==null&&(a[$.externalId]=[]),a[$.externalId].push(ye))}for(let $ of(ve=(Ie=o.enterprise)==null?void 0:Ie.locations)!=null?ve:[]){let me=new Ht(t,{mvfData:$,categoryIds:((X=(he=o.enterprise)==null?void 0:he.categoryPriorities)==null?void 0:X[$.id])||h[$.id],locationInstances:O[$.id]});n[$.id]=me,$.externalId&&(a[$.externalId]==null&&(a[$.externalId]=[]),a[$.externalId].push(me)),$.nodes.forEach(ee=>{y[ee.id]==null&&(y[ee.id]=[]),y[ee.id].push($.id)});for(let ee of $.polygons)d[ee.id]==null&&(d[ee.id]=[]),d[ee.id].push($)}if(t.enterpriseMode===!0){for(let $ in t.mvfConnectionsById){let me={},ee=t.mvfConnectionsById[$],oe={id:$,externalId:ee.externalId,kind:"enterprise."+ee.type,destinationNodes:[],flags:ee.flags,type:ee.type,nodes:ee.nodes,accessible:ee.accessible,extra:ee.extra,details:ee.details};for(let ue of t.mvfConnectionsById[$].nodes){let ye=t.nodesById[ue];ye!=null&&(me[ye.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ye.coordinate.longitude,ye.coordinate.latitude]},properties:oe})}Object.keys(me).length>0&&(e[$]=new It(t,{mvfData:oe}),ee.externalId&&(r[ee.externalId]==null&&(r[ee.externalId]=[]),r[ee.externalId].push(e[$])))}t.connectionsById=e}return{connectionsByExternalId:r,locationIdsByNodeId:y,mvfLocationsByGeometryId:d,mvfLocationsById:s,mvfCategoriesById:p,locationsById:n,locationInstancesById:x,instanceLocationsByPolygonId:_,locationsByExternalId:a,mvfLocationInstancesById:I,categoriesById:l,categoriesByExternalId:c,venue:b}},kh=(o,t,e)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:a,mvfNodesByFloorId:s}=o0(t,o),{connectionsById:l,mvfConnectionsById:c,mvfConnectionsByNodeId:p}=s0(t,o),{spacesById:d,spacesByExternalId:h,poisById:y,poisByExternalId:b,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:x,mvfSpacesByFloorId:_,mvfPoisByFloorId:O}=r0(t,o),{objectsById:U,objectsByExternalId:H,mvfObstructionById:V,obstructionIdByEntranceId:N}=n0(t,o),{floorsById:q,floorsByExternalId:B,mvfFloorsById:J}=i0(t,o),{floorStacksById:se,floorStacksByExternalId:W,mvfFloorStacksById:ie,facadesById:Ie,facadesBySpaceId:ve}=a0(t,o),{doorsById:he,doorsByExternalId:X,doorsByNodeId:$,mvfEntrancesById:me,mvfEntrancesByFloorId:ee}=l0(t,o),{annotationsById:oe,mvfAnnotationsById:ue,mvfAnnotationsByFloorId:ye}=f0(t,o),{areasById:Le,areasByExternalId:Me,mvfAreasById:ze}=h0(t,o);p0(t,I,V,ze),c0(t,I,V),d0(t,I),u0(t,I,V);let{mvf3LocationsById:Ce}=e0(e),{locationCategoriesByParentId:vt,locationProfilesById:Vt,locationCategoriesById:fo,locationProfilesByExternalId:Ho,locationProfilesByCategoryId:Tn,locationProfilesByAttachedFeatureId:hi}=t0(o,t,Ce),{entranceNodeIdsBySpaceId:qe,spaceIdsByNodeId:Wo,objectIdsByNodeId:dt,destinationNodesIdsBySpaceId:zo}=g0(I,$);return{spacesById:d,spacesByExternalId:h,nodesById:r,nodesByExternalId:n,objectsById:U,objectsByExternalId:H,floorsById:q,floorsByExternalId:B,floorStacksById:se,floorStacksByExternalId:W,facadesById:Ie,facadesBySpaceId:ve,connectionsById:l,doorsById:he,doorsByExternalId:X,doorsByNodeId:$,poisById:y,poisByExternalId:b,annotationsById:oe,areasById:Le,areasByExternalId:Me,objectEntranceNodeIdsByObstructionId:x,obstructionIdByEntranceId:N,locationProfilesById:Vt,locationCategoriesById:fo,locationProfilesByExternalId:Ho,locationProfilesByCategoryId:Tn,locationCategoriesByParentId:vt,mvfSpacesById:I,mvfNodesById:a,mvfObstructionById:V,mvfFloorsById:J,mvfFloorStacksById:ie,mvfConnectionsById:c,mvfConnectionsByNodeId:p,mvfEntrancesById:me,mvfAnnotationsById:ue,mvfNodesByFloorId:s,mvfSpacesByFloorId:_,mvfPoisByFloorId:O,mvfAreasById:ze,mvfEntrancesByFloorId:ee,mvfAnnotationsByFloorId:ye,locationProfilesByAttachedFeatureId:hi,entranceNodeIdsBySpaceId:qe,spaceIdsByNodeId:Wo,objectIdsByNodeId:dt,destinationNodesIdsBySpaceId:zo,mvf3LocationsById:Ce}};function m0(o){var t,e;return!["Polygon","MultiPolygon"].includes(o.geometry.type)&&"kind"in o.properties&&o.properties.kind==null||((t=o.properties.kind)==null?void 0:t.includes("connection"))||Kb.has((e=o.properties.kind)!=null?e:"")}m();var y0=new Set(["polygons"]),or,we,ct,bs,oa=class oa extends st{constructor(e,r){super(r.mvfData.externalId);f(this,"__type",oa.__type);f(this,"description");f(this,"name","");f(this,"amenity");f(this,"externalId","");f(this,"extra");f(this,"gallery");f(this,"instances");f(this,"logo");f(this,"operationHours");f(this,"phone");f(this,"picture");f(this,"shortName");f(this,"showFloatingLabelWhenImagePresent");f(this,"showLogo");f(this,"siblingGroups");f(this,"social");f(this,"sortOrder",-1);f(this,"states");f(this,"tags");f(this,"type","");f(this,"hidden",!1);f(this,"primaryCategory");M(this,or);M(this,we,{});M(this,ct);M(this,bs);E(this,or,e),E(this,ct,r.mvfData),E(this,bs,r.categoryIds||[]),this.instances=r.locationInstances||[];for(let n in r.mvfData)!y0.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(r.parentId){let a=i(this,or).locationsById[r.parentId];return i(this,ct)[n]!=null?i(this,or).getPropTranslation(this.__type,n,i(this,ct).id,i(this,ct)[n]):i(this,or).getPropTranslation(this.__type,n,i(this,ct).id,a[n])}return i(this,or).getPropTranslation(this.__type,n,i(this,ct).id,i(this,ct)[n])}})}static is(e){return e.__type===oa.__type}get focusTarget(){return this.spaces.length>0?this.spaces:this.coordinates}get navigationTarget(){return this.spaces}get categories(){return i(this,we).categories?i(this,we).categories:(i(this,we).categories=(i(this,bs).map(e=>i(this,or).getById("enterprise-category",e))||[]).filter(Boolean),i(this,we).categories)}get coordinates(){if(i(this,we).coordinates)return i(this,we).coordinates;i(this,we).coordinates=[];for(let e=0;e<this.nodes.length;e++)i(this,we).coordinates.push(this.nodes[e].coordinate);return i(this,we).coordinates}get nodes(){if(i(this,we).nodes)return i(this,we).nodes;i(this,we).nodes=[];for(let e=0;e<i(this,ct).nodes.length;e++){let r=i(this,or).getById("node",i(this,ct).nodes[e].id);r&&i(this,we).nodes.push(r)}return i(this,we).nodes}get points(){if(i(this,we).points)return i(this,we).points;i(this,we).points=[];for(let e=0;e<i(this,ct).spaces.length;e++){let r=i(this,or).getById("point-of-interest",i(this,ct).spaces[e].id);r&&i(this,we).points.push(r)}return i(this,we).points}get spaces(){if(i(this,we).spaces)return i(this,we).spaces;i(this,we).spaces=[];let e=Array.isArray(i(this,ct).spaces)?i(this,ct).spaces:i(this,ct).polygons;for(let r=0;r<e.length;r++){let n=i(this,or).getById("space",e[r].id);n&&i(this,we).spaces.push(n)}return i(this,we).spaces}get objects(){if(i(this,we).objects)return i(this,we).objects;i(this,we).objects=[];for(let e=0;e<i(this,ct).polygons.length;e++){let r=i(this,or).getById("object",i(this,ct).polygons[e].id);r&&i(this,we).objects.push(r)}return i(this,we).objects}toJSON(){return{__type:oa.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(i(this,we)))delete i(this,we)[e]}};or=new WeakMap,we=new WeakMap,ct=new WeakMap,bs=new WeakMap,f(oa,"__type","enterprise-location");var Md=oa,Ht=Md;m();var b0=new Set,Yn,Dt,oo,na=class na extends st{constructor(e,r){super(r.mvfData.externalId);f(this,"__type",na.__type);f(this,"name","");f(this,"color");f(this,"externalId","");f(this,"extra");f(this,"icon");f(this,"iconFromDefaultList");f(this,"sortOrder",-1);f(this,"picture");M(this,Yn);M(this,Dt,{});M(this,oo);E(this,Yn,e),E(this,oo,r.mvfData);for(let n in r.mvfData)!b0.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return i(this,Yn).getPropTranslation(this.__type,n,i(this,oo).id,i(this,oo)[n])}})}static is(e){return e.__type===na.__type}get children(){if(i(this,Dt).children)return i(this,Dt).children;i(this,Dt).children=[];for(let e=0;e<i(this,oo).children.length;e++){let r=i(this,Yn).getById("enterprise-category",i(this,oo).children[e]);r&&i(this,Dt).children.push(r)}return i(this,Dt).children}get locations(){if(i(this,Dt).locations)return i(this,Dt).locations;i(this,Dt).locations=[];for(let e=0;e<i(this,oo).locations.length;e++){let r=i(this,Yn).getById("enterprise-location",i(this,oo).locations[e]);r&&i(this,Dt).locations.push(r)}return i(this,Dt).locations}toJSON(){return{__type:na.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(i(this,Dt)))delete i(this,Dt)[e]}};Yn=new WeakMap,Dt=new WeakMap,oo=new WeakMap,f(na,"__type","enterprise-category");var Ed=na,nc=Ed;m();var v0=new Set,vs,Zn,ia=class ia extends st{constructor(e,r){super(r.mvfData.externalId);f(this,"__type",ia.__type);f(this,"countrycode");f(this,"coverImage");f(this,"externalId","");f(this,"defaultLanguage",{code:"en",name:"English"});f(this,"defaultFloor");f(this,"extra");f(this,"icon");f(this,"languages",[]);f(this,"links",[]);f(this,"logo");f(this,"mappedinWebUrl");f(this,"operationHours");f(this,"slug","");f(this,"topLocations");f(this,"tzid");M(this,vs,{});M(this,Zn);E(this,Zn,r.mvfData);for(let n in r.mvfData)!v0.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=r.mvfData[n])}static is(e){return e.__type===ia.__type}get name(){var e;return(e=i(this,Zn).name)!=null?e:""}get defaultMap(){var e,r;return(r=(e=i(this,Zn).defaultMap)!=null?e:this.defaultFloor)!=null?r:""}get enterpriseType(){var e;return(e=i(this,Zn).type)!=null?e:void 0}toJSON(){return{__type:ia.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(i(this,vs)))delete i(this,vs)[e]}};vs=new WeakMap,Zn=new WeakMap,f(ia,"__type","enterprise-venue");var xd=ia,Cd=xd;m();m();m();m();m();var Lh=(a=>(a.Departure="Departure",a.TakeConnection="TakeConnection",a.ExitConnection="ExitConnection",a.Turn="Turn",a.Arrival="Arrival",a))(Lh||{}),_d=(s=>(s.Straight="Straight",s.Right="Right",s.SlightRight="SlightRight",s.Left="Left",s.SlightLeft="SlightLeft",s.Back="Back",s))(_d||{}),Bh=(d=>(d.stairs="stairs",d.elevator="elevator",d.escalator="escalator",d.door="door",d.ramp="ramp",d.slide="slide",d.portal="portal",d.security="security",d.shuttle="shuttle",d.ladder="ladder",d))(Bh||{}),ac=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(ac||{}),sc=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(sc||{});m();function Nh(o){let{fromPosition:t,toPosition:e,junctionInset:r,fromAltitude:n,toAltitude:a}=o;if(r<=0)return null;let s=(t[1]+e[1])/2,{toCartesian:l,toGeographic:c}=df(s),p=l(t),d=l(e),h=d.x-p.x,y=d.y-p.y,b=a-n,I=Math.sqrt(h*h+y*y+b*b);if(I<=r*2)return null;let x=r/I,_={x:p.x+h*x,y:p.y+y*x},O=c(_.x,_.y),U=t[2]!==void 0?t[2]+b*x:void 0,H={x:d.x-h*x,y:d.y-y*x},V=c(H.x,H.y),N=e[2]!==void 0?e[2]-b*x:void 0;return{fromPosition:U!==void 0?[O.lon,O.lat,U]:[O.lon,O.lat],toPosition:N!==void 0?[V.lon,V.lat,N]:[V.lon,V.lat]}}function Pd(o,t,e,r,n){let a=Nh({fromPosition:o,toPosition:t,junctionInset:e,fromAltitude:r,toAltitude:n});return a?(o[0]=a.fromPosition[0],o[1]=a.fromPosition[1],o[2]!==void 0&&a.fromPosition[2]!==void 0&&(o[2]=a.fromPosition[2]),t[0]=a.toPosition[0],t[1]=a.toPosition[1],t[2]!==void 0&&a.toPosition[2]!==void 0&&(t[2]=a.toPosition[2]),!0):!1}function nr(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function S0(o){return new Map(o.map(t=>{let{properties:e}=t,{id:r}=e;return[r,t]}))}var Dd=(o,t)=>{let e=S0(t),r={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:o[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of o){let a=[n.geometry.coordinates],s=(n.properties.entrances||[]).reduce((l,c)=>(e.has(c)&&l.push(e.get(c)),l),[]);if(s.length){let{entrances:l,obstructions:c}=Qp(n,s);a=c.map(p=>p.geometry.coordinates),r.entrances.features.push(...l)}r.walls.geometry.coordinates.push(...a)}return r};function Vh(o,t){return((t-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function jh(o,t){let e="Left";return o<=-Math.PI/4?e="Right":o<=-t?e="SlightRight":o<=t?e="Straight":o<=Math.PI/4?e="SlightLeft":e="Left",e}function Gh(o){let t={};for(let e in o){let r=o[e];if(r!=null){if(r.id=e,"polygons"in r)for(let n of r.polygons)t[n]=r;else if("lineStrings"in r)for(let n of r.lineStrings)t[n]=r;else if("points"in r)for(let n of r.points)t[n]=r}}return t}function Ad(o,t){return o.reduce((e,r)=>{let n=t[r.properties.id];if(n==null)return e;if("textures"in r.properties&&Array.isArray(r.properties.textures)&&r.properties.textures.length>0){let a=z(k({},n),{id:n.id+"-textures"});e.set(a,[r])}else e.has(n)||e.set(n,[]),e.get(n).push(r);return e},new Map)}function aa(o,t={}){var a,s,l,c,p,d,h;let e=z(k({},o),{flipImageToFaceCamera:(a=t==null?void 0:t.flipImagesToFaceCamera)!=null?a:!0}),r=(l=(s=t==null?void 0:t.style)==null?void 0:s.shading)!=null?l:t==null?void 0:t.shadingAndOutlines;r===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof r=="object"&&(e.shading={start:r.start,end:r.end,intensity:r.intensity});let n=(p=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?p:t==null?void 0:t.shadingAndOutlines;if(e.outline=typeof n=="object"?!0:n,"lineStrings"in o){let y=(h=(d=t==null?void 0:t.style)==null?void 0:d.wallTopColor)!=null?h:t==null?void 0:t.wallTopColor;y!=null&&(e.topColor=y)}return e}var Fd=(o,t)=>{var n;let r=((n=t.currentMap)==null?void 0:n.currentFloor).layers.get($e);switch(o){case"interior-walls":return r==null?void 0:r.layers.get(Qo);case"exterior-walls":return r==null?void 0:r.layers.get(Qr);case"interior-doors":return r==null?void 0:r.layers.get(Li);case"exterior-doors":return r==null?void 0:r.layers.get(Bi);default:return typeof o=="string"?o:o==null?void 0:o.id}};function kd(o){return new Promise(t=>{o.onComplete(t),o.onStop(t)})}function Uh(o){return o.bbox?o.bbox:mi(o)}function sa(o,t,e){return o.floorId&&t.has(o.floorId)?t.get(o.floorId):e}function la(o){if(Ze.is(o)||Xt.is(o))return o.id}function Hh(o,t,e){var a,s;let r=o.coordinates.length===2&&o.coordinates[0].floorId!==o.coordinates[1].floorId,n=!0;if(r&&o.coordinates[0].floorId!=null&&o.coordinates[1].floorId!=null){let l=t==null?void 0:t.getById("floor",o.coordinates[0].floorId),c=t==null?void 0:t.getById("floor",o.coordinates[1].floorId);if(l&&c){let p=e.getState(l),d=e.getState(c);p!=null&&d!=null&&(n=p.visible&&d.visible&&p.altitude!==d.altitude)}}else{let l=o.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",o.coordinates[0].floorId):void 0;n=l&&(s=(a=e.getState(l))==null?void 0:a.visible)!=null?s:!0}return n}function Wh(o,t){let e=o.properties.path.split("/"),r=e[e.length-1].split(".")[0],n=atob(r);return"img_"+Rl(n).toString()+"-"+t}function wd(o="auto",t,e=1,r){return o!=="auto"?o*e:t!=null?t*e:r!=null?r*e:3*e}function Rh(o,t,e,r){if(o.maxHeight!=null&&o.maxHeight>0)return wd(t,o.maxHeight,e,r);let n=wd(t,void 0,e,r);if(t==="auto"&&"geometryMaxHeight"in o){let a=o.geometryMaxHeight;if(a!=null&&a>0){let s=Math.ceil(a*1.1);if(s>n)return s}}return n}function zh(o,t="auto",e=1,r,n){if(!o.length)return new Map;let a=o.sort((d,h)=>d.elevation-h.elevation),s=a.findIndex(d=>d.elevation>=0);s===-1&&(s=a.length);let l=0,c=new Map,p=-1;for(let d=s;d<a.length;d+=1){let h=a[d],y=Rh(h,t,e,r);if(!n){let b=h.elevation-p-1;b>0&&(l+=b*y)}c.set(h.elevation,{altitude:l,visualHeight:y}),l+=y,p=h.elevation}l=0;for(let d=s-1;d>=0;d-=1){let h=a[d],y=Rh(h,t,e,r),b=-(l+y);c.set(h.elevation,{altitude:b,visualHeight:y}),l+=y}return c}function Xh(o,t,e="auto",r=1,n){var p,d;let a=[...o].sort((h,y)=>h.elevation-y.elevation),s=a.findIndex(h=>h.elevation>=0);if(s===-1)return[];let l=[],c=-1;for(let h=s;h<a.length;h+=1){let y=a[h],b=y.elevation-c-1;if(b>0){let I=t.get(y.elevation),x=(p=I==null?void 0:I.visualHeight)!=null?p:wd(e,void 0,r,n),_=b*x,O=(d=I==null?void 0:I.altitude)!=null?d:0;l.push({altitude:O-_,height:_,floorAboveElevation:y.elevation,missingCount:b})}c=y.elevation}return l}function lc(o,t){let e=t(o.center);return{center:new re({latitude:e[1],longitude:e[0]}),radius:o.radius}}function $h(o){if(o.geometry.type==="Polygon")return{type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[0]]},properties:o.properties};let t=[];for(let e of o.geometry.coordinates)t.push([e[0]]);return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:t},properties:o.properties}}var Yh=Math.PI*.1,At,$t,ir,wo,Jn,pa,gr,Zh,ca,Jh,sn=class{constructor(t,e,r,n,a){M(this,gr);f(this,"id");M(this,At,{});M(this,$t);M(this,ir);f(this,"departure");f(this,"destination");M(this,wo);M(this,Jn);M(this,pa);var s;this.id=(s=a==null?void 0:a.id)!=null?s:Ee(),E(this,$t,e),E(this,ir,t.features),this.departure=r,this.destination=n}get path(){return i(this,ir).map(t=>i(this,$t).getById("node",t.properties.id)).filter(Boolean)}get coordinates(){return i(this,At).coordinates?i(this,At).coordinates:(i(this,At).coordinates=i(this,ir).map(t=>new re(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),i(this,At).coordinates)}get distance(){return i(this,At).distance?i(this,At).distance:(i(this,At).distance=i(this,ir).reduce((t,e)=>t+(e.properties.distance||0),0),i(this,At).distance)}get instructions(){if(i(this,ir).length<2)return[];if(i(this,At).instructions)return i(this,At).instructions;let t=[],e=0;for(let r=0;r<i(this,ir).length;r++){let n=i(this,ir)[r],a=i(this,ir)[r-1],s=i(this,ir)[r+1],l=new re(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=Y(this,gr,Zh).call(this,{prevDirection:a,direction:n,nextDirection:s});e+=(a==null?void 0:a.properties.distance)||0;for(let p of c)p&&(t.push({action:p,distance:e,coordinate:l,node:i(this,$t).getById("node",n.properties.id)}),e=0)}return i(this,At).instructions=t,i(this,At).instructions}toJSON(){return{id:this.id,directions:i(this,ir),__type:"directions",from:this.departure,to:this.destination,coordinates:this.coordinates,distance:this.distance,instructions:this.instructions}}};At=new WeakMap,$t=new WeakMap,ir=new WeakMap,wo=new WeakMap,Jn=new WeakMap,pa=new WeakMap,gr=new WeakSet,Zh=function(t){var I,x;let{prevDirection:e,direction:r,nextDirection:n}=t,a=e&&i(this,$t).getById("floor",e.properties.groupBy),s=i(this,$t).getById("floor",r.properties.groupBy),l=n&&i(this,$t).getById("floor",n.properties.groupBy),c=[];e||c.push({type:"Departure"});let p=i(this,$t).getMVFFeatureByNodeId("connection",r.properties.id),d=p?i(this,$t).getById("connection",p.id):void 0,h=p&&p.nodes.length>1,y=i(this,$t).enterpriseMode&&(!r.properties.destination||!(p!=null&&p.nodes.includes(r.properties.destination))||!(p!=null&&p.nodes.includes(r.properties.id)));if(p&&!(!h||y))if(!i(this,wo)||i(this,wo)==="exit")c.push(Y(this,gr,ca).call(this,"TakeConnection",s,l,d,p)),E(this,wo,"take"),E(this,Jn,d),E(this,pa,p);else{let _=i(this,$t).getMVFFeatureByNodeId("connection",(I=e==null?void 0:e.properties.id)!=null?I:""),O=i(this,$t).getById("connection",(x=_==null?void 0:_.id)!=null?x:"");c.push(Y(this,gr,ca).call(this,"ExitConnection",s,a,O,_)),E(this,wo,"exit"),E(this,Jn,d),E(this,pa,p)}else i(this,wo)==="take"?(c.push(Y(this,gr,ca).call(this,"ExitConnection",s,a,i(this,Jn),i(this,pa))),E(this,wo,"exit"),E(this,Jn,d)):l&&(s==null?void 0:s.id)!==l.id?c.push(Y(this,gr,ca).call(this,"TakeConnection",s,l,d)):a&&a.id!==(s==null?void 0:s.id)?c.push(Y(this,gr,ca).call(this,"ExitConnection",s,a,d)):c.push(Y(this,gr,Jh).call(this,e,r));return n||c.push({type:"Arrival"}),c},ca=function(t,e,r,n,a){var p,d;let s="none",l=e?e.elevation:0;if(l!=null&&(r==null?void 0:r.elevation)!=null){let h=l-r.elevation;h>0?s="down":h<0&&(s="up")}let c=(d=(p=n==null?void 0:n.type)!=null?p:a==null?void 0:a.type)!=null?d:"stairs";return{type:t,fromFloor:e,toFloor:r,direction:s,connection:n,connectionType:c}},Jh=function(t,e){let r=e.properties.edges;if(!r||r.filter(s=>s.destination.properties.id!==(t==null?void 0:t.properties.id)&&s.destination.properties.id!==e.properties.destination).length===0)return null;let a=t?-Vh(t.properties.angle,e.properties.angle):0;return Math.abs(a)>=Yh?{type:"Turn",bearing:jh(a,Yh),referencePosition:"At"}:null};m();m();m();function qh(o){return Mo(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var M0={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function Qh(o){return z(k({},M0),{lineOfSight:!o})}var je=new WeakMap;function cc(o,t,e){var s;let r=Qh(e),n=t.Query.__LEGACY_NEAREST_SYNC(o,t.getByType("node"),r),a=(s=n==null?void 0:n[0])==null?void 0:s.feature.id;return a?[a]:[]}async function pc(o,t,e){var s;let r=Qh(e),n=await t.Query.nearest(o,t.getByType("node"),r),a=(s=n==null?void 0:n[0])==null?void 0:s.feature.id;return a?[a]:[]}function E0(o,t,e){let r=[];for(let n of o.navigationTarget){let a=da(n,t,e);r.push(...a)}return r}async function x0(o,t,e){let r=[];for(let n of o.navigationTarget){let a=await ln(n,t,e);r.push(...a)}return r}function Kh(o,t){let e=t==null?void 0:t.getMVFFeatureById("entrance",o.id),r=e==null?void 0:e.properties.node;return r?[r]:[]}function eg(o,t){var r;let e=t==null?void 0:t.getMVFFeatureById("area",o.id);return(r=e==null?void 0:e.properties.destinationNodes)!=null?r:[]}function tg(o,t){var n,a;let e=t==null?void 0:t.getMVFFeatureById("space",o.id);if(e==null)return[];let r=(n=t.entranceNodeIdsBySpaceId)==null?void 0:n[o.id];return r&&r.length>0?r:(a=e.properties.destinationNodes)!=null?a:[]}function C0(o,t,e){let r=[];for(let n of o.coordinates){let a=cc(n,t,e);a.length>0&&r.push(a[0])}return r}async function _0(o,t,e){let r=[];for(let n of o.coordinates){let a=await pc(n,t,e);a.length>0&&r.push(a[0])}return r}function rg(o,t){var e;return(e=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[o.id])!=null?e:[]}function og(o,t){return o.spaces.flatMap(e=>{var r,n;return(n=(r=t==null?void 0:t.getMVFFeatureById("space",e.id))==null?void 0:r.properties.destinationNodes)!=null?n:[]}).filter(e=>typeof e=="string")}function ng(o){return o.nodes.map(t=>t.id)}function da(o,t,e){if(je.has(o))return je.get(o);if(Co.is(o)){let r=E0(o,t,e);return je.set(o,r),r}else if(kr.is(o)){let r=cc(o,t,e);return je.set(o,r),r}else if(re.is(o)){let r=cc(o,t,e);return je.set(o,r),r}else{if(rr.is(o))return cc(o,t,e);if(wt.is(o)){let r=Kh(o,t);return je.set(o,r),r}else if(fr.is(o)){let r=eg(o,t);return je.set(o,r),r}else if(Ze.is(o)){let r=tg(o,t);return je.set(o,r),r}else if(It.is(o)){let r=C0(o,t,e);return je.set(o,r),r}else if(Xt.is(o)){let r=rg(o,t);return je.set(o,r),r}else if(gt.is(o)){let r=og(o,t);return je.set(o,r),r}else if(Ht.is(o)){let r=ng(o);return je.set(o,r),r}else if(ur.is(o)){let r=[o.id];return je.set(o,r),r}else return[]}}async function ln(o,t,e){if(je.has(o))return je.get(o);if(Co.is(o)){let r=await x0(o,t,e);return je.set(o,r),r}else if(kr.is(o)){let r=await pc(o,t,e);return je.set(o,r),r}else if(re.is(o)){let r=await pc(o,t,e);return je.set(o,r),r}else if(rr.is(o)){let r=await pc(o,t,e);return je.set(o,r),r}else if(wt.is(o)){let r=Kh(o,t);return je.set(o,r),r}else if(fr.is(o)){let r=eg(o,t);return je.set(o,r),r}else if(Ze.is(o)){let r=tg(o,t);return je.set(o,r),r}else if(It.is(o)){let r=await _0(o,t,e);return je.set(o,r),r}else if(Xt.is(o)){let r=rg(o,t);return je.set(o,r),r}else{if(gt.is(o))return og(o,t);if(Ht.is(o)){let r=ng(o);return je.set(o,r),r}else if(ur.is(o)){let r=[o.id];return je.set(o,r),r}else return[]}}function ig(o,t){if(!o.instances||o.instances.length===0)return o;for(let e of o.instances)if(e.nodes.map(n=>n.id).includes(t))return e;return o}function ag(o,t,e){var a,s;let r=(a=o.features[0])==null?void 0:a.properties.id,n=t[0];if(t.length>1){for(let l of t)if(((s=e.get(l))!=null?s:[]).includes(r)){n=l;break}}return Ht.is(n)&&(n=ig(n,r)),n}function sg(o,t,e){var a,s;let r=(a=o.features[o.features.length-1])==null?void 0:a.properties.id,n=t[0];if(t.length>1){for(let l of t)if(((s=e.get(l))!=null?s:[]).includes(r)){n=l;break}}return Ht.is(n)&&(n=ig(n,r)),n}function Ld(o){if(re.is(o))return o;if(!(!qh(o)||Array.isArray(o.navigationTarget)||!re.is(o.navigationTarget)))return o.navigationTarget}var Is,dc,ua=class{constructor({nodes:t,geojsonCollection:e,connections:r,groupBy:n,multiplicativeDistanceWeightScaling:a,flagDeclarations:s,getDoorByNodeId:l}){f(this,"navigator");f(this,"connections");f(this,"getDirections",async(t,e,r,n)=>{let a=new Map,s=new Map;for(let d of t)a.set(d,await ln(d,n,n.enterpriseMode));for(let d of e)s.set(d,await ln(d,n,n.enterpriseMode));let{originIds:l,destinationNodeIds:c,featureToNodeIdsMap:p}=this.processTargets(a,s,n);return i(this,Is).call(this,t,e,l,c,r,n,p)});f(this,"getDirectionsSync",(t,e,r,n)=>{let a=new Map(t.map(d=>[d,da(d,n,n.enterpriseMode)])),s=new Map(e.map(d=>[d,da(d,n,n.enterpriseMode)])),{originIds:l,destinationNodeIds:c,featureToNodeIdsMap:p}=this.processTargets(a,s,n);return i(this,Is).call(this,t,e,l,c,r,n,p)});M(this,Is,(t,e,r,n,a,s,l)=>{var O;let c=this.getDisabledConnectionNodeIds(a.accessible).filter(U=>!r.includes(U)&&!n.includes(U)),p=new Map,d=k({},a.connectionIdWeightMap);for(let U of a.excludedConnections)d[U.id]=1/0;for(let U in d){let H=s.getById("connection",U);H&&i(this,dc).call(this,H,d[U],p)}let y=((O=a.smoothing.__EXPERIMENTAL_METHOD)!=null?O:"greedy-los")!=="greedy-los",b=this.navigator.getDirections({zones:a.zones.map(U=>{var H;return{geometry:U.geometry,cost:U.cost,map:(H=U.floor)==null?void 0:H.id}}),originIds:r,from:y?lg(t):[],to:y?lg(e):[],destinationNodeIds:n,disabledConnectionNodeIds:c,simplify:a.smoothing,overrideEdgeWeights:p,multiplicativeDistanceWeightScaling:!s.enterpriseMode});this.addCoordinateDirections(b,t,e);let I=ag(b,t,l),x=sg(b,e,l),_=new sn(b,s,I,x);if(!(_.distance===0&&new Set([...r,...n]).size===r.length+n.length))return _});f(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((e,r)=>r.accessible?e:e.concat(r.nodes),[]));M(this,dc,(t,e,r)=>{if(t.nodes.length<2)return;let n=new Set(t.nodes.map(a=>a.id));for(let a of t.nodes){let s=this.navigator.graph.edges[a.id];if(s)for(let l of s)n.has(l.destination.properties.id)&&r.set(l,e)}});f(this,"addCoordinateDirections",(t,[e],[r])=>{if(!t.features.length)return;let n=Ld(e);if(n){let s=this.createDirectionFeature(n,this.navigator.getAngle([n.longitude,n.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([n.longitude,n.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,s)}let a=Ld(r);if(a){let s=this.createDirectionFeature(a,0,0),l=t.features[t.features.length-1];l.properties.distance=this.navigator.getDistance(l.geometry.coordinates,[a.longitude,a.latitude]),l.properties.angle=this.navigator.getAngle(l.geometry.coordinates,[a.longitude,a.latitude]),t.features.push(s)}});f(this,"createDirectionFeature",(t,e,r)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:r,edges:[]}}));this.navigator=new vf({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n,multiplicativeDistanceWeightScaling:a,flagDeclarations:s,getDoorByNodeId:l}),this.connections=r}processTargets(t,e,r){let n=[],a=[],s=new Map,l=new Set,c=new Set;for(let[p,d]of t){let h=s.get(p);h||(h=[],s.set(p,h)),Ze.is(p)&&l.add(p.id);for(let y of d)h.push(y),n.push(y)}for(let[p,d]of e){let h=s.get(p);h||(h=[],s.set(p,h)),Ze.is(p)&&c.add(p.id);for(let y of d)h.push(y),a.push(y)}if(l.size===0&&c.size===0)return{originIds:n,destinationNodeIds:a,featureToNodeIdsMap:s};for(let p of n){let d=r.spaceIdsByNodeId[p]||[];for(let h of d)if(c.has(h)){a.push(p);break}}for(let p of a){let d=r.spaceIdsByNodeId[p]||[];for(let h of d)if(l.has(h)){n.push(p);break}}return{originIds:n,destinationNodeIds:a,featureToNodeIdsMap:s}}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[r,n])=>e.concat(n.features.map(a=>(a.properties.map=r,a))),[])}}};Is=new WeakMap,dc=new WeakMap;function P0(o){if(re.is(o))return o.floorId;if(Ze.is(o)||wt.is(o)||rr.is(o)||kr.is(o)||Xt.is(o)||fr.is(o)||ur.is(o))return o.floor.id;if((It.is(o)||Ht.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(gt.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function lg(o){return o.reduce((t,e)=>{let r=qo(e);if(!r)return t;let n=P0(e);return t.push({type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{id:e.id,neighbors:[],map:n}}),t},[])}m();m();m();import qn from"zod";var fa=50,Bd=1,Nd=!1,cg=qn.object({limit:qn.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:qn.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:qn.boolean().optional().or(qn.literal("auto")),maxDistance:qn.number().optional(),maxResults:qn.number().optional()}),pg={lineOfSight:Nd,mode:"travel-distance",maxDistance:fa,limit:"same-floor",maxResults:Bd},pt,Ss,Ms,Rd,ha,uc,fc,Ts=class{constructor(t,e){M(this,Ms);M(this,pt);M(this,Ss);f(this,"__LEGACY_NEAREST_SYNC",(t,e,r)=>{let n=k(k({},pg),r);try{cg.parse(n)}catch(d){A.error(d);return}let a=qo(t);if(!a)return;let s=Y(this,Ms,Rd).call(this,a,n),l=[],c={},p=[];for(let d of e){let h=da(d,i(this,pt),i(this,pt).enterpriseMode);if(h)for(let y of h)c[y]||(c[y]=[]),c[y].push(d),p.push(y)}return(r==null?void 0:r.mode)==="absolute-distance"?l=i(this,ha).call(this,a,s,e,n):l=i(this,fc).call(this,t,s,p,c,n),l.sort((d,h)=>d.distance-h.distance)});M(this,ha,(t,e,r,n)=>{var l,c;let a=[],s=new Set(r.map(p=>p.__type));for(let p of e)for(let d of s){let h=i(this,Ss).searchWithIncludedIds([t.longitude,t.latitude],d,i(this,pt).mapName,p,r.filter(y=>y.__type===d).map(y=>y.id),(l=n==null?void 0:n.maxDistance)!=null?l:fa,(n==null?void 0:n.lineOfSight)==="auto"?Nd:n==null?void 0:n.lineOfSight,(c=n==null?void 0:n.maxResults)!=null?c:1);if(h)for(let y of h)a.push({distance:y.distance,feature:i(this,pt).getById(d,y.node.properties.parentId)||i(this,pt).getById(d,y.node.properties.id)})}return a});M(this,uc,async(t,e,r,n,a)=>{var l,c,p,d;let s=[];for(let h of e){let y,b=0;if(!ur.is(t)){let I=i(this,ha).call(this,t.anchorTarget,[h],i(this,pt).getByType("node").filter(x=>x.floor.id===h),{limit:"same-floor",lineOfSight:(l=a==null?void 0:a.lineOfSight)!=null?l:!0,mode:"absolute-distance",maxDistance:(c=a==null?void 0:a.maxDistance)!=null?c:fa,maxResults:1});I.length>0&&(y=I[0].feature,b=I[0].distance)}if(y){let I=new Set,x=i(this,pt).directions.navigator.findNearestNodesOnGraph(y.id,((p=a==null?void 0:a.maxDistance)!=null?p:fa)-b,h,r,!1,(d=a==null?void 0:a.maxResults)!=null?d:Bd);for(let _ of x)for(let O of n[_.feature.properties.id])I.has(O.id)||(s.push({distance:_.distance+b,feature:O}),I.add(O.id))}}return s});M(this,fc,(t,e,r,n,a)=>{var l,c,p,d,h;let s=[];for(let y of e){let b;if(ur.is(t)||(b=(p=this.__LEGACY_NEAREST_SYNC(t,i(this,pt).getByType("node"),{lineOfSight:(l=a==null?void 0:a.lineOfSight)!=null?l:!0,mode:"absolute-distance",maxDistance:(c=a==null?void 0:a.maxDistance)!=null?c:fa,maxResults:1}))==null?void 0:p[0].feature),b){let I=i(this,pt).directions.navigator.findNearestNodesOnGraph(b.id,(d=a==null?void 0:a.maxDistance)!=null?d:fa,y,r,(a==null?void 0:a.lineOfSight)==="auto"?Nd:a==null?void 0:a.lineOfSight,(h=a==null?void 0:a.maxResults)!=null?h:Bd);for(let x of I)for(let _ of n[x.feature.properties.id])s.push({distance:x.distance,feature:_})}}return s});E(this,pt,t),E(this,Ss,e)}async nearest(t,e,r){let n=k(k({},pg),r);try{cg.parse(n)}catch(h){A.error(h);return}let a=qo(t);if(!a)return;let s=Y(this,Ms,Rd).call(this,a,n),l=[],c={},p=[],d=[];if((r==null?void 0:r.mode)==="absolute-distance")l=i(this,ha).call(this,a,s,e,n);else{for(let h of e)d.push(ln(h,i(this,pt),i(this,pt).enterpriseMode).then(y=>{if(y)for(let b of y)c[b]||(c[b]=[]),c[b].push(h),p.push(b)}));await Promise.all(d),l=await i(this,uc).call(this,t,s,p,c,n)}return l.sort((h,y)=>h.distance-y.distance)}};pt=new WeakMap,Ss=new WeakMap,Ms=new WeakSet,Rd=function(t,e){let r=t.floorId?[t.floorId]:[];if((e==null?void 0:e.limit)==="all-floors")r=i(this,pt).getByType("floor").map(n=>n.id);else if(t.floorId==null)for(let n of i(this,pt).getByType("floor-stack")){let a=n.defaultFloor;a&&r.push(a.id)}else if((e==null?void 0:e.limit)==="same-elevation"){let n=i(this,pt).floorsById[t.floorId];if(n){let a=n==null?void 0:n.elevation;a!=null&&(r=i(this,pt).getByType("floor-stack").map(s=>{var l;return(l=s.floors.find(c=>c.elevation===a))==null?void 0:l.id}).filter(Boolean))}}return r},ha=new WeakMap,uc=new WeakMap,fc=new WeakMap;m();var ga,gc,dg,hc=class{constructor(t){M(this,gc);M(this,ga);E(this,ga,t)}at(t){let e=[],r=[t.longitude,t.latitude],n=t.floorId?[t.floorId]:i(this,ga).getAllFloorIds();for(let a of n){let s=i(this,ga).searchAtCoordinate(t,a);for(let l of s)Y(this,gc,dg).call(this,r,l)&&e.push(l)}return e}};ga=new WeakMap,gc=new WeakSet,dg=function(t,e){let r=e.geoJSON;if(!r||!r.geometry)return!1;let n=r.geometry.type;return n==="Point"?t[0]===r.geometry.coordinates[0]&&t[1]===r.geometry.coordinates[1]:n!=="Polygon"&&n!=="MultiPolygon"?!1:bf(t,r)};m();m();m();m();function ug(o){let t=+this._x.call(null,o),e=+this._y.call(null,o);return fg(this.cover(t,e),t,e,o)}function fg(o,t,e,r){if(isNaN(t)||isNaN(e))return o;var n,a=o._root,s={data:r},l=o._x0,c=o._y0,p=o._x1,d=o._y1,h,y,b,I,x,_,O,U;if(!a)return o._root=s,o;for(;a.length;)if((x=t>=(h=(l+p)/2))?l=h:p=h,(_=e>=(y=(c+d)/2))?c=y:d=y,n=a,!(a=a[O=_<<1|x]))return n[O]=s,o;if(b=+o._x.call(null,a.data),I=+o._y.call(null,a.data),t===b&&e===I)return s.next=a,n?n[O]=s:o._root=s,o;do n=n?n[O]=new Array(4):o._root=new Array(4),(x=t>=(h=(l+p)/2))?l=h:p=h,(_=e>=(y=(c+d)/2))?c=y:d=y;while((O=_<<1|x)===(U=(I>=y)<<1|b>=h));return n[U]=a,n[O]=s,o}function hg(o){var t,e,r=o.length,n,a,s=new Array(r),l=new Array(r),c=1/0,p=1/0,d=-1/0,h=-1/0;for(e=0;e<r;++e)isNaN(n=+this._x.call(null,t=o[e]))||isNaN(a=+this._y.call(null,t))||(s[e]=n,l[e]=a,n<c&&(c=n),n>d&&(d=n),a<p&&(p=a),a>h&&(h=a));if(c>d||p>h)return this;for(this.cover(c,p).cover(d,h),e=0;e<r;++e)fg(this,s[e],l[e],o[e]);return this}m();function gg(o,t){if(isNaN(o=+o)||isNaN(t=+t))return this;var e=this._x0,r=this._y0,n=this._x1,a=this._y1;if(isNaN(e))n=(e=Math.floor(o))+1,a=(r=Math.floor(t))+1;else{for(var s=n-e||1,l=this._root,c,p;e>o||o>=n||r>t||t>=a;)switch(p=(t<r)<<1|o<e,c=new Array(4),c[p]=l,l=c,s*=2,p){case 0:n=e+s,a=r+s;break;case 1:e=n-s,a=r+s;break;case 2:n=e+s,r=a-s;break;case 3:e=n-s,r=a-s;break}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=r,this._x1=n,this._y1=a,this}m();function mg(){var o=[];return this.visit(function(t){if(!t.length)do o.push(t.data);while(t=t.next)}),o}m();function yg(o){return arguments.length?this.cover(+o[0][0],+o[0][1]).cover(+o[1][0],+o[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}m();m();function mt(o,t,e,r,n){this.node=o,this.x0=t,this.y0=e,this.x1=r,this.y1=n}function bg(o,t,e){var r,n=this._x0,a=this._y0,s,l,c,p,d=this._x1,h=this._y1,y=[],b=this._root,I,x;for(b&&y.push(new mt(b,n,a,d,h)),e==null?e=1/0:(n=o-e,a=t-e,d=o+e,h=t+e,e*=e);I=y.pop();)if(!(!(b=I.node)||(s=I.x0)>d||(l=I.y0)>h||(c=I.x1)<n||(p=I.y1)<a))if(b.length){var _=(s+c)/2,O=(l+p)/2;y.push(new mt(b[3],_,O,c,p),new mt(b[2],s,O,_,p),new mt(b[1],_,l,c,O),new mt(b[0],s,l,_,O)),(x=(t>=O)<<1|o>=_)&&(I=y[y.length-1],y[y.length-1]=y[y.length-1-x],y[y.length-1-x]=I)}else{var U=o-+this._x.call(null,b.data),H=t-+this._y.call(null,b.data),V=U*U+H*H;if(V<e){var N=Math.sqrt(e=V);n=o-N,a=t-N,d=o+N,h=t+N,r=b.data}}return r}m();function vg(o){if(isNaN(d=+this._x.call(null,o))||isNaN(h=+this._y.call(null,o)))return this;var t,e=this._root,r,n,a,s=this._x0,l=this._y0,c=this._x1,p=this._y1,d,h,y,b,I,x,_,O;if(!e)return this;if(e.length)for(;;){if((I=d>=(y=(s+c)/2))?s=y:c=y,(x=h>=(b=(l+p)/2))?l=b:p=b,t=e,!(e=e[_=x<<1|I]))return this;if(!e.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(r=t,O=_)}for(;e.data!==o;)if(n=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,n?(a?n.next=a:delete n.next,this):t?(a?t[_]=a:delete t[_],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(r?r[O]=e:this._root=e),this):(this._root=a,this)}function Ig(o){for(var t=0,e=o.length;t<e;++t)this.remove(o[t]);return this}m();function Tg(){return this._root}m();function Sg(){var o=0;return this.visit(function(t){if(!t.length)do++o;while(t=t.next)}),o}m();function Mg(o){var t=[],e,r=this._root,n,a,s,l,c;for(r&&t.push(new mt(r,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!o(r=e.node,a=e.x0,s=e.y0,l=e.x1,c=e.y1)&&r.length){var p=(a+l)/2,d=(s+c)/2;(n=r[3])&&t.push(new mt(n,p,d,l,c)),(n=r[2])&&t.push(new mt(n,a,d,p,c)),(n=r[1])&&t.push(new mt(n,p,s,l,d)),(n=r[0])&&t.push(new mt(n,a,s,p,d))}return this}m();function Eg(o){var t=[],e=[],r;for(this._root&&t.push(new mt(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var n=r.node;if(n.length){var a,s=r.x0,l=r.y0,c=r.x1,p=r.y1,d=(s+c)/2,h=(l+p)/2;(a=n[0])&&t.push(new mt(a,s,l,d,h)),(a=n[1])&&t.push(new mt(a,d,l,c,h)),(a=n[2])&&t.push(new mt(a,s,h,d,p)),(a=n[3])&&t.push(new mt(a,d,h,c,p))}e.push(r)}for(;r=e.pop();)o(r.node,r.x0,r.y0,r.x1,r.y1);return this}m();function xg(o){return o[0]}function Cg(o){return arguments.length?(this._x=o,this):this._x}m();function _g(o){return o[1]}function Pg(o){return arguments.length?(this._y=o,this):this._y}function Es(o,t,e){var r=new Vd(t==null?xg:t,e==null?_g:e,NaN,NaN,NaN,NaN);return o==null?r:r.addAll(o)}function Vd(o,t,e,r,n,a){this._x=o,this._y=t,this._x0=e,this._y0=r,this._x1=n,this._y1=a,this._root=void 0}function wg(o){for(var t={data:o.data},e=t;o=o.next;)e=e.next={data:o.data};return t}var Ft=Es.prototype=Vd.prototype;Ft.copy=function(){var o=new Vd(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,r;if(!t)return o;if(!t.length)return o._root=wg(t),o;for(e=[{source:t,target:o._root=new Array(4)}];t=e.pop();)for(var n=0;n<4;++n)(r=t.source[n])&&(r.length?e.push({source:r,target:t.target[n]=new Array(4)}):t.target[n]=wg(r));return o};Ft.add=ug;Ft.addAll=hg;Ft.cover=gg;Ft.data=mg;Ft.extent=yg;Ft.find=bg;Ft.remove=vg;Ft.removeAll=Ig;Ft.root=Tg;Ft.size=Sg;Ft.visit=Mg;Ft.visitAfter=Eg;Ft.x=Cg;Ft.y=Pg;m();function jd(o,t,e,r=0,n=0,a=0,s=0){if(e===void 0){e=o.root();let c=o.extent();if(c&&([[r,n],[a,s]]=c,t(e,r,n,a,s)))return!0;if(!e)return!1}let l=[[r,n,(a+r)/2,(s+n)/2],[(a+r)/2,n,a,(s+n)/2],[r,(s+n)/2,(a+r)/2,s],[(a+r)/2,(s+n)/2,a,s]];for(let c=0;c<4;c++){let p=e[c];if(p){let[d,h,y,b]=l[c];t(p,d,h,y,b)||jd(o,t,p,d,h,y,b)}}return!1}var Og=1e3,w0=.1,O0=5,D0=1.5,Br,xs,yc,Dg,xt,Qn,mc=class{constructor(t,e){M(this,yc);M(this,Br,{});M(this,xs,new Map);f(this,"getMaxSearchRadiusForFloorId",(t,e)=>{var a;let r=(a=i(this,xs).get(i(this,xt).mapName))==null?void 0:a.get(e);if(r)return r;let n=this.getNodeTreeByTypeAndFloorId(t,i(this,xt).mapName,e);if(typeof n.extent=="function")if(n.extent()){let[[s,l],[c,p]]=n.extent(),d=c-s,h=p-l;r=Math.max(d,h)}else r=Og;else r=Og;return i(this,xs).set(i(this,xt).mapName,new Map([[e,r]])),r});M(this,xt);M(this,Qn);E(this,xt,t),E(this,Qn,e)}searchWithIncludedIds(t,e,r,n,a,s,l=!1,c=1/0){let p=this.getNodeTreeByTypeAndFloorId(e,r,n),d=new Set,h=[],y=O0,b=Math.max(s,this.getMaxSearchRadiusForFloorId(e,n));for(;h.length<c&&y<=b;){let I=Y(this,yc,Dg).call(this,t,p,a,y,s,d);I.sort((x,_)=>x.distance-_.distance);for(let x of I){if(h.length>=c)break;l?i(this,xt).directions.navigator.hasLineOfSight(t,x.node.geometry.coordinates,n,w0)&&h.push(x):h.push(x)}y=y*D0}return h}getNodeTreeByTypeAndFloorId(t,e,r){var s,l;if(i(this,Br)[t]||(i(this,Br)[t]={}),(s=i(this,Br)[t][e])!=null&&s[r])return i(this,Br)[t][e][r];i(this,Br)[t][e]||(i(this,Br)[t][e]={}),i(this,Br)[t][e][r]=Es();let n=i(this,Br)[t][e][r];n.x(c=>{let p=c.geometry.coordinates;return i(this,Qn).call(this,p[0],p[1]).x}),n.y(c=>{let p=c.geometry.coordinates;return i(this,Qn).call(this,p[0],p[1]).y});let a=[];switch(t){case"space":a=i(this,xt).mvfSpacesByFloorId[r].flatMap(h=>h.properties.destinationNodes).map(h=>{let y=i(this,xt).mvfNodesById[h];return y?z(k({},y),{properties:{id:y.properties.id,parentId:y.properties.space[0]}}):null});break;case"node":a=((l=i(this,xt).mvfNodesByFloorId[r])==null?void 0:l.filter(h=>h.properties.neighbors.length>0))||[];break;case"point-of-interest":a=i(this,xt).mvfPoisByFloorId[r]||[];break;case"door":a=i(this,xt).mvfEntrancesByFloorId[r]||[];break;case"annotation":a=i(this,xt).mvfAnnotationsByFloorId[r]||[];break;case"enterprise-location":let p=i(this,xt).mvfNodesByFloorId[r]||[],d=i(this,xt).locationIdsByNodeId;a=[];for(let h=0;h<p.length;h++){let y=p[h],b=d[y.properties.id];(b==null?void 0:b.length)>0&&a.push(z(k({},y),{properties:{id:y.properties.id,parentId:b[0]}}))}break}return(a==null?void 0:a.length)>0&&n.addAll(a),n}};Br=new WeakMap,xs=new WeakMap,yc=new WeakSet,Dg=function(t,e,r,n,a,s){let{x:l,y:c}=i(this,Qn).call(this,t[0],t[1]),p=l-n,d=l+n,h=c-n,y=c+n,b=[];return jd(e,(I,x,_,O,U)=>{let H=x>=d||_>=y||O<p||U<h;if("data"in I){let V=I.data,N=V.properties.parentId||V.properties.id;if(r.includes(N)&&!s.has(N)){s.add(N);let q=yi(t,V.geometry.coordinates);q<=a&&b.push({node:V,distance:q})}}return H}),b},xt=new WeakMap,Qn=new WeakMap;m();m();m();m();function bc(o,t,e=0,r=o.length-1,n=A0){for(;r>e;){if(r-e>600){let c=r-e+1,p=t-e+1,d=Math.log(c),h=.5*Math.exp(2*d/3),y=.5*Math.sqrt(d*h*(c-h)/c)*(p-c/2<0?-1:1),b=Math.max(e,Math.floor(t-p*h/c+y)),I=Math.min(r,Math.floor(t+(c-p)*h/c+y));bc(o,t,b,I,n)}let a=o[t],s=e,l=r;for(Cs(o,e,t),n(o[r],a)>0&&Cs(o,e,r);s<l;){for(Cs(o,s,l),s++,l--;n(o[s],a)<0;)s++;for(;n(o[l],a)>0;)l--}n(o[e],a)===0?Cs(o,e,l):(l++,Cs(o,l,r)),l<=t&&(e=l+1),t<=l&&(r=l-1)}}function Cs(o,t,e){let r=o[t];o[t]=o[e],o[e]=r}function A0(o,t){return o<t?-1:o>t?1:0}var ws=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data,r=[];if(!Ic(t,e))return r;let n=this.toBBox,a=[];for(;e;){for(let s=0;s<e.children.length;s++){let l=e.children[s],c=e.leaf?n(l):l;Ic(t,c)&&(e.leaf?r.push(l):Ud(t,c)?this._all(l,r):a.push(l))}e=a.pop()}return r}collides(t){let e=this.data;if(!Ic(t,e))return!1;let r=[];for(;e;){for(let n=0;n<e.children.length;n++){let a=e.children[n],s=e.leaf?this.toBBox(a):a;if(Ic(t,s)){if(e.leaf||Ud(t,s))return!0;r.push(a)}}e=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){let r=this.data;this.data=e,e=r}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ya([]),this}remove(t,e){if(!t)return this;let r=this.data,n=this.toBBox(t),a=[],s=[],l,c,p;for(;r||a.length;){if(r||(r=a.pop(),c=a[a.length-1],l=s.pop(),p=!0),r.leaf){let d=F0(t,r.children,e);if(d!==-1)return r.children.splice(d,1),a.push(r),this._condense(a),this}!p&&!r.leaf&&Ud(r,n)?(a.push(r),s.push(l),l=0,c=r,r=r.children[0]):c?(l++,r=c.children[l],p=!1):r=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){let r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){let a=r-e+1,s=this._maxEntries,l;if(a<=s)return l=ya(t.slice(e,r+1)),ma(l,this.toBBox),l;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),l=ya([]),l.leaf=!1,l.height=n;let c=Math.ceil(a/s),p=c*Math.ceil(Math.sqrt(s));Ag(t,e,r,p,this.compareMinX);for(let d=e;d<=r;d+=p){let h=Math.min(d+p-1,r);Ag(t,d,h,c,this.compareMinY);for(let y=d;y<=h;y+=c){let b=Math.min(y+c-1,h);l.children.push(this._build(t,y,b,n-1))}}return ma(l,this.toBBox),l}_chooseSubtree(t,e,r,n){for(;n.push(e),!(e.leaf||n.length-1===r);){let a=1/0,s=1/0,l;for(let c=0;c<e.children.length;c++){let p=e.children[c],d=Gd(p),h=B0(t,p)-d;h<s?(s=h,a=d<a?d:a,l=p):h===s&&d<a&&(a=d,l=p)}e=l||e.children[0]}return e}_insert(t,e,r){let n=r?t:this.toBBox(t),a=[],s=this._chooseSubtree(n,this.data,e,a);for(s.children.push(t),Ps(s,n);e>=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(n,a,e)}_split(t,e){let r=t[e],n=r.children.length,a=this._minEntries;this._chooseSplitAxis(r,a,n);let s=this._chooseSplitIndex(r,a,n),l=ya(r.children.splice(s,r.children.length-s));l.height=r.height,l.leaf=r.leaf,ma(r,this.toBBox),ma(l,this.toBBox),e?t[e-1].children.push(l):this._splitRoot(r,l)}_splitRoot(t,e){this.data=ya([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ma(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,a=1/0,s=1/0;for(let l=e;l<=r-e;l++){let c=_s(t,0,l,this.toBBox),p=_s(t,l,r,this.toBBox),d=N0(c,p),h=Gd(c)+Gd(p);d<a?(a=d,n=l,s=h<s?h:s):d===a&&h<s&&(s=h,n=l)}return n||r-e}_chooseSplitAxis(t,e,r){let n=t.leaf?this.compareMinX:k0,a=t.leaf?this.compareMinY:L0,s=this._allDistMargin(t,e,r,n),l=this._allDistMargin(t,e,r,a);s<l&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);let a=this.toBBox,s=_s(t,0,e,a),l=_s(t,r-e,r,a),c=vc(s)+vc(l);for(let p=e;p<r-e;p++){let d=t.children[p];Ps(s,t.leaf?a(d):d),c+=vc(s)}for(let p=r-e-1;p>=e;p--){let d=t.children[p];Ps(l,t.leaf?a(d):d),c+=vc(l)}return c}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)Ps(e[n],t)}_condense(t){for(let e=t.length-1,r;e>=0;e--)t[e].children.length===0?e>0?(r=t[e-1].children,r.splice(r.indexOf(t[e]),1)):this.clear():ma(t[e],this.toBBox)}};function F0(o,t,e){if(!e)return t.indexOf(o);for(let r=0;r<t.length;r++)if(e(o,t[r]))return r;return-1}function ma(o,t){_s(o,0,o.children.length,t,o)}function _s(o,t,e,r,n){n||(n=ya(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let a=t;a<e;a++){let s=o.children[a];Ps(n,o.leaf?r(s):s)}return n}function Ps(o,t){return o.minX=Math.min(o.minX,t.minX),o.minY=Math.min(o.minY,t.minY),o.maxX=Math.max(o.maxX,t.maxX),o.maxY=Math.max(o.maxY,t.maxY),o}function k0(o,t){return o.minX-t.minX}function L0(o,t){return o.minY-t.minY}function Gd(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function vc(o){return o.maxX-o.minX+(o.maxY-o.minY)}function B0(o,t){return(Math.max(t.maxX,o.maxX)-Math.min(t.minX,o.minX))*(Math.max(t.maxY,o.maxY)-Math.min(t.minY,o.minY))}function N0(o,t){let e=Math.max(o.minX,t.minX),r=Math.max(o.minY,t.minY),n=Math.min(o.maxX,t.maxX),a=Math.min(o.maxY,t.maxY);return Math.max(0,n-e)*Math.max(0,a-r)}function Ud(o,t){return o.minX<=t.minX&&o.minY<=t.minY&&t.maxX<=o.maxX&&t.maxY<=o.maxY}function Ic(o,t){return t.minX<=o.maxX&&t.minY<=o.maxY&&t.maxX>=o.minX&&t.maxY>=o.minY}function ya(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ag(o,t,e,r,n){let a=[t,e];for(;a.length;){if(e=a.pop(),t=a.pop(),e-t<=r)continue;let s=t+Math.ceil((e-t)/r/2)*r;bc(o,s,t,e,n),a.push(t,s,s,e)}}var cn,Tc=class extends ws{constructor(e){super();M(this,cn);f(this,"toBBox",e=>{var h,y,b,I;let r=e.geoJSONBoundingBox;r==null&&A.warn('Item "'.concat(e.id,'" has no geoJSONBoundingBox; falling back to zero-size bbox at origin.'));let n=r!=null&&r.length===6,a=(h=r==null?void 0:r[0])!=null?h:0,s=(y=r==null?void 0:r[1])!=null?y:0,l=(b=n?r==null?void 0:r[3]:r==null?void 0:r[2])!=null?b:0,c=(I=n?r==null?void 0:r[4]:r==null?void 0:r[3])!=null?I:0,p=i(this,cn).call(this,a,s),d=i(this,cn).call(this,l,c);return{minX:p.x,minY:p.y,maxX:d.x,maxY:d.y}});f(this,"compareMinX",(e,r)=>{let n=this.toBBox(e),a=this.toBBox(r);return n.minX-a.minX});f(this,"compareMinY",(e,r)=>{let n=this.toBBox(e),a=this.toBBox(r);return n.minY-a.minY});E(this,cn,e)}search(e,r,n,a){if(typeof e=="object")return super.search(e);let s=i(this,cn).call(this,e,r),l=i(this,cn).call(this,n,a);return super.search({minX:s.x,minY:s.y,maxX:l.x,maxY:l.y})}searchCoordinate(e){return this.search(e.longitude,e.latitude,e.longitude,e.latitude)}};cn=new WeakMap;var Kn,Os,Ds,Sc=class{constructor(t,e){M(this,Kn);M(this,Os);M(this,Ds,new Map);E(this,Kn,t),E(this,Os,e)}getTreeByFloorId(t){let e=i(this,Ds).get(t);if(e)return e;let r=new Tc(i(this,Os)),n=i(this,Kn).floorsById[t];if(n){let a=[n,...n.spaces,...n.objects];for(let s of i(this,Kn).areas)s.floor.id===t&&a.push(s);r.load(a)}return i(this,Ds).set(t,r),r}searchAtCoordinate(t,e){return this.getTreeByFloorId(e).searchCoordinate(t)}getAllFloorIds(){return i(this,Kn).floors.map(t=>t.id)}};Kn=new WeakMap,Os=new WeakMap,Ds=new WeakMap;m();function Fg(o,t){let e=111319.9*Math.cos(t*Math.PI/180);return(r,n)=>({x:(r-o)*e,y:(n-t)*111319.9})}var ba,Fs,ks,Ls,As=class{constructor(t){M(this,ba);M(this,Fs);M(this,ks);M(this,Ls);f(this,"__LEGACY_NEAREST_SYNC",(t,e,r)=>i(this,ba).__LEGACY_NEAREST_SYNC(t,e,r));let e=Fg(t.mapCenter.longitude,t.mapCenter.latitude);E(this,ks,new mc(t,e)),E(this,Ls,new Sc(t,e)),E(this,ba,new Ts(t,i(this,ks))),E(this,Fs,new hc(i(this,Ls)))}async nearest(t,e,r){return i(this,ba).nearest(t,e,r)}async at(t){return i(this,Fs).at(t)}};ba=new WeakMap,Fs=new WeakMap,ks=new WeakMap,Ls=new WeakMap;m();m();var Bs,Mc=class{constructor(t){M(this,Bs);E(this,Bs,t||[])}get raw(){return i(this,Bs)}};Bs=new WeakMap;var kt,ae,Ge,Ia,va=class va extends st{constructor(e,r){super(r.mvf2Data.id);f(this,"__type",va.__type);f(this,"id","loc_");f(this,"name","");f(this,"externalId");f(this,"description");f(this,"logo");f(this,"logoImage");f(this,"phone");f(this,"social",[]);f(this,"images",[]);f(this,"links",[]);f(this,"website");f(this,"icon");f(this,"extra");f(this,"searchTags");M(this,kt);M(this,ae,{});M(this,Ge);M(this,Ia);E(this,kt,e),E(this,Ge,r.mvf2Data),E(this,Ia,r.mvf3Data);for(let n in r.mvf2Data)n==="links"?this.links=r.mvf2Data.links.map(a=>new wn({mvfData:a})):n==="pictures"?this.images=r.mvf2Data.pictures.map(a=>{var s;return a.url?new qr({mvfData:z(k({},a),{url:(s=a.url)!=null?s:""}),mapData:i(this,kt)}):void 0}).filter(a=>a!=null):n==="website"?r.mvf2Data.website&&(this.website=new wn({mvfData:r.mvf2Data.website})):n==="icon"?r.mvf2Data.icon&&(this.icon=new qr({mvfData:{url:r.mvf2Data.icon},mapData:i(this,kt)})):n==="logo"?r.mvf2Data.logo&&(this.logoImage=new qr({mvfData:{url:r.mvf2Data.logo},mapData:i(this,kt)}),Object.defineProperty(this,"logo",{get(){var a;return(a=this.logoImage)==null?void 0:a.url}})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return i(this,Ge)[n]}});i(this,Ia)&&(this.extra=i(this,Ia).extra)}static is(e){return e.__type===va.__type}get spaces(){if(i(this,ae).spaces)return i(this,ae).spaces;if(i(this,Ge).spaces==null)return i(this,ae).spaces=[],i(this,ae).spaces;i(this,ae).spaces=[];for(let e=0;e<i(this,Ge).spaces.length;e++){let r=i(this,kt).getById("space",i(this,Ge).spaces[e].id);r&&i(this,ae).spaces.push(r)}return i(this,ae).spaces}get points(){if(i(this,ae).points)return i(this,ae).points;if(i(this,Ge).spaces==null)return i(this,ae).points=[],i(this,ae).points;i(this,ae).points=[];for(let e=0;e<i(this,Ge).spaces.length;e++){let r=i(this,kt).getById("point-of-interest",i(this,Ge).spaces[e].id);r&&i(this,ae).points.push(r)}return i(this,ae).points}get doors(){if(i(this,ae).doors)return i(this,ae).doors;if(i(this,Ge).entrances==null)return i(this,ae).doors=[],i(this,ae).doors;i(this,ae).doors=[];for(let e=0;e<i(this,Ge).entrances.length;e++){let r=i(this,kt).getById("door",i(this,Ge).entrances[e].id);r&&i(this,ae).doors.push(r)}return i(this,ae).doors}get connections(){if(i(this,ae).connections)return i(this,ae).connections;if(i(this,Ge).connections==null)return i(this,ae).connections=[],i(this,ae).connections;i(this,ae).connections=[];for(let e of i(this,Ge).connections){let r=i(this,kt).getById("connection",e);r&&i(this,ae).connections.push(r)}return i(this,ae).connections}get annotations(){if(i(this,ae).annotations)return i(this,ae).annotations;if(i(this,Ge).annotations==null)return i(this,ae).annotations=[],i(this,ae).annotations;i(this,ae).annotations=[];for(let e=0;e<i(this,Ge).annotations.length;e++){let r=i(this,kt).getById("annotation",i(this,Ge).annotations[e].id);r&&i(this,ae).annotations.push(r)}return i(this,ae).annotations}get categories(){return i(this,ae).categories?i(this,ae).categories:i(this,Ge).categories==null?(i(this,ae).categories=[],i(this,ae).categories):(i(this,ae).categories=i(this,Ge).categories.map(e=>i(this,kt).getById("location-category",e)).filter(e=>e!=null),i(this,ae).categories)}get mapObjects(){return i(this,ae).mapObjects?i(this,ae).mapObjects:i(this,Ge).obstructions==null?(i(this,ae).mapObjects=[],i(this,ae).mapObjects):(i(this,ae).mapObjects=i(this,Ge).obstructions.map(e=>i(this,kt).getById("object",e.id)).filter(e=>e!=null),i(this,ae).mapObjects)}get areas(){return i(this,ae).areas?i(this,ae).areas:i(this,Ge).areas==null?(i(this,ae).areas=[],i(this,ae).areas):(i(this,ae).areas=i(this,Ge).areas.map(e=>i(this,kt).getById("area",e.id)).filter(e=>e!=null),i(this,ae).areas)}get focusTarget(){if(i(this,ae).focusTarget)return i(this,ae).focusTarget;let e=[];for(let r of this.spaces)e.push(r);for(let r of this.connections)e.push(...r.coordinates);for(let r of this.doors)e.push(r.focusTarget);for(let r of this.mapObjects)e.push(r.focusTarget);for(let r of this.annotations)e.push(r.focusTarget);for(let r of this.points)e.push(r.focusTarget);for(let r of this.areas)e.push(r.focusTarget);return i(this,ae).focusTarget=e,e}get openingHours(){var e;return i(this,ae).openingHours?i(this,ae).openingHours:(i(this,ae).openingHours=new Mc((e=i(this,Ge).openingHoursSpecification)!=null?e:[]),i(this,ae).openingHours)}get navigationTarget(){if(i(this,ae).navigationTarget)return i(this,ae).navigationTarget;let e=[];for(let r of this.spaces)e.push(r);for(let r of this.connections)e.push(...r.coordinates);for(let r of this.doors)e.push(r.focusTarget);for(let r of this.mapObjects)e.push(r.focusTarget);for(let r of this.annotations)e.push(r.focusTarget);for(let r of this.points)e.push(r.focusTarget);return i(this,ae).navigationTarget=e,e}toJSON(){return{__type:va.__type,id:this.id,name:this.name}}};kt=new WeakMap,ae=new WeakMap,Ge=new WeakMap,Ia=new WeakMap,f(va,"__type","location-profile");var Hd=va,Co=Hd;m();var pn,Yt,ei,Ta=class Ta extends st{constructor(e,r){super(r.mvfData.id);f(this,"__type",Ta.__type);f(this,"id","cat_");f(this,"name","");f(this,"icon","");M(this,pn);M(this,Yt,{});M(this,ei);E(this,pn,e),E(this,ei,r.mvfData);for(let n in r.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return i(this,ei)[n]}})}static is(e){return e.__type===Ta.__type}get parent(){return i(this,Yt).parent?i(this,Yt).parent:(i(this,Yt).parent=i(this,ei).parent?i(this,pn).getById("location-category",i(this,ei).parent):void 0,i(this,Yt).parent)}get children(){return i(this,Yt).children?i(this,Yt).children:(i(this,Yt).children=i(this,pn).locationCategoriesByParentId[this.id]||[],i(this,Yt).children)}get locationProfiles(){if(i(this,Yt).locationProfiles)return i(this,Yt).locationProfiles;let e=[];for(let r of i(this,pn).locationProfilesByCategoryId[this.id]||[]){let n=i(this,pn).getById("location-profile",r.id);n&&e.push(n)}return i(this,Yt).locationProfiles=e,e}toJSON(){return{__type:Ta.__type,id:this.id,name:this.name}}};pn=new WeakMap,Yt=new WeakMap,ei=new WeakMap,f(Ta,"__type","location-category");var Wd=Ta,ic=Wd;var zd=.75;function R0(o){let t=[];if(o.geometry.type==="Polygon")for(let e=1;e<o.geometry.coordinates.length;e++)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[e]]},properties:z(k({},o.properties),{id:Ee()})});else if(o.geometry.type==="MultiPolygon")for(let e of o.geometry.coordinates)for(let r=1;r<e.length;r++)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:[e[r]]},properties:z(k({},o.properties),{id:Ee()})});return t}function V0(o){var r,n;let t={},e=(n=(r=o["floor.geojson"])==null?void 0:r.features)!=null?n:[];for(let a of e){let s=a.properties.id;if(!s)continue;let l=[];if(a.geometry!=null&&a.geometry.coordinates.length>0){let c=R0(a);for(let p of c)l.push(p)}t[s]={voids:{type:"FeatureCollection",features:l}}}return t}var ge,Ns,Sa,Ma,ti=class extends cr{constructor(e,r){var s,l,c,p,d,h;super();f(this,"Analytics");M(this,ge,{});f(this,"Query");f(this,"mvf");f(this,"outdoorViewToken");f(this,"objectEntranceNodeIdsByObstructionId");f(this,"obstructionIdByEntranceId");f(this,"venue");f(this,"tokenManager");f(this,"directions");f(this,"enterpriseMode",!1);f(this,"nodesById");f(this,"spacesById");f(this,"floorsById");f(this,"floorStacksById");f(this,"facadesById");f(this,"facadesBySpaceId");f(this,"connectionsById");f(this,"objectsById");f(this,"doorsById");f(this,"pointsOfInterestById");f(this,"annotationsById");f(this,"areasById");f(this,"locationProfilesById");f(this,"locationCategoriesById");f(this,"locationProfilesByExternalId");f(this,"locationProfilesByCategoryId");f(this,"locationCategoriesByParentId");f(this,"doorsByNodeId");f(this,"mvfAnnotationsById");f(this,"mvfConnectionsById");f(this,"mvfConnectionsByNodeId");f(this,"mvfEntrancesById");f(this,"mvfNodesById");f(this,"mvfObstructionById");f(this,"mvfSpacesById");f(this,"mvfFloorsById");f(this,"mvfFloorStacksById");f(this,"mvfAreasById");f(this,"spacesByExternalId");f(this,"nodesByExternalId");f(this,"objectsByExternalId");f(this,"poisByExternalId");f(this,"floorsByExternalId");f(this,"floorStacksByExternalId");f(this,"doorsByExternalId");f(this,"areasByExternalId");f(this,"locationProfilesByAttachedFeatureId",{});f(this,"entranceNodeIdsBySpaceId",{});f(this,"locationsById",{});f(this,"locationInstancesById",{});f(this,"instanceLocationsByPolygonId",{});f(this,"categoriesById",{});f(this,"mvfLocationsByGeometryId",{});f(this,"locationIdsByNodeId",{});f(this,"spaceIdsByNodeId",{});f(this,"objectIdsByNodeId",{});f(this,"connectionsByExternalId",{});f(this,"locationsByExternalId",{});f(this,"categoriesByExternalId",{});f(this,"destinationNodesIdsBySpaceId",{});f(this,"mvfNodesByFloorId");f(this,"mvfSpacesByFloorId");f(this,"mvfPoisByFloorId");f(this,"mvfEntrancesByFloorId");f(this,"mvfAnnotationsByFloorId");f(this,"voidsByFloorId",{});f(this,"floorImagesByAnchorId",new Map);f(this,"localePacksUrls");f(this,"currentLanguage");f(this,"languagePacks",{});f(this,"tilesets",{});f(this,"navigationFlags");f(this,"binaryBundle");f(this,"envControl");f(this,"getMapDataOptions");M(this,Ns);M(this,Sa,new re(0,0,"initializing"));f(this,"propTranslationCache",new Map);M(this,Ma);f(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(e,r,n)=>this.__LEGACY_GET_DIRECTIONS_SYNC(e,r,z(k({},n),{multiDestination:!0})));f(this,"__LEGACY_GET_DIRECTIONS_SYNC",(e,r,n)=>{let{accessible:a=!1,multiDestination:s=!1}=n||{},l=kg(this.enterpriseMode,n),c=(n==null?void 0:n.zones)||[],p={accessible:a,zones:c,smoothing:l,excludedConnections:(n==null?void 0:n.excludedConnections)||[],connectionIdWeightMap:(n==null?void 0:n.connectionIdWeightMap)||{}};if(s&&Array.isArray(r)){let d=Array.isArray(e)?e:[e],h=[];for(let y of r){let b=Array.isArray(y)?y:[y],I=this.directions.getDirectionsSync(d,b,p,this);if(!I){A.error("getDirections failed due to missing directions for one of the segments");return}d=b,h.push(I)}return h}else{let d=Array.isArray(e)?e:[e],h=Array.isArray(r)?r:[r];if(Array.isArray(h[0])){A.error("getDirections does not support multi-destination without multisegment option");return}d[0].id&&h[0].id&&this.Analytics.sendGetDirectionsEvent(d[0].id,h[0].id,a);try{return this.directions.getDirectionsSync(d,h,p,this)}catch(y){A.error("Unable to get directions",y);return}}});f(this,"getDirections",async(e,r,n)=>{let{accessible:a=!1}=n||{},s=kg(this.enterpriseMode,n),l=(n==null?void 0:n.zones)||[],c={accessible:a,zones:l,smoothing:s,excludedConnections:(n==null?void 0:n.excludedConnections)||[],connectionIdWeightMap:(n==null?void 0:n.connectionIdWeightMap)||{}},p=Array.isArray(e)?e:[e],d=Array.isArray(r)?r:[r];if(Array.isArray(d[0])){A.error("getDirections does not support multi-destination without multisegment option");return}p[0].id&&d[0].id&&this.Analytics.sendGetDirectionsEvent(p[0].id,d[0].id,a);try{return this.directions.getDirections(p,d,c,this)}catch(h){A.error("Unable to get directions",h);return}});f(this,"getDirectionsMultiDestination",async(e,r,n)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,r,n)));f(this,"getDoorByNodeId",e=>this.doorsByNodeId[e]);f(this,"transformImageRequest",async e=>{var n,a;if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!vh(e))return{url:e};if(Ih(e))return{url:e};let r=Ai(e);if(!r)return{url:e};try{let s=await((n=this.tokenManager)==null?void 0:n.getSasTokensAsync()),l=(a=s==null?void 0:s.tokens)==null?void 0:a[r.mapId];if(l==null)throw new Error("SAS token not found");let[c]=e.split("?");return{url:"".concat(c,"?").concat(l.token)}}catch(s){return A.error("Failed to append SAS token to image request. Requests for private images may fail.",s),{url:e}}});let n=(s=r==null?void 0:r.env)!=null?s:Yo();if(this.envControl=n,this.binaryBundle=r==null?void 0:r.binaryBundle,this.Analytics=new Mi,this.localePacksUrls=(l=r==null?void 0:r.localePacksUrls)!=null?l:{},this.mvf=e,this.outdoorViewToken=r==null?void 0:r.outdoorViewToken,this.getMapDataOptions=r==null?void 0:r.getMapDataOptions,E(this,Ns,r==null?void 0:r.mvf3),((c=e["tileset.json"])==null?void 0:c.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,n.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let y of e["tileset.json"].others)this.tilesets[y.key]=y;this.navigationFlags=(p=e["navigationFlags.json"])!=null?p:{},this.enterpriseMode=(d=r==null?void 0:r.enterprise)!=null?d:!1,this.tokenManager=r==null?void 0:r.tokenManager;let a=kh(this,e,r==null?void 0:r.mvf3);if(this.nodesById=a.nodesById,this.spacesById=a.spacesById,this.floorsById=a.floorsById,this.floorStacksById=a.floorStacksById,this.facadesById=a.facadesById,this.facadesBySpaceId=a.facadesBySpaceId,this.connectionsById=a.connectionsById,this.objectsById=a.objectsById,this.doorsById=a.doorsById,this.pointsOfInterestById=a.poisById,this.annotationsById=a.annotationsById,this.areasById=a.areasById,this.locationProfilesById=a.locationProfilesById,this.locationCategoriesById=a.locationCategoriesById,this.locationProfilesByCategoryId=a.locationProfilesByCategoryId,this.locationCategoriesByParentId=a.locationCategoriesByParentId,this.spacesByExternalId=a.spacesByExternalId,this.nodesByExternalId=a.nodesByExternalId,this.objectsByExternalId=a.objectsByExternalId,this.floorsByExternalId=a.floorsByExternalId,this.locationProfilesByExternalId=a.locationProfilesByExternalId,this.floorStacksByExternalId=a.floorStacksByExternalId,this.poisByExternalId=a.poisByExternalId,this.doorsByExternalId=a.doorsByExternalId,this.areasByExternalId=a.areasByExternalId,this.mvfAnnotationsById=a.mvfAnnotationsById,this.mvfConnectionsById=a.mvfConnectionsById,this.mvfConnectionsByNodeId=a.mvfConnectionsByNodeId,this.mvfEntrancesById=a.mvfEntrancesById,this.mvfNodesById=a.mvfNodesById,this.mvfObstructionById=a.mvfObstructionById,this.mvfSpacesById=a.mvfSpacesById,this.mvfFloorsById=a.mvfFloorsById,this.mvfFloorStacksById=a.mvfFloorStacksById,this.mvfNodesByFloorId=a.mvfNodesByFloorId,this.mvfSpacesByFloorId=a.mvfSpacesByFloorId,this.mvfPoisByFloorId=a.mvfPoisByFloorId,this.mvfEntrancesByFloorId=a.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=a.mvfAnnotationsByFloorId,this.mvfAreasById=a.mvfAreasById,this.doorsByNodeId=a.doorsByNodeId,this.objectEntranceNodeIdsByObstructionId=a.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=a.obstructionIdByEntranceId,this.locationProfilesByAttachedFeatureId=a.locationProfilesByAttachedFeatureId,this.entranceNodeIdsBySpaceId=a.entranceNodeIdsBySpaceId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.objectIdsByNodeId=a.objectIdsByNodeId,this.destinationNodesIdsBySpaceId=a.destinationNodesIdsBySpaceId,this.voidsByFloorId=V0(e),this.enterpriseMode||Rs()){let y=Fh(e,this);if(this.locationsById=y.locationsById,this.locationInstancesById=y.locationInstancesById,this.instanceLocationsByPolygonId=y.instanceLocationsByPolygonId,this.categoriesById=y.categoriesById,this.mvfLocationsByGeometryId=y.mvfLocationsByGeometryId,this.locationIdsByNodeId=y.locationIdsByNodeId,this.connectionsByExternalId=y.connectionsByExternalId,this.locationsByExternalId=y.locationsByExternalId,this.categoriesByExternalId=y.categoriesByExternalId,y.venue.name!=null){this.venue=new Cd(this,{mvfData:y.venue});let b={};for(let I in y.mvfLocationsById)b[I]=y.mvfLocationsById[I];for(let I in y.mvfLocationInstancesById)b[I]=y.mvfLocationInstancesById[I];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":b,"enterprise-category":y.mvfCategoriesById,"floor-stack":a.mvfFloorStacksById,floor:a.mvfFloorsById}},(h=r==null?void 0:r.languagePacks)==null||h.forEach(({language:I,localePack:x})=>{this.languagePacks[I.code]=ed(x)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new ua({nodes:e["node.geojson"],geojsonCollection:this.enterpriseMode&&e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode,flagDeclarations:e["navigationFlags.json"],getDoorByNodeId:(y=>{let b=this.doorsByNodeId[y];if(b!=null)return{geoJSON:b.geoJSON}})}),this.Query=new As(this)}getEnv(){let e=this;return{get baseUri(){return e.envControl.getBaseUri()},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return i(this,Sa).floorId==="initializing"&&E(this,Sa,new re(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])),i(this,Sa)}get naturalBearing(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?e:0}get spaces(){return i(this,ge).spaces==null&&(i(this,ge).spaces=globalThis.Object.values(this.spacesById)),i(this,ge).spaces}get objects(){return i(this,ge).objects==null&&(i(this,ge).objects=globalThis.Object.values(this.objectsById)),i(this,ge).objects}get connections(){return i(this,ge).connections==null&&(i(this,ge).connections=globalThis.Object.values(this.connectionsById)),i(this,ge).connections}get floors(){return i(this,ge).floors==null&&(i(this,ge).floors=globalThis.Object.values(this.floorsById)),i(this,ge).floors}get floorStacks(){return i(this,ge).floorStacks==null&&(i(this,ge).floorStacks=globalThis.Object.values(this.floorStacksById)),i(this,ge).floorStacks}get facades(){return i(this,ge).facades==null&&(i(this,ge).facades=globalThis.Object.values(this.facadesById)),i(this,ge).facades}get doors(){return i(this,ge).doors==null&&(i(this,ge).doors=globalThis.Object.values(this.doorsById)),i(this,ge).doors}get pointsOfInterest(){return i(this,ge).pointsOfInterest==null&&(i(this,ge).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),i(this,ge).pointsOfInterest}get annotations(){return i(this,ge).annotations==null&&(i(this,ge).annotations=globalThis.Object.values(this.annotationsById)),i(this,ge).annotations}get areas(){return i(this,ge).areas==null&&(i(this,ge).areas=globalThis.Object.values(this.areasById)),i(this,ge).areas}get nodes(){return i(this,ge).nodes==null&&(i(this,ge).nodes=globalThis.Object.values(this.nodesById)),i(this,ge).nodes}get locations(){return i(this,ge).locations==null&&(i(this,ge).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return i(this,ge).categories==null&&(i(this,ge).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return i(this,ge).locationProfiles==null&&(i(this,ge).locationProfiles=globalThis.Object.values(this.locationProfilesById)),i(this,ge).locationProfiles}get locationCategories(){return i(this,ge).locationCategories==null&&(i(this,ge).locationCategories=globalThis.Object.values(this.locationCategoriesById)),i(this,ge).locationCategories}get mvfFloors(){return i(this,ge).mvfFloors==null&&(i(this,ge).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),i(this,ge).mvfFloors}get mvfFloorStacks(){return i(this,ge).mvfFloorStacks==null&&(i(this,ge).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),i(this,ge).mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getAllOfTypes(e,r){let n=e instanceof Set?e:new Set(e);return r!=null&&Array.isArray(r)?r.filter(a=>n.has(a.__type)):Array.from(n).flatMap(a=>this.getByType(a))}getById(e,r){let n={"location-profile":this.locationProfilesById,"location-category":this.locationCategoriesById,space:this.spacesById,floor:this.floorsById,"floor-stack":this.floorStacksById,facade:this.facadesById,node:this.nodesById,door:this.doorsById,connection:this.connectionsById,"mvf-connection":this.mvfConnectionsById,object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":l=>{var c;return(c=this.locationsById[l])!=null?c:this.locationInstancesById[l]},"enterprise-category":this.categoriesById},a=l=>{let c=n[l];if(c!=null)return typeof c=="function"?c(r):c[r]},s=()=>{for(let l of Object.keys(n)){let c=a(l);if(c!=null)return c}};return e==="unknown"?s():a(e)}getByExternalId(e,r){var n,a,s,l,c,p,d,h,y,b,I,x;switch(e){case"location-profile":return(n=this.locationProfilesByExternalId[r])!=null?n:[];case"location-category":return[];case"space":return(a=this.spacesByExternalId[r])!=null?a:[];case"floor":return(s=this.floorsByExternalId[r])!=null?s:[];case"floor-stack":return(l=this.floorStacksByExternalId[r])!=null?l:[];case"node":return(c=this.nodesByExternalId[r])!=null?c:[];case"door":return(p=this.doorsByExternalId[r])!=null?p:[];case"connection":return(d=this.connectionsByExternalId[r])!=null?d:[];case"object":return(h=this.objectsByExternalId[r])!=null?h:[];case"point-of-interest":return(y=this.poisByExternalId[r])!=null?y:[];case"area":return(b=this.areasByExternalId[r])!=null?b:[];case"enterprise-location":return(I=this.locationsByExternalId[r])!=null?I:[];case"enterprise-category":return(x=this.categoriesByExternalId[r])!=null?x:[];default:return[]}}getMapDataById(e){var r,n,a,s,l,c,p,d,h,y;return(y=(h=(d=(p=(c=(l=(s=(a=(n=(r=this.spacesById[e])!=null?r:this.floorsById[e])!=null?n:this.floorStacksById[e])!=null?a:this.facadesById[e])!=null?s:this.nodesById[e])!=null?l:this.doorsById[e])!=null?c:this.connectionsById[e])!=null?p:this.objectsById[e])!=null?d:this.pointsOfInterestById[e])!=null?h:this.annotationsById[e])!=null?y:this.areasById[e]}getMVFFeatureById(e,r){switch(e){case"space":return this.mvfSpacesById[r];case"node":return this.mvfNodesById[r];case"obstruction":return this.mvfObstructionById[r];case"floor":return this.mvfFloorsById[r];case"floor-stack":return this.mvfFloorStacksById[r];case"connection":return this.mvfConnectionsById[r];case"entrance":return this.mvfEntrancesById[r];case"annotation":return this.mvfAnnotationsById[r];case"area":return this.mvfAreasById[r];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,r){switch(e){case"connection":return this.mvfConnectionsByNodeId[r];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,r,n,a){var c,p;if(!this.currentLanguage)return a;let{code:s}=this.currentLanguage,l=(p=(c=this.languagePacks[s])==null?void 0:c.optimized)==null?void 0:p[e];if(l){let d=l[n];if(d!=null&&d[r]!==void 0){let h=d[r];if(h!=null&&typeof h=="object"){if(typeof a=="object"&&typeof h=="object"&&!Array.isArray(h)){let y=Rl(s+e+n+r.toString());if(this.propTranslationCache.has(y))return this.propTranslationCache.get(y);let b=hf(a,h,["id"]);return this.propTranslationCache.set(y,b),b}return h}return h}}return a}findPreferredLanguage(e){if(!this.venue)return;let r=Xd(this.venue,e);return(e==null?void 0:e.languageCode)!=null&&e.languageCode.toLowerCase()!==r.code.toLowerCase()&&A.warn('Language code "'.concat(e.languageCode,'" could not be found in the venue. Using "').concat(r.code,'" instead.')),r}async changeLanguage(e){var l;let r=e.toLowerCase();if(!r){A.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){A.error("Changing the language is not supported for this map.");return}let n=this.currentLanguage.code,a=(l=this.venue)==null?void 0:l.languages.find(({code:c})=>c.toLowerCase()===r.toLowerCase());if(!a){A.warn('Language code "'.concat(r,'" could not be found in the venue.'));return}if(n===a.code)return;let s=this.languagePacks[a.code];if(!s){let c=this.localePacksUrls[a.code];if(!c){A.error('Locale pack URL not found for language code "'.concat(a.code,'".'));return}i(this,Ma)&&i(this,Ma).abort();let p=new AbortController;E(this,Ma,p);let d;try{d=await mh(c,{signal:p.signal})}catch(h){A.error('Failed to download language pack for language code "'.concat(a.code,'".'),h);return}if(!d||p.signal.aborted)return;s=ed(d),this.languagePacks[a.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=a,this.publish("language-change",this.currentLanguage)}getDistance(e,r){let n=qo(e),a=qo(r);return yi([n.longitude,n.latitude],[a.longitude,a.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var n;let r=[];if(e&&this.enterpriseMode){let a=new AbortController;for(let s of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[s.code]){let l=await Xp(this.localePacksUrls[s.code],{signal:a.signal}),c=await _i(l);c&&r.push({language:{code:s.code,name:s.name},localePack:c})}}catch(l){A.warn("failed downloading language pack",l)}}return{type:"json",options:{enterprise:this.enterpriseMode,mvf3:i(this,Ns)},languagePacks:r,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var n;if(!this.binaryBundle){A.error("binary bundle not found");return}let r=[];if(e&&this.enterpriseMode){let a=new AbortController;for(let s of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[s.code]){let l=await Xp(this.localePacksUrls[s.code],{signal:a.signal});l&&r.push({language:{code:s.code,name:s.name},localePack:l})}}catch(l){A.warn("failed downloading language pack",l)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:r,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(i(this,ge)))i(this,ge)[e]=null;this.propTranslationCache.clear()}};ge=new WeakMap,Ns=new WeakMap,Sa=new WeakMap,Ma=new WeakMap;var kg=(o,t)=>{var c,p;let e=!o,r=t==null?void 0:t.smoothing,a=r!=null?typeof r=="object"?(c=r.enabled)!=null?c:e:r:e,s=typeof r=="object"?r.radius:void 0,l=typeof r=="object"&&(p=r.__EXPERIMENTAL_METHOD)!=null?p:"greedy-los";return l==="dp-optimal"?{enabled:a,radius:s!=null?s:zd,__EXPERIMENTAL_METHOD:"dp-optimal",includeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="dp-optimal"?r.__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:void 0}:l==="rdp"?{enabled:a,radius:s!=null?s:zd,__EXPERIMENTAL_METHOD:"rdp",mustIncludeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="rdp"?r.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:void 0}:{enabled:a,radius:s!=null?s:zd,__EXPERIMENTAL_METHOD:l}};m();m();m();m();m();var Vs=class Vs{constructor(t,e,r){f(this,"id");f(this,"text");f(this,"target");f(this,"__type",Vs.__type);this.id=t,this.text=e,this.target=r}static is(t){return t.__type===Vs.__type}get focusTarget(){return this.target.anchorTarget}get navigationTarget(){return this.target.anchorTarget}};f(Vs,"__type","label");var Oo=Vs;m();var ri,Ea=class Ea{constructor(t,e,r){f(this,"id");M(this,ri);f(this,"__type",Ea.__type);f(this,"contentEl");this.id=t,this.contentEl=e,E(this,ri,r)}get target(){return i(this,ri)}get coordinate(){return i(this,ri).anchorTarget}get navigationTarget(){return this.target.anchorTarget}toJSON(){return{id:this.id,__type:Ea.__type,target:this.target,coordinate:this.coordinate}}static is(t){return t.__type===Ea.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){E(this,ri,t)}};ri=new WeakMap,f(Ea,"__type","marker");var no=Ea;m();var dn,xa=class xa{constructor(t,e,r){f(this,"id");f(this,"groupId");f(this,"__type",xa.__type);M(this,dn);this.id=t,this.groupId=e,E(this,dn,r)}get target(){return i(this,dn)}static is(t){return t.__type===xa.__type}updateTarget(t){E(this,dn,t)}toJSON(){return{id:this.id,__type:xa.__type,groupId:this.groupId,target:i(this,dn)}}get navigationTarget(){return i(this,dn).anchorTarget}};dn=new WeakMap,f(xa,"__type","model");var oi=xa;m();var ni,js=class js{constructor(t,e){f(this,"id");f(this,"coordinates");M(this,ni);f(this,"__type",js.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===js.__type}get isConnectionSegment(){return this.coordinates.length===2&&this.coordinates[0].floorId!==this.coordinates[1].floorId}get distance(){return i(this,ni)?i(this,ni):(E(this,ni,od(this.coordinates)),i(this,ni))}get focusTarget(){return this.coordinates}};ni=new WeakMap,f(js,"__type","path-segment");var un=js,ii,Ca=class Ca{constructor(t,e,r,n){f(this,"id");f(this,"animation");f(this,"coordinates");f(this,"segments");M(this,ii);f(this,"__type",Ca.__type);this.id=t,this.animation=e,this.coordinates=r,this.segments=n.map(({id:a,coordinates:s})=>new un(a.toString(),s))}static is(t){return t.__type===Ca.__type}get focusTarget(){return this.coordinates}get distance(){return i(this,ii)?i(this,ii):(E(this,ii,od(this.coordinates)),i(this,ii))}toJSON(){return{__type:Ca.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};ii=new WeakMap,f(Ca,"__type","path");var Nr=Ca;m();var j0=7,fn,ai,Gs=class{constructor(t,e){M(this,fn);M(this,ai);var r;E(this,fn,t),E(this,ai,(r=e==null?void 0:e.precision)!=null?r:j0)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let t=i(this,fn).center;if(i(this,ai)===-1)return t;let e=Ul(t.latitude,i(this,ai)),r=Ul(t.longitude,i(this,ai));return new re({latitude:e,longitude:r,floorId:t.floorId,verticalOffset:t.verticalOffset})}get bearing(){return i(this,fn).bearing}get pitch(){return i(this,fn).pitch}get zoomLevel(){return Ul(i(this,fn).zoomLevel,5)}};fn=new WeakMap,ai=new WeakMap;m();var Us=class Us{constructor(t){f(this,"id");f(this,"__type",Us.__type);this.id=t}static is(t){return t.__type===Us.__type}get focusTarget(){return this}};f(Us,"__type","shape");var Do=Us;m();var Hs=class Hs{constructor(t,e){f(this,"id");f(this,"target");f(this,"__type",Hs.__type);this.id=t,this.target=e}static is(t){return t.__type===Hs.__type}};f(Hs,"__type","text-3d");var Ao=Hs;m();m();m();var G0=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>']]),U0=/<svg([^>]*)>/g;function Lg(o,t,e){let r=G0.get(o);return r?r.replace(U0,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var H0=o=>'\n <div class="pin-shadow" style="background: '.concat(o,'"></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(o,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),W0=o=>'\n <div class="pin-shadow" style="background: '.concat(o,'"></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(o,'"\n />\n </svg>\n '),$d="#722ED1",Yd="#1890FF",Bg=({type:o="departure",color:t=Yd,animated:e})=>{let r=e===!1?"":"dropped-pin-wrapper";return'<div class="'.concat(r,'">\n ').concat(o==="departure"?H0(t):W0(t),"\n </div>")},z0=o=>{switch(o){case"default":return 28;case"selection":return 28;case"navigation":return 32}},Ng=({type:o="stairs",color:t=$d,direction:e="up",animated:r})=>{let n=z0("default"),a=n/2+2,s=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(Lg("connection-"+o+"-16x16","white",a)||"","\n </div>\n ").concat(s?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="').concat(r===!1?"":"bouncey",'">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(a,"px; height: ").concat(a,'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>")};m();var Rg=63710088e-1,Ec=new WeakMap,Vg=async o=>new Promise(t=>setTimeout(t,o));function xc(o,t,e){let r=o.distance,n=Y0(o,t,e);return n?(r-(n==null?void 0:n.distance))/r:0}function Zd(o,t){if(o.coordinates.length===0)return[];if(Ec.has(o)&&Ec.get(o).has(t))return Ec.get(o).get(t);let e=o.coordinates.map(r=>Cc(r,t));return Ec.set(o,new Map([[t,e]])),e}function Cc(o,t){let e=t.latitude,r=t.longitude,n=o.latitude-e,a=o.longitude-r,s=Math.PI*Rg/180,l=s*Math.cos(e*Math.PI/180),c=a*l,p=n*s;return{x:c,y:p}}function X0(o,t){if(o.length===0)return;let e,r=1/0;for(let n=0;n<o.length;n++){let a=o[n],s=Zd(a,t);for(let l=0;l<s.length-1;l++){let c=s[l],p=s[l+1],d=_c(c,p,{x:0,y:0}),h=bi({x:0,y:0},d);h<r&&(r=h,e=d)}}if(e)return $0(e,t)}function _c(o,t,e){let r=t.x-o.x,n=t.y-o.y,a=e.x-o.x,s=e.y-o.y,l=r*r+n*n;if(l===0)return{x:o.x,y:o.y};let c=(a*r+s*n)/l,p=Math.max(0,Math.min(1,c));return{x:o.x+p*r,y:o.y+p*n}}function $0(o,t){let r=Math.PI*Rg/180,n=r*Math.cos(t.latitude*Math.PI/180),a=o.y/r,s=o.x/n,l=t.latitude+a,c=t.longitude+s;return new re({latitude:l,longitude:c,floorId:t.floorId,verticalOffset:t.verticalOffset})}function Y0(o,t,e){let r=X0([o],t);if(!r)return;let n=Zd(o,e),a=Cc(r,e),s=-1,l=1/0;for(let p=0;p<n.length-1;p++){let d=n[p],h=n[p+1],y=_c(d,h,a),b=bi(y,a);b<1&&b<l&&(l=b,s=p)}if(s===-1){let p=0,d=1/0;for(let h=0;h<n.length;h++){let y=n[h],b=bi(y,a);b<d&&(d=b,p=h)}s=Math.max(0,p-1)}let c=[r];for(let p=s+1;p<o.coordinates.length;p++)c.push(o.coordinates[p]);return new un("".concat(o.id,"_remaining"),c)}function Pc(o,t,e,r){var h;let n,a,s=1/0,l=1/0,c=Cc(t,r),p=Cc(e,r);for(let y of o)for(let b of y.segments){if(b.isConnectionSegment)continue;let I=(h=b.coordinates[0])==null?void 0:h.floorId,x=I===t.floorId,_=I===e.floorId;if(!x&&!_)continue;let O=Zd(b,r);if(x){let U=1/0;for(let H=0;H<O.length-1;H++){let V=O[H],N=O[H+1],q=_c(V,N,c),B=bi(q,c);B<U&&(U=B)}U<s&&(s=U,n=b)}if(_){let U=1/0;for(let H=0;H<O.length-1;H++){let V=O[H],N=O[H+1],q=_c(V,N,p),B=bi(q,p);B<U&&(U=B)}U<l&&(l=U,a=b)}}if(!n||!a)return;let d=[];if(n.id===a.id)return d.push({segment:n,startHighlightFraction:xc(n,t,r),endHighlightFraction:xc(a,e,r)}),d;for(let y of o)for(let b of y.segments)b.id===n.id?d.push({segment:b,startHighlightFraction:xc(b,t,r),endHighlightFraction:1}):b.id===a.id?d.push({segment:b,startHighlightFraction:0,endHighlightFraction:xc(b,e,r)}):d.push({segment:b,startHighlightFraction:0,endHighlightFraction:1});return d}var jg=.01,Gg=.02,wc=0,Ug={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},Z0={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},hn={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:Ug,inactivePathOptions:Z0,markerOptions:{departureColor:Yd,destinationColor:$d},animatePathDrawing:!0};function _a(o){let t=k({},o);return t.__EXPERIMENTAL_ENDCAP_EXTENSION=[0,0],o.__EXPERIMENTAL__CONNECTION_COLOR!==void 0&&(t.color=o.__EXPERIMENTAL__CONNECTION_COLOR),o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET!==void 0&&(t.__EXPERIMENTAL_JUNCTION_INSET=o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET),o.__EXPERIMENTAL__CONNECTION_DASHED!==void 0&&(t.dashed=o.__EXPERIMENTAL__CONNECTION_DASHED),o.__EXPERIMENTAL__CONNECTION_GEOMETRY!==void 0&&(t.__EXPERIMENTAL_GEOMETRY=o.__EXPERIMENTAL__CONNECTION_GEOMETRY),o.__EXPERIMENTAL__CONNECTION_BILLBOARDING!==void 0&&(t.__EXPERIMENTAL_BILLBOARDING=o.__EXPERIMENTAL__CONNECTION_BILLBOARDING),t}var J0=z(k({},hn),{connectionPathOptions:_a(Ug)}),Fo,mr,Oe,Se,ko,si,Ke,Zt,yr,gn,xe,Hg,Wg,Jd,qd,Qd,zg,Kd,Ws,Oc,Pa,eu,wa,zs=class{constructor(t){M(this,xe);M(this,Fo,new Map);M(this,mr,new Map);M(this,Oe);M(this,Se,J0);M(this,ko);M(this,si);M(this,Ke,[]);M(this,Zt);M(this,yr,new Map);M(this,gn,new Map);M(this,wa,t=>{var e;if((e=i(this,Se).createMarkers)!=null&&e.connection&&t.markers!=null&&t.markers.length>0){let{instruction:r}=i(this,Fo).get(t.markers[0].id);r!=null&&r.action.toFloor&&(i(this,Se).setMapOnConnectionClick&&i(this,Oe).setFloor(r.action.toFloor.id,"navigation-connection-click"),i(this,Oe).publish("navigation-connection-click",{instruction:r,fromFloor:r.action.fromFloor,toFloor:r.action.toFloor}))}});E(this,Oe,t)}get isMultiFloor(){if(!i(this,Ke).length)return!1;let t=new Set;for(let e of i(this,Ke))for(let r of e.coordinates)if(r.floorId&&(t.add(r.floorId),t.size>1))return!0;return!1}getPathById(t){return i(this,mr).get(t)}getMarkerById(t){return i(this,Fo).get(t)}get paths(){let t=new Set;return i(this,mr).forEach(e=>t.add(e)),Array.from(t)}get activeDirections(){return i(this,gn).get(i(this,Zt))}get activePath(){if(i(this,Zt))return i(this,mr).get(i(this,Zt).id)}get floorStacks(){let t=i(this,Oe).getMapData();if(!i(this,Ke).length||!t)return[];let e=new Set;for(let r of i(this,Ke))for(let n of r.coordinates)if(n.floorId){let a=t.getById("floor",n.floorId);a&&e.add(a.floorStack)}return Array.from(e)}get floors(){let t=i(this,Oe).getMapData();if(!i(this,Ke).length||!t)return[];let e=new Set;for(let r of i(this,Ke))for(let n of r.coordinates)if(n.floorId){let a=t.getById("floor",n.floorId);a&&e.add(a)}return Array.from(e)}setActivePathByIndex(t){let e=i(this,Ke)[t];if(!i(this,Ke).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!i(this,Ke)[t]){A.warn("Direction #".concat(t," does not exist"));return}let r=i(this,yr).get(e);if(!r){A.warn("The direction is not a part of muli-direcional path");return}Y(this,xe,Oc).call(this,r)}setActivePath(t){if(!i(this,Ke).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!i(this,gn).get(t)){A.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}Y(this,xe,Oc).call(this,t)}setActivePathByDirections(t){if(!i(this,Ke).length){A.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=i(this,yr).get(t);if(!e){let r=i(this,Ke).find(n=>n.id===t.id);if(!r){A.warn("[setActivePathByDirections] Cannot find directions for id");return}e=i(this,yr).get(r)}if(!e){A.warn("[setActivePathByDirections] Cannot find path for directions");return}Y(this,xe,Oc).call(this,e)}clearHighlightedPathSection(){for(let t of this.paths)for(let e of t.segments)i(this,Oe).updateState(e,{highlightCompleteFraction:0})}highlightPathSection(t,e,r){var d;let n=(d=r==null?void 0:r.animationDuration)!=null?d:1500,a=i(this,Oe).getMapData().mapCenter,s=Pc(this.paths,t,e,a);if(!s)return;this.clearHighlightedPathSection();let l=s.map(h=>{var y,b;return i(this,Oe).updateState(h.segment,{highlightStartFraction:h.startHighlightFraction,highlightEndFraction:h.endHighlightFraction,highlightColor:(y=r==null?void 0:r.color)!=null?y:"red",highlightWidthMultiplier:(b=r==null?void 0:r.widthMultiplier)!=null?b:1}),new yo({fraction:0}).to({fraction:1},n).onUpdate(I=>{i(this,Oe).updateState(h.segment,{highlightCompleteFraction:I.fraction})})}),c=()=>{},p=new Promise(h=>{c=h});return l.length>0&&(l.forEach((h,y)=>{y<l.length-1&&h.chain(l[y+1]),i(this,Oe).tweenGroup().add(l[y])}),l[0].start(),l[l.length-1].onComplete(()=>{i(this,Oe).tweenGroup().remove(l[l.length-1]),c()})),{animation:p}}drawSync(t,e={}){var l,c,p;i(this,si)&&this.clear(),E(this,si,!0),Y(this,xe,Kd).call(this,e);let r=Array.isArray(t)?t:[t],n=r[0],a=r[r.length-1],s=n.coordinates[0];E(this,Ke,r),s.floorId&&i(this,Se).setMapToDeparture&&i(this,Oe).setFloor(s.floorId),(l=i(this,Se).createMarkers)!=null&&l.departure&&Y(this,xe,Pa).call(this,"departure",n.instructions[0]);for(let d=0;d<r.length;d++){let h=r[d];if(h.coordinates.length<2){A.warn("Directions must have at least 2 coordinates");return}let y=d===wc,b=y?i(this,Se).pathOptions:i(this,Se).inactivePathOptions,I=Y(this,xe,Qd).call(this,y?"active":"inactive"),x=z(k({},_a(b)),{animateDrawing:i(this,Se).animatePathDrawing,verticalOffset:I}),_=Y(this,xe,Jd).call(this,h.coordinates,z(k({},b),{animateDrawing:i(this,Se).animatePathDrawing,verticalOffset:I}),x);i(this,yr).set(h,_),i(this,gn).set(_,h),(c=i(this,Se).createMarkers)!=null&&c.connection&&Y(this,xe,eu).call(this,h.instructions,"connection"),y&&(E(this,Zt,i(this,yr).get(i(this,Ke)[wc])),i(this,Oe).externalPubSub.on("click",i(this,wa)))}(p=i(this,Se).createMarkers)!=null&&p.destination&&Y(this,xe,Pa).call(this,"destination",a.instructions[a.instructions.length-1]),i(this,Oe).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)}),Y(this,xe,Ws).call(this)}async draw(t,e={}){i(this,ko)&&this.clear(),Y(this,xe,Kd).call(this,e);let r=Array.isArray(t)?t:[t],a=r[0].coordinates[0];return E(this,Ke,r),a.floorId&&i(this,Se).setMapToDeparture&&i(this,Oe).setFloor(a.floorId),Y(this,xe,zg).call(this,r)}clear(){i(this,Fo).forEach(t=>{t!=null&&t.marker&&i(this,Oe).currentMap.Markers.remove(t.marker.id.toString())}),i(this,Fo).clear(),i(this,mr).forEach(t=>{i(this,Oe).currentMap.Paths.remove(t.segments.map(e=>e.id.toString()))}),i(this,mr).clear(),i(this,ko)&&(i(this,ko).cancel(),E(this,ko,void 0)),i(this,si)&&E(this,si,!1),E(this,Ke,[]),i(this,yr).clear(),i(this,gn).clear(),E(this,Zt,void 0),i(this,Oe).externalPubSub.off("click",i(this,wa)),i(this,Oe).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)}),Y(this,xe,Ws).call(this)}};Fo=new WeakMap,mr=new WeakMap,Oe=new WeakMap,Se=new WeakMap,ko=new WeakMap,si=new WeakMap,Ke=new WeakMap,Zt=new WeakMap,yr=new WeakMap,gn=new WeakMap,xe=new WeakSet,Hg=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},Wg=function(){if(!i(this,Zt))return;let t=i(this,mr).get(i(this,Zt).id);if(t){for(let e of i(this,mr).values())if(e.id.includes("internal-"))if(e.id===i(this,Zt).id)for(let r of t.segments)i(this,Oe).updateState(r,{verticalOffset:Gg});else i(this,Oe).updateState(e,{verticalOffset:jg})}},Jd=function(t,e,r){var l,c;let n=(c=(l=e.id)==null?void 0:l.toString())!=null?c:Ee(),a=i(this,Oe).currentMap.Paths.add(t,e,r),s=new Nr(n,a.animation,t,a.paths);i(this,mr).set(n,s);for(let p of a.paths)i(this,mr).set(p.id.toString(),s);return s},qd=function(t,e,r=!1){let n=i(this,Se).markerOptions.animated,a=i(this,Oe).currentMap.Markers.add(t.coordinate,e,{interactive:r,placement:"top",rank:"always-visible",animated:n}),s=i(this,Oe).currentMap.Markers.getContentEl(a.id.toString());if(!s)throw new Error("marker component should exist");return new no(a.id.toString(),s,t.coordinate)},Qd=function(t){var e,r,n,a;return t==="active"?Gg+((r=(e=i(this,Se).pathOptions)==null?void 0:e.verticalOffset)!=null?r:0):jg+((a=(n=i(this,Se).inactivePathOptions)==null?void 0:n.verticalOffset)!=null?a:0)},zg=function(t){let e=t[0],r=t[t.length-1],n=!1;return E(this,ko,{promise:new Promise(async a=>{var s,l,c;if(C.env.NODE_ENV!=="test"&&await Vg(500),n||!t.length){a();return}(s=i(this,Se).createMarkers)!=null&&s.departure&&Y(this,xe,Pa).call(this,"departure",e.instructions[0]);for(let p=0;p<t.length;p++){let d=t[p];if(d.coordinates.length<2){A.warn("Directions must have at least 2 coordinates"),a();return}let h=p===wc,y=h?i(this,Se).pathOptions:i(this,Se).inactivePathOptions,b=Y(this,xe,Qd).call(this,h?"active":"inactive"),I=z(k({},_a(y)),{animateDrawing:i(this,Se).animatePathDrawing,verticalOffset:b}),x=Y(this,xe,Jd).call(this,d.coordinates,z(k({},y),{animateDrawing:i(this,Se).animatePathDrawing,verticalOffset:b}),I);if(i(this,yr).set(d,x),i(this,gn).set(x,d),h&&(E(this,Zt,i(this,yr).get(i(this,Ke)[wc])),i(this,Oe).externalPubSub.on("click",i(this,wa))),C.env.NODE_ENV!=="test"&&await x.animation,n){a();return}(l=i(this,Se).createMarkers)!=null&&l.connection&&Y(this,xe,eu).call(this,d.instructions,"connection")}if((c=i(this,Se).createMarkers)!=null&&c.destination&&Y(this,xe,Pa).call(this,"destination",r.instructions[r.instructions.length-1]),n){a();return}i(this,Oe).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),Y(this,xe,Ws).call(this),a()}),cancel:()=>{n=!0}}),i(this,ko).promise},Kd=function(t){var r,n,a;let e=k(k({},hn.pathOptions),t.pathOptions);E(this,Se,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:hn.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:hn.setMapToDeparture,pathOptions:e,inactivePathOptions:k(k({},hn.inactivePathOptions),t.inactivePathOptions),connectionPathOptions:_a(e),createMarkers:k(k({},hn.createMarkers),t.createMarkers),markerOptions:k(k({},hn.markerOptions),t.markerOptions),animatePathDrawing:(a=t.animatePathDrawing)!=null?a:hn.animatePathDrawing})},Ws=function(){i(this,Oe).publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},Oc=function(t){E(this,Zt,t);let e=_a(i(this,Se).pathOptions),r=_a(i(this,Se).inactivePathOptions);i(this,Ke).forEach(n=>{let a=i(this,yr).get(n);if(a){let s=a.id===i(this,Zt).id,l=s?i(this,Se).pathOptions:i(this,Se).inactivePathOptions,c=s?e:r;for(let p of a.segments){let d=p.isConnectionSegment?c:l;i(this,Oe).updateState(p,d)}}}),i(this,Oe).publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),Y(this,xe,Wg).call(this),Y(this,xe,Ws).call(this)},Pa=function(t,e){var r,n,a,s,l;if(t==="connection"&&e){let c=e.action.type==="ExitConnection"?i(this,Se).markerOptions.departureColor:i(this,Se).markerOptions.destinationColor,p;typeof((r=i(this,Se).createMarkers)==null?void 0:r.connection)=="function"?(p=i(this,Se).createMarkers.connection(e),i(this,Oe).updateState(p,{interactive:!0})):p=Y(this,xe,qd).call(this,e,Ng({type:(a=(n=e.action.connection)==null?void 0:n.type)!=null?a:e.action.connectionType,color:c,direction:e.action.direction,animated:i(this,Se).markerOptions.animated}),!0),i(this,Fo).set(p.id,{instruction:e,marker:p})}else{let c=t==="departure"?i(this,Se).markerOptions.departureColor:i(this,Se).markerOptions.destinationColor,p;typeof((s=i(this,Se).createMarkers)==null?void 0:s.departure)=="function"&&t==="departure"?p=i(this,Se).createMarkers.departure(e):typeof((l=i(this,Se).createMarkers)==null?void 0:l.destination)=="function"&&t==="destination"?p=i(this,Se).createMarkers.destination(e):p=Y(this,xe,qd).call(this,e,Bg({type:t,color:c,animated:i(this,Se).markerOptions.animated})),i(this,Fo).set(p.id,{instruction:e,marker:p})}},eu=function(t,e){t.filter(n=>Y(this,xe,Hg).call(this,n.action)).forEach(n=>{Y(this,xe,Pa).call(this,e,n)})},wa=new WeakMap;m();var be,Oa,Lo,Dc,tu,Xs=class{constructor(t){M(this,Lo);M(this,be);M(this,Oa);f(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(i(this,be).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(i(this,be).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(i(this,be).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{i(this,be).getSystems().cameraSystem.enablePan=!0,i(this,be).getSystems().cameraSystem.enableZoom=!0,i(this,be).getSystems().cameraSystem.enableRotate=!0},disable:()=>{i(this,be).getSystems().cameraSystem.enablePan=!1,i(this,be).getSystems().cameraSystem.enableZoom=!1,i(this,be).getSystems().cameraSystem.enableRotate=!1}});f(this,"setMinPitch",t=>{i(this,be).camera.setMinPitch(t)});f(this,"setMaxPitch",t=>{i(this,be).camera.setMaxPitch(t)});f(this,"setMinZoomLevel",t=>{i(this,be).camera.setMinZoomLevel(t,!0)});f(this,"setMaxZoomLevel",t=>{i(this,be).camera.setMaxZoomLevel(t)});E(this,Oa,t),E(this,be,t.core)}setScreenOffsets(t){i(this,be).camera.setInsetPadding(t)}get screenOffsets(){return i(this,be).camera.insetsPadding}get panMode(){return i(this,be).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&i(this,be).camera.setPanMode(t)}getFocusOnTransform(t,e){var n,a,s;let r=i(this,be).camera.getCameraFrameForCoordinates(Y(this,Lo,tu).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(n=e==null?void 0:e.axisAlignedPadding)==null?void 0:n.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing,debugKey:t,debugColor:e==null?void 0:e.debugColor});return{center:new re(r.center[1],r.center[0]),zoomLevel:r.zoomLevel,bearing:(a=e==null?void 0:e.bearing)!=null?a:this.bearing,pitch:(s=e==null?void 0:e.pitch)!=null?s:this.pitch}}focusOn(t,e){var r;return i(this,be).camera.focusOn(Y(this,Lo,tu).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(r=e==null?void 0:e.axisAlignedPadding)==null?void 0:r.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var c;let{center:r,zoomLevel:n,bearing:a,pitch:s}=t,l=r!=null?r:this.center;return i(this,be).camera.animateTo({center:r!=null?[l.longitude,l.latitude,i(this,be).camera.elevation]:void 0,zoomLevel:n,bearing:a,pitch:s,duration:(c=e==null?void 0:e.duration)!=null?c:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:r=this.zoomLevel,bearing:n=this.bearing,pitch:a=this.pitch}=t,s=[e.longitude,e.latitude];i(this,be).camera.setCenter(s),i(this,be).camera.setZoomLevel(r),i(this,be).camera.setBearing(n),i(this,be).camera.setPitch(a)}get center(){let t=i(this,be).camera.center;return new re(t[1],t[0],void 0)}setAutoMinZoomLevel(t){i(this,be).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return i(this,be).camera.autoMinZoomLevel}get zoomLevel(){return i(this,be).camera.zoomLevel}get pitch(){return i(this,be).camera.pitch}get minPitch(){return i(this,be).camera.minPitch}get maxPitch(){return i(this,be).camera.maxPitch}get bearing(){let t=i(this,be).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return i(this,be).camera.minZoomLevel}get maxZoomLevel(){return i(this,be).camera.maxZoomLevel}setElevation(t){i(this,be).camera.setElevation(t)}get elevation(){return i(this,be).camera.elevation}animateElevation(t,e){return i(this,be).camera.animateElevation(t,e)}get bounds(){return lc(i(this,be).getSystems().cameraSystem.panBounds,i(this,be).convert3DMapPositionToCoordinate)}get isAnimating(){return i(this,be).camera.isAnimating}cancelAnimation(){i(this,be).camera.cancelAnimation()}updateFacadesInView(){i(this,be).getSystems().geometryInFocusSystem.compute()}};be=new WeakMap,Oa=new WeakMap,Lo=new WeakSet,Dc=function(t){var r,n,a,s,l,c;let e=i(this,be).camera.elevation;return re.is(t)&&t.floorId!=null?(n=(r=i(this,be).getState(t.floorId))==null?void 0:r.altitude)!=null?n:e:zt.is(t)?(s=(a=i(this,be).getState(t.id))==null?void 0:a.altitude)!=null?s:e:"floor"in t&&zt.is(t.floor)&&(c=(l=i(this,be).getState(t.floor.id))==null?void 0:l.altitude)!=null?c:e},tu=function(t){var a,s;let e=[],n=(Array.isArray(t)?t:[t]).flatMap(l=>{var c;return(c=l==null?void 0:l.focusTarget)!=null?c:[l]});for(let l of n)if(l!=null)if(re.is(l)){let c=Y(this,Lo,Dc).call(this,l);e.push([l.longitude,l.latitude,c])}else if((l==null?void 0:l.id)!=null){if(Ki.is(l)){let d=i(this,Oa).getFloorStackAltitudeData(l.id);for(let h of l.floors){let y=d.get(h.elevation),b=(a=y==null?void 0:y.altitude)!=null?a:i(this,be).camera.elevation,I=y!=null?y.altitude+y.visualHeight:b;Tp(h.geoJSON,x=>{e.push([x[0],x[1],b]),I!==b&&e.push([x[0],x[1],I])})}continue}let c=Y(this,Lo,Dc).call(this,l);if(zt.is(l)&&((s=i(this,Oa).getMapDataInternal())!=null&&s.enterpriseMode)){e.push(l.id);continue}else if("geoJSON"in l&&l.geoJSON.geometry.coordinates.length>0){Tp(l.geoJSON,d=>{e.push([d[0],d[1],c])});continue}let p=i(this,be).getBoundingArea(l.id);if(p)e.push(...p.map(d=>[d[0],d[1],c]));else if("geoJSONBoundingBox"in l){let d=Y(this,Lo,Dc).call(this,l);if(l.geoJSONBoundingBox!=null){let h=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],d],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],d]];e.push(...h)}}}else Sh(l)&&e.push(l);return e};m();var Da,$s=class{constructor({currentMapGetter:t}){M(this,Da);E(this,Da,t)}get currentMap(){return i(this,Da).call(this)}async getCurrentSceneGLTF(t){let e=i(this,Da).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(A.error("There is no map to export. Please load a map first."),new Blob)}};Da=new WeakMap;m();var Rr,Zs,Ys=class{constructor({currentMapGetter:t}){M(this,Rr,new Map);M(this,Zs);E(this,Zs,t)}get currentMap(){return i(this,Zs).call(this)}getAll(){return Array.from(i(this,Rr).values()).map(t=>t.label)}getById(t){return i(this,Rr).get(t)}add(t,e,r){let n=t.anchorTarget,a=this.currentMap;if(!a)throw new Error("currentMap should exist");let s=a.Labels.add(n,e,z(k({},r),{attachTo:la(t),rank:(r==null?void 0:r.rank)==null||(r==null?void 0:r.rank)==="initial"?"medium":r.rank})),l=new Oo(s.id.toString(),e,t);return i(this,Rr).set(l.id,{label:l,entityId:l.id}),l}__EXPERIMENTAL__all(t){var r;let e=[];return(r=this.currentMap)==null||r.Labels.all({onCreate:(n,a,s)=>{let l=new Oo(n.toString(),a,s);i(this,Rr).set(l.id,{label:l,entityId:l.id}),e.push(l)},labelOptions:t}),e}remove(t){var r;let e=i(this,Rr).get(t.id);e&&((r=this.currentMap)==null||r.Labels.remove(e),i(this,Rr).delete(t.id.toString()))}removeAll(){let t=[];return i(this,Rr).forEach(({label:e})=>{this.remove(e),t.push(e),i(this,Rr).delete(e.id.toString())}),t}};Rr=new WeakMap,Zs=new WeakMap;m();m();m();m();var Xg=Nl(vd(),1);function q0(o,t){var e=Ii(o),r=Ii(t),n=o.properties||{},a=Xg.default.difference(e.coordinates,r.coordinates);return a.length===0?null:a.length===1?Vl(a[0],n):jl(a,n)}var $g=q0;var Yg=.2,Zg=.1,Aa=251,Q0=!1;function Jg(o){if(!o||o.length<3)return null;let t=[],e=0;for(let l=0;l<o.length;l++){let c=o[l],p="".concat(c[0],",").concat(c[1]),d=!1;for(let h=0;h<t.length;h++)if(t[h]===p){d=!0;break}d||(t.push(p),e++)}if(e<3)return null;let r=o[0],n=o[o.length-1];if(r[0]===n[0]&&r[1]===n[1])return o;let s=[];for(let l=0;l<o.length;l++)s.push(o[l]);return s.push(r),s}function qg(o,t){let e=[];if(o.type==="Polygon"){let r=Jg(o.coordinates[0]);r&&e.push(r)}else if(o.type==="MultiPolygon")for(let r of o.coordinates){let n=Jg(r[0]);n&&e.push(n)}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:e},properties:t||{}}}var Js=class{constructor(t,e,r,n){f(this,"renderer");f(this,"mapObject");f(this,"config");f(this,"wallsId");f(this,"maskedWallsId");f(this,"voidWallsId");f(this,"maskedVoidWallsId");f(this,"ceilingId");f(this,"ceilingMaskId");f(this,"basementMaskId");f(this,"footprintColor");f(this,"layer");f(this,"groupContainer");var s;this.renderer=t,this.mapObject=e,this.config=n;let a=Bo;if(n.obstructions!=null&&n.obstructions.features.length>0){let l=n.obstructions.features.filter(c=>{var p;return c.geometry.type==="LineString"&&((p=c.properties.kind)==null?void 0:p.toLowerCase())==="wall"&&c.properties.footprintComponent===!0});if(l!=null&&l.length>0){let c=n.styleMap[(s=l[0].properties)==null?void 0:s.id];c!=null&&(a=c)}}this.footprintColor=a.color,this.groupContainer=this.renderer.addGroupContainer("Footprint-".concat(n.floorId),{visible:!1},r),this.layer=this.renderer.addGroupContainer("".concat(gs,"-").concat(n.floorId),{visible:!1},this.groupContainer.id.toString())}getFloorAltitudes(){return this.mapObject.getFloorStackAltitudeData(this.config.floorStackId)}getVisualHeight(){var r,n;if(this.config.fixedHeight!=null)return this.config.fixedHeight;let e=((r=this.getFloorAltitudes())!=null?r:new Map).get(this.config.elevation);return(n=e==null?void 0:e.visualHeight)!=null?n:0}get footprintGeometry(){return this.config.footprintGeometry}buildWalls(){let r=qg(this.config.footprintGeometry.geometry,{id:"Footprint-Floor-".concat(this.config.floorId)}).geometry.coordinates.map((l,c)=>({type:"Feature",geometry:{type:"LineString",coordinates:l},properties:{id:"Footprint-Floor-Section-".concat(this.config.floorId,"-").concat(c)}})),n=this.getVisualHeight(),a="front";this.wallsId="Footprint-Walls-".concat(this.config.floorId);let s={color:this.footprintColor,height:n,altitude:0,width:Zg,outline:!1,visible:!0,opacity:1,side:a,renderOrder:2};this.config.elevation<0&&(s.__EXPERIMENTAL_maskMode="masked-object",s.__EXPERIMENTAL_maskEffect="reveal",s.__EXPERIMENTAL_maskEnabled=!0,s.__EXPERIMENTAL_maskId=Aa),this.renderer.addBatchedGeometryGroup(this.wallsId,{features:r},s,this.groupContainer)}buildVoidWalls(t){if(!t||t.length===0)return;let e=[],r=0;for(let l of t){let c=qg(l.geometry,{id:"Void-Wall-".concat(this.config.floorId,"-").concat(r)});for(let p of c.geometry.coordinates)e.push({type:"Feature",geometry:{type:"LineString",coordinates:p},properties:{id:"Void-Wall-Section-".concat(this.config.floorId,"-").concat(r)}}),r++}if(e.length===0)return;let n=this.getVisualHeight(),a="front";this.voidWallsId="Void-Walls-".concat(this.config.floorId);let s={color:this.footprintColor,height:n,altitude:0,width:Zg,outline:!1,visible:!0,opacity:1,side:a,renderOrder:2};this.config.elevation<0&&(s.__EXPERIMENTAL_maskMode="masked-object",s.__EXPERIMENTAL_maskEffect="reveal",s.__EXPERIMENTAL_maskEnabled=!0,s.__EXPERIMENTAL_maskId=Aa),this.renderer.addBatchedGeometryGroup(this.voidWallsId,{features:e},s,this.groupContainer)}buildCeiling(t){let e=k({},this.config.footprintGeometry);e=Qg(e),(t==null?void 0:t.length)>0&&(e=K0(e,t));let r="front";this.ceilingId="Ceiling-".concat(this.config.floorId);let n=this.getVisualHeight(),a={color:this.footprintColor,height:-Yg,altitude:n,visible:!0,outline:!1,opacity:1,side:r};this.config.elevation<0&&(a.__EXPERIMENTAL_maskMode="masked-object",a.__EXPERIMENTAL_maskEffect="reveal",a.__EXPERIMENTAL_maskEnabled=!0,a.__EXPERIMENTAL_maskId=Aa),this.renderer.addBatchedGeometryGroup(this.ceilingId,{features:[z(k({},e),{properties:{id:"Footprint-Ceiling-".concat(this.config.floorId),externalId:this.config.externalId,elevation:this.config.elevation}})]},a,this.groupContainer)}buildBasementMask(){let t=this.config.footprintGeometry;t=Qg(t),this.basementMaskId="Footprint-Basement-Mask-".concat(this.config.floorId),this.renderer.addBatchedGeometryGroup(this.basementMaskId,{features:[z(k({},t),{properties:{id:"Footprint-Basement-Mask-Geometry-".concat(this.config.floorId)}})]},{color:Kg(-1),altitude:0,visible:!1,height:.01,outline:!1,__EXPERIMENTAL_maskEnabled:!0,__EXPERIMENTAL_maskMode:"mask",__EXPERIMENTAL_maskId:Aa},"outdoors-container"),Q0&&this.renderer.addBatchedGeometryGroup(this.basementMaskId+"debug",{features:[z(k({},t),{properties:{id:"Footprint-Basement-Mask-Geometry-".concat(this.config.floorId,"-debug")}})]},{color:Kg(-1),altitude:0,opacity:.5,visible:!1,height:.01,outline:!1},"outdoors-container")}update(t){var a;if(t.basementMaskEnabled!==void 0&&this.basementMaskId&&(this.renderer.setState(this.basementMaskId,{visible:t.basementMaskEnabled}),this.renderer.setState(this.basementMaskId+"debug",{visible:t.basementMaskEnabled})),(a=this.config.multiFloorView)!=null&&a.footprintsHidden)return;let e={};t.altitude!==void 0&&(e.altitude=t.altitude),t.visible!==void 0&&(e.visible=t.visible),Object.keys(e).length>0&&this.renderer.setState(this.groupContainer.id,e);let r={};t.opacity!==void 0&&(r.opacity=t.opacity),t.side!==void 0&&(r.side=t.side),t.color!==void 0&&(r.color=t.color),t.outline!==void 0&&(r.outline=t.outline);let n={};if(t.height!==void 0&&(r.height=t.height,n.altitude=t.height),this.wallsId&&Object.keys(r).length>0&&this.renderer.setState(this.wallsId,r),this.voidWallsId&&Object.keys(r).length>0&&this.renderer.setState(this.voidWallsId,r),this.maskedWallsId&&Object.keys(r).length>0){let s=r,{outline:p}=s,d=qt(s,["outline"]);Object.keys(d).length>0&&this.renderer.setState(this.maskedWallsId,d)}if(this.maskedVoidWallsId&&Object.keys(r).length>0){let l=r,{outline:p}=l,d=qt(l,["outline"]);Object.keys(d).length>0&&this.renderer.setState(this.maskedVoidWallsId,d)}if(t.opacity!==void 0&&(n.opacity=t.opacity),t.color!==void 0&&(n.color=t.color),t.ceilingVisible!==void 0&&(n.visible=t.ceilingVisible),t.outline!==void 0&&(n.outline=t.outline),this.ceilingId&&Object.keys(n).length>0&&this.renderer.setState(this.ceilingId,n),this.ceilingMaskId&&Object.keys(n).length>0){let c=n,{outline:p}=c,d=qt(c,["outline"]);Object.keys(d).length>0&&this.renderer.setState(this.ceilingMaskId,d)}}getState(){var c,p;let t=this.renderer.getState(this.groupContainer.id),e=t.altitude,r=t.visible,n=this.ceilingId?this.renderer.getState(this.ceilingId):void 0,a=n==null?void 0:n.visible,s=(c=n==null?void 0:n.height)!=null?c:Yg,l=this.basementMaskId?(p=this.renderer.getState(this.basementMaskId))==null?void 0:p.visible:void 0;if(this.wallsId){let d=this.renderer.getState(this.wallsId),h=d.height;return{altitude:e,visible:r,opacity:d.opacity,side:d.side,color:d.color,height:h,ceilingVisible:a,basementMaskEnabled:l,outline:d.outline,ceilingThickness:s}}return{altitude:e,visible:r,ceilingVisible:a,basementMaskEnabled:l,ceilingThickness:s}}};function Qg(o){if(o.geometry.type==="Polygon")return{type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[0]]},properties:o.properties};let t=[];for(let e of o.geometry.coordinates)t.push([e[0]]);return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:t},properties:o.properties}}function K0(o,t){var n,a;let e;if(Array.isArray(t))if(t.length>0&&"geometry"in t[0])e=t;else{e=[];for(let s of t)for(let l of s.coordinates)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:l},properties:{}})}else{e=[];for(let s of t.coordinates)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:s},properties:{}})}if(e.length===0)return o;let r=o;for(let s=0;s<e.length;s++){let l=e[s];if(r===null)break;try{r=$g(r,l)}catch(c){A.warn("Polygon difference failed for hole ".concat((a=(n=l.properties)==null?void 0:n.id)!=null?a:"unknown"," (index ").concat(s,"/").concat(e.length,"), skipping. Error: ").concat(c instanceof Error?c.message:c))}}return r===null?{type:"Feature",geometry:{type:"MultiPolygon",coordinates:[]},properties:o.properties}:z(k({},r),{properties:o.properties})}var Kg=o=>o===0?"red":o===-1?"blue":o===-2?"green":"black";var ev={color:"#ffffff",opacity:1},Bo={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},em={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},ru={color:"red",opacity:.2,height:Bo.height+.1,visible:!0,borderVisible:!1},tm=.5,ar=class{constructor(t,e,r=new Map){f(this,"containerId");f(this,"layers");f(this,"renderer");this.containerId=e,this.layers=r,this.renderer=t}get visible(){var t;return((t=this.renderer.getState(this.containerId))==null?void 0:t.visible)===!0}setVisible(t){this.visible!==t&&this.renderer.setState(this.containerId,{visible:t})}},rm=0,li,qs=class{constructor(t,e,r,n,a,s,l,c){f(this,"id");f(this,"name");f(this,"elevation");f(this,"maxHeight");f(this,"containerId");f(this,"externalId");f(this,"metadata");f(this,"shortName");f(this,"subtitle");f(this,"occluderId");f(this,"loaded",!1);f(this,"styleMap",{});f(this,"obstructions");f(this,"entrances");f(this,"spaces");f(this,"floorImages");f(this,"floorText");f(this,"areas");f(this,"renderer");f(this,"mapObject");f(this,"options");f(this,"layers",new Map);f(this,"footprint");f(this,"ceiling");f(this,"floorStackId");f(this,"multiFloorView");f(this,"mapDataInternal");f(this,"_computedMaxHeight");f(this,"facadesByStyleId",new Map);f(this,"footprintObject");f(this,"gapFootprintObject");M(this,li);f(this,"load",(t=!1)=>{var l,c,p,d,h,y,b,I,x,_,O,U,H,V,N,q,B,J;if(this.loaded)return this;((l=this.footprint)==null?void 0:l.geometry)==null&&((c=this.obstructions)==null?void 0:c.features.length)===0&&((p=this.spaces)==null?void 0:p.features.length)===0&&A.warn("Floor ".concat(this.id," exists in the data but contains no geometry.")),this.loaded=!0;let e=this.renderer.addGroupContainer("".concat(Kr,"-").concat(this.id),{},this.id);this.layers.set(Kr,new ar(this.renderer,e.id.toString()));let r=this.renderer.addGroupContainer("".concat(Or,"-").concat(this.id),{},this.id);this.layers.set(Or,new ar(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat($e,"-").concat(this.id),{focusable:t},this.id);this.layers.set($e,new ar(this.renderer,n.id.toString()));let a=this.renderer.addGroupContainer("".concat(eo,"-").concat(this.id),{},this.id);this.layers.set(eo,new ar(this.renderer,a.id.toString()));let s=this.renderer.addGroupContainer("".concat(Dr,"-").concat(this.id),{},this.id);if(this.layers.set(Dr,new ar(this.renderer,s.id.toString())),(d=this.multiFloorView)!=null&&d.__EXPERIMENTAL_DEBUG_showVoids){let se=0;for(let W of this.voids)this.renderer.addBatchedGeometryGroup("Void-".concat(this.id,"-").concat(se),{features:[W]},{color:"red"},n),se++}if((h=this.multiFloorView)!=null&&h.__EXPERIMENTAL_DEBUG_showOpenToBelow){let se=0;for(let W of this.spacesOpenToBelow)this.renderer.addBatchedGeometryGroup("SpacesOpenToBelow-".concat(this.id,"-").concat(se),{features:[W]},{color:"blue"},n),se++}if(this.spaces!=null&&this.spaces.features.length>0){let se=[],W=new Map,ie=(y=this.multiFloorView)==null?void 0:y.__EXPERIMENTAL_excludeSpaceIdsInAutoHeightCalculation,Ie=ie!=null&&ie.length>0?new Set(ie):void 0;for(let X of this.spaces.features){if(X.geometry.type!=="Polygon")continue;let $=(b=X.properties.kind)==null?void 0:b.toLowerCase();if($==="void"||$==="otb")continue;let me=this.styleMap[X.properties.id];if(me!=null&&"height"in me&&(me==null?void 0:me.height)!=null&&(Ie==null||!Ie.has(X.properties.id))){let oe=((I=me.altitude)!=null?I:0)+me.height;(this._computedMaxHeight==null||oe>this._computedMaxHeight)&&(this._computedMaxHeight=oe)}let ee=(x=this.mapDataInternal)==null?void 0:x.facadesBySpaceId[X.properties.id];if(ee){let oe=W.get(ee.id);oe==null&&(oe=[],W.set(ee.id,oe)),oe.push(X)}else se.push(X)}let ve=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),he=this.renderer.addBatchedGeometryGroup("Spaces-".concat(this.id,"-0"),{features:se},X=>{var $;return(($=X==null?void 0:X.properties)==null?void 0:$.id)!=null&&this.styleMap[X.properties.id]!=null?aa(this.styleMap[X.properties.id],this.options):ev},ve);if(this.layers.get($e).layers.set("Spaces",he.id.toString()),W.size>0){let X=this.renderer.addGroupContainer("".concat(Ln,"-").concat(this.id),{},this.id);this.layers.set(Ln,new ar(this.renderer,X.id.toString()));for(let[$,me]of W){let ee=this.renderer.addGroupContainer($,{focusable:!0},X),oe=this.renderer.addGroupContainer("".concat($,"-geometry"),{},ee),ue=Ad(me,this.styleMap),ye=0;for(let[Le,Me]of ue){let ze=this.renderer.addBatchedGeometryGroup("Facades-".concat(this.id,"-").concat($,"-").concat(ye),{features:Me},z(k({},aa(Le,this.options)),{renderOrder:3}),oe);ye++;let Ce=Le.id||ze.id.toString();this.layers.get(Ln).layers.set("".concat($,"-").concat(Ce),ze.id.toString()),this.facadesByStyleId.has(Ce)?(_=this.facadesByStyleId.get(Ce))==null||_.push($):this.facadesByStyleId.set(Ce,[$])}}}}if(((O=this.footprint)==null?void 0:O.geometry)!=null&&this.footprint.geometry.coordinates.length>0&&this.styleMap!=null&&(this.footprintObject=new Js(this.renderer,this.mapObject,this.id,{floorId:this.id,externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,obstructions:this.obstructions,styleMap:this.styleMap,multiFloorView:this.multiFloorView}),this.layers.set(gs,new ar(this.renderer,this.footprintObject.layer.id.toString())),this.footprint=$h(this.footprint)),this.obstructions!=null&&this.obstructions.features.length>0){let se=this.obstructions.features.filter(ee=>ee.geometry.type==="Polygon"&&(ee.properties.kind==="object"||ee.properties.kind==="unknown")),W=Ad(se,this.styleMap),ie=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),Ie=0;for(let[ee,oe]of W){let ue=this.renderer.addBatchedGeometryGroup("Objects-".concat(this.id,"-").concat(Ie),{features:oe},aa(ee,this.options),ie);Ie++;let ye=ie.id.toString();this.layers.get($e).layers.set(ee.id||ye,ue.id.toString())}let ve=this.obstructions.features.filter(ee=>{var oe;return ee.geometry.type==="LineString"&&((oe=ee.properties.kind)==null?void 0:oe.toLowerCase())==="wall"&&ee.properties.footprintComponent===!1}),he=this.obstructions.features.filter(ee=>{var oe;return ee.geometry.type==="LineString"&&((oe=ee.properties.kind)==null?void 0:oe.toLowerCase())==="wall"&&ee.properties.footprintComponent===!0}),X=this.entrances,$=Bo,me=Bo;if(ve!=null&&ve.length>0){let ee=this.styleMap[(U=ve[0].properties)==null?void 0:U.id];ee!=null&&($=k({},ee)),me=$;let{walls:oe,entrances:ue}=Dd(ve,(X==null?void 0:X.features)||[]),ye=Math.max($.height-.11,tm),Le=z(k({},em),{height:ye}),Me=this.renderer.addBatchedGeometryGroup("InteriorDoors-".concat(this.id),ue,Le,n);this.layers.get($e).layers.set(Li,Me.id.toString());let ze=this.renderer.addBatchedGeometryGroup("Walls-".concat(this.id),{features:[oe]},aa($,this.options),n);this.layers.get($e).layers.set(Qo,ze.id.toString())}if(he!=null&&he.length>0){let ee=this.styleMap[(H=he[0].properties)==null?void 0:H.id];ee!=null&&(me=z(k({},ee),{id:Qr}));let{walls:oe,entrances:ue}=Dd(he,(X==null?void 0:X.features)||[]),ye=Math.max(me.height-.11,tm),Le=z(k({},em),{height:ye}),Me=this.renderer.addBatchedGeometryGroup("ExteriorDoors-".concat(this.id),ue,Le,n);this.layers.get($e).layers.set(Bi,Me.id.toString());let ze=this.renderer.addBatchedGeometryGroup("ExteriorWalls-".concat(this.id),{features:[oe]},aa(me,this.options),n);this.layers.get($e).layers.set(Qr,ze.id.toString())}}if(this.floorImages!=null){let se=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let W of this.floorImages.features||[]){let ie="anchorId"in W.properties?W.properties.anchorId:null,Ie=ie==null,ve=ie!=null&&this.mapDataInternal!=null&&this.mapDataInternal.pointsOfInterestById[ie]!=null;if(Ie||ve){let he=Wh(W,rm),$=(((V=W.properties.rotation)!=null?V:0)%360+360)%360;if(ve){let me=new re({latitude:W.geometry.coordinates[1],longitude:W.geometry.coordinates[0],floorId:this.id});this.mapDataInternal.Query.at(me).then(ee=>{var ue,ye,Le;let oe=0;for(let Me of ee)if(Ze.is(Me)){let ze=(ye=(ue=this.renderer.getState(Me.id))==null?void 0:ue.height)!=null?ye:0;ze>oe&&(oe=ze)}this.mapObject.api.Image3D.add(new re({latitude:W.geometry.coordinates[1],longitude:W.geometry.coordinates[0],floorId:this.id,verticalOffset:oe}),W.properties.path,z(k({id:he,flipImageToFaceCamera:(Le=this.options.flipImagesToFaceCamera)!=null?Le:!0},W.properties),{rotation:$}))})}else this.mapObject.api.Image3D.add(new re({latitude:W.geometry.coordinates[1],longitude:W.geometry.coordinates[0],floorId:this.id}),W.properties.path,z(k({id:he,flipImageToFaceCamera:(N=this.options.flipImagesToFaceCamera)!=null?N:!0},W.properties),{rotation:$}));rm++}}this.layers.set(Ni,new ar(this.renderer,se.id.toString()))}if(this.floorText!=null)for(let se of this.floorText.features||[]){let W=0;"geometryId"in se.properties?W=(B=(q=this.renderer.getState(se.properties.geometryId))==null?void 0:q.height)!=null?B:0:W=(J=se.properties.verticalOffset)!=null?J:0,this.renderer.addText3D(Ee(),z(k({},se),{properties:z(k({},se.properties),{verticalOffset:W})}),{appearance:{flipToFaceCamera:!1}},this.id)}if(this.areas!=null){let se=this.renderer.addGroupContainer("areas-".concat(this.id),{},this.id);this.layers.set(kn,new ar(this.renderer,se.id.toString()));let W=this.renderer.addBatchedGeometryGroup("Areas-".concat(this.id),{features:this.areas.features},{color:ru.color,height:ru.height},se);for(let ie of this.areas.features||[])this.renderer.setState(ie.properties.id,z(k({},ru),{visible:!1}));this.layers.get(kn).layers.set(W.id.toString(),W.id.toString())}return this.renderer.render(),this});var d,h,y,b,I,x;this.mapObject=r,this.renderer=r.renderer,this.id=e.id,this.options=a;let p=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(d=a.preloadFloors)==null?void 0:d.map(_=>_.id).includes(e.id)},t);if(this.containerId=p.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.maxHeight=e.maxHeight,this.elevation=e.elevation,s!=null&&l!=null){this.styleMap=l,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.areas=(h=s.area)==null?void 0:h[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(y=s.floorImages)==null?void 0:y[this.id],this.floorText=(I=(b=s.enterprise)==null?void 0:b.floorText)==null?void 0:I[this.id];let _=(x=s["floor.geojson"])==null?void 0:x.features.find(O=>O.properties.id===e.id);_&&_.geometry!=null&&_.geometry.coordinates.length>0&&(this.footprint=_)}this.floorStackId=t,this.multiFloorView=n,this.mapDataInternal=c}get geometryMaxHeight(){return this._computedMaxHeight}get spacesOpenToBelowEnabled(){var t,e;return(e=(t=this.multiFloorView)==null?void 0:t.spacesOpenToBelowEnabled)!=null?e:!1}get voids(){var t,e,r,n;return(n=(r=(e=(t=this.mapDataInternal)==null?void 0:t.voidsByFloorId[this.id])==null?void 0:e.voids)==null?void 0:r.features)!=null?n:[]}get spacesOpenToBelow(){var e,r;if(!this.spaces)return[];let t=[];for(let n of this.spaces.features){if(n.geometry.type!=="Polygon")continue;(((e=n.properties.kind)==null?void 0:e.toLowerCase())==="void"||((r=n.properties.kind)==null?void 0:r.toLowerCase())==="otb")&&t.push(n)}return t}get geoJSONBoundingBox(){if(i(this,li))return i(this,li);if(!this.footprint){A.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return E(this,li,Uh(this.footprint)),i(this,li)}addOccluder(){var r;if(((r=this.footprint)==null?void 0:r.geometry)==null)return;let t=this.renderer.addGroupContainer("".concat(Fn,"-").concat(this.id),{},this.id),e=new ar(this.renderer,t.id.toString());this.layers.set(Fn,e),this.occluderId=this.renderer.addOccluder(this.footprint,e.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}buildCeiling(t){this.footprintObject&&this.footprintObject.buildCeiling(t)}buildBasementMask(){this.footprintObject&&this.footprintObject.buildBasementMask()}buildGapFootprint(t,e){var r;((r=this.footprint)==null?void 0:r.geometry)!=null&&(this.gapFootprintObject=new Js(this.renderer,this.mapObject,this.id,{floorId:"gap-below-".concat(this.id),externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,obstructions:void 0,styleMap:{},multiFloorView:this.multiFloorView,fixedHeight:t}),this.gapFootprintObject.buildWalls(),this.gapFootprintObject.buildCeiling(e),this.gapFootprintObject.update({altitude:-t,visible:!1}))}getFootprintStyle(){var e;let t=Bo;if(this.obstructions!=null&&this.obstructions.features.length>0){let r=this.obstructions.features.filter(n=>{var a;return n.geometry.type==="LineString"&&((a=n.properties.kind)==null?void 0:a.toLowerCase())==="wall"&&n.properties.footprintComponent===!0});r!=null&&r.length>0&&(t=this.styleMap[(e=r[0].properties)==null?void 0:e.id])}return t}buildFootprint(){if(!this.footprintObject)return;this.footprintObject.buildWalls(),this.footprintObject.buildVoidWalls(this.voids);let t=new ar(this.renderer,this.footprintObject.layer.id.toString());this.layers.set(gs,t)}setBatchedTextVisible(t){let e=this.renderer.getInternalState().geometry3DMap.get(this.id);if(e&&e instanceof Of){let r=this.renderer.getSystems().text3DSystem.batchedTextMap.get(e);r&&r.then(n=>{n.visible=t})}}};li=new WeakMap;m();var Fa,Qs=class{constructor(t,e,r,n){f(this,"id");f(this,"externalId");f(this,"name");f(this,"type");f(this,"floorIds");f(this,"defaultFloorId");f(this,"floorObjects",[]);f(this,"floorObjectsByElevation",new Map);f(this,"metadata");f(this,"containerId");f(this,"facade");f(this,"renderer");f(this,"altitudeMap",new Map);M(this,Fa);var s;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(s=t.floors)!=null?s:t.maps,this.defaultFloorId=t.defaultFloor;let a=r.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=a.id.toString(),this.facade=n,this.renderer=r}get defaultFloor(){if(i(this,Fa)==null){if(this.floorObjects.length===0)throw new tt("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,r)=>Math.abs(r.elevation)<Math.abs(e.elevation)?r:e)),E(this,Fa,t)}return i(this,Fa)}get isOutdoors(){var e;return((e=this.type)==null?void 0:e.toLowerCase())==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(r=>r.hasFacadeGeometry)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){A.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}loadAllFloors(t){this.floorObjects.sort((e,r)=>e.elevation-r.elevation);for(let e of this.floorObjects)e.load(this.facade!=null),!this.isOutdoors&&!e.hasFacadeGeometry&&e.footprint!=null&&e.addOccluder();if(this.altitudeMap=zh(this.floorObjects,t==null?void 0:t.floorGap,t==null?void 0:t.floorGapMultiplier,t==null?void 0:t.floorGapFallback,t==null?void 0:t.__EXPERIMENTAL_disableGapFilling),t!=null&&t.enabled)for(let e of this.floorObjects){let r=this.altitudeMap.get(e.elevation);r&&this.renderer.setState(e.id,{altitude:r.altitude})}if(!this.isOutdoors){for(let e of this.floorObjects){let r=this.floorObjectsByElevation.get(e.elevation+1),n=[];if(e.spacesOpenToBelowEnabled){for(let a of e.voids)n.push(a);if(r)for(let a of r.spacesOpenToBelow)n.push(a)}e.buildCeiling(n),e.buildFootprint(),e.elevation<=0&&e.buildBasementMask()}if(t!=null&&t.enabled&&!t.__EXPERIMENTAL_disableGapFilling){let e=Xh(this.floorObjects,this.altitudeMap,t.floorGap,t.floorGapMultiplier,t.floorGapFallback);for(let r of e){let n=this.floorObjectsByElevation.get(r.floorAboveElevation);if(!n)continue;let a=n.spacesOpenToBelow;n.buildGapFootprint(r.height,a)}}}}};Fa=new WeakMap;m();var tv=5,rv="#ffffff";function ov(o,t){var e;return typeof o=="string"?o:(e=o[t])!=null?e:rv}function nv(o){return o.spacesOpenToBelow.length>0}function ou(o,t,e,r,n){var y,b,I,x,_,O,U,H,V,N,q,B,J,se;let a={outdoorOpacity:"initial",floorStates:[]},{spacesOpenToBelowEnabled:s}=n,l=(y=n.spacesOpenToBelowVisualEffectEnabled)!=null?y:!0,c=(I=(b=r.get(t.elevation))==null?void 0:b.altitude)!=null?I:0,p=c;for(let[W,ie]of r)W<t.elevation&&ie.altitude<p&&(p=ie.altitude);let d=c-p+tv,h=o.sort((W,ie)=>W.elevation-ie.elevation);for(let W of h){let ie=(_=(x=r.get(W.elevation))==null?void 0:x.visualHeight)!=null?_:0,Ie=(O=n.opacity)!=null?O:W.elevation<0?1:.4,ve=!1;if(s){let ue=W.elevation<t.elevation?o.find(ye=>ye.elevation===W.elevation+1):null;ve=ue?nv(ue):!1}let he={maskEnabled:W.elevation<0,maskId:Aa,maskEffect:"reveal",maskMode:"masked-object"},X=s?W.elevation===t.elevation||ve:!1,$=s?W.elevation<t.elevation:W.elevation===t.elevation&&W.elevation<0,me=(t.elevation>=0?W.elevation===0:W.elevation===t.elevation)&&((H=(U=W.floorStack)==null?void 0:U.type)==null?void 0:H.toLowerCase())!=="outdoor",ee={color:ov(n.color,W.id),ceilingVisible:W.elevation<t.elevation,visible:$,basementMaskEnabled:me,outline:n.outline,ceilingThickness:.5,height:ie,opacity:Ie},oe={floor:W,state:{type:"floor",visible:X,geometry:s?z(k({visible:X},he),{effectStart:W.elevation<t.elevation&&l?c:0,effectDistance:W.elevation<t.elevation&&l?d:0,darkenAmount:l?(V=n.spacesOpenToBelowVisualEffectDarkenAmount)!=null?V:.2:0,darkenUseDepth:(N=n.spacesOpenToBelowVisualEffectDarkenUseDepth)!=null?N:!0,desaturateAmount:l&&(q=n.spacesOpenToBelowVisualEffectDesaturateAmount)!=null?q:0,desaturateUseDepth:(B=n.spacesOpenToBelowVisualEffectDesaturateUseDepth)!=null?B:!0,washOutAmount:l&&(J=n.spacesOpenToBelowVisualEffectWashOutAmount)!=null?J:0,washOutUseDepth:(se=n.spacesOpenToBelowVisualEffectWashOutUseDepth)!=null?se:!1}):z(k({},he),{visible:!1}),labels:{enabled:!1},markers:{enabled:!1},footprint:ee,occlusion:{enabled:!1},areas:{visible:!1},text3d:{visible:!1},images:{visible:!1,collisionsEnabled:W.id===t.id},paths:{visible:!1},models:{visible:!1}}};a.floorStates.push(oe),W.id===t.id?(oe.state.visible=!0,oe.state.images.visible=!0,oe.state.paths.visible=!0,oe.state.geometry.visible=!0,oe.state.models.visible=!0,oe.state.labels.enabled=!0,oe.state.markers.enabled=!0,oe.state.occlusion.enabled=!0,oe.state.areas.visible=!0,oe.state.text3d.visible=!0,W.elevation<0&&(oe.state.footprint.height=ie*Math.abs(W.elevation),oe.state.footprint.visible=!0,a.outdoorOpacity=.2)):e.includes(W.id)&&W.elevation<t.elevation?(oe.state.visible=!0,oe.state.geometry.visible=!0,oe.state.models.visible=!0,oe.state.paths.visible=!0,oe.state.markers.enabled=!0,oe.state.occlusion.enabled=!0,oe.state.footprint.visible=!0,oe.state.footprint.height=ie,W.elevation<0&&(a.outdoorOpacity=.2)):t.elevation>0&&W.elevation<t.elevation&&W.elevation>=0&&(oe.state.visible=!0,oe.state.footprint.visible=!0,oe.state.footprint.height=ie)}return a}m();import pe from"zod";m();import{z as om}from"zod";function nm(o){try{let t=o.shape;if("type"in t){let e=t.type;if(e instanceof om.ZodOptional&&(e=e._def.innerType),"value"in e)return String(e.value);if(e instanceof om.ZodDefault&&"value"in e._def.innerType)return String(e._def.innerType.value)}return"unknown"}catch(t){return"unknown"}}function im(o){if(o.success)return{};let t={};for(let e of o.error.issues)if(e.path.length>0){let r=String(e.path[0]);t[r]||(t[r]=[]),t[r].push(e.message)}return t}function am(o,t){let e=Object.entries(o);if(e.length>0){let r=e.map(([n,a])=>"".concat(n,": ").concat(a.join(", "))).join("; ");A.warn("".concat(e.length," invalid field(s) in ").concat(t!=null?t:"unknown"," state: [").concat(r,"]"))}}function ke(o,t,e){if(e!=null&&e.disableValidation)return t;if(t==null||typeof t!="object")return{};let r=o.safeParse(t);if(r.success){let s={};for(let l of Object.keys(t))l in r.data&&(s[l]=t[l]);return s}let n=im(r);e!=null&&e.warn&&am(n,nm(o));let a={};for(let s of Object.keys(t))!(s in n)&&s in o.shape&&(a[s]=t[s]);return a}function yt(o,t,e){if(e!=null&&e.disableValidation)return t;let r=o.safeParse(t);if(r.success)return r.data;if((e==null?void 0:e.warn)===!0){let n=im(r);am(n,nm(o))}return t}var sm="path",Vr={color:"#4b90e2",width:1,completeFraction:0,visible:!0,verticalOffset:.1,xrayOpacity:.25,__EXPERIMENTAL_SMOOTHING_TENSION:xp.tension,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:xp.cornerRadius,dashed:!1,__EXPERIMENTAL_ENDCAP_EXTENSION:[.5,.5],__EXPERIMENTAL_BILLBOARDING:80,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:!1},nu=pe.object({type:pe.literal(sm).default(sm),color:pe.string().default(Vr.color),width:pe.union([pe.number(),pe.string().regex(Ep),pe.object({on:pe.literal("zoom-level"),input:pe.array(pe.number()).nonempty(),output:pe.union([pe.array(pe.number()).nonempty(),pe.array(pe.string().regex(Ep)).nonempty()]),easing:pe.string().optional()})]),completeFraction:pe.number().default(Vr.completeFraction),visible:pe.boolean().default(Vr.visible),verticalOffset:pe.number().default(Vr.verticalOffset),highlightStartFraction:pe.number().default(0),highlightEndFraction:pe.number().default(0),highlightColor:pe.string().default("red"),highlightWidthMultiplier:pe.number().default(1.1),highlightCompleteFraction:pe.number().default(1),xrayOpacity:pe.number().min(0).max(1).default(Vr.xrayOpacity),__EXPERIMENTAL_SMOOTHING_TENSION:pe.number().default(Vr.__EXPERIMENTAL_SMOOTHING_TENSION),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:pe.number().default(Vr.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS),dashed:pe.boolean().default(Vr.dashed),__EXPERIMENTAL_DASH_OPTIONS:pe.discriminatedUnion("__EXPERIMENTAL_DASH_MODE",[pe.object({__EXPERIMENTAL_DASH_MODE:pe.literal("length-scaling"),__EXPERIMENTAL_DASH_LENGTH:pe.number().min(0).max(1).default(.1),__EXPERIMENTAL_DASH_GAP:pe.number().min(0).max(1).default(.1)}),pe.object({__EXPERIMENTAL_DASH_MODE:pe.literal("width-scaling"),__EXPERIMENTAL_DASH_SIZE:pe.number().min(0).default(3),__EXPERIMENTAL_GAP_SIZE:pe.number().min(0).default(2)}),pe.object({__EXPERIMENTAL_DASH_MODE:pe.literal("absolute"),__EXPERIMENTAL_DASH_METERS:pe.number().min(0).default(1),__EXPERIMENTAL_GAP_METERS:pe.number().min(0).default(.5)})]).optional(),__EXPERIMENTAL_GEOMETRY:pe.enum(["tube","ribbon"]).default("tube"),__EXPERIMENTAL_ENDCAP_EXTENSION:pe.tuple([pe.number(),pe.number()]).default(Vr.__EXPERIMENTAL_ENDCAP_EXTENSION),__EXPERIMENTAL_BILLBOARDING:pe.union([pe.boolean(),pe.number().min(0).max(90)]).default(Vr.__EXPERIMENTAL_BILLBOARDING),__EXPERIMENTAL_BORDER:pe.object({enabled:pe.boolean(),color:pe.custom(o=>typeof o=="string"),width:pe.number().optional()}).optional(),__EXPERIMENTAL_PREVENT_SELF_OVERLAP:pe.boolean().default(Vr.__EXPERIMENTAL_PREVENT_SELF_OVERLAP),__EXPERIMENTAL_XRAY_STYLE:pe.object({opacity:pe.number().min(0).max(1).optional(),color:pe.string().optional(),tint:pe.number().min(0).max(1).optional(),dithering:pe.number().min(0).optional()}).optional()}),iu=nu.partial(),M7=pe.strictObject(nu.shape);function lm(o){let{color:t,visible:e,width:r,verticalOffset:n,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:d,xrayOpacity:h,xrayStyle:y,smoothingTension:b,smoothingCornerRadius:I,dashed:x,dashLength:_,dashGap:O,dashRelativeToWidth:U,dashSize:H,gapSize:V,dashAbsolute:N,dashMeters:q,gapMeters:B,__EXPERIMENTAL_GEOMETRY:J,__EXPERIMENTAL_ENDCAP_EXTENSION:se,__EXPERIMENTAL_BILLBOARDING:W,__EXPERIMENTAL_BORDER:ie,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Ie}=o,ve={};h!==void 0&&(ve.opacity=h),(y==null?void 0:y.color)!==void 0&&(ve.color=y.color),(y==null?void 0:y.tint)!==void 0&&(ve.tint=y.tint),(y==null?void 0:y.dithering)!==void 0&&(ve.dithering=y.dithering);let he=Object.keys(ve).length>0?ve:void 0,X;return N?X={__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:q,__EXPERIMENTAL_GAP_METERS:B}:U?X={__EXPERIMENTAL_DASH_MODE:"width-scaling",__EXPERIMENTAL_DASH_SIZE:H,__EXPERIMENTAL_GAP_SIZE:V}:X={__EXPERIMENTAL_DASH_MODE:"length-scaling",__EXPERIMENTAL_DASH_LENGTH:_,__EXPERIMENTAL_DASH_GAP:O},yt(nu,{color:t,visible:e,width:r,verticalOffset:n,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:d,xrayOpacity:h,__EXPERIMENTAL_XRAY_STYLE:he,__EXPERIMENTAL_SMOOTHING_TENSION:b,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:I,dashed:x,__EXPERIMENTAL_DASH_OPTIONS:X,__EXPERIMENTAL_GEOMETRY:J,__EXPERIMENTAL_ENDCAP_EXTENSION:se,__EXPERIMENTAL_BILLBOARDING:W,__EXPERIMENTAL_BORDER:ie,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Ie})}function ka(o){let t={};for(let e in o)if(e==="__EXPERIMENTAL_SMOOTHING_TENSION"){let r=o[e];r!==void 0&&(t.smoothingTension=r)}else if(e==="__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS"){let r=o[e];r!==void 0&&(t.smoothingCornerRadius=r)}else if(e==="__EXPERIMENTAL_DASH_OPTIONS"){let r=o[e];r&&(r.__EXPERIMENTAL_DASH_MODE==="length-scaling"?(t.dashRelativeToWidth=!1,t.dashAbsolute=!1,r.__EXPERIMENTAL_DASH_LENGTH!==void 0&&(t.dashLength=r.__EXPERIMENTAL_DASH_LENGTH),r.__EXPERIMENTAL_DASH_GAP!==void 0&&(t.dashGap=r.__EXPERIMENTAL_DASH_GAP)):r.__EXPERIMENTAL_DASH_MODE==="width-scaling"?(t.dashRelativeToWidth=!0,t.dashAbsolute=!1,r.__EXPERIMENTAL_DASH_SIZE!==void 0&&(t.dashSize=r.__EXPERIMENTAL_DASH_SIZE),r.__EXPERIMENTAL_GAP_SIZE!==void 0&&(t.gapSize=r.__EXPERIMENTAL_GAP_SIZE)):r.__EXPERIMENTAL_DASH_MODE==="absolute"&&(t.dashAbsolute=!0,t.dashRelativeToWidth=!1,r.__EXPERIMENTAL_DASH_METERS!==void 0&&(t.dashMeters=r.__EXPERIMENTAL_DASH_METERS),r.__EXPERIMENTAL_GAP_METERS!==void 0&&(t.gapMeters=r.__EXPERIMENTAL_GAP_METERS)))}else if(e==="xrayOpacity"){let r=o.__EXPERIMENTAL_XRAY_STYLE;(r==null?void 0:r.opacity)===void 0&&(t[e]=o[e])}else if(e==="__EXPERIMENTAL_XRAY_STYLE"){let r=o[e];if(r){r.opacity!==void 0&&(t.xrayOpacity=r.opacity);let n={};r.color!==void 0&&(n.color=r.color),r.tint!==void 0&&(n.tint=r.tint),r.dithering!==void 0&&(n.dithering=r.dithering),Object.keys(n).length>0&&(t.xrayStyle=n)}}else t[e]=o[e];return t}var Be,Ks=class extends cr{constructor(e,r,n,a){var p,d,h,y;super();f(this,"floorStacksById",new Map);f(this,"floorsById",new Map);f(this,"startingFloorId","");f(this,"currentFloorId","");f(this,"currentFloorStackId","");f(this,"outdoorFloorStacks",new Set);f(this,"id");f(this,"renderer");f(this,"api");f(this,"mvf");f(this,"options",{});f(this,"styleMap");f(this,"animations",new Map);f(this,"Models",{add:(e,r,n)=>{var b;let y=n,{floorId:a,scale:s}=y,l=qt(y,["floorId","scale"]),c=a?this.floorsById.get(a):void 0,p=c==null?void 0:c.layers.get(Dr),d=k({},l);s!=null&&(d.scale=Array.isArray(n.scale)?n.scale:[n.scale,n.scale,n.scale]);let h=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:r.map(I=>({type:"Feature",properties:{id:Ee(),rotation:n.rotation,scale:d.scale,interactive:n.interactive},geometry:{type:"Point",coordinates:nr(I)}}))},d,{parent:(b=p==null?void 0:p.containerId)!=null?b:c==null?void 0:c.id});if(h==null)throw new tt("error creating model");return this.renderer.getState(h).children},remove:(e,r)=>{this.renderer.remove(e)}});f(this,"Image3D",{add:(e,r,n)=>{var y;let h=n,{floorId:a,flipImageToFaceCamera:s,maxImageSize:l}=h,c=qt(h,["floorId","flipImageToFaceCamera","maxImageSize"]),p=a?this.floorsById.get(a):this.currentFloor,d={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage((y=n.id)!=null?y:Ee(),d,{url:r,flipImageToFaceCamera:s!=null?s:!1,maxImageSize:l},p.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});f(this,"Markers",{add:(e,r,n)=>{let a=sa(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),h=n,{attachTo:s}=h,l=qt(h,["attachTo"]),c=l;l.rank==="initial"&&(c.rank="medium");let p=a.layers.get(Or),d=this.renderer.addMarker2D(nr(e),r,z(k({},c),{occluderId:a==null?void 0:a.occluderId,attachTo:s}),p==null?void 0:p.containerId);if(!d)throw new tt("Failed to create Marker");return d},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let r=this.renderer.getState(e);if((r==null?void 0:r.type)==="marker")return r.element},removeAll:()=>{},setPosition:(e,r,n)=>{var l;let a=this.renderer.getState(e),s=n?this.floorsById.get(n):this.currentFloor;if(!a){A.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(a.type!=="marker"){A.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(a,{position:r,parent:(l=s==null?void 0:s.layers.get(Or))==null?void 0:l.containerId})},animateTo:(e,r,n,a)=>{let s=this.renderer.getState(e),l=n?this.floorsById.get(n):this.currentFloor;if(!s)return A.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return A.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let c=k({duration:1e3,easing:"ease-in-out"},a);this.cancelAnimation(e);let p=new yo({lon:s.position[0],lat:s.position[1]}).to({lon:r[0],lat:r[1]},c.duration).easing(Ti[c.easing]).onUpdate(({lon:d,lat:h})=>{var b;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let I=(b=l==null?void 0:l.layers.get(Or))==null?void 0:b.containerId;I&&this.Markers.setPosition(e,[d,h],I)}}).start();return this.renderer.getInternalTweenGroup().add(p),this.renderer.render(),this.animations.set(e,p),kd(p).then(()=>{this.animations.delete(e)})}});f(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});f(this,"Shapes",{add:(e,r,n)=>{let a=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,s="shape-"+Ee();return this.renderer.addBatchedGeometryGroup(s,e,r,a.id),s},remove:e=>(this.renderer.remove(e.id),e.id)});f(this,"Text3D",{label:(e,r,n)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){A.warn("Enterprise mode is not enabled, skipping label creation");return}let a=cm(this.renderer,e,r,n);if(a)return{textInfo:a,target:e}},labelAll:(e={})=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode))return A.warn("Enterprise mode is not enabled, skipping label creation"),[];let r=this.api.getMapData();if(!r)return[];let n=[];return r.getByType("space").forEach(s=>{var l,c;if(s.enterpriseLocations[0]){let p=cm(this.renderer,s,(c=(l=s.enterpriseLocations[0])==null?void 0:l.name)!=null?c:s.name,e);p&&n.push({textInfo:p,target:s})}}),n},add:(e,r,n)=>{var x;let{rotation:a=0,appearance:s}=n,{fontSize:l=12,color:c="black",font:p=""}=s!=null?s:{},d=sa(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),y={type:"Feature",properties:{text:r,rotation:a,verticalOffset:(x=e.verticalOffset)!=null?x:0,fontSize:l,color:c,align:"center",visible:!0,fontFamily:p},geometry:{type:"Point",coordinates:nr(e)}},b=Ee();return this.renderer.addText3D(b,y,{appearance:z(k({},s),{fontSize:l,color:c,font:p||void 0})},d.id)},remove:e=>(this.renderer.remove(e),e)});f(this,"Labels",{all:({onCreate:e,labelOptions:r={}})=>{for(let n of Object.entries(this.mvf.space)){let[a,s]=n;s&&s.features.forEach(l=>{var x,_,O,U;let c=(x=this.api.getMapData())==null?void 0:x.getById("space",l.properties.id);if(!c)return;let p=(_=this.styleMap[l.properties.id])==null?void 0:_.showImage,d=(O=l.properties.details)==null?void 0:O.images,h=p&&((U=d==null?void 0:d[0])!=null&&U.url)?{icon:d[0].url}:{},y=k({icon:h.icon},r.appearance),I=(a?this.floorsById.get(a):this.currentFloor).layers.get(Kr);if(l.properties.center&&c.name!==""){let H=this.renderer.addLabel2D(l.properties.center,c.name,z(k({id:l.properties.id+"-label"},r),{appearance:y,rank:r.rank,attachTo:la(c)}),Ze.is(c)?c.id:I==null?void 0:I.containerId);H&&e(H.id,c.name,c)}})}},add:(e,r,n={})=>{let d=n,{attachTo:a}=d,s=qt(d,["attachTo"]),l=sa(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(Kr),p=this.renderer.addLabel2D(nr(e),r,z(k({},s),{occluderId:l.occluderId,attachTo:a}),c==null?void 0:c.containerId);if(!p)throw new tt("label creating failed");return p},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}});f(this,"Paths",{add:(e,r,n)=>{var h,y;let a=r?ka(r):void 0,s=(h=r==null?void 0:r.animateDrawing)!=null?h:!0,l=[],c=e[0].floorId||"root",p=0;for(let b of e){let I=(y=b.floorId)!=null?y:c,{latitude:x,longitude:_}=b;I!==c&&(p++,c=I),l[p]==null&&l.push({floorId:I,coordinates:[]});let O=b.floorId===I?b:new re({longitude:_,latitude:x,floorId:I});l[p].coordinates.push(O)}let d=l.reduce((b,{floorId:I,coordinates:x},_)=>{var H,V,N,q,B,J,se,W,ie;if(_!==0){let Ie=l[_-1],ve=Ie.coordinates[Ie.coordinates.length-1],he=x[0],X=nr(ve),$=nr(he),me=this.floorsById.get(Ie.floorId),ee=this.floorsById.get(I),oe=me==null?void 0:me.floorStackId,ue=ee==null?void 0:ee.floorStackId,ye=oe?this.getFloorStackAltitudeData(oe):void 0,Le=ue?this.getFloorStackAltitudeData(ue):void 0,Me=(N=(V=ye==null?void 0:ye.get((H=me==null?void 0:me.elevation)!=null?H:0))==null?void 0:V.altitude)!=null?N:0,ze=(J=(B=Le==null?void 0:Le.get((q=ee==null?void 0:ee.elevation)!=null?q:0))==null?void 0:B.altitude)!=null?J:0,Ce=(se=n==null?void 0:n.__EXPERIMENTAL_JUNCTION_INSET)!=null?se:0;Pd(X,$,Ce,Me,ze);let vt=n?ka(n):a,Vt=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:Ie.floorId},geometry:{type:"Point",coordinates:X}},{type:"Feature",properties:{parentId:I},geometry:{type:"Point",coordinates:$}}]},vt,this.id);Vt&&(s&&this.renderer.setState(Vt.id,{completeFraction:0}),b.push(z(k({},Vt),{coordinates:[ve,he]})))}if(x.length<2)return b;let O=(ie=(W=this.floorsById.get(I))==null?void 0:W.layers.get(eo))==null?void 0:ie.containerId,U=this.renderer.addPath({type:"FeatureCollection",features:x.map(Ie=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:nr(Ie)}}))},a,O!=null?O:I);return U&&(s&&this.renderer.setState(U.id,{completeFraction:0}),b.push(z(k({},U),{coordinates:x}))),b},[]);if(s){let b=[],I=this.api.getMapData();return d.forEach(x=>{var O;let _=Hh(x,I,this.api);b.push(new yo({fraction:0}).to({fraction:1},_?(O=r==null?void 0:r.drawDuration)!=null?O:1500:0).onUpdate(U=>{this.renderer.setState(x.id,{completeFraction:U.fraction})}))}),b.forEach((x,_)=>{_<b.length-1&&x.chain(b[_+1]),this.renderer.getInternalTweenGroup().add(x)}),b[0].start(),this.renderer.render(),this.animations.set(d[0].id.toString(),b[0]),{paths:d,animation:kd(b[b.length-1]).then(()=>{this.animations.delete(d[0].id.toString())})}}else return{paths:d,animation:Promise.resolve()}},remove:e=>{e.forEach(r=>{this.cancelAnimation(r),this.renderer.remove(r)})}});M(this,Be,{enabled:!1,floorGap:"auto",updateCameraElevationOnFloorChange:!0,footprintColor:Bo.color,footprintOpacity:void 0,footprintOutline:!0,spacesOpenToBelowEnabled:!1});this.renderer=a.core,this.api=a,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=n!=null?n:{},this.mvf=(p=r==null?void 0:r.mvf)!=null?p:{};let s=Gh(this.mvf["styles.json"]||{});if(this.styleMap=s,E(this,Be,k(k({},i(this,Be)),n==null?void 0:n.multiFloorView)),!r){this.id!=="outdoors-container"&&A.warn("Map (".concat(this.id,") created with no data."));let b=new Qs({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let I=new qs(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,i(this,Be),n!=null?n:{});this.floorsById.set(I.id,I),b.addFloor(I),this.setFloor(I.id);return}let l=r.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new tt("MVF does not contain any Floor Stacks.");for(let b of l){let I=new Qs(b,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[b.id]);for(let x of I.floorIds){let _=r.getMVFFeatureById("floor",x);if(_!=null){let O=new qs(I.id,_,this,i(this,Be),n!=null?n:{},this.mvf,s,r);this.floorsById.set(O.id,O),I.addFloor(O)}}if(I.floorObjects.length<1){A.warn("Floor stack ".concat(b.id," has no floors. It will not be loaded."));continue}this.floorStacksById.set(b.id,I),this.currentFloorStackId||(this.currentFloorStackId=b.id)}for(let[b]of Object.entries(r.facadesBySpaceId)){let I=r.getById("space",b);I&&(this.outdoorFloorStacks.add(I.floor.floorStack.id),(h=this.floorsById.get(I.floor.id))==null||h.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(n!=null&&n.initialFloor){let b=ps(n.initialFloor);b&&this.floorsById.has(b)?c=b:A.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.startingFloorId=c}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new tt('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return e}setFloorStack(e,r){if(this.currentFloorStackId===e)return;let n=this.floorStacksById.get(e);if(n==null){A.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(n.floorObjects.length===0){A.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(n.defaultFloor.id,r)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new tt('Floor with id "'.concat(this.currentFloorId,'" not found'));return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var a,s,l,c,p,d,h,y,b,I,x,_,O;if(this.api.manualFloorVisibility===!0)return;let r=(a=this.api.getMapDataInternal())==null?void 0:a.getById("floor",e),n=(s=this.api.getMapDataInternal())==null?void 0:s.getById("floor-stack",this.currentFloorStackId);if(r&&n){let U=r.floorStack.id===(n==null?void 0:n.id),H=(l=this.api.getMapDataInternal())==null?void 0:l.getById("floor-stack",r.floorStack.id);if((c=i(this,Be))!=null&&c.enabled&&H){if(!U)for(let N of this.floorStacksById.values())N.id!==H.id&&N.floorObjects.forEach(q=>{q.setVisible(!1)});let V=ou(H.floors,r,((d=(p=this.api.Navigation)==null?void 0:p.floors)==null?void 0:d.map(N=>N.id))||[],this.getFloorStackAltitudeData(H.id),{color:(h=i(this,Be).footprintColor)!=null?h:Bo.color,opacity:i(this,Be).footprintOpacity,outline:(y=i(this,Be).footprintOutline)!=null?y:!0,spacesOpenToBelowEnabled:(b=i(this,Be).spacesOpenToBelowEnabled)!=null?b:!1,spacesOpenToBelowVisualEffectEnabled:i(this,Be).spacesOpenToBelowVisualEffectEnabled,spacesOpenToBelowVisualEffectDarkenAmount:i(this,Be).spacesOpenToBelowVisualEffectDarkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:i(this,Be).spacesOpenToBelowVisualEffectDarkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:i(this,Be).spacesOpenToBelowVisualEffectDesaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:i(this,Be).spacesOpenToBelowVisualEffectDesaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:i(this,Be).spacesOpenToBelowVisualEffectWashOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:i(this,Be).spacesOpenToBelowVisualEffectWashOutUseDepth});if((x=(I=this.api)==null?void 0:I.Outdoor)==null||x.setOpacity(V.outdoorOpacity),V.floorStates.forEach(N=>{var q;if(N.floor){let B=(q=this.api.getMapData())==null?void 0:q.getById("floor",N.floor.id);B&&this.api.updateState(B,N.state)}}),i(this,Be).updateCameraElevationOnFloorChange){let N=this.getFloorStackAltitudeData(H.id);this.api.Camera.setElevation((O=(_=N.get(r.elevation))==null?void 0:_.altitude)!=null?O:0)}}else for(let V of this.floorStacksById.values())V.floorObjects.forEach(N=>{N.id!==e&&N.setVisible(!1)})}}updateMultiFloorViewEffects(e){E(this,Be,k(k({},i(this,Be)),e)),this.processFloorChange(this.currentFloorId)}getMultiFloorViewEffects(){var e,r,n,a,s,l,c;return{spacesOpenToBelowVisualEffectEnabled:(e=i(this,Be).spacesOpenToBelowVisualEffectEnabled)!=null?e:!0,spacesOpenToBelowVisualEffectDarkenAmount:(r=i(this,Be).spacesOpenToBelowVisualEffectDarkenAmount)!=null?r:.2,spacesOpenToBelowVisualEffectDarkenUseDepth:(n=i(this,Be).spacesOpenToBelowVisualEffectDarkenUseDepth)!=null?n:!0,spacesOpenToBelowVisualEffectDesaturateAmount:(a=i(this,Be).spacesOpenToBelowVisualEffectDesaturateAmount)!=null?a:0,spacesOpenToBelowVisualEffectDesaturateUseDepth:(s=i(this,Be).spacesOpenToBelowVisualEffectDesaturateUseDepth)!=null?s:!0,spacesOpenToBelowVisualEffectWashOutAmount:(l=i(this,Be).spacesOpenToBelowVisualEffectWashOutAmount)!=null?l:0,spacesOpenToBelowVisualEffectWashOutUseDepth:(c=i(this,Be).spacesOpenToBelowVisualEffectWashOutUseDepth)!=null?c:!1}}setFloor(e,r){if(this.currentFloorId===e)return;if(!this.floorsById.get(e)){A.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let a=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:a,floorId:e,reason:r}),this.currentFloorStack&&this.processFloorChange(e),this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.updateOutdoorPathLayerVisibility(),this.publish("floor-change",{reason:r,floorId:this.currentFloor.id,previousFloorId:a})}updateOutdoorPathLayerVisibility(){var r;let e=this.api.hidePathsNotOnCurrentFloor===!0&&!((r=this.options.multiFloorView)!=null&&r.enabled);for(let n of this.floorsById.values()){let a=this.floorStacksById.get(n.floorStackId);if(!(a!=null&&a.isOutdoors))continue;let s=n.layers.get(eo);if(!s)continue;let l=!e||n.id===this.currentFloor.id;s.setVisible(l)}}getFloorStackAltitudeData(e){var r,n;return(n=(r=this.floorStacksById.get(e))==null?void 0:r.altitudeMap)!=null?n:new Map}cancelAnimation(e){let r=this.animations.get(e);r&&(r.stop(),this.animations.delete(e),this.renderer.getInternalTweenGroup().remove(r))}loadAllFloors(){for(let e of this.floorStacksById.values())e.loadAllFloors(i(this,Be))}};Be=new WeakMap;function cm(o,t,e,r){return o.labelText3D(t.id,e!=null?e:t.name,z(k({},r),{parentId:t.floor.id}))}m();var br,tl,el=class{constructor({currentMapGetter:t}){M(this,br,new Map);M(this,tl);E(this,tl,t)}get currentMap(){return i(this,tl).call(this)}getAll(){return Array.from(i(this,br).values()).map(({marker:t})=>t)}getById(t){return i(this,br).get(t)}add(t,e,r){var p;let n=t.anchorTarget;if(!n)throw new Error("get coordinate failed");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let s=a.Markers.add(n,e,z(k({},r),{rank:(r==null?void 0:r.rank)||"medium",dynamicResize:(p=r==null?void 0:r.dynamicResize)!=null?p:!0,attachTo:la(t)}));if(s==null)throw new Error("error creating marker");let l=a.Markers.getContentEl(s.id.toString());if(!l)throw new Error("marker component should exist");let c=new no(s.id.toString(),l,t);return i(this,br).set(c.id,{marker:c,entityId:s.id.toString()}),c}remove(t){var r;let e=i(this,br).get(t.id);e&&((r=this.currentMap)==null||r.Markers.remove(e.entityId),i(this,br).delete(t.id.toString()))}removeAll(){let t=[];return i(this,br).forEach(({marker:e})=>{this.remove(e),t.push(e),i(this,br).delete(e.id.toString())}),t}setPosition(t,e){var s;let r=e.anchorTarget;if(!r){A.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){A.error("Cannot determine the current map.");return}let a=i(this,br).get(t.id);if(!a){A.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(a.entityId,nr(r),(s=r.floorId)!=null?s:n.currentFloorId),a.marker.updateTarget(e)}animateTo(t,e,r){var l;let n=e.anchorTarget;if(!n)return A.error("Cannot determine coordinate from target."),Promise.resolve();let a=this.currentMap;if(!a)return A.error("Cannot determine the current map."),Promise.resolve();let s=i(this,br).get(t.id);return s?(s.marker.updateTarget(e),a.Markers.animateTo(s.entityId,nr(n),(l=n.floorId)!=null?l:a.currentFloorId,r)):(A.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};br=new WeakMap,tl=new WeakMap;m();var No,ol,La,Ac,pm,rl=class{constructor({currentMapGetter:t,mapDataInternalGetter:e}){M(this,Ac);M(this,No,new Map);M(this,ol);M(this,La);E(this,ol,t),E(this,La,e)}get currentMap(){return i(this,ol).call(this)}getById(t){return i(this,No).get(t)}add(t,e,r){var p,d,h;let n=t.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let s=a.Image3D.add(nr(n),e,z(k({},r),{floorId:n.floorId,verticalOffset:n.verticalOffset+((p=r.verticalOffset)!=null?p:0)}));if(!s)throw new Error("image component should exist");let l=(d=i(this,La))==null?void 0:d.call(this),c=new tr(s.id.toString(),e,t,l==null?void 0:l.tokenManager);if(i(this,No).set(c.id,{image:c,entityId:s.id.toString(),anchorId:r.anchorId}),r.anchorId!=null&&l!=null){let y=(h=l.floorImagesByAnchorId.get(r.anchorId))!=null?h:[];y.push(c),l.floorImagesByAnchorId.set(r.anchorId,y)}return c}remove(t){var r;let e=i(this,No).get(t.id);e&&((r=this.currentMap)==null||r.Image3D.remove(e.entityId),i(this,No).delete(t.id),Y(this,Ac,pm).call(this,e.anchorId,t))}removeAll(){let t=[];return i(this,No).forEach(({image:e})=>{this.remove(e),t.push(e),i(this,No).delete(e.id.toString())}),t}};No=new WeakMap,ol=new WeakMap,La=new WeakMap,Ac=new WeakSet,pm=function(t,e){var s,l;if(t==null)return;let r=(l=(s=i(this,La))==null?void 0:s.call(this))==null?void 0:l.floorImagesByAnchorId;if(r==null)return;let n=r.get(t);if(n==null)return;let a=n.filter(c=>c!==e);a.length===0?r.delete(t):r.set(t,a)};m();var io,il,al,nl=class{constructor({currentMapGetter:t,mapDataInternalGetter:e}){M(this,io,new Map);M(this,il);M(this,al);E(this,il,t),E(this,al,e)}get currentMap(){return i(this,il).call(this)}getById(t){return i(this,io).get(t)}add(t,e,r){let n=[t],a=n.reduce((c,p)=>{var h,y;if(!p)return A.error("Cannot determine coordinate from options."),c;let d=(h=sa(p,this.currentMap.floorsById,this.currentMap.floorsById.get("default-floor")))==null?void 0:h.id;return c.has(d)||c.set(d,[]),(y=c.get(d))==null||y.push(p),c},new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=[];return a.forEach((c,p)=>{var y;let d=Ee();s.Models.add(d,c,z(k({},r),{url:e,floorId:p,verticalOffset:c[0].verticalOffset+((y=r==null?void 0:r.verticalOffset)!=null?y:0)})).forEach(b=>{let I=new oi(b.toString(),d,c[0]);i(this,io).set(I.id,{model:I,entityId:b.toString(),groupId:d}),l.push(I)})}),l[0]}all(){var a,s,l;let t=(a=i(this,al))==null?void 0:a.call(this);if(!t)return[];let e=t.getByType("enterprise-venue");if(!e)return[];let r=(s=e.extra)==null?void 0:s.models;if(!((l=r==null?void 0:r.models)!=null&&l.length))return[];let n=[];for(let c of r.models){if(!(c!=null&&c.url)||!c.coordinate||!t.getById("floor",c.coordinate.floorId))continue;let d=new re({latitude:c.coordinate.latitude,longitude:c.coordinate.longitude,floorId:c.coordinate.floorId,verticalOffset:c.coordinate.verticalOffset}),h=this.add(d,c.url,{visible:!0,rotation:c.rotation,scale:c.scale,material:{Default:{color:c.color},Fabric:{color:c.color}},EXPERIMENTAL_clippingEnabled:!!c.manifolded});n.push(h)}return n}remove(t){var r;let e=i(this,io).get(t.id);e&&((r=this.currentMap)==null||r.Models.remove(e.entityId,e.groupId),i(this,io).delete(t.id.toString()))}removeAll(){let t=[];return i(this,io).forEach(({model:e})=>{var n;let r=i(this,io).get(e.id);r&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),i(this,io).delete(e.id.toString()))}),t}};io=new WeakMap,il=new WeakMap,al=new WeakMap;m();var jr,ll,sl=class{constructor({currentMapGetter:t}){M(this,jr,new Map);M(this,ll);E(this,ll,t)}get currentMap(){return i(this,ll).call(this)}getById(t){var e;return(e=i(this,jr).get(t))==null?void 0:e.path}add(t,e){let r=this.currentMap;if(!r)throw new Error("currentMap should exist");let n=r.Paths.add(t,e),a=n.paths.map(l=>l.id.toString()),s=new Nr((e==null?void 0:e.id)||Ee(),n.animation,t,n.paths);for(let l of a)i(this,jr).set(l,{path:s,entityIds:a});return i(this,jr).set(s.id,{path:s,entityIds:a}),s}highlightPathSection(t,e,r,n){var h,y,b,I;let a=(y=(h=this.currentMap)==null?void 0:h.api.getMapData())==null?void 0:y.mapCenter;if(!a)return;let s=Pc([t],e,r,a);if(!s)return;let l=(b=n==null?void 0:n.animationDuration)!=null?b:1500,c=()=>{},p=new Promise(x=>{c=x}),d=new yo({fraction:0}).to({fraction:1},l).onUpdate(x=>{var _;for(let O of s)(_=this.currentMap)==null||_.api.updateState(O.segment,{highlightCompleteFraction:x.fraction})}).onStart(()=>{var x,_,O;for(let U of s)(O=this.currentMap)==null||O.api.updateState(U.segment,{highlightStartFraction:U.startHighlightFraction,highlightEndFraction:U.endHighlightFraction,highlightColor:(x=n==null?void 0:n.color)!=null?x:"red",highlightWidthMultiplier:(_=n==null?void 0:n.widthMultiplier)!=null?_:1})}).onComplete(()=>{var x;c(),(x=this.currentMap)==null||x.api.removeTween(d)});return(I=this.currentMap)==null||I.api.tweenGroup().add(d),d.start(),{animation:p}}clearHighlightedPathSection(t){var e;(e=this.currentMap)==null||e.api.updateState(t,{highlightCompleteFraction:0,highlightStartFraction:0,highlightEndFraction:0})}clearAllHighlightedPathSections(){for(let t of i(this,jr).values())this.clearHighlightedPathSection(t.path)}remove(t){var r;let e=i(this,jr).get(t.id);e&&((r=this.currentMap)==null||r.Paths.remove(e.entityIds),i(this,jr).delete(t.id),e.entityIds.forEach(n=>i(this,jr).delete(n)))}removeAll(){let t=[];return i(this,jr).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};jr=new WeakMap,ll=new WeakMap;m();var Ro,pl,cl=class{constructor({currentMapGetter:t}){M(this,Ro,new Map);M(this,pl);E(this,pl,t)}get currentMap(){return i(this,pl).call(this)}getById(t){return i(this,Ro).get(t)}add(t,e,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let a=n.Shapes.add(t,e||{},{floorId:r==null?void 0:r.id}),s=new Do(a);return i(this,Ro).set(s.id,s),s}remove(t){var r;i(this,Ro).get(t.id)&&((r=this.currentMap)==null||r.Shapes.remove(t),i(this,Ro).delete(t.id.toString()))}removeAll(){let t=[];return i(this,Ro).forEach(e=>{this.remove(e),t.push(e.id),i(this,Ro).delete(e.id.toString())}),t}};Ro=new WeakMap,pl=new WeakMap;m();var ul,dl=class{constructor({currentMapGetter:t}){M(this,ul);E(this,ul,t)}get currentMap(){return i(this,ul).call(this)}setFromStyleCollection(t){var e,r,n,a,s;for(let l in t)for(let c of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[l]==null||!c.layers.has($e))continue;let p=c.layers.get($e);for(let y of Object.values(t))if(y&&"polygons"in y&&"color"in y)for(let b of y.polygons)(r=this.currentMap)==null||r.renderer.setState(b,{color:y.color});if(p!=null&&p.layers.has(l)&&"color"in t[l]){let y=p.layers.get(l);y&&((n=this.currentMap)==null||n.renderer.setState(y,{color:t[l].color}))}if(p&&l===Qo&&!(Qr in t)){let y=p.layers.get(Qr);y&&"color"in t[l]&&((a=this.currentMap)==null||a.renderer.setState(y,{color:t[l].color}))}if(!c.layers.has(Ln))continue;let d=c.layers.get(Ln),h=c.facadesByStyleId.get(l);if(h&&h.length>0)for(let y of h){let b=d.layers.get("".concat(y,"-").concat(l));b&&"color"in t[l]&&((s=this.currentMap)==null||s.renderer.setState(b,{color:t[l].color}))}}}};ul=new WeakMap;m();var au={opacity:1},Ct,fl,hl,mn,Vo,ci,su,dm,Ba=class{constructor(t,e){M(this,ci);M(this,Ct);M(this,fl,[]);M(this,hl,{opacity:"initial"});M(this,mn,{opacity:new Map});M(this,Vo,new Set);E(this,Ct,t),E(this,fl,e||[]);let r=i(this,Ct).map;r&&r.on("idle",()=>{i(this,mn).opacity.size||Y(this,ci,su).call(this,r)})}setStyle(t){var e,r;if(i(this,Ct).map){(e=i(this,Ct).map)==null||e.setStyle(t),i(this,Vo).size&&(i(this,Vo).clear(),this.hide()),Y(this,ci,dm).call(this),Y(this,ci,su).call(this,i(this,Ct).map),this.setOpacity(i(this,hl).opacity),(r=i(this,Ct).map)==null||r.moveLayer(Ef);for(let[n,a]of i(this,fl)||[])i(this,Ct).hideOutdoorLayersIntersectingPolygons(n,a)}}get map(){return i(this,Ct).map}get enabled(){return!!i(this,Ct).map}get visible(){return i(this,Vo).size===0}show(){let t=i(this,Ct).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(r=>{i(this,Vo).has(r.id)&&t.setLayoutProperty(r.id,"visibility","visible")}),i(this,Vo).clear())}hide(t=[]){let e=i(this,Ct).map;if(!e)return;let r=e.getStyle().layers;r&&r.forEach(n=>{let a=e.getLayoutProperty(n.id,"visibility");!t.includes(n.id)&&a!=="none"&&(e.setLayoutProperty(n.id,"visibility","none"),i(this,Vo).add(n.id))})}setOpacity(t,e=[]){var a,s,l;let r=i(this,Ct).map;if(!r)return;let n=(l=(s=(a=i(this,Ct).map)==null?void 0:a.getStyle)==null?void 0:s.call(a))==null?void 0:l.layers;n&&r.once("idle",()=>{n.forEach(c=>{let p=r.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&p!=="none")try{let d=i(this,mn).opacity.get(c.id);d!==void 0&&(c.id==="background"||(c.type==="symbol"?(r.setPaintProperty(c.id,"icon-opacity",t==="initial"?d[0]:t),r.setPaintProperty(c.id,"text-opacity",t==="initial"?d[1]:t)):r.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?d[0]:t)),i(this,hl).opacity=t)}catch(d){A.warn("Error setting opacity:",d)}})})}};Ct=new WeakMap,fl=new WeakMap,hl=new WeakMap,mn=new WeakMap,Vo=new WeakMap,ci=new WeakSet,su=function(t){let e=t.getStyle().layers;e&&e.forEach(r=>{var a,s,l;t.getLayoutProperty(r.id,"visibility")!=="none"&&(r.id==="background"||(r.type==="symbol"?i(this,mn).opacity.set(r.id,[(a=t.getPaintProperty(r.id,"icon-opacity"))!=null?a:au.opacity,(s=t.getPaintProperty(r.id,"text-opacity"))!=null?s:au.opacity]):i(this,mn).opacity.set(r.id,[(l=t.getPaintProperty(r.id,"".concat(r.type,"-opacity")))!=null?l:au.opacity,void 0])))})},dm=function(){Object.values(i(this,mn)).forEach(t=>t.clear())};m();function iv(){_f(!1)}var ao,so,Gr,gl=class{constructor({currentMapGetter:t}){M(this,ao);M(this,so,new Map);M(this,Gr,new Map);E(this,ao,t)}labelAll(t={}){var n,a;let e=[],r=new Set;return(a=(n=i(this,ao).call(this))==null?void 0:n.Text3D.labelAll(t))==null||a.forEach(({textInfo:s,target:l})=>{let c=s.id.toString(),p=i(this,Gr).get(c);if(p){r.has(c)||e.push(p.text3DView),r.add(c);return}r.add(c);let d=new Ao(c,l);i(this,so).set(d.id,{targetId:l.id,text3d:c,text3DView:d}),i(this,Gr).set(c,{text3DView:d}),e.push(d)}),e}label(t,e,r={}){var a;if(i(this,ao).call(this))if(Ze.is(t)){let s=(a=i(this,ao).call(this))==null?void 0:a.Text3D.label(t,e,r);if(!s)return;let l=s.textInfo.id.toString(),c=i(this,Gr).get(l);if(c)return c.text3DView;let p=new Ao(l,s.target);return i(this,so).set(p.id,{targetId:s.target.id,text3d:l,text3DView:p}),i(this,Gr).set(l,{text3DView:p}),p}else throw new Error("Non-space target is not supported")}add(t,e,r={}){let n=i(this,ao).call(this);if(!n)throw new Error("Current map not found.");if(!re.is(t))throw new Error("Target must be a Coordinate");let a=t.anchorTarget,s=n.Text3D.add(a,e,r);if(!s)throw new Error("Failed to add Text3D.");let l=s.id.toString(),c=i(this,Gr).get(l);if(c)return A.warn("Text3DView with ID ".concat(l," already exists. A new Text3DView will not be created. Returning existing. ")),c.text3DView;let p=new Ao(l,t);return i(this,so).set(p.id,{targetId:t.id,text3d:l,text3DView:p}),i(this,Gr).set(l,{text3DView:p}),p}remove(t){var n;let e=typeof t=="string"?t:t.id,r=i(this,so).get(e);r&&((n=i(this,ao).call(this))==null||n.Text3D.remove(r.text3d),i(this,so).delete(e),i(this,Gr).delete(r.text3d))}removeAll(){i(this,so).forEach(t=>{var e;(e=i(this,ao).call(this))==null||e.Text3D.remove(t.text3d)}),i(this,so).clear(),i(this,Gr).clear()}};ao=new WeakMap,so=new WeakMap,Gr=new WeakMap;m();m();import Ur from"zod";var um="doors",lu=Ur.object({type:Ur.literal(um).default(um),color:Ur.string().default("#ffffff"),topColor:Ur.string().optional(),texture:Ur.object({url:Ur.string().optional()}).optional(),topTexture:Ur.object({url:Ur.string().optional()}).optional(),visible:Ur.boolean().default(!1),opacity:Ur.number().default(1)}),Fc=lu.partial(),B6=Ur.strictObject(lu.shape);function fm(o){let{color:t,topColor:e,texture:r,topTexture:n,visible:a,opacity:s}=o;return yt(lu,{visible:a,color:t,topColor:e,opacity:s,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0})}function kc(o,t){var r,n;let e={};return t==null||(o.color&&(o.color==="initial"?e.color=t.initialColor:e.color=o.color),o.topColor&&(o.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=o.topColor),o.visible!==void 0&&(e.visible=o.visible),((r=o.texture)==null?void 0:r.url)!==void 0&&(e.texture=o.texture.url),((n=o.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=o.topTexture.url),o.opacity!==void 0&&(e.opacity=o.opacity)),e}m();import{z as ml}from"zod";var hm="facade",cu=ml.object({type:ml.literal(hm).default(hm),opacity:ml.number().default(1),visible:ml.boolean().default(!0)}),gm=cu.partial(),G6=ml.strictObject(cu.shape);function mm(o){return yt(cu,{opacity:o.opacity,visible:o.visible})}m();import{z as ne}from"zod";var Hr="floor",ym="".concat(Hr,".footprint"),bm="".concat(Hr,".geometry"),vm="".concat(Hr,".labels"),Im="".concat(Hr,".markers"),Tm="".concat(Hr,".images"),Sm="".concat(Hr,".occlusion"),Mm="".concat(Hr,".paths"),Em="".concat(Hr,".areas"),xm="".concat(Hr,".models"),pi=ne.object({type:ne.literal(ym).default(ym),altitude:ne.number().default(0),visible:ne.boolean().default(!1),height:ne.number().default(0),opacity:ne.number().default(1),side:ne.enum(["double","front","back"]).default("double"),color:ne.string().default("#ffffff"),ceilingVisible:ne.boolean().default(!0),basementMaskEnabled:ne.boolean().default(!1),outline:ne.boolean().default(!0),ceilingThickness:ne.number().default(.2)}),Y6=pi.partial(),Lc=ne.object({type:ne.literal(bm).default(bm),opacity:ne.number().default(1),visible:ne.boolean().default(!0),maskId:ne.number().nullable().default(null),maskEffect:ne.enum(["hide","reveal"]).default("hide"),maskMode:ne.enum(["mask","masked-object"]).default("mask"),maskEnabled:ne.boolean().default(!1),effectStart:ne.number().default(0),effectDistance:ne.number().default(0),darkenAmount:ne.number().default(0),darkenUseDepth:ne.boolean().default(!0),desaturateAmount:ne.number().default(0),desaturateUseDepth:ne.boolean().default(!0),washOutAmount:ne.number().default(0),washOutUseDepth:ne.boolean().default(!1)}),Cm=Lc.partial(),Bc=ne.object({type:ne.literal(vm).default(vm),enabled:ne.boolean().default(!0)}),_m=Bc.partial(),Nc=ne.object({type:ne.literal(Im).default(Im),enabled:ne.boolean().default(!0)}),Pm=Nc.partial(),Rc=ne.object({type:ne.literal(Tm).default(Tm),visible:ne.boolean().default(!0),collisionsEnabled:ne.boolean().default(!1)}),wm=Rc.partial(),Vc=ne.object({type:ne.literal(Sm).default(Sm),enabled:ne.boolean().default(!0)}),Om=Vc.partial(),jc=ne.object({type:ne.literal(Mm).default(Mm),visible:ne.boolean().default(!0)}),Dm=jc.partial(),Gc=ne.object({type:ne.literal(Hr).default(Hr),visible:ne.boolean().default(!1),altitude:ne.number().default(0)}),Uc=ne.object({type:ne.literal(Em).default(Em),visible:ne.boolean().default(!0)}),Am=Uc.partial(),Hc=ne.object({visible:ne.boolean().default(!0)}),Fm=Hc.partial(),Wc=ne.object({type:ne.literal(xm).default(xm),visible:ne.boolean().default(!0)}),km=Wc.partial(),av=ne.object(z(k({},Gc.shape),{geometry:Lc,labels:Bc,markers:Nc,images:Rc,footprint:pi,occlusion:Vc,paths:jc,areas:Uc,text3d:Hc,models:Wc})),Lm=Gc.partial(),Z6=ne.object(z(k({},Gc.shape),{geometry:Lc.partial(),labels:Bc.partial(),markers:Nc.partial(),images:Rc.partial(),footprint:pi.partial(),occlusion:Vc.partial(),paths:jc.partial(),areas:Uc.partial(),text3d:Hc.partial(),models:Wc.partial()})).partial(),J6=ne.strictObject(z(k({},Gc.shape),{geometry:ne.strictObject(Lc.shape),labels:ne.strictObject(Bc.shape),markers:ne.strictObject(Nc.shape),images:ne.strictObject(Rc.shape),footprint:ne.strictObject(pi.shape),occlusion:ne.strictObject(Vc.shape),paths:ne.strictObject(jc.shape),areas:ne.strictObject(Uc.shape),text3d:ne.strictObject(Hc.shape),models:ne.strictObject(Wc.shape)}));function Bm(o,t,e){var se,W,ie,Ie;if(!t){A.error("Floor is not defined. Cannot get floor state.");return}let r=t.layers.get($e),n=r?e==null?void 0:e.getState(r.containerId):void 0,a=t.layers.get(Kr),s=t.layers.get(Or),l=(se=t.footprintObject)==null?void 0:se.getState(),c=t.layers.get(Fn),p=c?e==null?void 0:e.getState(c.containerId):void 0,d=t.layers.get(Ni),h=d?e==null?void 0:e.getState(d.containerId):void 0,y=!1;if(r!=null&&r.layers)for(let ve of r.layers.values()){let he=e==null?void 0:e.getState(ve);if((W=he==null?void 0:he.children)!=null&&W[0]){let X=e==null?void 0:e.getState(he.children[0]);y=(ie=X==null?void 0:X.enableImageCollisions)!=null?ie:!1;break}}let b=t.layers.get(eo),I=b?e==null?void 0:e.getState(b.containerId):void 0,x=t.layers.get(kn),_=x?e==null?void 0:e.getState(x.containerId):void 0,O=t.layers.get(Dr),U=O?e==null?void 0:e.getState(O.containerId):void 0,H=!0,V=!0,N=!0,q=!0;for(let[,ve]of r.layers){let he=e==null?void 0:e.getState(ve);he!=null&&he.maskId||(H=!1),he!=null&&he.maskEffect||(V=!1),he!=null&&he.maskMode||(N=!1),he!=null&&he.maskEnabled||(q=!1)}let B=e==null?void 0:e.getInternalState().geometry3DMap.get(t.id),J=!1;if((B==null?void 0:B.type)==="group-container"){let ve=B?e==null?void 0:e.getSystems().text3DSystem.getBatchedText(B):void 0;J=(Ie=ve==null?void 0:ve.visible)!=null?Ie:!0}return yt(av,{geometry:{opacity:n==null?void 0:n.opacity,visible:n==null?void 0:n.visible,maskId:H,maskEffect:V,maskMode:N,maskEnabled:q},labels:{enabled:a==null?void 0:a.visible},markers:{enabled:s==null?void 0:s.visible},footprint:{altitude:l==null?void 0:l.altitude,visible:l==null?void 0:l.visible,height:l==null?void 0:l.height,opacity:l==null?void 0:l.opacity,side:l==null?void 0:l.side,color:l==null?void 0:l.color,ceilingVisible:l==null?void 0:l.ceilingVisible,basementMaskEnabled:l==null?void 0:l.basementMaskEnabled,outline:l==null?void 0:l.outline,ceilingThickness:l==null?void 0:l.ceilingThickness},images:{visible:h==null?void 0:h.visible,collisionsEnabled:y},occlusion:{enabled:p==null?void 0:p.visible},paths:{visible:I==null?void 0:I.visible},areas:{visible:_==null?void 0:_.visible},text3d:{visible:J},models:{visible:U==null?void 0:U.visible},visible:o.visible,altitude:o.altitude})}m();import{z as Ue}from"zod";var Nm="geometry",pu=Ue.object({type:Ue.literal(Nm).default(Nm),visible:Ue.boolean().default(!0),color:Ue.union([Ue.string(),Ue.literal("initial")]).default("#ffffff"),topColor:Ue.union([Ue.string(),Ue.literal("initial")]).optional(),hoverColor:Ue.union([Ue.string(),Ue.literal("initial")]).optional(),interactive:Ue.boolean().default(!1),opacity:Ue.number().default(1),height:Ue.number().default(0),altitude:Ue.number().default(0),texture:Ue.object({url:Ue.string()}).optional(),topTexture:Ue.object({url:Ue.string()}).optional(),flipImageToFaceCamera:Ue.boolean().default(!1),enableImageCollisions:Ue.boolean().default(!1),borderVisible:Ue.boolean().default(!1),borderColor:Ue.string().optional(),borderWidth:Ue.number().optional()}),du=pu.partial(),rP=Ue.strictObject(pu.shape);function Rm(o){let{altitude:t,interactive:e,hoverColor:r,color:n,visible:a,opacity:s,height:l,texture:c,topTexture:p,flipImageToFaceCamera:d,enableImageCollisions:h,topColor:y,borderVisible:b,borderColor:I,borderWidth:x}=o;return yt(pu,{interactive:e,hoverColor:r,color:n,visible:a,opacity:s,height:l,texture:c?{url:o.texture}:void 0,topTexture:p?{url:p}:void 0,flipImageToFaceCamera:d,enableImageCollisions:h,topColor:y,altitude:t,borderVisible:b,borderColor:I,borderWidth:x})}function Vm(o,t){var r,n;let e={};return t==null||(o.color&&(o.color==="initial"?e.color=t.initialColor:e.color=o.color),o.topColor&&(o.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=o.topColor),o.visible!==void 0&&(e.visible=o.visible),((r=o.texture)==null?void 0:r.url)!==void 0&&(e.texture=o.texture.url),((n=o.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=o.topTexture.url),o.hoverColor!==void 0&&(e.hoverColor=o.hoverColor),o.interactive!==void 0&&(e.interactive=o.interactive),o.height!==void 0&&(e.height=o.height),o.opacity!==void 0&&(e.opacity=o.opacity),o.flipImageToFaceCamera!==void 0&&(e.flipImageToFaceCamera=o.flipImageToFaceCamera),o.enableImageCollisions!==void 0&&(e.enableImageCollisions=o.enableImageCollisions),o.altitude!==void 0&&(e.altitude=o.altitude),o.borderVisible!==void 0&&(e.borderVisible=o.borderVisible),o.borderColor!==void 0&&(e.borderColor=o.borderColor),o.borderWidth!==void 0&&(e.borderWidth=o.borderWidth)),e}m();import vr from"zod";var uu="label",sv=vr.object({type:vr.literal(uu).default(uu),text:vr.string(),rank:vr.custom(o=>Hl.safeParse(o).success||o==="initial"),appearance:vr.custom(o=>Pf.safeParse(o).success),interactive:vr.boolean().default(!1),enabled:vr.boolean().default(!0),textPlacement:vr.union([vr.enum(Dp),vr.array(vr.enum(Dp))]).default(Ap),occlude:vr.boolean().default(!0)}),jm=sv.partial();function Gm(o){var n,a,s,l,c;let{text:t,enabled:e,options:r}=o;return{type:uu,text:t!=null?t:"",appearance:wf((n=r==null?void 0:r.appearance)!=null?n:{}),rank:(a=r==null?void 0:r.rank)!=null?a:"medium",enabled:e!=null?e:!0,interactive:(s=r==null?void 0:r.interactive)!=null?s:!1,textPlacement:(l=r==null?void 0:r.textPlacement)!=null?l:Ap,occlude:(c=r==null?void 0:r.occlude)!=null?c:!0}}function Um(o,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return o.text&&(e.text=o.text),o.appearance&&(e.options.appearance=o.appearance),o.textPlacement&&(e.options.textPlacement=o.textPlacement),o.rank!=null&&(o.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=o.rank),o.enabled!==void 0&&(e.enabled=o.enabled),o.interactive!==void 0&&(e.options.interactive=o.interactive),o.occlude!==void 0&&(e.options.occlude=o.occlude),o.enabled!==void 0&&(e.enabled=o.enabled),e}m();import et from"zod";var fu="marker",lv=et.object({type:et.literal(fu).default(fu),rank:et.custom(o=>Hl.safeParse(o).success||o==="initial"),placement:et.union([et.enum(Fp),et.array(et.enum(Fp))]).optional(),interactive:et.union([et.boolean(),et.literal("pointer-events-auto")]).default(!1),dynamicResize:et.boolean().default(!0),enabled:et.boolean().default(!0),zIndex:et.number().optional(),lowPriorityPin:et.object({enabled:et.boolean().optional(),size:et.number().positive().optional(),color:et.string().optional()}).optional(),element:et.custom(o=>o instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:et.string(),occlude:et.boolean().default(!0),animated:et.boolean().default(!0)}),Hm=lv.omit({element:!0}).partial();function Wm(o,t){var y,b,I,x,_,O;let e=t!=null&&t.target?t.target.anchorTarget:void 0,{enabled:r,placement:n,element:a,dynamicResize:s,contentHTML:l,options:c,position:p,parent:d}=o,h=typeof d=="object"?d.id:d;return e==null&&(e=new re({latitude:(y=p==null?void 0:p[1])!=null?y:0,longitude:(b=p==null?void 0:p[0])!=null?b:0,floorId:h==null?void 0:h.toString()})),{type:fu,rank:(I=c==null?void 0:c.rank)!=null?I:"medium",interactive:(x=c==null?void 0:c.interactive)!=null?x:!1,enabled:r!=null?r:!0,element:a,placement:n!=null?n:[],zIndex:c==null?void 0:c.zIndex,dynamicResize:s!=null?s:!0,lowPriorityPin:c==null?void 0:c.lowPriorityPin,contentHTML:l!=null?l:"",occlude:(_=c==null?void 0:c.occlude)!=null?_:!0,animated:(O=c==null?void 0:c.animated)!=null?O:!0}}function zm(o,t){let e={};return e.options={},o.rank!=null&&(o.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=o.rank),o.dynamicResize!=null&&(e.options.dynamicResize=o.dynamicResize),o.enabled!=null&&(e.enabled=o.enabled),o.interactive!=null&&(e.options.interactive=o.interactive),o.enabled!=null&&(e.enabled=o.enabled),o.contentHTML!=null&&(e.contentHTML=o.contentHTML),o.placement!=null&&(e.placement=o.placement),o.occlude!=null&&(e.options.occlude=o.occlude),o.zIndex!=null&&(e.options.zIndex=o.zIndex),o.animated!=null&&(e.options.animated=o.animated),e}m();import{z as _t}from"zod";var Xm="shape",hu=_t.object({type:_t.literal(Xm).default(Xm),visible:_t.boolean().default(!0),altitude:_t.number().default(0),color:_t.string().default("#ffffff"),height:_t.number().default(0),opacity:_t.number().default(1),interactive:_t.boolean().default(!1),bevel:_t.object({enabled:_t.boolean().optional(),thickness:_t.number().optional(),size:_t.number().optional(),offset:_t.number().optional(),segments:_t.number().optional()}).optional(),position:_t.custom(o=>re.is(o))}),gu=hu.partial(),bP=_t.strictObject(hu.shape);function $m(o){let{altitude:t,visible:e,color:r,opacity:n,interactive:a,height:s,children:l,bevel:c,position:p}=o;if(l==null||l.length<1){A.error("Expected at least one child for Shape (".concat(o.id,"). Cannot get shape state."));return}return yt(hu,{altitude:t,visible:e,color:r,height:s,opacity:n,interactive:a,bevel:c,position:new re({latitude:p[1],longitude:p[0],verticalOffset:t!=null?t:0})})}function Ym(o){let t=ke(gu,o,{warn:!0}),e={};if(t.visible!==void 0&&(e.visible=t.visible),t.color!==void 0&&(e.color=t.color),t.opacity!==void 0&&(e.opacity=t.opacity),t.altitude!==void 0&&(e.altitude=t.altitude),t.height!==void 0&&(e.height=t.height),t.interactive!==void 0&&(e.interactive=t.interactive),t.bevel!==void 0){let r={enabled:t.bevel.enabled||!1,thickness:t.bevel.thickness,size:t.bevel.size,offset:t.bevel.offset,segments:t.bevel.segments};e.bevel=r}return t.position!==void 0&&(e.position=[t.position.longitude,t.position.latitude],e.altitude=t.position.verticalOffset),e}m();import zc from"zod";var Zm="text3d",Jm=zc.object({type:zc.literal(Zm).default(Zm),position:zc.custom(o=>o instanceof re,{error:"Must be a Coordinate instance"})}),qm=Sf.extend(k({},Jm.shape)),Qm=Mf.extend(k({},Jm.shape)).partial(),xP=zc.strictObject(qm.shape);function Km(o){var V,N;let{position:t,visible:e,color:r,flipToFaceCamera:n,font:a,fontSize:s,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:d,outlineOffsetX:h,outlineOffsetY:y,strokeWidth:b,strokeOpacity:I,strokeColor:x,fillOpacity:_,hoverColor:O,rotation:U,content:H}=o;return yt(qm,{position:new re({latitude:(V=t==null?void 0:t[1])!=null?V:0,longitude:(N=t==null?void 0:t[0])!=null?N:0}),visible:e,color:r,flipToFaceCamera:n,font:a,fontSize:s,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:d,outlineOffsetX:h,outlineOffsetY:y,strokeWidth:b,strokeOpacity:I,strokeColor:x,fillOpacity:_,hoverColor:O,rotation:U,content:H})}m();import Jt from"zod";var ey="walls",mu=Jt.object({type:Jt.literal(ey).default(ey),color:Jt.string().default("#ffffff"),topColor:Jt.string().optional(),texture:Jt.object({url:Jt.string()}).or(Jt.undefined()),topTexture:Jt.object({url:Jt.string()}).or(Jt.undefined()),visible:Jt.boolean().default(!0),height:Jt.number().default(0),opacity:Jt.number().default(1)}),yu=mu.partial(),DP=Jt.strictObject(mu.shape);function ty(o){let{color:t,topColor:e,texture:r,topTexture:n,visible:a,height:s,opacity:l}=o;return yt(mu,{visible:a,color:t,topColor:e,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0,height:s,opacity:l})}function bu(o,t){var r,n;let e={};return t==null||(o.color&&(o.color==="initial"?e.color=t.initialColor:e.color=o.color),o.topColor&&(o.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=o.topColor),o.visible!==void 0&&(e.visible=o.visible),((r=o.texture)==null?void 0:r.url)!==void 0&&(e.texture=o.texture.url),((n=o.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=o.topTexture.url),o.height!==void 0&&(e.height=o.height),o.opacity!==void 0&&(e.opacity=o.opacity)),e}m();import{z as lo}from"zod";var vu="image3d",cv=lo.object({type:lo.literal(vu).default(vu),visible:lo.boolean().default(!0),opacity:lo.number().min(0).max(1).default(1),position:lo.custom(o=>o instanceof re,{error:"Must be a Coordinate instance"}),width:lo.number().default(1),height:lo.number().default(1),rotation:lo.number().default(0),verticalOffset:lo.number().default(0),flipImagesToFaceCamera:lo.boolean().default(!1)}),ry=cv.partial();function oy(o){var e,r,n,a,s,l,c,p,d;let{position:t}=o;return{type:vu,visible:(e=o.visible)!=null?e:!0,opacity:(r=o.opacity)!=null?r:1,position:new re({latitude:(n=t==null?void 0:t[1])!=null?n:0,longitude:(a=t==null?void 0:t[0])!=null?a:0,verticalOffset:t==null?void 0:t[2]}),width:(s=o.width)!=null?s:1,height:(l=o.height)!=null?l:1,rotation:(c=o.rotation)!=null?c:0,verticalOffset:(p=o.verticalOffset)!=null?p:0,flipImagesToFaceCamera:(d=o.flipImageToFaceCamera)!=null?d:!1}}m();import{z as De}from"zod";var ny="model",Iu=If.extend({type:De.literal(ny).default(ny),color:De.string().optional(),position:De.custom(o=>re.is(o),{error:"Expected a Coordinate"}),visible:De.boolean().default(!0),rotation:De.tuple([De.number(),De.number(),De.number()]).default([0,0,0]),scale:De.tuple([De.number(),De.number(),De.number()]).default([1,1,1]),verticalOffset:De.number().default(0),opacity:De.number().default(1),material:De.record(De.string(),Tf).optional(),interactive:De.boolean().default(!1),clippingPlaneZOffset:De.custom(o=>typeof o=="number"&&!Number.isNaN(o),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:De.string().default("#E67B5B"),clippingPlaneTopVisible:De.boolean().default(!0)}),iy=Iu.extend({scale:De.union([De.number(),De.tuple([De.number(),De.number(),De.number()])]),rotation:De.union([De.number(),De.tuple([De.number(),De.number(),De.number()])])}).partial(),HP=De.strictObject(Iu.shape);function ay(o){var O,U,H;let{color:t,position:e,rotation:r,scale:n,visible:a,interactive:s,opacity:l,material:c,verticalOffset:p,parent:d,clippingPlaneZOffset:h,clippingPlaneTopColor:y,clippingPlaneTopVisible:b}=o,I=typeof d=="object"?(O=d==null?void 0:d.id)==null?void 0:O.toString():d==null?void 0:d.toString(),x="".concat(Dr,"-"),_=I!=null&&I.startsWith(x)?I.slice(x.length):I;return yt(Iu,{color:t,position:new re({latitude:(U=e==null?void 0:e[1])!=null?U:0,longitude:(H=e==null?void 0:e[0])!=null?H:0,verticalOffset:e==null?void 0:e[2],floorId:_}),rotation:r,scale:n,visible:a,interactive:s,opacity:l,material:c,verticalOffset:p,clippingPlaneZOffset:h,clippingPlaneTopColor:y,clippingPlaneTopVisible:b})}m();m();m();var Va=Nl(Jy());Va.registerHelper({});Va.registerPartial({});var qy=Va.template({compiler:[8,">= 4.3.0"],main:function(o,t,e,r,n){var a=o.lambda,s=o.escapeExpression,l=o.lookupProperty||function(c,p){if(Object.prototype.hasOwnProperty.call(c,p))return c[p]};return"<div class='mappedin-annotation-marker'>\n <div style='width: "+s(a(t!=null?l(t,"size"):t,t))+"px; height: "+s(a(t!=null?l(t,"size"):t,t))+"px'>\n <img src='"+s(a(t!=null?l(t,"icon"):t,t))+"' alt='"+s(a(t!=null?l(t,"name"):t,t))+"' width='"+s(a(t!=null?l(t,"size"):t,t))+"' height='"+s(a(t!=null?l(t,"size"):t,t))+"' />\n </div>\n</div>"},useData:!0});var NI=30,Qy=new Set(["annotation"]);function RI(o){var t,e;return qy({size:NI,icon:(e=(t=o.icon)==null?void 0:t.url)!=null?e:"",name:o.name})}function VI(o={}){return k({rank:"high",placement:["center"],interactive:!0},o)}function jI(o,t){return t.Markers.add(o.coordinate,RI(o),VI())}function Ky(o,t){let e=[];for(let r of t)Mo(r)&&kr.is(r)&&r.icon!=null&&typeof r.icon.url=="string"&&r.icon.url.length>0&&e.push(jI(r,o));return e}m();var e1=new Set(["space","object"]);function t1(o,t){t.forEach(e=>{Mh(e)&&o.updateState(e,{interactive:!0})})}m();m();function r1(o){return Mo(o)?"anchorTarget"in o&&o.anchorTarget!=null:!1}m();m();var{entries:u1,setPrototypeOf:o1,isFrozen:GI,getPrototypeOf:UI,getOwnPropertyDescriptor:HI}=Object,{freeze:Bt,seal:Ir,create:f1}=Object,{apply:Wu,construct:zu}=typeof Reflect<"u"&&Reflect;Bt||(Bt=function(t){return t});Ir||(Ir=function(t){return t});Wu||(Wu=function(t,e,r){return t.apply(e,r)});zu||(zu=function(t,e){return new t(...e)});var pp=Nt(Array.prototype.forEach),WI=Nt(Array.prototype.lastIndexOf),n1=Nt(Array.prototype.pop),Tl=Nt(Array.prototype.push),zI=Nt(Array.prototype.splice),up=Nt(String.prototype.toLowerCase),Vu=Nt(String.prototype.toString),i1=Nt(String.prototype.match),Sl=Nt(String.prototype.replace),XI=Nt(String.prototype.indexOf),$I=Nt(String.prototype.trim),zr=Nt(Object.prototype.hasOwnProperty),Lt=Nt(RegExp.prototype.test),Ml=YI(TypeError);function Nt(o){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Wu(o,t,r)}}function YI(o){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return zu(o,e)}}function _e(o,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:up;o1&&o1(o,null);let r=t.length;for(;r--;){let n=t[r];if(typeof n=="string"){let a=e(n);a!==n&&(GI(t)||(t[r]=a),n=a)}o[n]=!0}return o}function ZI(o){for(let t=0;t<o.length;t++)zr(o,t)||(o[t]=null);return o}function Uo(o){let t=f1(null);for(let[e,r]of u1(o))zr(o,e)&&(Array.isArray(r)?t[e]=ZI(r):r&&typeof r=="object"&&r.constructor===Object?t[e]=Uo(r):t[e]=r);return t}function El(o,t){for(;o!==null;){let r=HI(o,t);if(r){if(r.get)return Nt(r.get);if(typeof r.value=="function")return Nt(r.value)}o=UI(o)}function e(){return null}return e}var a1=Bt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ju=Bt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gu=Bt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),JI=Bt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Uu=Bt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),qI=Bt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),s1=Bt(["#text"]),l1=Bt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Hu=Bt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c1=Bt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),dp=Bt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),QI=Ir(/\{\{[\w\W]*|[\w\W]*\}\}/gm),KI=Ir(/<%[\w\W]*|[\w\W]*%>/gm),eT=Ir(/\$\{[\w\W]*/gm),tT=Ir(/^data-[\-\w.\u00B7-\uFFFF]+$/),rT=Ir(/^aria-[\-\w]+$/),h1=Ir(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),oT=Ir(/^(?:\w+script|data):/i),nT=Ir(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),g1=Ir(/^html$/i),iT=Ir(/^[a-z][.\w]*(-[.\w]+)+$/i),p1=Object.freeze({__proto__:null,ARIA_ATTR:rT,ATTR_WHITESPACE:nT,CUSTOM_ELEMENT:iT,DATA_ATTR:tT,DOCTYPE_NAME:g1,ERB_EXPR:KI,IS_ALLOWED_URI:h1,IS_SCRIPT_OR_DATA:oT,MUSTACHE_EXPR:QI,TMPLIT_EXPR:eT}),xl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},aT=function(){return typeof window>"u"?null:window},sT=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(r=e.getAttribute(n));let a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch(s){return console.warn("TrustedTypes policy "+a+" could not be created."),null}},d1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function m1(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aT(),t=fe=>m1(fe);if(t.version="3.2.6",t.removed=[],!o||!o.document||o.document.nodeType!==xl.document||!o.Element)return t.isSupported=!1,t;let{document:e}=o,r=e,n=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:p,NamedNodeMap:d=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:h,DOMParser:y,trustedTypes:b}=o,I=c.prototype,x=El(I,"cloneNode"),_=El(I,"remove"),O=El(I,"nextSibling"),U=El(I,"childNodes"),H=El(I,"parentNode");if(typeof s=="function"){let fe=e.createElement("template");fe.content&&fe.content.ownerDocument&&(e=fe.content.ownerDocument)}let V,N="",{implementation:q,createNodeIterator:B,createDocumentFragment:J,getElementsByTagName:se}=e,{importNode:W}=r,ie=d1();t.isSupported=typeof u1=="function"&&typeof H=="function"&&q&&q.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Ie,ERB_EXPR:ve,TMPLIT_EXPR:he,DATA_ATTR:X,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:oe}=p1,{IS_ALLOWED_URI:ue}=p1,ye=null,Le=_e({},[...a1,...ju,...Gu,...Uu,...s1]),Me=null,ze=_e({},[...l1,...Hu,...c1,...dp]),Ce=Object.seal(f1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),vt=null,Vt=null,fo=!0,Ho=!0,Tn=!1,hi=!0,qe=!1,Wo=!0,dt=!1,zo=!1,Xa=!1,ho=!1,go=!1,Sn=!1,Al=!0,Fl=!1,kl="user-content-",$a=!0,Mn=!1,ut={},En=null,mp=_e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),yp=null,bp=_e({},["audio","video","img","source","image","track"]),Ya=null,w=_e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),u="http://www.w3.org/1998/Math/MathML",g="http://www.w3.org/2000/svg",v="http://www.w3.org/1999/xhtml",S=v,T=!1,L=null,F=_e({},[u,g,v],Vu),j=_e({},["mi","mo","mn","ms","mtext"]),R=_e({},["annotation-xml"]),te=_e({},["title","style","font","a","script"]),D=null,G=["application/xhtml+xml","text/html"],Q="text/html",le=null,de=null,Pe=e.createElement("form"),Te=function(P){return P instanceof RegExp||P instanceof Function},Ne=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(de&&de===P)){if((!P||typeof P!="object")&&(P={}),P=Uo(P),D=G.indexOf(P.PARSER_MEDIA_TYPE)===-1?Q:P.PARSER_MEDIA_TYPE,le=D==="application/xhtml+xml"?Vu:up,ye=zr(P,"ALLOWED_TAGS")?_e({},P.ALLOWED_TAGS,le):Le,Me=zr(P,"ALLOWED_ATTR")?_e({},P.ALLOWED_ATTR,le):ze,L=zr(P,"ALLOWED_NAMESPACES")?_e({},P.ALLOWED_NAMESPACES,Vu):F,Ya=zr(P,"ADD_URI_SAFE_ATTR")?_e(Uo(w),P.ADD_URI_SAFE_ATTR,le):w,yp=zr(P,"ADD_DATA_URI_TAGS")?_e(Uo(bp),P.ADD_DATA_URI_TAGS,le):bp,En=zr(P,"FORBID_CONTENTS")?_e({},P.FORBID_CONTENTS,le):mp,vt=zr(P,"FORBID_TAGS")?_e({},P.FORBID_TAGS,le):Uo({}),Vt=zr(P,"FORBID_ATTR")?_e({},P.FORBID_ATTR,le):Uo({}),ut=zr(P,"USE_PROFILES")?P.USE_PROFILES:!1,fo=P.ALLOW_ARIA_ATTR!==!1,Ho=P.ALLOW_DATA_ATTR!==!1,Tn=P.ALLOW_UNKNOWN_PROTOCOLS||!1,hi=P.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qe=P.SAFE_FOR_TEMPLATES||!1,Wo=P.SAFE_FOR_XML!==!1,dt=P.WHOLE_DOCUMENT||!1,ho=P.RETURN_DOM||!1,go=P.RETURN_DOM_FRAGMENT||!1,Sn=P.RETURN_TRUSTED_TYPE||!1,Xa=P.FORCE_BODY||!1,Al=P.SANITIZE_DOM!==!1,Fl=P.SANITIZE_NAMED_PROPS||!1,$a=P.KEEP_CONTENT!==!1,Mn=P.IN_PLACE||!1,ue=P.ALLOWED_URI_REGEXP||h1,S=P.NAMESPACE||v,j=P.MATHML_TEXT_INTEGRATION_POINTS||j,R=P.HTML_INTEGRATION_POINTS||R,Ce=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&Te(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&Te(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ce.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),qe&&(Ho=!1),go&&(ho=!0),ut&&(ye=_e({},s1),Me=[],ut.html===!0&&(_e(ye,a1),_e(Me,l1)),ut.svg===!0&&(_e(ye,ju),_e(Me,Hu),_e(Me,dp)),ut.svgFilters===!0&&(_e(ye,Gu),_e(Me,Hu),_e(Me,dp)),ut.mathMl===!0&&(_e(ye,Uu),_e(Me,c1),_e(Me,dp))),P.ADD_TAGS&&(ye===Le&&(ye=Uo(ye)),_e(ye,P.ADD_TAGS,le)),P.ADD_ATTR&&(Me===ze&&(Me=Uo(Me)),_e(Me,P.ADD_ATTR,le)),P.ADD_URI_SAFE_ATTR&&_e(Ya,P.ADD_URI_SAFE_ATTR,le),P.FORBID_CONTENTS&&(En===mp&&(En=Uo(En)),_e(En,P.FORBID_CONTENTS,le)),$a&&(ye["#text"]=!0),dt&&_e(ye,["html","head","body"]),ye.table&&(_e(ye,["tbody"]),delete vt.tbody),P.TRUSTED_TYPES_POLICY){if(typeof P.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ml('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof P.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ml('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=P.TRUSTED_TYPES_POLICY,N=V.createHTML("")}else V===void 0&&(V=sT(b,n)),V!==null&&typeof N=="string"&&(N=V.createHTML(""));Bt&&Bt(P),de=P}},ot=_e({},[...ju,...Gu,...JI]),Ye=_e({},[...Uu,...qI]),ft=function(P){let Z=H(P);(!Z||!Z.tagName)&&(Z={namespaceURI:S,tagName:"template"});let ce=up(P.tagName),Xe=up(Z.tagName);return L[P.namespaceURI]?P.namespaceURI===g?Z.namespaceURI===v?ce==="svg":Z.namespaceURI===u?ce==="svg"&&(Xe==="annotation-xml"||j[Xe]):!!ot[ce]:P.namespaceURI===u?Z.namespaceURI===v?ce==="math":Z.namespaceURI===g?ce==="math"&&R[Xe]:!!Ye[ce]:P.namespaceURI===v?Z.namespaceURI===g&&!R[Xe]||Z.namespaceURI===u&&!j[Xe]?!1:!Ye[ce]&&(te[ce]||!ot[ce]):!!(D==="application/xhtml+xml"&&L[P.namespaceURI]):!1},Re=function(P){Tl(t.removed,{element:P});try{H(P).removeChild(P)}catch(Z){_(P)}},nt=function(P,Z){try{Tl(t.removed,{attribute:Z.getAttributeNode(P),from:Z})}catch(ce){Tl(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(P),P==="is")if(ho||go)try{Re(Z)}catch(ce){}else try{Z.setAttribute(P,"")}catch(ce){}},it=function(P){let Z=null,ce=null;if(Xa)P="<remove></remove>"+P;else{let at=i1(P,/^[\r\n\t ]+/);ce=at&&at[0]}D==="application/xhtml+xml"&&S===v&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");let Xe=V?V.createHTML(P):P;if(S===v)try{Z=new y().parseFromString(Xe,D)}catch(at){}if(!Z||!Z.documentElement){Z=q.createDocument(S,"template",null);try{Z.documentElement.innerHTML=T?N:Xe}catch(at){}}let Tt=Z.body||Z.documentElement;return P&&ce&&Tt.insertBefore(e.createTextNode(ce),Tt.childNodes[0]||null),S===v?se.call(Z,dt?"html":"body")[0]:dt?Z.documentElement:Tt},jt=function(P){return B.call(P.ownerDocument||P,P,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Pt=function(P){return P instanceof h&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof d)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},Gt=function(P){return typeof l=="function"&&P instanceof l};function Qe(fe,P,Z){pp(fe,ce=>{ce.call(t,P,Z,de)})}let lr=function(P){let Z=null;if(Qe(ie.beforeSanitizeElements,P,null),Pt(P))return Re(P),!0;let ce=le(P.nodeName);if(Qe(ie.uponSanitizeElement,P,{tagName:ce,allowedTags:ye}),Wo&&P.hasChildNodes()&&!Gt(P.firstElementChild)&&Lt(/<[/\w!]/g,P.innerHTML)&&Lt(/<[/\w!]/g,P.textContent)||P.nodeType===xl.progressingInstruction||Wo&&P.nodeType===xl.comment&&Lt(/<[/\w]/g,P.data))return Re(P),!0;if(!ye[ce]||vt[ce]){if(!vt[ce]&&Ll(ce)&&(Ce.tagNameCheck instanceof RegExp&&Lt(Ce.tagNameCheck,ce)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(ce)))return!1;if($a&&!En[ce]){let Xe=H(P)||P.parentNode,Tt=U(P)||P.childNodes;if(Tt&&Xe){let at=Tt.length;for(let Ut=at-1;Ut>=0;--Ut){let mo=x(Tt[Ut],!0);mo.__removalCount=(P.__removalCount||0)+1,Xe.insertBefore(mo,O(P))}}}return Re(P),!0}return P instanceof c&&!ft(P)||(ce==="noscript"||ce==="noembed"||ce==="noframes")&&Lt(/<\/no(script|embed|frames)/i,P.innerHTML)?(Re(P),!0):(qe&&P.nodeType===xl.text&&(Z=P.textContent,pp([Ie,ve,he],Xe=>{Z=Sl(Z,Xe," ")}),P.textContent!==Z&&(Tl(t.removed,{element:P.cloneNode()}),P.textContent=Z)),Qe(ie.afterSanitizeElements,P,null),!1)},Xo=function(P,Z,ce){if(Al&&(Z==="id"||Z==="name")&&(ce in e||ce in Pe))return!1;if(!(Ho&&!Vt[Z]&&Lt(X,Z))){if(!(fo&&Lt($,Z))){if(!Me[Z]||Vt[Z]){if(!(Ll(P)&&(Ce.tagNameCheck instanceof RegExp&&Lt(Ce.tagNameCheck,P)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(P))&&(Ce.attributeNameCheck instanceof RegExp&&Lt(Ce.attributeNameCheck,Z)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(Z))||Z==="is"&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&Lt(Ce.tagNameCheck,ce)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(ce))))return!1}else if(!Ya[Z]){if(!Lt(ue,Sl(ce,ee,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&P!=="script"&&XI(ce,"data:")===0&&yp[P])){if(!(Tn&&!Lt(me,Sl(ce,ee,"")))){if(ce)return!1}}}}}}return!0},Ll=function(P){return P!=="annotation-xml"&&i1(P,oe)},Bl=function(P){Qe(ie.beforeSanitizeAttributes,P,null);let{attributes:Z}=P;if(!Z||Pt(P))return;let ce={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me,forceKeepAttr:void 0},Xe=Z.length;for(;Xe--;){let Tt=Z[Xe],{name:at,namespaceURI:Ut,value:mo}=Tt,Za=le(at),Ip=mo,St=at==="value"?Ip:$I(Ip);if(ce.attrName=Za,ce.attrValue=St,ce.keepAttr=!0,ce.forceKeepAttr=void 0,Qe(ie.uponSanitizeAttribute,P,ce),St=ce.attrValue,Fl&&(Za==="id"||Za==="name")&&(nt(at,P),St=kl+St),Wo&&Lt(/((--!?|])>)|<\/(style|title)/i,St)){nt(at,P);continue}if(ce.forceKeepAttr)continue;if(!ce.keepAttr){nt(at,P);continue}if(!hi&&Lt(/\/>/i,St)){nt(at,P);continue}qe&&pp([Ie,ve,he],nf=>{St=Sl(St,nf," ")});let of=le(P.nodeName);if(!Xo(of,Za,St)){nt(at,P);continue}if(V&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!Ut)switch(b.getAttributeType(of,Za)){case"TrustedHTML":{St=V.createHTML(St);break}case"TrustedScriptURL":{St=V.createScriptURL(St);break}}if(St!==Ip)try{Ut?P.setAttributeNS(Ut,at,St):P.setAttribute(at,St),Pt(P)?Re(P):n1(t.removed)}catch(nf){nt(at,P)}}Qe(ie.afterSanitizeAttributes,P,null)},vp=function fe(P){let Z=null,ce=jt(P);for(Qe(ie.beforeSanitizeShadowDOM,P,null);Z=ce.nextNode();)Qe(ie.uponSanitizeShadowNode,Z,null),lr(Z),Bl(Z),Z.content instanceof a&&fe(Z.content);Qe(ie.afterSanitizeShadowDOM,P,null)};return t.sanitize=function(fe){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,ce=null,Xe=null,Tt=null;if(T=!fe,T&&(fe="<!-->"),typeof fe!="string"&&!Gt(fe))if(typeof fe.toString=="function"){if(fe=fe.toString(),typeof fe!="string")throw Ml("dirty is not a string, aborting")}else throw Ml("toString is not a function");if(!t.isSupported)return fe;if(zo||Ne(P),t.removed=[],typeof fe=="string"&&(Mn=!1),Mn){if(fe.nodeName){let mo=le(fe.nodeName);if(!ye[mo]||vt[mo])throw Ml("root node is forbidden and cannot be sanitized in-place")}}else if(fe instanceof l)Z=it("<!---->"),ce=Z.ownerDocument.importNode(fe,!0),ce.nodeType===xl.element&&ce.nodeName==="BODY"||ce.nodeName==="HTML"?Z=ce:Z.appendChild(ce);else{if(!ho&&!qe&&!dt&&fe.indexOf("<")===-1)return V&&Sn?V.createHTML(fe):fe;if(Z=it(fe),!Z)return ho?null:Sn?N:""}Z&&Xa&&Re(Z.firstChild);let at=jt(Mn?fe:Z);for(;Xe=at.nextNode();)lr(Xe),Bl(Xe),Xe.content instanceof a&&vp(Xe.content);if(Mn)return fe;if(ho){if(go)for(Tt=J.call(Z.ownerDocument);Z.firstChild;)Tt.appendChild(Z.firstChild);else Tt=Z;return(Me.shadowroot||Me.shadowrootmode)&&(Tt=W.call(r,Tt,!0)),Tt}let Ut=dt?Z.outerHTML:Z.innerHTML;return dt&&ye["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&Lt(g1,Z.ownerDocument.doctype.name)&&(Ut="<!DOCTYPE "+Z.ownerDocument.doctype.name+">\n"+Ut),qe&&pp([Ie,ve,he],mo=>{Ut=Sl(Ut,mo," ")}),V&&Sn?V.createHTML(Ut):Ut},t.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ne(fe),zo=!0},t.clearConfig=function(){de=null,zo=!1},t.isValidAttribute=function(fe,P,Z){de||Ne({});let ce=le(fe),Xe=le(P);return Xo(ce,Xe,Z)},t.addHook=function(fe,P){typeof P=="function"&&Tl(ie[fe],P)},t.removeHook=function(fe,P){if(P!==void 0){let Z=WI(ie[fe],P);return Z===-1?void 0:zI(ie[fe],Z,1)[0]}return n1(ie[fe])},t.removeHooks=function(fe){ie[fe]=[]},t.removeAllHooks=function(){ie=d1()},t}var y1=m1();var lT={"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-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>',"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>',"door-12x12":'<svg viewBox="0 0 13 12">\n <path\n stroke="none"\n d="M4.02533 0.662341H9.61421C9.95171 0.662341 10.2264 0.937033 10.2264 1.27453V10.726C10.2264 11.0639 9.95218 11.3382 9.61421 11.3382H4.02533C3.69721 11.3382 3.42674 11.078 3.41408 10.7504V1.24696C3.4272 0.919297 3.69721 0.659149 4.02533 0.659149V0.662341ZM5.96969 5.22798H6.64563V6.7725H5.96969V5.22798ZM4.94219 1.39218L7.31267 2.6541C7.43501 2.71973 7.50533 2.84488 7.50533 2.97473C7.50721 4.99181 7.50674 7.00877 7.50674 9.02585C7.50674 9.17679 7.41487 9.30663 7.28361 9.36195L4.94217 10.6084H9.49653V1.39227L4.94219 1.39218Z"\n />\n </svg>',"building-12x12":'<svg viewBox="0 0 12 12" stroke="none">\n <path\n d="M11.2374 9.75H10.5V4.5C10.5 4.30109 10.421 4.11032 10.2804 3.96967C10.1397 3.82902 9.94894 3.75 9.75003 3.75H7.68753C7.6378 3.75 7.59011 3.76976 7.55495 3.80492C7.51978 3.84008 7.50003 3.88777 7.50003 3.9375V9.75H6.75003V1.51922C6.75127 1.4024 6.72592 1.28683 6.67589 1.18125C6.62587 1.07567 6.55248 0.982864 6.46128 0.909845C6.33697 0.812924 6.18528 0.757635 6.02776 0.751829C5.87024 0.746023 5.71489 0.789995 5.58378 0.877501L1.83378 3.375C1.73091 3.44364 1.6466 3.53664 1.58837 3.64574C1.53014 3.75484 1.4998 3.87665 1.50003 4.00031V9.75H0.762687C0.66578 9.74857 0.571927 9.78389 0.500006 9.84885C0.428085 9.91382 0.383432 10.0036 0.37503 10.1002C0.371625 10.1515 0.378802 10.2029 0.396116 10.2513C0.413431 10.2997 0.440513 10.344 0.47568 10.3815C0.510847 10.419 0.553349 10.4489 0.600545 10.4693C0.647741 10.4897 0.698623 10.5001 0.75003 10.5H11.25C11.3014 10.5001 11.3523 10.4897 11.3995 10.4693C11.4467 10.4489 11.4892 10.419 11.5244 10.3815C11.5595 10.344 11.5866 10.2997 11.6039 10.2513C11.6213 10.2029 11.6284 10.1515 11.625 10.1002C11.6166 10.0036 11.572 9.91382 11.5001 9.84885C11.4281 9.78389 11.3343 9.74857 11.2374 9.75ZM3.56253 8.625C3.56264 8.67641 3.55219 8.72729 3.53181 8.77449C3.51143 8.82168 3.48156 8.86418 3.44406 8.89935C3.40657 8.93452 3.36224 8.9616 3.31383 8.97892C3.26543 8.99623 3.21398 9.00341 3.16269 9C3.06605 8.99159 2.9762 8.94688 2.91122 8.87485C2.84624 8.80283 2.81098 8.70886 2.81253 8.61188V7.88766C2.81121 7.79078 2.84657 7.69699 2.91151 7.62509C2.97645 7.55319 3.06618 7.50851 3.16269 7.5C3.21398 7.4966 3.26543 7.50377 3.31383 7.52109C3.36224 7.5384 3.40657 7.56548 3.44406 7.60065C3.48156 7.63582 3.51143 7.67832 3.53181 7.72552C3.55219 7.77271 3.56264 7.82359 3.56253 7.875V8.625ZM3.56253 6C3.56264 6.05141 3.55219 6.10229 3.53181 6.14949C3.51143 6.19668 3.48156 6.23918 3.44406 6.27435C3.40657 6.30952 3.36224 6.3366 3.31383 6.35392C3.26543 6.37123 3.21398 6.37841 3.16269 6.375C3.06609 6.36649 2.9763 6.32174 2.91135 6.24974C2.84639 6.17774 2.81109 6.08383 2.81253 5.98688V5.26266C2.81121 5.16578 2.84657 5.07199 2.91151 5.00009C2.97645 4.92819 3.06618 4.88351 3.16269 4.875C3.21398 4.8716 3.26543 4.87877 3.31383 4.89609C3.36224 4.9134 3.40657 4.94048 3.44406 4.97565C3.48156 5.01082 3.51143 5.05332 3.53181 5.10052C3.55219 5.14771 3.56264 5.19859 3.56253 5.25V6ZM5.43753 8.625C5.43764 8.67641 5.42719 8.72729 5.40681 8.77449C5.38643 8.82168 5.35656 8.86418 5.31906 8.89935C5.28157 8.93452 5.23724 8.9616 5.18883 8.97892C5.14043 8.99623 5.08898 9.00341 5.03769 9C4.94122 8.9916 4.8515 8.94702 4.78654 8.8752C4.72159 8.80338 4.68622 8.70964 4.68753 8.61281V7.88766C4.68633 7.79086 4.72174 7.69718 4.78667 7.62539C4.8516 7.55359 4.94126 7.50897 5.03769 7.50047C5.08898 7.49706 5.14043 7.50424 5.18883 7.52156C5.23724 7.53887 5.28157 7.56595 5.31906 7.60112C5.35656 7.63629 5.38643 7.67879 5.40681 7.72598C5.42719 7.77318 5.43764 7.82406 5.43753 7.87547V8.625ZM5.43753 6C5.43764 6.05141 5.42719 6.10229 5.40681 6.14949C5.38643 6.19668 5.35656 6.23918 5.31906 6.27435C5.28157 6.30952 5.23724 6.3366 5.18883 6.35392C5.14043 6.37123 5.08898 6.37841 5.03769 6.375C4.94126 6.3665 4.8516 6.32188 4.78667 6.25008C4.72174 6.17829 4.68633 6.08461 4.68753 5.98781V5.26266C4.68633 5.16586 4.72174 5.07218 4.78667 5.00039C4.8516 4.92859 4.94126 4.88397 5.03769 4.87547C5.08898 4.87206 5.14043 4.87924 5.18883 4.89656C5.23724 4.91387 5.28157 4.94095 5.31906 4.97612C5.35656 5.01129 5.38643 5.05379 5.40681 5.10098C5.42719 5.14818 5.43764 5.19906 5.43753 5.25047V6Z"\n stroke="none"\n />\n </svg>',"ladder-12x12":'<svg viewBox="0 0 12 12">\n <g id="surface1">\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.34375 0.375 L 2.53125 0.375 L 2.625 11.53125 L 2.34375 11.625 L 2.25 0.46875 Z M 2.34375 0.375 "/>\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 9.46875 0.375 L 9.65625 0.375 L 9.75 11.53125 L 9.46875 11.625 L 9.375 0.46875 Z M 9.46875 0.375 "/>\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 2.25 L 2.25 1.875 L 9.75 1.875 L 9.75 2.25 Z M 2.25 2.25 "/>\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 4.875 L 2.25 4.5 L 9.75 4.5 L 9.75 4.875 Z M 2.25 4.875 "/>\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 7.5 L 2.25 7.125 L 9.75 7.125 L 9.75 7.5 Z M 2.25 7.5 "/>\n <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 10.125 L 2.25 9.75 L 9.75 9.75 L 9.75 10.125 Z M 2.25 10.125 "/>\n </g>\n </svg>'},cT=/<svg([^>]*)>/g;function b1(o,t,e){let r=lT[o];return r?r.replace(cT,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):null}function pT(o){return y1.sanitize(o,{USE_PROFILES:{svg:!0}})}function dT(o,t){let n=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(A.error("Failed to parse SVG",{svg:o,tagName:n==null?void 0:n.tagName}),o):(t!=null&&(n.setAttribute("color",t),n.querySelectorAll("*").forEach(l=>{(l.getAttribute("fill")!=null||l.tagName==="path")&&l.getAttribute("fill")!=="none"&&l.setAttribute("fill","currentColor"),l.getAttribute("stroke")!=null&&l.getAttribute("stroke")!=="none"&&l.setAttribute("stroke","currentColor")})),new XMLSerializer().serializeToString(n))}async function v1(o,t){let e="";try{if(o.trim()==="")throw new Error("URL is empty!");(t==null?void 0:t.style)==="fill"&&(o=o.replace(".svg","-fill.svg"));let r=await Qt()(o),n=r.headers.get("content-type");if(n!=null&&n.includes("image/svg+xml")){let a=await r.text();return e=pT(a),(t==null?void 0:t.color)!=null&&(e=dT(e,t.color)),{icon:e,type:"svg"}}else{if(n!=null&&n.includes("image"))return{icon:o,type:"image"};throw new Error("Expected SVG or Image content, but received: ".concat(n))}}catch(r){return A.error("Failed to fetch icon from ".concat(o,"."),r),null}}m();function I1(o){return o.locationProfiles.some(t=>t.categories.some(e=>e.name.includes("Restroom")))}function T1(o){return o.locationProfiles.some(t=>t.categories.some(e=>e.name.includes("Parking")))}var M1=new Set(["connection","point-of-interest","space","object","door","facade"]),fi={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},ja={elevator:"connection-elevator-12x12",escalator:"connection-stairs-12x12",stairs:"connection-stairs-12x12",point:"point-of-interest-12x12",door:"door-12x12",building:"building-12x12",ladder:"ladder-12x12"};function uT(o){let t=null;if(It.is(o))switch(o.type){case"elevator":t=ja.elevator;break;case"ladder":t=ja.ladder;break;case"escalator":case"stairs":default:t=ja.stairs}else rr.is(o)?t=ja.point:wt.is(o)?t=ja.door:gt.is(o)&&(t=ja.building);return t!=null?b1(t,"#FFFFFF",12):null}function S1(o){return It.is(o)?fi.connection:gt.is(o)?fi.default:I1(o)?fi.washroom:T1(o)?fi.parking:rr.is(o)?fi.point:wt.is(o)?fi.door:fi.default}async function fT(o,t){var n;let e=null,r="locationProfiles"in o?(n=o.locationProfiles.find(a=>a.icon!=null))==null?void 0:n.icon:null;if((r==null?void 0:r.url)!=null&&(e=await v1(r.url,{color:t.color,style:"fill"})),e==null){let a=uT(o);a!=null&&(e={icon:a,type:"svg"})}return e}function hT(o){return It.is(o)||wt.is(o)?"low":rr.is(o)||gt.is(o)?"high":"medium"}async function gT(o){let t={appearance:{color:S1(o),pinOutlineColor:S1(o),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:hT(o),interactive:!0},e=await fT(o,{color:"#FFFFFF"});return e!=null&&(t.appearance.icon=e.icon,e.type==="svg"?gt.is(o)&&(t.appearance.iconSize=30,t.appearance.iconPadding=10):e.type==="image"&&(t.appearance.iconSize=48,t.appearance.iconPadding=2,t.appearance.pinOutlineColor="#FFFFFF",t.rank="high")),t}async function E1(o,t){return(await Promise.all(t.map(async r=>{let n=[];if(!Mo(r))return n;let a=await gT(r);return It.is(r)?n=r.coordinates.map(s=>o.Labels.add(s,r.name,a)):gt.is(r)?r.spaces.length>0&&r.floorStack.name!=null&&r.floorStack.name!==""&&n.push(o.Labels.add(r.spaces[0],r.floorStack.name,a)):r1(r)&&nd(r)&&n.push(o.Labels.add(r,r.name,a)),n}))).flat()}async function x1(o,t){let e=o.getMapDataInternal();if(!e)throw new Error("Map data not found");let r=e.getAllOfTypes(M1,t),n=e.getAllOfTypes(Qy,t),a=e.getAllOfTypes(e1,t),[s,l]=await Promise.all([r.length>0?E1(o,r):[],n.length>0?Ky(o,n):[],a.length>0?t1(o,a):[]]);return{labels:s,markers:l}}var fp=.05,_l,Pl,Cl=class extends cr{constructor(e,r,n){super();f(this,"core");f(this,"mapObjects",[]);f(this,"id");f(this,"mapDataExternal",{});f(this,"mapsByFloorId",{});f(this,"mapData");f(this,"currentMap");f(this,"hiddenOutdoorGeometries",[]);f(this,"lastFacadeIntersected");M(this,_l,!1);M(this,Pl,!1);f(this,"mapView");f(this,"externalPubSub");f(this,"Camera");f(this,"Labels");f(this,"Text3D");f(this,"Markers");f(this,"Models");f(this,"Paths");f(this,"Exporter");f(this,"Navigation");f(this,"Outdoor");f(this,"Shapes");f(this,"Style");f(this,"Image3D");f(this,"update",()=>{this.core.render()});this.core=e,this.mapView=r,this.externalPubSub=n,this.Camera=new Xs(this),this.id=this.core.addGroupContainer("root").id.toString();let a=new Ks("outdoors-container",void 0,void 0,this);this.mapObjects.push(a),this.currentMap=a,this.core.on("pre-render",()=>{n.publish("pre-render")},{signal:this.signal}),this.core.on("post-render",()=>{n.publish("post-render")},{signal:this.signal}),this.core.on("resize",()=>{n.publish("resize")},{signal:this.signal}),this.core.on("render-error",({error:d})=>{n.publish("render-error",{error:new ff(d instanceof Error?d.message:"Unknown error")})},{signal:this.signal});let s=d=>{let h=d;d.startsWith("".concat($e,"-"))&&(h=d.slice($e.length+1));let y=this.getMapDataObject(h);switch(y==null?void 0:y.__type){case"facade":return y;case"floor":return y.floorStack.facade;default:return null}};this.core.on("geometry-in-focus",d=>{let h=new Set;for(let y of d){let b=s(y);b&&h.add(b)}n.publish("facades-in-view-change",{facades:Array.from(h)})},{signal:this.signal}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{n.publish("state-change-internal",{Camera:this.getCameraState()})},{signal:this.signal});let l=new Gs(this.Camera,{precision:7});this.core.on("camera-change",()=>{n.publish("camera-change",l)},{signal:this.signal}),this.core.on("pan-bounds-change",d=>{n.publish("camera-bounds-change",lc(d,this.core.convert3DMapPositionToCoordinate))},{signal:this.signal}),this.core.camera.on("padding-change",({padding:d})=>{n.publish("camera-screen-offsets-change",d)},{signal:this.signal});let c=d=>h=>{let y=[],b=[],I=[],x=[];h.labels.forEach(B=>{let J=this.Labels.getById(B.toString());J&&y.push(J.label)}),h.markers.forEach(B=>{let J=this.Markers.getById(B.toString())||this.Navigation.getMarkerById(B.toString());J&&b.push(J.marker)}),h.models.forEach(B=>{let J=this.Models.getById(B.toString());J&&I.push(J.model)}),h.paths.forEach(B=>{let J=this.Paths.getById(B.toString())||this.Navigation.getPathById(B.toString());J&&!x.includes(J)&&x.push(J)});let _=h.geometry,O;_.length>0&&(O=_.map(B=>{var J;return(J=this.getMapDataInternal())==null?void 0:J.getById("space",B)}).filter(Boolean)[0],O||(O=_.map(B=>{var J;return(J=this.getMapDataInternal())==null?void 0:J.getById("object",B)}).filter(Boolean)[0]),O||(O=_.map(B=>{var J;return(J=this.getMapDataInternal())==null?void 0:J.getById("area",B)}).filter(Boolean)[0]),O||(O=_.map(B=>this.Shapes.getById(B)).filter(Boolean)[0]));let U=h.containers.reduce((B,J)=>{var W;let se=(W=this.getMapDataInternal())==null?void 0:W.getById("floor",J);return se&&zt.is(se)&&B.push(se),B},[]),H,V=0;if(U.length>0){H=U[0].id;let B=this.core.getState(H);V=h.coordinate[2]?h.coordinate[2]-B.altitude:V}let N;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!1})}),O&&Ze.is(O)&&(N=_.map(B=>{var J;return(J=this.getMapDataInternal())==null?void 0:J.facadesBySpaceId[B]}).filter(Boolean)[0],N&&N.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!0})})),this.lastFacadeIntersected=N;let q={coordinate:new re({latitude:h.coordinate[1],longitude:h.coordinate[0],floorId:H,verticalOffset:V}),spaces:O&&Ze.is(O)?[O]:[],objects:O&&Xt.is(O)?[O]:[],areas:O&&fr.is(O)?[O]:[],shapes:O&&Do.is(O)?[O]:[],markers:b,labels:y,models:I,paths:x,floors:U,facades:N?[N]:[]};"pointerEvent"in h&&(q.pointerEvent=h.pointerEvent),n.publish(d,q)};this.core.on("hover",c("hover"),{signal:this.signal}),this.core.on("click",c("click"),{signal:this.signal}),this.core.on("user-interaction-start",()=>{n.publish("user-interaction-start")},{signal:this.signal}),this.core.on("user-interaction-end",()=>{n.publish("user-interaction-end")},{signal:this.signal});let p={currentMapGetter:()=>this.currentMap,mapDataInternalGetter:()=>{var d;return(d=this.mapData)==null?void 0:d.internal}};this.Markers=new el(p),this.Models=new nl(p),this.Labels=new Ys(p),this.Text3D=new gl(p),this.Exporter=new $s(p),this.Paths=new sl(p),this.Navigation=new zs(this),this.on("navigation-state-change",d=>{this.externalPubSub.publish("state-change-internal",{Navigation:d})}),this.on("navigation-connection-click",d=>{this.externalPubSub.publish("navigation-connection-click",d)}),this.on("navigation-active-path-change",d=>{this.externalPubSub.publish("navigation-active-path-change",d)}),this.Outdoor=new Ba(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{n.publish("outdoor-view-loaded")},{signal:this.signal}),this.core.on("outdoor-style-loaded",()=>{n.publish("outdoor-style-loaded")},{signal:this.signal})),this.Image3D=new rl(p),this.Shapes=new cl(p),this.Style=new dl(p)}get manualFloorVisibility(){return i(this,_l)}set manualFloorVisibility(e){E(this,_l,e),this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:e})}get hidePathsNotOnCurrentFloor(){return i(this,Pl)}set hidePathsNotOnCurrentFloor(e){var r;E(this,Pl,e),(r=this.currentMap)==null||r.updateOutdoorPathLayerVisibility()}preloadFloors(e){e.forEach(r=>{r instanceof zt&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(e,r){var s,l,p,d,h,y,b,I,x,_,O,U,H,V;if(r==null||typeof r!="object")return;let n=(l=(s=this.currentMap.options)==null?void 0:s.disableUpdateStateValidation)!=null?l:!1;if(e==="interior-walls"){this.currentMap.floors.forEach(N=>{let q=N.layers.get($e);if(q){let B=q.layers.get(Qo);B&&this.core.hasState(B)&&this.core.setState(B,bu(ke(yu,r,{warn:!0,disableValidation:n}),this.core.getState(B)))}});return}if(e==="exterior-walls"){this.currentMap.floors.forEach(N=>{let q=N.layers.get($e);if(q){let B=q.layers.get(Qr);B&&this.core.hasState(B)&&this.core.setState(B,bu(ke(yu,r,{warn:!0,disableValidation:n}),this.core.getState(B)))}});return}if(e==="interior-doors"){this.currentMap.floors.forEach(N=>{let q=N.layers.get($e);if(q){let B=q.layers.get(Li);B&&this.core.hasState(B)&&this.core.setState(B,kc(ke(Fc,r,{warn:!0,disableValidation:n}),this.core.getState(B)))}});return}if(e==="exterior-doors"){this.currentMap.floors.forEach(N=>{let q=N.layers.get($e);if(q){let B=q.layers.get(Bi);B&&this.core.hasState(B)&&this.core.setState(B,kc(ke(Fc,r,{warn:!0,disableValidation:n}),this.core.getState(B)))}});return}let a=typeof e=="string"?this.getMapDataObject(e):e;if(a){if(a.__type!==Nr.__type&&!this.core.hasState(a.id)){A.warn('Failed to update state for "'.concat(a.id,'". No ').concat(a.__type," found with that ID."));return}if(Oo.is(a))return this.core.setState(a.id,Um(ke(jm,r,{warn:!0,disableValidation:n}),this.core.getState(a.id)));if(no.is(a))return this.core.setState(a.id,zm(ke(Hm,r,{warn:!0,disableValidation:n}),this.core.getState(a.id)));if(Ze.is(a)||Xt.is(a)){let N=this.core.getState(a.id);N!=null&&this.core.setState(a.id,Vm(ke(du,r,{warn:!0,disableValidation:n}),N))}if(fr.is(a)&&this.core.setState(a.id,ke(du,r,{warn:!0,disableValidation:n})),tr.is(a)&&this.core.setState(a.id,ke(ry,r,{warn:!0,disableValidation:n})),wt.is(a)&&this.core.setState(a.id,kc(ke(Fc,r,{warn:!0,disableValidation:n}),this.core.getState(a.id))),Do.is(a)&&this.core.setState(a.id,Ym(ke(gu,r,{warn:!0,disableValidation:n}))),oi.is(a)){let c=ke(iy,r,{warn:!0,disableValidation:n}),{position:N,scale:q,rotation:B}=c,se=qt(c,["position","scale","rotation"]);N&&(se.position=[N.longitude,N.latitude,N.verticalOffset]),q!=null&&(Array.isArray(q)?se.scale=q:se.scale=[q,q,q]),B!=null&&(Array.isArray(B)?se.rotation=B:se.rotation=[B,B,B]),N&&a.updateTarget(N),this.core.setState(a.id,se)}if(zt.is(a)){let N=this.currentMap.floorsById.get(a.id);if(N==null)return;let q=ke(Lm,r,{warn:!0,disableValidation:n});this.core.setState(a.id,q);let B=N.layers.get($e);if(B!=null&&"geometry"in r&&r.geometry){this.core.setState(B.containerId,ke(Cm,r.geometry,{warn:!0,disableValidation:n}));for(let X of B.layers.keys())this.core.setState(B.layers.get(X),{maskId:(p=r.geometry.maskId)!=null?p:void 0,maskEffect:(d=r.geometry.maskEffect)!=null?d:void 0,maskMode:(h=r.geometry.maskMode)!=null?h:void 0,maskEnabled:(y=r.geometry.maskEnabled)!=null?y:void 0,effectStart:(b=r.geometry.effectStart)!=null?b:void 0,effectDistance:(I=r.geometry.effectDistance)!=null?I:void 0,darkenAmount:(x=r.geometry.darkenAmount)!=null?x:void 0,darkenUseDepth:(_=r.geometry.darkenUseDepth)!=null?_:void 0,desaturateAmount:(O=r.geometry.desaturateAmount)!=null?O:void 0,desaturateUseDepth:(U=r.geometry.desaturateUseDepth)!=null?U:void 0,washOutAmount:(H=r.geometry.washOutAmount)!=null?H:void 0,washOutUseDepth:(V=r.geometry.washOutUseDepth)!=null?V:void 0})}let J=N.layers.get(Kr);if(J!=null&&"labels"in r&&r.labels){let X=ke(_m,r.labels,{warn:!0,disableValidation:n});"enabled"in X&&typeof X.enabled=="boolean"&&J.setVisible(X.enabled)}let se=N.layers.get(Or);if(se!=null&&"markers"in r&&r.markers){let X=ke(Pm,r.markers,{warn:!0,disableValidation:n});"enabled"in X&&typeof X.enabled=="boolean"&&se.setVisible(X.enabled)}if(N.footprintObject&&"footprint"in r&&r.footprint){let X=ke(pi,r.footprint,{warn:!0,disableValidation:n});N.footprintObject.update({altitude:X.altitude,visible:X.visible,height:X.height,opacity:X.opacity,side:X.side,color:X.color,ceilingVisible:X.ceilingVisible,ceilingThickness:X.ceilingThickness,basementMaskEnabled:X.basementMaskEnabled,outline:X.outline})}if(N.gapFootprintObject&&"visible"in r){let X={visible:r.visible};if("footprint"in r&&r.footprint){let $=ke(pi,r.footprint,{warn:!0,disableValidation:n});$.color!==void 0&&(X.color=$.color),$.opacity!==void 0&&(X.opacity=$.opacity),$.outline!==void 0&&(X.outline=$.outline)}N.gapFootprintObject.update(X)}let W=N.layers.get(Fn);if(W!=null&&"occlusion"in r&&r.occlusion){let X=ke(Om,r.occlusion,{warn:!0,disableValidation:n});"enabled"in X&&typeof X.enabled=="boolean"&&W.setVisible(X.enabled)}let ie=N.layers.get(Ni);if(ie!=null&&"images"in r&&r.images){let X=ke(wm,r.images,{warn:!0,disableValidation:n});if("visible"in X&&typeof X.visible=="boolean"&&ie.setVisible(X.visible),"collisionsEnabled"in X&&typeof X.collisionsEnabled=="boolean"&&B!=null)for(let $ of B.layers.values()){let me=this.core.getState($);if(me!=null&&me.children)for(let ee of me.children)this.core.setState(ee,{enableImageCollisions:X.collisionsEnabled})}}let Ie=N.layers.get(eo);if(Ie!=null&&"paths"in r&&r.paths!=null){let X=ke(Dm,r.paths,{warn:!0,disableValidation:n});X.visible!=null&&typeof X.visible=="boolean"&&Ie.setVisible(X.visible)}let ve=N.layers.get(kn);if(ve!=null&&"areas"in r&&r.areas!=null){let X=ke(Am,r.areas,{warn:!0,disableValidation:n});X.visible!=null&&typeof X.visible=="boolean"&&ve.setVisible(X.visible)}let he=N.layers.get(Dr);if(he!=null&&"models"in r&&r.models!=null){let X=ke(km,r.models,{warn:!0,disableValidation:n});X.visible!=null&&typeof X.visible=="boolean"&&he.setVisible(X.visible)}if("text3d"in r&&r.text3d!=null){let X=ke(Fm,r.text3d,{warn:!0,disableValidation:n});X.visible!=null&&N.setBatchedTextVisible(X.visible)}}if(gt.is(a)){let N=this.core.getState(a.id);for(let q of N.children)q.type==="group-container"&&this.core.setState(q.id,ke(gm,r,{warn:!0,disableValidation:n}))}if(Ao.is(a)&&this.core.setState(a.id,ke(Qm,r,{warn:!0,disableValidation:n})),Nr.is(a)){let N=ke(iu,r,{warn:!0,disableValidation:n}),q=ka(N);for(let B of a.segments)this.core.setState(B.id,q)}if(un.is(a)){let N=ke(iu,r,{warn:!0,disableValidation:n}),q=ka(N);this.core.setState(a.id,q)}}}getMapDataObject(e){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return ns(this.mapData)}getMapData(){return this.mapData}addMap(e,r){return new Promise(n=>{var h,y,b,I;let a;try{a=ns(e)}catch(x){A.error("Error adding map",x),n(e);return}this.mapDataExternal[e.mapName]=e,this.mapData=e;let{mvf:s}=a,l=s["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new re(l[1],l[0])});let c=s["manifest.geojson"].features[0].properties.name,p=new Ks("mapObject-".concat(c),a,r,this);this.currentMap=p,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId),this.core.renderSync();let d=(y=(h=r==null?void 0:r.outdoorView)==null?void 0:h.layersHiddenByGeometry)!=null?y:[];if(d.length>0){let x=[];for(let _ of p.floorStacksById.values())_.isOutdoors===!1&&_.defaultFloor.footprint&&_.defaultFloor.footprint.geometry!=null&&((b=_.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0&&x.push(_.defaultFloor.footprint);x.length>0&&(this.core.hideOutdoorLayersIntersectingPolygons(x,d),this.hiddenOutdoorGeometries.push([x,d]))}if(this.mapObjects.push(p),a.getMVFFeatureByType("floor").forEach(x=>{this.mapsByFloorId[x.id]=p}),p.on("floor-change-start",x=>{var _,O,U,H;this.externalPubSub.publish("floor-change-start",{reason:x.reason,floor:(O=(_=this.getMapDataInternal())==null?void 0:_.getById("floor",x.floorId))!=null?O:this.currentFloor,previousFloor:(H=(U=this.getMapDataInternal())==null?void 0:U.getById("floor",x.previousFloorId))!=null?H:this.currentFloor})},{signal:this.signal}),p.on("floor-change",x=>{var _,O;this.externalPubSub.publish("floor-change",{reason:x.reason,floor:this.currentFloor,previousFloor:(O=(_=this.getMapDataInternal())==null?void 0:_.getById("floor",x.previousFloorId))!=null?O:this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})},{signal:this.signal}),(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(e);else if(this.core.mode!=="outdoors-overlay"&&this.currentFloor){let x=(I=r==null?void 0:r.screenOffsets)!=null?I:{top:fp*this.core.canvasHeight,left:fp*this.core.canvasWidth,right:fp*this.core.canvasWidth,bottom:fp*this.core.canvasHeight};this.Camera.focusOn(this.currentFloor,{duration:Eh,screenOffsets:x}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),n(e)})}else n(e)})}setFloor(e,r){return this.currentMap.setFloor(ps(e),r)}setFloorStack(e,r){return this.currentMap.setFloorStack(ps(e),r)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){var n;let e=this.currentMap.currentFloorStack.id;if(!e)throw new tt("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",e);if(!r)throw new tt("FloorStack was not found in map data.");return r}get currentFloor(){var n;let e=this.currentMap.currentFloor.id;if(!e)throw new tt("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",e);if(!r)throw new tt("Missing currentFloor");return r}getState(e){var a,s;typeof e=="object"&&Nr.is(e)&&A.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=Fd(e,this),n=this.core.getState(r);if(n){if(["interior-walls","exterior-walls"].includes(e)&&n.type==="batched-geometry-group")return ty(n);if(["interior-doors","exterior-doors"].includes(e)&&n.type==="batched-geometry-group")return fm(n);if(n.type==="geometry")return Rm(n);if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return Gm(n);if(n.type==="marker"&&((a=n.options)==null?void 0:a.rank)!==void 0&&n.options.interactive!==void 0)return Wm(n,(s=this.Markers.getById(n.id.toString()))==null?void 0:s.marker);if(n.type==="model")return ay(n);if(n.type==="image")return oy(n);if(n.type==="text3d")return Km(n);if(n.type==="batched-geometry-group"&&e&&typeof e!="string"&&Do.is(e))return $m(n);if(n.type==="path")return lm(n);if(n.type==="group-container"&&typeof e!="string"&&zt.is(e))return Bm(n,this.currentMap.floorsById.get(e.id),this.core);if(n.type==="group-container"&&n.children.length>0&&typeof e!="string"&&gt.is(e)){let l=this.core.getState(n.children[0].id);return mm(l)}}}__EXPERIMENTAL__getRenderedState(e){let r=Fd(e,this);if(r)return this.core.getRenderedState(r)}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}getFloorStackAltitudeData(e){return this.currentMap.getFloorStackAltitudeData(e)}createCoordinateFromScreenCoordinate(e,r,n){var p;if(n!=null){let d=this.core.projectScreenXYToCoordinate(e,r,!0);return d?new re(d.coordinate[1],d.coordinate[0],n.id):void 0}let a=this.core.projectScreenXYToCoordinate(e,r);if(a==null||a.coordinate==null)return;let{coordinate:s,groupContainers:l}=a,c=(p=l==null?void 0:l.find(d=>{let h=d.userData.entityId.toString();return h.includes("f_")||h.includes("m_")}))==null?void 0:p.userData.entityId.toString();return new re(s[1],s[0],c)}getScreenCoordinateFromCoordinate(e){var n,a,s;let r=0;if(e.floorId!=null){let l=(n=this.mapData)==null?void 0:n.getById("floor",e.floorId);l!=null&&(r=(s=(a=this.getState(l))==null?void 0:a.altitude)!=null?s:0)}return this.core.projectCoordinateToScreenXY([e.longitude,e.latitude,r])}isInView(e){return this.core.isInView(typeof e=="string"?e:e.id)}getInView(e,r){let n=this.core.queryGeometry2DInView({screenOffsets:r==null?void 0:r.screenOffsets,fullyContains:r==null?void 0:r.fullyContains});if(n.length===0)return[];let a=[];switch(e){case Oo.__type:a=n.map(s=>this.Labels.getById(s)).filter(s=>s!=null).map(s=>s.label);break;case no.__type:a=n.map(s=>this.Markers.getById(s)).filter(s=>s!=null).map(s=>s.marker)}return a}async __EXPERIMENTAL__auto(e){return await x1(this,e)}tween(e){let r=new yo(e);return this.core.getExternalTweenGroup().add(r),this.core.render(),r}removeTween(e){this.core.getExternalTweenGroup().remove(e)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Image3D.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),super.destroy(),this.core.destroy()}getOptimalVisualDistanceBetweenFloors(e,r=!1){let n=this.currentMap;if(!n){A.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){A.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let a=n.renderer.getInternalState().geometry3DMap.get(e[0].id),s=n.renderer.getInternalState().geometry3DMap.get(e[1].id);if(!a||!s){A.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}Op(a,"group-container"),Op(s,"group-container"),r&&typeof n.renderer.debugVisualizeBoundingBoxes=="function"&&n.renderer.debugVisualizeBoundingBoxes(a,s);let l=n.renderer.computeMinZOffsetBetweenContainers(a,s);if(l!==-1)return l}};_l=new WeakMap,Pl=new WeakMap;function mT(o){if(o===""){_p(""),wp("");return}wp("".concat(o,"/").concat(Cf)),_p("".concat(o,"/").concat(xf))}m();var vn,hp=class{constructor(t){f(this,"state");M(this,vn);f(this,"update");E(this,vn,t),this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}getCameraState(){let t=i(this,vn).camera.center,e=i(this,vn).camera.bearing;return{center:new re({longitude:t[0],latitude:t[1]}),zoomLevel:i(this,vn).camera.zoomLevel,bearing:e,pitch:i(this,vn).camera.pitch}}};vn=new WeakMap;m();import bt from"zod";var C1=bt.strictObject({environment:bt.union([bt.literal("basic"),bt.literal(!1)]).optional(),text3d:bt.object({hoverColor:bt.string().optional()}).optional(),geometry:bt.object({hoverColor:bt.string().optional()}).optional(),backgroundColor:bt.string().optional(),backgroundAlpha:bt.number().optional(),multiFloorView:bt.object({spacesOpenToBelowVisualEffectEnabled:bt.boolean().optional(),spacesOpenToBelowVisualEffectDarkenAmount:bt.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDarkenUseDepth:bt.boolean().optional(),spacesOpenToBelowVisualEffectDesaturateAmount:bt.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDesaturateUseDepth:bt.boolean().optional(),spacesOpenToBelowVisualEffectWashOutAmount:bt.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectWashOutUseDepth:bt.boolean().optional()}).optional()});m();var Ju=Nl(W1(),1);m();var wl=null;function _1(){if(wl)return wl;if(typeof OffscreenCanvas<"u")wl=new OffscreenCanvas(1,1).getContext("2d");else if(typeof document<"u"){let o=document.createElement("canvas");o.width=1,o.height=1,wl=o.getContext("2d")}return wl}function Xu(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function $u(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}function Yu(o){let t=_1();if(!t)return[0,0,0];t.fillStyle=o,t.fillRect(0,0,1,1);let[e,r,n]=t.getImageData(0,0,1,1).data;return[Xu(e/255),Xu(r/255),Xu(n/255)]}function P1(o){let t=Math.round(Math.min(1,Math.max(0,$u(o[0])))*255),e=Math.round(Math.min(1,Math.max(0,$u(o[1])))*255),r=Math.round(Math.min(1,Math.max(0,$u(o[2])))*255);return"#"+(1<<24|t<<16|e<<8|r).toString(16).slice(1)}var yT=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,bT=/^rgba?\(\s*\d+/,vT=/^hsla?\(\s*[\d.]+/;function Zu(o){if(o==null||typeof o!="string")return!1;if(yT.test(o)||bT.test(o)||vT.test(o))return!0;let t=_1();return t?(t.fillStyle="#000",t.fillStyle=o,t.fillStyle!=="#000000"||o.toLowerCase()==="black"||o==="#000"||o==="#000000"):!1}var IT=(o,t)=>{let e={},r=(n,a,s)=>{for(let l in a){let c=n[l],p=a[l];typeof p=="object"&&!Array.isArray(p)&&p!==null&&typeof c=="object"&&!Array.isArray(c)&&c!==null?(s[l]={},r(c,p,s[l])):s[l]=c}};return r(o,t,e),e},w1=(o,t)=>{let e=IT(o,t),r=(0,Ju.default)({},e,t),n=(0,Ju.default)({},e),a=(s,l,c,p=n)=>{for(let d in l){let h=s[d],y=l[d];if(typeof y=="number"&&typeof h=="number")p[d]=h+(y-h)*c;else if(typeof y=="string"&&typeof h=="string"){if(Zu(h)&&Zu(y)){let b=Yu(h),I=Yu(y);b&&I?p[d]=P1([b[0]+(I[0]-b[0])*c,b[1]+(I[1]-b[1])*c,b[2]+(I[2]-b[2])*c]):A.warn('Color "'.concat(d,'" could not be animated!'))}}else typeof y=="object"&&y!==null&&typeof h=="object"&&h!==null?a(h,y,c,p[d]):A.warn('Value "'.concat(d,'" could not be animated!'))}};return s=>(s=Math.min(Math.max(s,0),1),s===0?o:s===1?r:(a(e,t,s),n))};m();function TT(o){return o.getContext("webgl2")||o.getContext("webgl")}function qu(o){let t=TT(o);if(!t||o.width===0||o.height===0)return null;let e=t;e.PIXEL_PACK_BUFFER!==void 0&&e.bindBuffer(e.PIXEL_PACK_BUFFER,null);let r=new Uint8Array(o.width*o.height*4);t.readPixels(0,0,o.width,o.height,t.RGBA,t.UNSIGNED_BYTE,r);let n=document.createElement("canvas");n.width=o.width,n.height=o.height;let a=n.getContext("2d");if(!a)return null;let s=new ImageData(o.width,o.height);for(let l=0;l<o.height;l++)for(let c=0;c<o.width;c++){let p=((o.height-l-1)*o.width+c)*4,d=(l*o.width+c)*4;s.data[d]=r[p],s.data[d+1]=r[p+1],s.data[d+2]=r[p+2],s.data[d+3]=r[p+3]}return a.putImageData(s,0,0),n}async function O1(o,t=1e3){let e=null,r=new Promise(s=>{e=()=>{let l=o.getCanvas();s(l?qu(l):null)},o.once("render",e),o.triggerRepaint()}),n=new Promise(s=>setTimeout(()=>s(null),t)),a=await Promise.race([r,n]);return a===null&&e&&o.off("render",e),a}function Qu(o,t="labels"){let e=o.getContext("2d");if(!e)return null;try{let r=e.getImageData(0,0,o.width,o.height),n=document.createElement("canvas");n.width=o.width,n.height=o.height;let a=n.getContext("2d");return a?(a.putImageData(r,0,0),n):null}catch(r){let n=t==="overlay"?"HTML overlay canvas is tainted and cannot be included in screenshot. This may occur if overlay content contains cross-origin images without proper CORS headers.":"Labels canvas is tainted and cannot be included in screenshot. This may occur if labels contain cross-origin images without proper CORS headers.";return A.warn(n),null}}var po,K,Rt,Ol=class{constructor(t){M(this,po);M(this,K);M(this,Rt);f(this,"Camera");f(this,"Labels");f(this,"Text3D");f(this,"Markers");f(this,"Image3D");f(this,"Models");f(this,"Paths");f(this,"Exporter");f(this,"Navigation");f(this,"Style");f(this,"Shapes");f(this,"Outdoor");f(this,"update",()=>{i(this,K).core.render()});f(this,"__LEGACY_GET_DIRECTIONS_SYNC",(t,e,r)=>{var n,a;return(a=(n=i(this,K).getMapData())==null?void 0:n.__LEGACY_GET_DIRECTIONS_SYNC(t,e,r))!=null?a:void 0});f(this,"getDirections",(t,e,r)=>{var n,a;return(a=(n=i(this,K).getMapData())==null?void 0:n.getDirections(t,e,r))!=null?a:Promise.resolve(void 0)});f(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(t,e,r)=>{var n,a;return(a=(n=i(this,K).getMapData())==null?void 0:n.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,e,r))!=null?a:void 0});f(this,"getDirectionsMultiDestination",(t,e,r)=>{var n,a;return(a=(n=i(this,K).getMapData())==null?void 0:n.getDirectionsMultiDestination(t,e,r))!=null?a:Promise.resolve(void 0)});f(this,"on",(t,e)=>{i(this,po).on(t,e)});f(this,"off",(t,e)=>{i(this,po).off(t,e)});f(this,"Debug");E(this,po,new cr),E(this,Rt,t);let e=new Cl(t,this,i(this,po));E(this,K,e),this.Camera=i(this,K).Camera,this.Markers=i(this,K).Markers,this.Models=i(this,K).Models,this.Labels=i(this,K).Labels,this.Text3D=i(this,K).Text3D,this.Exporter=i(this,K).Exporter,this.Paths=i(this,K).Paths,this.Navigation=i(this,K).Navigation,this.Shapes=i(this,K).Shapes,this.Style=i(this,K).Style,this.Outdoor=i(this,K).Outdoor,this.Image3D=i(this,K).Image3D,i(this,Rt).container.dataset.version=C.env.npm_package_version,this.Debug=new hp(i(this,K).core)}updateState(t,e){return i(this,K).updateState(t,e)}animateState(t,e,r){var c;let n=i(this,K).getState(t);if(n==null)return A.warn("Cannot animate state of ".concat(t,".")),new Promise(d=>d({result:"completed"}));let a=w1(n,e),s=i(this,K).tween({percent:0}).to({percent:1},(c=r==null?void 0:r.duration)!=null?c:1e3).onUpdate(({percent:p})=>{i(this,K).updateState(t,a(p))});r!=null&&r.easing&&r.easing in Ti&&s.easing(Ti[r.easing]);let l=new Promise(p=>{s.onComplete(()=>{i(this,K).removeTween(s),p({result:"completed"})}).onStop(()=>{i(this,K).removeTween(s),p({result:"cancelled"})}),s.start()});return l.cancel=()=>{s.stop(),i(this,K).updateState(t,a(0))},l}updateGlobalState(t){var e,r,n,a;try{C1.parse(t)}catch(s){A.error("updateGlobalState",s);return}if(typeof t=="object"){let s={};if((e=t.text3d)!=null&&e.hoverColor&&(s.text3dHoverColor=t.text3d.hoverColor),(r=t.geometry)!=null&&r.hoverColor&&(s.hoverColor=t.geometry.hoverColor),t.backgroundColor||t.backgroundAlpha!==void 0){let l=(n=t.backgroundColor)!=null?n:i(this,K).core.backgroundColor,c=(a=t.backgroundAlpha)!=null?a:i(this,K).core.backgroundAlpha;i(this,K).core.setBackgroundColor(l,c)}t.environment!=null&&i(this,K).core.setEnvironment(t.environment),t.multiFloorView!=null&&i(this,K).currentMap.updateMultiFloorViewEffects(t.multiFloorView),i(this,K).core.setState(s),i(this,po).publish("global-state-change")}}get options(){return _h(i(this,K).currentMap.options)}getGlobalState(){let t=i(this,K).core.getState();return{backgroundColor:i(this,K).core.backgroundColor,backgroundAlpha:i(this,K).core.backgroundAlpha,environment:i(this,K).core.getEnvironment(),geometry:{hoverColor:t.hoverColor},text3d:{hoverColor:t.text3dHoverColor},multiFloorView:i(this,K).currentMap.getMultiFloorViewEffects()}}getMapData(){if(i(this,K).mapData==null)throw new tt("MapData not found.");return i(this,K).mapData}getDimensions(){return{width:i(this,Rt).canvasWidth,height:i(this,Rt).canvasHeight}}addMap(t,e){return i(this,K).addMap(t,e)}setFloor(t,e){return i(this,K).setFloor(t,e==null?void 0:e.context)}setFloorStack(t,e){return i(this,K).setFloorStack(t,e==null?void 0:e.context)}preloadFloors(t){i(this,K).preloadFloors(t)}tween(t){return i(this,K).tween(t)}removeTween(t){i(this,K).removeTween(t)}get tweenGroup(){return i(this,K).tweenGroup()}get currentFloorStack(){return i(this,K).currentFloorStack}get currentFloor(){return i(this,K).currentFloor}updateWatermark(t){i(this,K).updateWatermark(t)}getState(t){return i(this,K).getState(t)}getFloorStackAltitudeData(t){let e=typeof t=="string"?t:t.id;return i(this,K).getFloorStackAltitudeData(e)}__EXPERIMENTAL__getRenderedState(t){return i(this,K).__EXPERIMENTAL__getRenderedState(t)}setHoverColor(t){i(this,K).setHoverColor(t)}getHoverColor(){return i(this,K).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return i(this,K).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return i(this,K).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return i(this,K).isInView(t)}getInView(t,e){return i(this,K).getInView(t,e)}getMetersPerPixel(){return i(this,K).core.getMetersPerPixel()}getDistance(t,e){var r;return(r=i(this,K).getMapData())==null?void 0:r.getDistance(t,e)}createCoordinate(t,e,r){return typeof t=="object"?new re(t):new re(t,e,r==null?void 0:r.id)}createCoordinateFromScreenCoordinate(t,e,r){return i(this,K).createCoordinateFromScreenCoordinate(t,e,r)}getScreenCoordinateFromCoordinate(t){return i(this,K).getScreenCoordinateFromCoordinate(t)}__EXPERIMENTAL__auto(t){return i(this,K).__EXPERIMENTAL__auto(t)}get __core(){if(C.env.INTERNAL==="true")return i(this,K).core;throw new Error("__core is not available.")}get container(){return i(this,Rt).container}publishAllState(){i(this,K).publishAllState()}clear(){i(this,K).clear()}destroy(){i(this,po).publish("destroy"),i(this,po).destroy(),i(this,K).destroy()}async enableDebug(t={}){let{Inspector:e}=await import("./inspector-6AQ5XCPD.js");await new e(this,i(this,K)).enable(t)}async takeScreenshot(t){var c,p,d,h,y;let e={withOutdoorContext:(c=t==null?void 0:t.withOutdoorContext)!=null?c:!1,withLabels:(p=t==null?void 0:t.withLabels)!=null?p:!1,captureMarkers:t==null?void 0:t.captureMarkers},r=i(this,Rt).rendererDomElement,n=i(this,Rt).map,a=!1,s=!1,l=[];if(this.Outdoor.enabled&&this.Outdoor.visible&&!e.withOutdoorContext&&(this.Outdoor.hide(),a=!0,n)){let b=null;n.triggerRepaint(),await Promise.race([new Promise(x=>{b=()=>x(),n.once("render",b)}),new Promise(x=>setTimeout(x,1e3))])===void 0&&b&&n.off("render",b)}if(this.Outdoor.enabled&&e.withOutdoorContext&&!this.Outdoor.visible){if(n){let b=(d=n.getStyle())==null?void 0:d.layers;b&&(l=b.filter(I=>n.getLayoutProperty(I.id,"visibility")!=="none").map(I=>I.id))}if(this.Outdoor.show(),s=!0,n){let b=null;n.triggerRepaint(),await Promise.race([new Promise(x=>{b=()=>x(),n.once("render",b)}),new Promise(x=>setTimeout(x,1e3))])===void 0&&b&&n.off("render",b)}}try{let b=document.createElement("canvas"),I=b.getContext("2d",{willReadFrequently:!0});if(b.width=r.width,b.height=r.height,!I)throw new Error("Failed to get 2D context");if(e.withOutdoorContext&&n){if(!n.loaded()){let O=null;await Promise.race([new Promise(H=>{O=()=>H(),n.once("idle",O)}),new Promise(H=>setTimeout(H,5e3))])===void 0&&O&&n.off("idle",O)}let _=await O1(n);_&&I.drawImage(_,0,0,b.width,b.height)}await i(this,Rt).renderSync();let x=qu(r);if(x&&I.drawImage(x,0,0,b.width,b.height),e.withLabels){let _=i(this,Rt).labelsCanvas;if(_){let O=Qu(_);O&&I.drawImage(O,0,0,b.width,b.height)}}if(e.withLabels&&e.captureMarkers){let _=i(this,Rt).container;if(_)for(let O=0;O<_.children.length;O++){let U=_.children[O],H=U.classList.contains("mappedin-2d-entities");if(!(U.tagName==="CANVAS"||U.offsetWidth===0||U.offsetHeight===0||!H))try{let V=await e.captureMarkers(U),N=Qu(V,"overlay");N&&N.width>0&&N.height>0&&I.drawImage(N,0,0,b.width,b.height)}catch(V){A.warn("Overlay layer capture failed: ".concat(V instanceof Error?V.message:String(V),". Continuing with other layers."))}}}try{return b.toDataURL("image/png")}catch(_){if((_ instanceof Error?_.name:_==null?void 0:_.name)==="SecurityError"||((h=_==null?void 0:_.message)==null?void 0:h.includes("tainted"))||((y=_==null?void 0:_.message)==null?void 0:y.includes("security"))){let V=_ instanceof Error?"Screenshot failed due to security restrictions: ".concat(_.message):"Screenshot failed due to security restrictions. Ensure all images have proper CORS headers.";throw new tt(V)}let H=_ instanceof Error?"Screenshot failed: ".concat(_.message):"Screenshot failed due to an unknown error.";throw new tt(H)}}finally{a&&this.Outdoor.show(),s&&this.Outdoor.hide(l)}}get manualFloorVisibility(){return i(this,K).manualFloorVisibility}set manualFloorVisibility(t){i(this,K).manualFloorVisibility=t}getOptimalVisualDistanceBetweenFloors(t){return i(this,K).getOptimalVisualDistanceBetweenFloors(t)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return i(this,K).hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(t){i(this,K).hidePathsNotOnCurrentFloor=!!t}registerPlugin(t){A.warn("registerPlugin is super experimental and may change or be removed without notice."),i(this,Rt).registerPlugin(t)}unregisterPlugin(t){i(this,Rt).unregisterPlugin(t)}};po=new WeakMap,K=new WeakMap,Rt=new WeakMap;m();var D1=(o,{id:t}={})=>{let e=Array.isArray(o)?o:[o];if(!e.every(a=>typeof a=="string"))return;let r=e.join(""),n=null;if(t){let a=document.getElementById(t);a instanceof HTMLStyleElement&&(n=a)}n==null&&(n=document.createElement("style")),t&&t!==""&&(n.id=t),n.textContent=r,document.head.appendChild(n)};m();var ST=1e3*60*60*2,In,Ua,He,uo,Xr,Tr,$r,Ha,Wa,Dl,We,A1,F1,Ga,gp,Ku,ef,tf,za=class{constructor(t,e){M(this,We);M(this,In,new cr);M(this,Ua);M(this,He);M(this,uo);M(this,Xr);M(this,Tr);M(this,$r);M(this,Ha);M(this,Wa);M(this,Dl,()=>{"key"in i(this,He)&&"secret"in i(this,He)&&Y(this,We,Ga).call(this),Y(this,We,gp).call(this)});f(this,"on",(t,e)=>i(this,In).on(t,e));f(this,"off",(t,e)=>i(this,In).off(t,e));E(this,Ua,t),E(this,He,e)}setMapIds(t){E(this,Ua,t)}setEnterprise(t){i(this,He).enterprise=t}async readySync(){var n;if((!("key"in i(this,He))||!("secret"in i(this,He)))&&!("accessToken"in i(this,He))){A.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[Y(this,We,Ga).call(this),null];i(this,He).enterprise||(t[1]=this.getSasTokensAsync());let[e,r]=await Promise.all(t);Y(this,We,tf).call(this),Y(this,We,Ku).call(this,e),r!=null&&Y(this,We,ef).call(this,r),qa()&&((n=globalThis.addEventListener)==null||n.call(globalThis,"focus",i(this,Dl)))}async refreshing(){let t=[];return i(this,uo)!=null&&t.push(i(this,uo)),i(this,Xr)!=null&&t.push(i(this,Xr)),Promise.all(t)}getAccessTokenAsync(){return Y(this,We,Ga).call(this)}getSasTokensAsync(){return Y(this,We,gp).call(this)}getAccessToken(){return i(this,Tr)==null?(A.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):i(this,Tr)}getSasToken(t){return this.isEnterpriseMode()?(A.error("SAS tokens are not available in the enterprise mode!"),{token:""}):i(this,$r)==null?(A.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in i(this,$r).tokens?i(this,$r).tokens[t]:(A.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=i(this,He).enterprise)!=null?t:!1}destroy(){Y(this,We,tf).call(this),i(this,In).destroy(),qa()&&globalThis.removeEventListener("focus",i(this,Dl))}};In=new WeakMap,Ua=new WeakMap,He=new WeakMap,uo=new WeakMap,Xr=new WeakMap,Tr=new WeakMap,$r=new WeakMap,Ha=new WeakMap,Wa=new WeakMap,Dl=new WeakMap,We=new WeakSet,A1=function(t){var r;let e=t.token!==((r=i(this,Tr))==null?void 0:r.token);E(this,Tr,t),e&&i(this,In).publish("access-token-refreshed",{accessToken:t})},F1=function(t){var r;let e=JSON.stringify(t.tokens)!==JSON.stringify((r=i(this,$r))==null?void 0:r.tokens);E(this,$r,t),e&&i(this,In).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},Ga=async function(t=!1){var e;if("accessToken"in i(this,He)&&typeof i(this,He).accessToken=="string"){let r={token:i(this,He).accessToken,expires:Date.now()+72e5};return E(this,Tr,r),r}if(!("key"in i(this,He))||!("secret"in i(this,He))||typeof i(this,He).key!="string"||typeof i(this,He).secret!="string")throw new Error("No API keys or access token provided!");return i(this,uo)!=null?i(this,uo):i(this,Tr)!=null&&i(this,Tr).expires!=null&&i(this,Tr).expires>Date.now()&&!t?i(this,Tr):(E(this,uo,is(z(k({},i(this,He)),{key:i(this,He).key,secret:i(this,He).secret}),(e=i(this,He).enterprise)!=null?e:!1).then(r=>{let n={token:r.accessToken,expires:r.expiresTimestamp*1e3};return Y(this,We,A1).call(this,n),n}).catch(r=>{throw r}).finally(()=>{E(this,uo,void 0)})),i(this,uo))},gp=async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:i(this,Xr)!=null?i(this,Xr):i(this,$r)!=null&&i(this,$r).expires>Date.now()&&!t?i(this,$r):(E(this,Xr,new Promise((e,r)=>{Y(this,We,Ga).call(this).then(n=>{let a={},s=i(this,Ua).map(l=>Np(z(k({},i(this,He)),{mapId:l}),n.token).then(c=>{a[l]={token:c.token,expires:c.expires}}).catch(c=>{A.error("Error getting SAS token for map ".concat(l,":"),c)}));Promise.all(s).then(()=>{let l={tokens:a,expires:Math.min(...Object.values(a).map(c=>{var p;return(p=c.expires)!=null?p:1/0}))};Y(this,We,F1).call(this,l),e(l)})}).catch(n=>{r(n)})})),i(this,Xr).catch(e=>{throw e}).finally(()=>{E(this,Xr,void 0)}),i(this,Xr))},Ku=function(t){if(!("key"in i(this,He))||!("secret"in i(this,He)))return;let e=t.expires!=null?t.expires-Date.now():ST;isFinite(e)&&E(this,Ha,setTimeout(()=>{Y(this,We,Ga).call(this,!0).then(r=>{Y(this,We,Ku).call(this,r)})},e-eh))},ef=function(t){let e=t.expires-Date.now();isFinite(e)&&E(this,Wa,setTimeout(()=>{Y(this,We,gp).call(this,!0).then(r=>{Y(this,We,ef).call(this,r)})},e-oh))},tf=function(){i(this,Ha)!=null&&clearTimeout(i(this,Ha)),i(this,Wa)!=null&&clearTimeout(i(this,Wa))};m();var MT=async(o,t)=>{var x,_,O,U,H,V,N,q,B,J,se;let e=(O="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?O:"options"in o&&"version"in((x=o.options)!=null?x:{})?(_=o.options)==null?void 0:_.version:void 0,r=z(k({prefetchTokens:!0},t||{}),{mvfVersion:e}),n,a,s=Yo();s.updateByUserOption(r);let l={};if("type"in o&&typeof o.type=="string"){if(o.type==="binary"&&o.main instanceof Uint8Array){let ie=await Jl(o.main,r.mvfVersion);n=ie.mvf2,a=ie.mvf3,l.languagePacks=[];for(let Ie of(U=o.languagePacks)!=null?U:[])Ie.localePack instanceof Uint8Array&&l.languagePacks.push({language:Ie.language,localePack:await _i(Ie.localePack)})}else if(o.type==="json")n=o.main,a=(H=o.options)==null?void 0:H.mvf3,l.languagePacks=(V=o.languagePacks)!=null?V:[];else throw new Error("Invalid backup type");o.type==="binary"&&o.main instanceof Uint8Array&&(l.binaryBundle=o.main);let W=n.enterprise!=null;((N=o.options)==null?void 0:N.enterprise)!==void 0&&(W?A.warn('The "enterprise" option in hydrateMapData is deprecated and ignored. Enterprise mode is now automatically detected from the MVF data.'):A.warn('The "enterprise" option in hydrateMapData is deprecated and will be removed in a future release. Please ensure your MVF bundle includes enterprise data for automatic detection.')),l.enterprise=W||((B=(q=o.options)==null?void 0:q.enterprise)!=null?B:!1)}else n=o,l.enterprise=n.enterprise!=null;l.mvf3=a,s.setEnterprise((J=l.enterprise)!=null?J:!1);let c=Zl(n),p=c.length>0?c:[r.mapId];r.baseAuthUri=s.getBaseAuthUri();let d=new za(p,z(k({},r),{enterprise:l.enterprise})),h;if("accessToken"in r&&r.accessToken)h=r.accessToken;else if("key"in r&&"secret"in r){let W;try{W=await d.getAccessTokenAsync()}catch(ie){A.error("Failed getting token during hydrateMapData",ie)}h=(W==null?void 0:W.token)||""}if(l.outdoorViewToken=h,l.env=s,l.getMapDataOptions=r,l.tokenManager=d,r.prefetchTokens)try{await d.readySync()}catch(W){A.error("Failed to ready token manager!",W)}Rs()&&(l.enterprise&&A.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),r.mvfVersion!=="3.0.0"&&A.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let y=new ti(n,l);h&&y.Analytics.init(z(k({accessToken:h,mapId:r.mapId,key:"key"in r?r.key:void 0,secret:"secret"in r?r.secret:void 0},r.analytics),{baseUri:s.getAnalyticsBaseUri(),context:(se=r.analytics)==null?void 0:se.context}));let b=new os(y),I=y.findPreferredLanguage({languageCode:r.language,fallbackToNavigatorLanguage:!1});if(I)try{await b.changeLanguage(I.code)}catch(W){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(n),b};var k1=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var L1=".mappedin-marker {\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Opt out of CSS opacity transitions when the marker has animated: false.\n * Without this, direct style.opacity assignments (from DOMDrawSystem's snap\n * path and from onStrategySelected) still fade over the CSS transition\n * duration, and during that fade `marker.animation` is null so the transform\n * update path is skipped \u2014 causing markers to drift if the camera is moving.\n */\n.mappedin-marker[data-animated='false'] {\n transition: none;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide child elements as well */\n.mappedin-marker[data-placement='hidden'] > .mappedin-marker-content {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker::before {\n content: '';\n display: none;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n\n.mappedin-marker[data-placement='hidden']::before {\n display: block;\n}\n";var B1=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var N1=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var R1=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var V1='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}';var j1=".mappedin-annotation-marker {\n --mappedin-annotation-border-radius: 5px;\n --mappedin-annotation-border-width: 2px;\n --mappedin-annotation-background-color: #ffffff;\n --mappedin-annotation-scale: 0.7;\n\n position: relative;\n box-sizing: border-box;\n border-radius: var(--mappedin-annotation-border-radius);\n border: var(--mappedin-annotation-border-width) solid var(--mappedin-annotation-background-color);\n\n transform: scale(var(--mappedin-annotation-scale)) translateY(0rem);\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);\n\n img {\n position: absolute;\n image-rendering: crisp-edges;\n top: 0px;\n\n object-fit: contain;\n border-radius: calc(var(--mappedin-annotation-border-radius) - var(--mappedin-annotation-border-width));\n }\n}\n";m();function DT(o){var t,e;if(!(!o.languages||!qa()||!((e=(t=globalThis.navigator)==null?void 0:t.languages)!=null&&e.length)))for(let r=0;r<globalThis.navigator.languages.length;r++){let n=o.languages.find(a=>a.code.toLowerCase()===globalThis.navigator.languages[r].toLowerCase());if(n)return{code:n.code,name:n.name}}}function Xd(o,t){var s,l,c;let e=(s=t==null?void 0:t.languageCode)!=null?s:"",r=(l=t==null?void 0:t.fallbackToNavigatorLanguage)!=null?l:!0,n=(c=o==null?void 0:o.languages)==null?void 0:c.find(p=>p.code.toLowerCase()===e.toLowerCase()),a;if(n)a=n;else if(r==null||r)try{let p=DT(o);p&&(a=p)}catch(p){A.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",p)}return a!=null?a:o.defaultLanguage}var AT=[k1,L1,B1,N1,R1,V1,j1],G1;function KO(o){G1=o}var eD=async(o,t)=>{let e,r=Yo();t&&r.updateByUserOption(t);try{t&&(e=(await is(z(k({},t),{baseAuthUri:r.getBaseAuthUri()}))).accessToken)}catch(s){A.warn("Getting access token failed. Outdoor map disabled.",s)}let n=new ti(o,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:r});return new os(n)},U1=!1;function tD(o){U1=o}var H1=!1;function rD(o){H1=o}function Rs(){return H1}var FT=async o=>{var O,U;let t=U1,e,r=Yo();r.updateByUserOption(o);let n=z(k({prefetchTokens:!0},o),{fallbackToNavigatorLanguage:(O=o.fallbackToNavigatorLanguage)!=null?O:!0}),a=new za([n.mapId],n);if("accessToken"in n&&n.accessToken){e=n.accessToken;let{aud:H,sub:V}=Gl(e);(xh.some(N=>H.includes(N))||V&&V.startsWith("client"))&&(t=!0,r.setEnterprise(t),a.setEnterprise(t))}else if("key"in n&&"secret"in n){if(n.key.startsWith("mipk_"))throw new Error("Partner API keys detected! \n\nPartner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.");n.key.startsWith("mik_")||(t=!0,r.setEnterprise(t),a.setEnterprise(t)),n.baseAuthUri=r.getBaseAuthUri();let H;try{H=await a.getAccessTokenAsync(),e=H==null?void 0:H.token}catch(V){throw A.warn("Get access token failed",V.message),new Error("Get access token failed: "+V.message)}}else throw new Error("Missing key or secret.");n.layoutId!=null&&(t?n.layoutId!=="draft"&&A.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):A.warn("layoutId is currently unsupported!")),n.baseUri=r.getBaseUri();let s=performance.now(),l,c;if(t){let H=z(k({},n),{venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"}),V=await $p(H);l=V.compressed,c=V.localePacks}else l=await Yp(n,e);let p=performance.now(),{mvf2:d,mvf3:h}=await Jl(l,n.mvfVersion),y=performance.now();typeof o.onMVFParsed=="function"&&o.onMVFParsed(d);let b=Zl(d);if(b.length>0?a.setMapIds(b):a.setMapIds([n.mapId]),n.prefetchTokens)try{await a.readySync()}catch(H){A.error("Failed to ready token manager!",H)}Rs()&&(t&&A.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&A.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new ti(d,{env:r,outdoorViewToken:e,tokenManager:a,enterprise:t,localePacksUrls:c,binaryBundle:l,getMapDataOptions:n,mvf3:h}),x=new os(I,{search:o.search});I.Analytics.init(z(k({accessToken:e,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:r.getAnalyticsBaseUri(),context:(U=n.analytics)==null?void 0:U.context})),I.Analytics.sendGetMapDataEvent({parseDuration:y-p,downloadDuration:p-s,viewId:n.viewId});let _=I.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(_)try{await x.changeLanguage(_.code)}catch(H){}return x},oD=FT,kT=async()=>{if(Cp===""||Pp==="")return!1;let o=[fetch(Cp,{mode:"same-origin"}),fetch(Pp,{mode:"same-origin"})],[t,e]=[{ok:!1},{ok:!1}];try{[t,e]=await Promise.all(o)}catch(r){}return{collision:t.ok,maplibre:e.ok}},rf=new WeakSet,LT=async(o,t,e)=>{var y,b,I,x,_,O,U,H,V,N,q,B,J,se,W,ie,Ie;let r=performance.now();rf.has(o)&&A.warn("show3dMap was called on a container that already has an active MapView. Call destroy() on the existing MapView before creating a new one to avoid resource leaks.");let n=sd(e,t);n&&ad(n),((y=n.injectStyles)==null||y)&&D1(AT,{id:"mappedin__styles"});let a=Ch((b=t.outdoorViewToken)!=null?b:""),s=ns(t);(I=n.outdoorView)!=null&&I.style&&s.envControl.updateTileServerBaseUrl((x=n.outdoorView)==null?void 0:x.style);let l=!1,c=!1,p=await kT();p&&(p.collision||(l=!0),p.maplibre||(c=!0));let d=await Df(o,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(_=n.style)==null?void 0:_.backgroundAlpha,backgroundColor:(O=n.style)==null?void 0:O.backgroundColor,outdoorView:!c&&((U=n.outdoorView)!=null&&U.token)?{headers:{"x-mappedin-tiles-key":(H=n.outdoorView)==null?void 0:H.token},style:t.getEnv().tileServerUri,enabled:!!((V=n.outdoorView)!=null&&V.enabled),lowDpi:(N=n.outdoorView)==null?void 0:N.lowDpi}:void 0,watermark:z(k({},n.watermark),{visible:(B=(q=n.watermark)==null?void 0:q.visible)!=null?B:!s.enterpriseMode&&!a.remove_watermark,onClick:G1||void 0}),attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((J=n.antialiasing)!=null&&J.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:s.enterpriseMode?void 0:s.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError,useStandaloneCamera:(se=n.useStandaloneCamera)!=null?se:!1,useWorkers:!((W=n.disableWorkers)!=null&&W),useCollisionWorker:!l,disableUpdateStateValidation:(ie=n.disableUpdateStateValidation)!=null?ie:!1,__EXPERIMENTAL_shadows:n.__EXPERIMENTAL_shadows,outlines:typeof((Ie=n.style)==null?void 0:Ie.outlines)=="object"?n.style.outlines:void 0}),h=new Ol(d);return await h.addMap(t,n),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-r,dimension:h.getDimensions(),collisionWorkerDisabled:l,outdoorsWorkerDisabled:c}),rf.add(o),h.on("destroy",()=>rf.delete(o)),h},nD=()=>C.env.npm_package_version,iD=LT;export{re as a,ur as b,wn as c,qr as d,lt as e,Xb as f,fr as g,wt as h,Ze as i,zt as j,It as k,Xt as l,rr as m,kr as n,Ki as o,gt as p,Ht as q,nc as r,Cd as s,yh as t,Zp as u,Jl as v,Lh as w,_d as x,Bh as y,ac as z,sc as A,sn as B,Co as C,ic as D,ou as E,iv as F,uu as G,fu as H,mT as I,Ol as J,MT as K,Xd as L,KO as M,eD as N,tD as O,rD as P,Rs as Q,FT as R,oD as S,kT as T,LT as U,nD as V,iD as W};