@mappedin/react-sdk 6.0.1-beta.44 → 6.0.1-beta.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{V as y,W as B,u as w,v as x,w as b}from"./chunk-2DFVQLLS.js";import{a as A}from"./chunk-VMPZPJW5.js";import{a as g}from"./chunk-2OY65JNC.js";A();function R(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new B,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=T(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=T(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}g(R,"mergeGeometries");function T(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new y(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}g(T,"mergeAttributes");function X(o,l){if(l===w)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===b||l===x){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===b)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}g(X,"toTrianglesDrawMode");export{R as a,X as b};
1
+ import{V as y,W as B,u as w,v as x,w as b}from"./chunk-FAMEMKII.js";import{a as A}from"./chunk-GVHB2OJC.js";import{a as g}from"./chunk-BYMKRV3A.js";A();function R(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new B,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=T(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=T(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}g(R,"mergeGeometries");function T(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new y(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}g(T,"mergeAttributes");function X(o,l){if(l===w)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===b||l===x){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===b)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}g(X,"toTrianglesDrawMode");export{R as a,X as b};
@@ -1 +1 @@
1
- import{i as ae,j as ke,k as Ge}from"./chunk-WULPIMBT.js";import{$a as Ae,M as x,N as ne,P as ie,R as L,S as oe,ma as Oe}from"./chunk-2DFVQLLS.js";import{a as u,b as d}from"./chunk-VMPZPJW5.js";import{a as o,f as i,g as h,h as S,i as y}from"./chunk-2OY65JNC.js";u();function wt(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=o(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}o(wt,"debounce");u();u();var se="[MappedinJS]",et=(a=>(a[a.LOG=0]="LOG",a[a.WARN=1]="WARN",a[a.ERROR=2]="ERROR",a[a.SILENT=3]="SILENT",a))(et||{});function Ot(r){0<=r&&r<=3&&(Fe.logState=r)}o(Ot,"setLoggerLevel");var Fe={logState:d.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(se,...r)},warn(...r){this.logState<=1&&console.warn(se,...r)},error(...r){this.logState<=2&&console.error(se,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)}},ue=Fe;u();u();var le=class le extends Error{};o(le,"InvalidTokenError");var R=le;R.prototype.name="InvalidTokenError";function tt(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}o(tt,"b64DecodeUnicode");function rt(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tt(e)}catch{return atob(e)}}o(rt,"base64UrlDecode");function Ne(r,e){if(typeof r!="string")throw new R("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new R("Invalid token specified: missing part #".concat(t+1));let a;try{a=rt(n)}catch(s){throw new R("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(s.message,")"))}try{return JSON.parse(a)}catch(s){throw new R("Invalid token specified: invalid json for part #".concat(t+1," (").concat(s.message,")"))}}o(Ne,"jwtDecode");u();var _=63710088e-1;function zt(r){var t,n;let e=Ne(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}o(zt,"decodeAccessToken");function O(r){return r*(Math.PI/180)}o(O,"toRadians");function nt(r){return r*(180/Math.PI)}o(nt,"toDegrees");function Wt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}o(Wt,"round");function Re(r,e){return(r%e+e)%e}o(Re,"euclideanModulo");function Jt([r,e],[t,n]){let a=O(n-e),s=O(t-r),l=O(e),c=O(n),m=Math.sin(a/2)*Math.sin(a/2)+Math.sin(s/2)*Math.sin(s/2)*Math.cos(l)*Math.cos(c),p=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));return _*p}o(Jt,"haversineDistance");function qt([r,e],[t,n]){let a=O(e),s=O(r),l=O(n),m=O(t)-s,p=Math.sin(m)*Math.cos(l),g=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(m);return nt((Math.atan2(p,g)+Math.PI*2)%(Math.PI*2))}o(qt,"getForwardBearing");function Yt(r,e){let t=Re(r,Math.PI*2),n=Re(e,Math.PI*2),a=n-t,s=n+(a>Math.PI?-Math.PI*2:a<-Math.PI?Math.PI*2:0);return{start:t,end:s}}o(Yt,"shortestTweenRotation");function it(r){return r instanceof Ae?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}o(it,"isFiniteBox");function $t(r,e,t,n){return(r<e||r>t)&&ue.warn(n),Math.min(t,Math.max(e,r))}o($t,"clampWithWarning");function Kt(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}o(Kt,"arraysEqual");u();var $=class $ extends Error{constructor(t){super(t);i(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,$)}};o($,"AssertionError");var ce=$;function _e(r,e){if(r==null){let t;if(e!=null&&e.customMessage)t=e.customMessage;else{let s=e!=null&&e.valueName?"'".concat(e.valueName,"'"):"value";t="Expected ".concat(s," to be defined, but received ").concat(r)}let n=(e==null?void 0:e.errorClass)||ce,a=new n(t);throw(e==null?void 0:e.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(a,_e),a}}o(_e,"assertExists");function er(r,e,t){if(_e(r),(r==null?void 0:r.type)!==e){let n="Expected type ".concat(e," but got ").concat(r==null?void 0:r.type);throw new Error(t!=null?t:n)}}o(er,"assertType");u();var me=[0,4,6,8,10],v=o(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],me.map((n,a)=>t.slice(n,a===me.length-1?void 0:me[a+1]).join("")).join("-")},"randomId");u();var pe=class pe{constructor(){i(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};o(pe,"PubSub");var de=pe;u();var Be="mi-session-data",Ve="mi-local-data",B,T,M,U=class U{constructor(){S(this,T);S(this,M);try{let e=sessionStorage.getItem(Be);e?y(this,T,JSON.parse(e)):y(this,T,{id:v()})}catch{y(this,T,{id:v()})}try{let e=localStorage.getItem(Ve);e?y(this,M,JSON.parse(e)):y(this,M,{deviceId:v()})}catch{y(this,M,{deviceId:v()})}h(this,T).id||(h(this,T).id=v()),h(this,M).deviceId||(h(this,M).deviceId=v())}static getInstance(){return h(this,B)||y(this,B,new U),h(this,B)}static ___clearInstance(){y(this,B,void 0)}saveSessionData(e,t){h(this,T)[e]=t;try{return sessionStorage.setItem(Be,JSON.stringify(h(this,T))),!0}catch{return!1}}loadSessionData(e){let t=h(this,T)[e];if(t!=null)return t}saveLocalData(e,t){h(this,M)[e]=t;try{return localStorage.setItem(Ve,JSON.stringify(h(this,M))),!0}catch{return!1}}loadLocalData(e){let t=h(this,M)[e];if(t!=null)return t}};B=new WeakMap,T=new WeakMap,M=new WeakMap,o(U,"SafeStorage"),S(U,B);var fe=U;u();function ot(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}o(ot,"normalizeAngle");u();u();u();u();u();u();u();u();var b=63710088e-1,Ue={centimeters:b*100,centimetres:b*100,degrees:b/111325,feet:b*3.28084,inches:b*39.37,kilometers:b/1e3,kilometres:b/1e3,meters:b,metres:b,miles:b/1609.344,millimeters:b*1e3,millimetres:b*1e3,nauticalmiles:b/1852,radians:1,yards:b*1.0936},Pr={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/b,yards:1.0936133};function A(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}o(A,"feature");function at(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!je(r[0])||!je(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return A(n,e,t)}o(at,"point");function wr(r,e,t){t===void 0&&(t={});for(var n=0,a=r;n<a.length;n++){var s=a[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return A(c,e,t)}o(wr,"polygon");function He(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return A(n,e,t)}o(He,"lineString");function Cr(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}o(Cr,"featureCollection");function Ir(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return A(n,e,t)}o(Ir,"multiLineString");function Lr(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return A(n,e,t)}o(Lr,"multiPolygon");function Or(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r*t}o(Or,"radiansToLength");function Ar(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r/t}o(Ar,"lengthToRadians");function kr(r){var e=r%(2*Math.PI);return e*180/Math.PI}o(kr,"radiansToDegrees");function Gr(r){var e=r%360;return e*Math.PI/180}o(Gr,"degreesToRadians");function je(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}o(je,"isNumber");function K(r,e,t){if(r!==null)for(var n,a,s,l,c,m,p,g=0,f=0,w,C=r.type,D=C==="FeatureCollection",G=C==="Feature",te=D?r.features.length:1,F=0;F<te;F++){p=D?r.features[F].geometry:G?r.geometry:r,w=p?p.type==="GeometryCollection":!1,c=w?p.geometries.length:1;for(var re=0;re<c;re++){var E=0,N=0;if(l=w?p.geometries[re]:p,l!==null){m=l.coordinates;var I=l.type;switch(g=t&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(e(m,f,F,E,N)===!1)return!1;f++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<m.length;n++){if(e(m[n],f,F,E,N)===!1)return!1;f++,I==="MultiPoint"&&E++}I==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<m.length;n++){for(a=0;a<m[n].length-g;a++){if(e(m[n][a],f,F,E,N)===!1)return!1;f++}I==="MultiLineString"&&E++,I==="Polygon"&&N++}I==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<m.length;n++){for(N=0,a=0;a<m[n].length;a++){for(s=0;s<m[n][a].length-g;s++){if(e(m[n][a][s],f,F,E,N)===!1)return!1;f++}N++}E++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(K(l.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(K,"coordEach");function Vr(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}o(Vr,"featureEach");function st(r,e){var t,n,a,s,l,c,m,p,g,f,w=0,C=r.type==="FeatureCollection",D=r.type==="Feature",G=C?r.features.length:1;for(t=0;t<G;t++){for(c=C?r.features[t].geometry:D?r.geometry:r,p=C?r.features[t].properties:D?r.properties:{},g=C?r.features[t].bbox:D?r.bbox:void 0,f=C?r.features[t].id:D?r.id:void 0,m=c?c.type==="GeometryCollection":!1,l=m?c.geometries.length:1,a=0;a<l;a++){if(s=m?c.geometries[a]:c,s===null){if(e(null,w,p,g,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,w,p,g,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],w,p,g,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}o(st,"geomEach");function ut(r,e){st(r,function(t,n,a,s,l){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(A(t,a,{bbox:s,id:l}),n,0)===!1?!1:void 0}var m;switch(c){case"MultiPoint":m="Point";break;case"MultiLineString":m="LineString";break;case"MultiPolygon":m="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var g=t.coordinates[p],f={type:m,coordinates:g};if(e(A(f,a),n,p)===!1)return!1}})}o(ut,"flattenEach");function lt(r,e){ut(r,function(t,n,a){var s=0;if(t.geometry){var l=t.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,m=0,p=0,g=0;if(K(t,function(f,w,C,D,G){if(c===void 0||n>m||D>p||G>g){c=f,m=n,p=D,g=G,s=0;return}var te=He([c,f],t.properties);if(e(te,n,a,G,s)===!1)return!1;s++,c=f})===!1)return!1}}})}o(lt,"segmentEach");function jr(r,e,t){var n=t,a=!1;return lt(r,function(s,l,c,m,p){a===!1&&t===void 0?n=s:n=e(n,s,l,c,m,p),a=!0}),n}o(jr,"segmentReduce");function he(r){var e=[1/0,1/0,-1/0,-1/0];return K(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}o(he,"bbox");he.default=he;var ze=he;function We(r){return ze(r)}o(We,"getBoundingBoxFromFeature");u();var ge="#ffffff";var be=class be{constructor(e={}){i(this,"initialColor",ge);i(this,"color",ge);i(this,"initialTopColor");i(this,"topColor");i(this,"topTexture");i(this,"texture");i(this,"hoverColor");i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"width",.1);i(this,"height",.1);i(this,"initialHeight",.1);i(this,"altitude",0);i(this,"join","round");i(this,"cap","round");i(this,"showImage",!0);i(this,"flipImageToFaceCamera",!0);i(this,"url");i(this,"side","double");i(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};o(be,"StyleComponent");var ye=be;var xe=class xe extends Oe{constructor(){super(...arguments);i(this,"type","entityBatchedMesh");i(this,"userData",{entities:{}})}};o(xe,"EntityBatchedMesh");var X=xe,H,z,V,ve=class ve{constructor(e){i(this,"mesh");i(this,"focusMesh");i(this,"imageMesh");i(this,"textMesh");i(this,"textEntityId");i(this,"type","geometry");i(this,"dirty",!0);i(this,"detached",!1);i(this,"instanceIndex",-1);i(this,"geometry");i(this,"material");i(this,"feature");i(this,"currentHeight",.1);i(this,"focusable",!1);i(this,"color",new oe);i(this,"topColor",new oe);i(this,"position",new x);S(this,H,0);S(this,z,1);S(this,V);i(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return h(this,H)}set altitude(e){this.mesh&&(this.mesh.position.z=e,y(this,H,e))}get opacity(){return h(this,z)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}y(this,z,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return h(this,V)?h(this,V):(y(this,V,We(this.feature)),h(this,V))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};H=new WeakMap,z=new WeakMap,V=new WeakMap,o(ve,"MeshComponent");var Je=ve;u();var qe="#ffffff",k,Te=class Te{constructor(e={}){i(this,"color",qe);i(this,"initialColor",qe);i(this,"topColor");i(this,"initialTopColor");i(this,"opacity",1);i(this,"height");S(this,k);i(this,"outline",!0);i(this,"texture");i(this,"topTexture");i(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.initialColor=this.color,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return h(this,k)}set shading(e){var t;if(!e){y(this,k,void 0);return}y(this,k,(t=h(this,k))!=null?t:{start:0,end:0,intensity:0}),Object.assign(h(this,k),e)}};k=new WeakMap,o(Te,"GeometryGroupStyleComponent");var Z=Te;var Me=class Me extends L{constructor(t,n=new Z){super();i(this,"visible",!0);i(this,"type","geometry-group");i(this,"components");i(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let a of this.children)if(!a.userData.detached){t=a;break}return t instanceof X?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};o(Me,"GeometryGroupObject3D");var P=Me;u();var De=class De extends L{};o(De,"Geometry2DObject3D");var j=De,Ee=class Ee{constructor(e,t,n=0){i(this,"id");i(this,"verticalOffset");i(this,"positionDirty",!0);i(this,"occluderId");i(this,"object3d",new j);i(this,"components");i(this,"disposed",!1);i(this,"worldPosition",new x);this.id=e.id||v(),this.components=[e],this.verticalOffset=n,this.object3d=new j,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};o(Ee,"Geometry2D");var W=Ee;u();var Se=class Se extends L{constructor(){super(...arguments);i(this,"type","geometry");i(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(a=>{n.push(a)})}};o(Se,"Geometry3DObject3D");var Q=Se,Pe=class Pe{constructor(e,t){i(this,"id",v());i(this,"components");i(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof P?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof P&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};o(Pe,"Geometry3D");var J=Pe;var q=class q extends L{constructor(t){super();i(this,"childrenIds",new Set);i(this,"children",[]);i(this,"type","group-container");i(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1});i(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof q?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof W?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof P?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof J&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof q?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof W?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof P?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof J&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};o(q,"GroupContainerObject3D");var Y=q;u();var Nn={top:0,bottom:0,left:0,right:0,type:"pixel"},Ye="mappedin";var Rn=250;u();function mt(r){let e=r.min,t=r.max,n=new x(e.x,e.y,e.z),a=new x(t.x,e.y,e.z),s=new x(e.x,t.y,e.z),l=new x(t.x,t.y,e.z);return[n,a,s,l]}o(mt,"getCornersOfBoundingBox");u();function $e(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}o($e,"getGeometryByGeometryId");function Wn(r,e,t=[],n=new ne,a){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=$e(r.getInternalState(),e);return Ke(s,t,n,a),t}o(Wn,"getVerticesOfEntity");var ee=new x;function Ke(r,e=[],t=new ne,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let a=r.geometry;if(a.isBufferGeometry){let s=a.attributes.position;for(let l=0;l<s.count;l++)ee.fromBufferAttribute(s,l),n!==void 0&&(ee.z=n),e.push(ee.clone()),t.expandByPoint(ee)}}for(let a of r.children)Ke(a,e,t,n)}}o(Ke,"traverse");u();function dt(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}o(dt,"getPixelRatio");u();function pt(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=o(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}o(pt,"debounce");u();var ft=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,a=/(iphone|ipod|ipad)/i.test(e),s=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,l=/android/i.test(e);return r={isIpad:s,isMobile:l||a||s,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Xe=ft.getDeviceType,Ze=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let s=r.getContext("webgl")||r.getContext("experimental-webgl");if(!s)return e;try{let l=Xe().isFirefox?null:s.getExtension("WEBGL_debug_renderer_info");return e=l?s.getParameter(l.UNMASKED_RENDERER_WEBGL):s.getParameter(s.RENDERER),e}catch{let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}o(n,"getInfo");function a(){var l,c;if(!Xe().isWindows)return!1;if(t!==void 0)return t;let s=(c=(l=ht())==null?void 0:l.toLowerCase())!=null?c:"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return o(a,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:a,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),ht=Ze.getInfo,gt=Ze.shouldDisableOffscreenCanvas;u();function yt(r,e){let t={};for(let n=0;n<e.length;n++){let a=e[n];a in r&&(t[a]=r[a])}return t}o(yt,"pick");function bt(r){return Object.keys(r).length===0}o(bt,"isEmpty");u();var xt=o(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let a=r[n];e.includes("mappedin")||(r[n]=a)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function xi(r,e,t,n){let a=r*(Math.PI/180),s=n/_,l=r+s*180/Math.PI,c=t/_/Math.cos(a),m=e+c*180/Math.PI;return{lat:l,lon:m}}o(xi,"cartesianToGeographic");function vi(r,e,t,n){let a=t*(Math.PI/180),s=n*(Math.PI/180),l=r*(Math.PI/180),c=e*(Math.PI/180),m=a-l,p=s-c,g=_*p*Math.cos(l),f=_*m;return{x:g,y:f}}o(vi,"geographicToCartesian");var vt=o((r,e)=>{var t;if(r.children&&r.visible)for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((t=n.userData)!=null&&t.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let a of n.userData.entities3D.values())e.add(a)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof Q)&&e.add(n.userData.entityId);vt(n,e)}return e},"populateGeometry3DIdsInScene"),Tt=o((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof j&&e.add(n.userData.entityId),Tt(n,e);return e},"populateGeometry2DIdsInScene");function Mt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Mt(r[t],e[t]):r[t]=e[t]}return r}o(Mt,"mergeObjects");function Ti(r,e,t,n){let a={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new ie,l=new x(a.scale,-a.scale,a.scale),c=new ie().makeTranslation(a.translateX,a.translateY,a.translateZ).scale(l),m=t.elevation;return{id:Ye,type:"custom",renderingMode:"3d",render:o((p,g)=>{if(s.fromArray(g),m!==t.elevation){let f=Ge.fromLngLat(r.toLngLat(),t.elevation);c.makeTranslation(a.translateX,a.translateY,-f.z).scale(l)}e.projectionMatrix=s.multiply(c),m=t.elevation,n()},"render")}}o(Ti,"createCustomLayer");function Dt(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}o(Dt,"fetchToken");async function Mi(r){let e=await Dt(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}o(Mi,"getRequestHeaders");function Di(r,e=0){let t=3735928559^e,n=1103547991^e;for(let a=0,s;a<r.length;a++)s=r.charCodeAt(a),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}o(Di,"cyrb53");var Et=o(r=>r,"linearEase");var Ei=o(r=>1-Math.cos(r*Math.PI/2),"easeIn");function Si(r,e,t,n,a,s=Et){r=Math.max(e,Math.min(r,t));let l=(r-Math.min(e,t))/Math.abs(t-e),c=s(l);return n+c*(a-n)}o(Si,"interpolate");function Pi(r,e,t){let n=r*(Math.PI/180)/2,a=e/2;return t*Math.tan(n)/a}o(Pi,"getProjectionScaleFactor");function wi(r){return new ke(new ae(r[0][0],r[0][1]),new ae(r[1][0],r[1][1])).getCenter().toArray()}o(wi,"getBoundingBoxCenter");function Ci(r,e){return r<e||e<=12}o(Ci,"shouldExpandZoomLevel");function Ii(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof Y?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof P&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof Y&&(e=r.parentObject3D.parent.userData.computedOpacity),e}o(Ii,"getGroupContainerOpacity");u();var Ce=class Ce{constructor(e){i(this,"visible");i(this,"altitude");i(this,"color");i(this,"dirty",!0);i(this,"maxWidth");i(this,"maxHeight");i(this,"hoverByPolygon");i(this,"flipToFaceCamera",Qe.flipToFaceCamera);i(this,"font");i(this,"fillOpacity");i(this,"fontSize");i(this,"margin");i(this,"outlineWidth");i(this,"outlineBlur");i(this,"outlineOffsetX");i(this,"strokeColor");i(this,"strokeOpacity");i(this,"strokeWidth");i(this,"hoverColor");i(this,"outlineOffsetY");i(this,"outlineColor");i(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};o(Ce,"Text3DStyleComponent");var we=Ce,Qe=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});u();u();var Le=class Le{constructor(e){i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"verticalOffset",0);i(this,"interactive",!1);i(this,"color");i(this,"material");i(this,"rotation");i(this,"scale");e&&Object.assign(this,e)}};o(Le,"ModelStyleComponnet");var Ie=Le;u();var St=[1,1,1],Pt=[0,0,0];export{se as a,et as b,Ot as c,ue as d,_ as e,zt as f,O as g,Wt as h,Jt as i,qt as j,Yt as k,it as l,$t as m,Kt as n,wt as o,er as p,v as q,de as r,fe as s,A as t,at as u,wr as v,He as w,Cr as x,Ir as y,Lr as z,Or as A,Ar as B,kr as C,Gr as D,K as E,Vr as F,ut as G,jr as H,ze as I,ge as J,ye as K,X as L,Je as M,Z as N,P as O,j as P,W as Q,Q as R,J as S,Y as T,Nn as U,Ye as V,Rn as W,mt as X,$e as Y,Wn as Z,dt as _,pt as $,gt as aa,yt as ba,bt as ca,xt as da,ot as ea,xi as fa,vi as ga,vt as ha,Tt as ia,Mt as ja,Ti as ka,Mi as la,Di as ma,Et as na,Ei as oa,Si as pa,Pi as qa,wi as ra,Ci as sa,Ii as ta,we as ua,Qe as va,Ie as wa,St as xa,Pt as ya};
1
+ import{h as ae,i as ke,j as Ge}from"./chunk-FSBH4P52.js";import{$a as Ae,M as x,N as ne,P as ie,R as L,S as oe,ma as Oe}from"./chunk-FAMEMKII.js";import{a as u,b as d}from"./chunk-GVHB2OJC.js";import{a as o,f as i,g as h,h as S,i as y}from"./chunk-BYMKRV3A.js";u();function wt(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=o(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}o(wt,"debounce");u();u();var se="[MappedinJS]",et=(a=>(a[a.LOG=0]="LOG",a[a.WARN=1]="WARN",a[a.ERROR=2]="ERROR",a[a.SILENT=3]="SILENT",a))(et||{});function Ot(r){0<=r&&r<=3&&(Fe.logState=r)}o(Ot,"setLoggerLevel");var Fe={logState:d.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(se,...r)},warn(...r){this.logState<=1&&console.warn(se,...r)},error(...r){this.logState<=2&&console.error(se,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)}},ue=Fe;u();u();var le=class le extends Error{};o(le,"InvalidTokenError");var R=le;R.prototype.name="InvalidTokenError";function tt(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}o(tt,"b64DecodeUnicode");function rt(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tt(e)}catch{return atob(e)}}o(rt,"base64UrlDecode");function Ne(r,e){if(typeof r!="string")throw new R("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new R("Invalid token specified: missing part #".concat(t+1));let a;try{a=rt(n)}catch(s){throw new R("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(s.message,")"))}try{return JSON.parse(a)}catch(s){throw new R("Invalid token specified: invalid json for part #".concat(t+1," (").concat(s.message,")"))}}o(Ne,"jwtDecode");u();var _=63710088e-1;function zt(r){var t,n;let e=Ne(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}o(zt,"decodeAccessToken");function O(r){return r*(Math.PI/180)}o(O,"toRadians");function nt(r){return r*(180/Math.PI)}o(nt,"toDegrees");function Wt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}o(Wt,"round");function Re(r,e){return(r%e+e)%e}o(Re,"euclideanModulo");function Jt([r,e],[t,n]){let a=O(n-e),s=O(t-r),l=O(e),c=O(n),m=Math.sin(a/2)*Math.sin(a/2)+Math.sin(s/2)*Math.sin(s/2)*Math.cos(l)*Math.cos(c),p=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));return _*p}o(Jt,"haversineDistance");function qt([r,e],[t,n]){let a=O(e),s=O(r),l=O(n),m=O(t)-s,p=Math.sin(m)*Math.cos(l),g=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(m);return nt((Math.atan2(p,g)+Math.PI*2)%(Math.PI*2))}o(qt,"getForwardBearing");function Yt(r,e){let t=Re(r,Math.PI*2),n=Re(e,Math.PI*2),a=n-t,s=n+(a>Math.PI?-Math.PI*2:a<-Math.PI?Math.PI*2:0);return{start:t,end:s}}o(Yt,"shortestTweenRotation");function it(r){return r instanceof Ae?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}o(it,"isFiniteBox");function $t(r,e,t,n){return(r<e||r>t)&&ue.warn(n),Math.min(t,Math.max(e,r))}o($t,"clampWithWarning");function Kt(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}o(Kt,"arraysEqual");u();var $=class $ extends Error{constructor(t){super(t);i(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,$)}};o($,"AssertionError");var ce=$;function _e(r,e){if(r==null){let t;if(e!=null&&e.customMessage)t=e.customMessage;else{let s=e!=null&&e.valueName?"'".concat(e.valueName,"'"):"value";t="Expected ".concat(s," to be defined, but received ").concat(r)}let n=(e==null?void 0:e.errorClass)||ce,a=new n(t);throw(e==null?void 0:e.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(a,_e),a}}o(_e,"assertExists");function er(r,e,t){if(_e(r),(r==null?void 0:r.type)!==e){let n="Expected type ".concat(e," but got ").concat(r==null?void 0:r.type);throw new Error(t!=null?t:n)}}o(er,"assertType");u();var me=[0,4,6,8,10],v=o(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],me.map((n,a)=>t.slice(n,a===me.length-1?void 0:me[a+1]).join("")).join("-")},"randomId");u();var pe=class pe{constructor(){i(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};o(pe,"PubSub");var de=pe;u();var Be="mi-session-data",Ve="mi-local-data",B,T,M,U=class U{constructor(){S(this,T);S(this,M);try{let e=sessionStorage.getItem(Be);e?y(this,T,JSON.parse(e)):y(this,T,{id:v()})}catch{y(this,T,{id:v()})}try{let e=localStorage.getItem(Ve);e?y(this,M,JSON.parse(e)):y(this,M,{deviceId:v()})}catch{y(this,M,{deviceId:v()})}h(this,T).id||(h(this,T).id=v()),h(this,M).deviceId||(h(this,M).deviceId=v())}static getInstance(){return h(this,B)||y(this,B,new U),h(this,B)}static ___clearInstance(){y(this,B,void 0)}saveSessionData(e,t){h(this,T)[e]=t;try{return sessionStorage.setItem(Be,JSON.stringify(h(this,T))),!0}catch{return!1}}loadSessionData(e){let t=h(this,T)[e];if(t!=null)return t}saveLocalData(e,t){h(this,M)[e]=t;try{return localStorage.setItem(Ve,JSON.stringify(h(this,M))),!0}catch{return!1}}loadLocalData(e){let t=h(this,M)[e];if(t!=null)return t}};B=new WeakMap,T=new WeakMap,M=new WeakMap,o(U,"SafeStorage"),S(U,B);var fe=U;u();function ot(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}o(ot,"normalizeAngle");u();u();u();u();u();u();u();u();var b=63710088e-1,Ue={centimeters:b*100,centimetres:b*100,degrees:b/111325,feet:b*3.28084,inches:b*39.37,kilometers:b/1e3,kilometres:b/1e3,meters:b,metres:b,miles:b/1609.344,millimeters:b*1e3,millimetres:b*1e3,nauticalmiles:b/1852,radians:1,yards:b*1.0936},Pr={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/b,yards:1.0936133};function A(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}o(A,"feature");function at(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!je(r[0])||!je(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return A(n,e,t)}o(at,"point");function wr(r,e,t){t===void 0&&(t={});for(var n=0,a=r;n<a.length;n++){var s=a[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return A(c,e,t)}o(wr,"polygon");function He(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return A(n,e,t)}o(He,"lineString");function Cr(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}o(Cr,"featureCollection");function Ir(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return A(n,e,t)}o(Ir,"multiLineString");function Lr(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return A(n,e,t)}o(Lr,"multiPolygon");function Or(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r*t}o(Or,"radiansToLength");function Ar(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r/t}o(Ar,"lengthToRadians");function kr(r){var e=r%(2*Math.PI);return e*180/Math.PI}o(kr,"radiansToDegrees");function Gr(r){var e=r%360;return e*Math.PI/180}o(Gr,"degreesToRadians");function je(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}o(je,"isNumber");function K(r,e,t){if(r!==null)for(var n,a,s,l,c,m,p,g=0,f=0,w,C=r.type,D=C==="FeatureCollection",G=C==="Feature",te=D?r.features.length:1,F=0;F<te;F++){p=D?r.features[F].geometry:G?r.geometry:r,w=p?p.type==="GeometryCollection":!1,c=w?p.geometries.length:1;for(var re=0;re<c;re++){var E=0,N=0;if(l=w?p.geometries[re]:p,l!==null){m=l.coordinates;var I=l.type;switch(g=t&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(e(m,f,F,E,N)===!1)return!1;f++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<m.length;n++){if(e(m[n],f,F,E,N)===!1)return!1;f++,I==="MultiPoint"&&E++}I==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<m.length;n++){for(a=0;a<m[n].length-g;a++){if(e(m[n][a],f,F,E,N)===!1)return!1;f++}I==="MultiLineString"&&E++,I==="Polygon"&&N++}I==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<m.length;n++){for(N=0,a=0;a<m[n].length;a++){for(s=0;s<m[n][a].length-g;s++){if(e(m[n][a][s],f,F,E,N)===!1)return!1;f++}N++}E++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(K(l.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(K,"coordEach");function Vr(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}o(Vr,"featureEach");function st(r,e){var t,n,a,s,l,c,m,p,g,f,w=0,C=r.type==="FeatureCollection",D=r.type==="Feature",G=C?r.features.length:1;for(t=0;t<G;t++){for(c=C?r.features[t].geometry:D?r.geometry:r,p=C?r.features[t].properties:D?r.properties:{},g=C?r.features[t].bbox:D?r.bbox:void 0,f=C?r.features[t].id:D?r.id:void 0,m=c?c.type==="GeometryCollection":!1,l=m?c.geometries.length:1,a=0;a<l;a++){if(s=m?c.geometries[a]:c,s===null){if(e(null,w,p,g,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,w,p,g,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],w,p,g,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}o(st,"geomEach");function ut(r,e){st(r,function(t,n,a,s,l){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(A(t,a,{bbox:s,id:l}),n,0)===!1?!1:void 0}var m;switch(c){case"MultiPoint":m="Point";break;case"MultiLineString":m="LineString";break;case"MultiPolygon":m="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var g=t.coordinates[p],f={type:m,coordinates:g};if(e(A(f,a),n,p)===!1)return!1}})}o(ut,"flattenEach");function lt(r,e){ut(r,function(t,n,a){var s=0;if(t.geometry){var l=t.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,m=0,p=0,g=0;if(K(t,function(f,w,C,D,G){if(c===void 0||n>m||D>p||G>g){c=f,m=n,p=D,g=G,s=0;return}var te=He([c,f],t.properties);if(e(te,n,a,G,s)===!1)return!1;s++,c=f})===!1)return!1}}})}o(lt,"segmentEach");function jr(r,e,t){var n=t,a=!1;return lt(r,function(s,l,c,m,p){a===!1&&t===void 0?n=s:n=e(n,s,l,c,m,p),a=!0}),n}o(jr,"segmentReduce");function he(r){var e=[1/0,1/0,-1/0,-1/0];return K(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}o(he,"bbox");he.default=he;var ze=he;function We(r){return ze(r)}o(We,"getBoundingBoxFromFeature");u();var ge="#ffffff";var be=class be{constructor(e={}){i(this,"initialColor",ge);i(this,"color",ge);i(this,"initialTopColor");i(this,"topColor");i(this,"topTexture");i(this,"texture");i(this,"hoverColor");i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"width",.1);i(this,"height",.1);i(this,"initialHeight",.1);i(this,"altitude",0);i(this,"join","round");i(this,"cap","round");i(this,"showImage",!0);i(this,"flipImageToFaceCamera",!0);i(this,"url");i(this,"side","double");i(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};o(be,"StyleComponent");var ye=be;var xe=class xe extends Oe{constructor(){super(...arguments);i(this,"type","entityBatchedMesh");i(this,"userData",{entities:{}})}};o(xe,"EntityBatchedMesh");var X=xe,H,z,V,ve=class ve{constructor(e){i(this,"mesh");i(this,"focusMesh");i(this,"imageMesh");i(this,"textMesh");i(this,"textEntityId");i(this,"type","geometry");i(this,"dirty",!0);i(this,"detached",!1);i(this,"instanceIndex",-1);i(this,"geometry");i(this,"material");i(this,"feature");i(this,"currentHeight",.1);i(this,"focusable",!1);i(this,"color",new oe);i(this,"topColor",new oe);i(this,"position",new x);S(this,H,0);S(this,z,1);S(this,V);i(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return h(this,H)}set altitude(e){this.mesh&&(this.mesh.position.z=e,y(this,H,e))}get opacity(){return h(this,z)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}y(this,z,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return h(this,V)?h(this,V):(y(this,V,We(this.feature)),h(this,V))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};H=new WeakMap,z=new WeakMap,V=new WeakMap,o(ve,"MeshComponent");var Je=ve;u();var qe="#ffffff",k,Te=class Te{constructor(e={}){i(this,"color",qe);i(this,"initialColor",qe);i(this,"topColor");i(this,"initialTopColor");i(this,"opacity",1);i(this,"height");S(this,k);i(this,"outline",!0);i(this,"texture");i(this,"topTexture");i(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.initialColor=this.color,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return h(this,k)}set shading(e){var t;if(!e){y(this,k,void 0);return}y(this,k,(t=h(this,k))!=null?t:{start:0,end:0,intensity:0}),Object.assign(h(this,k),e)}};k=new WeakMap,o(Te,"GeometryGroupStyleComponent");var Z=Te;var Me=class Me extends L{constructor(t,n=new Z){super();i(this,"visible",!0);i(this,"type","geometry-group");i(this,"components");i(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let a of this.children)if(!a.userData.detached){t=a;break}return t instanceof X?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};o(Me,"GeometryGroupObject3D");var P=Me;u();var De=class De extends L{};o(De,"Geometry2DObject3D");var j=De,Ee=class Ee{constructor(e,t,n=0){i(this,"id");i(this,"verticalOffset");i(this,"positionDirty",!0);i(this,"occluderId");i(this,"object3d",new j);i(this,"components");i(this,"disposed",!1);i(this,"worldPosition",new x);this.id=e.id||v(),this.components=[e],this.verticalOffset=n,this.object3d=new j,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};o(Ee,"Geometry2D");var W=Ee;u();var Se=class Se extends L{constructor(){super(...arguments);i(this,"type","geometry");i(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(a=>{n.push(a)})}};o(Se,"Geometry3DObject3D");var Q=Se,Pe=class Pe{constructor(e,t){i(this,"id",v());i(this,"components");i(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof P?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof P&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};o(Pe,"Geometry3D");var J=Pe;var q=class q extends L{constructor(t){super();i(this,"childrenIds",new Set);i(this,"children",[]);i(this,"type","group-container");i(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1});i(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof q?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof W?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof P?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof J&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof q?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof W?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof P?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof J&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};o(q,"GroupContainerObject3D");var Y=q;u();var Nn={top:0,bottom:0,left:0,right:0,type:"pixel"},Ye="mappedin";var Rn=250;u();function mt(r){let e=r.min,t=r.max,n=new x(e.x,e.y,e.z),a=new x(t.x,e.y,e.z),s=new x(e.x,t.y,e.z),l=new x(t.x,t.y,e.z);return[n,a,s,l]}o(mt,"getCornersOfBoundingBox");u();function $e(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}o($e,"getGeometryByGeometryId");function Wn(r,e,t=[],n=new ne,a){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=$e(r.getInternalState(),e);return Ke(s,t,n,a),t}o(Wn,"getVerticesOfEntity");var ee=new x;function Ke(r,e=[],t=new ne,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let a=r.geometry;if(a.isBufferGeometry){let s=a.attributes.position;for(let l=0;l<s.count;l++)ee.fromBufferAttribute(s,l),n!==void 0&&(ee.z=n),e.push(ee.clone()),t.expandByPoint(ee)}}for(let a of r.children)Ke(a,e,t,n)}}o(Ke,"traverse");u();function dt(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}o(dt,"getPixelRatio");u();function pt(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=o(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}o(pt,"debounce");u();var ft=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,a=/(iphone|ipod|ipad)/i.test(e),s=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,l=/android/i.test(e);return r={isIpad:s,isMobile:l||a||s,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Xe=ft.getDeviceType,Ze=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let s=r.getContext("webgl")||r.getContext("experimental-webgl");if(!s)return e;try{let l=Xe().isFirefox?null:s.getExtension("WEBGL_debug_renderer_info");return e=l?s.getParameter(l.UNMASKED_RENDERER_WEBGL):s.getParameter(s.RENDERER),e}catch{let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}o(n,"getInfo");function a(){var l,c;if(!Xe().isWindows)return!1;if(t!==void 0)return t;let s=(c=(l=ht())==null?void 0:l.toLowerCase())!=null?c:"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return o(a,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:a,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),ht=Ze.getInfo,gt=Ze.shouldDisableOffscreenCanvas;u();function yt(r,e){let t={};for(let n=0;n<e.length;n++){let a=e[n];a in r&&(t[a]=r[a])}return t}o(yt,"pick");function bt(r){return Object.keys(r).length===0}o(bt,"isEmpty");u();var xt=o(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let a=r[n];e.includes("mappedin")||(r[n]=a)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function xi(r,e,t,n){let a=r*(Math.PI/180),s=n/_,l=r+s*180/Math.PI,c=t/_/Math.cos(a),m=e+c*180/Math.PI;return{lat:l,lon:m}}o(xi,"cartesianToGeographic");function vi(r,e,t,n){let a=t*(Math.PI/180),s=n*(Math.PI/180),l=r*(Math.PI/180),c=e*(Math.PI/180),m=a-l,p=s-c,g=_*p*Math.cos(l),f=_*m;return{x:g,y:f}}o(vi,"geographicToCartesian");var vt=o((r,e)=>{var t;if(r.children&&r.visible)for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((t=n.userData)!=null&&t.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let a of n.userData.entities3D.values())e.add(a)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof Q)&&e.add(n.userData.entityId);vt(n,e)}return e},"populateGeometry3DIdsInScene"),Tt=o((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof j&&e.add(n.userData.entityId),Tt(n,e);return e},"populateGeometry2DIdsInScene");function Mt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Mt(r[t],e[t]):r[t]=e[t]}return r}o(Mt,"mergeObjects");function Ti(r,e,t,n){let a={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new ie,l=new x(a.scale,-a.scale,a.scale),c=new ie().makeTranslation(a.translateX,a.translateY,a.translateZ).scale(l),m=t.elevation;return{id:Ye,type:"custom",renderingMode:"3d",render:o((p,g)=>{if(s.fromArray(g),m!==t.elevation){let f=Ge.fromLngLat(r.toLngLat(),t.elevation);c.makeTranslation(a.translateX,a.translateY,-f.z).scale(l)}e.projectionMatrix=s.multiply(c),m=t.elevation,n()},"render")}}o(Ti,"createCustomLayer");function Dt(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}o(Dt,"fetchToken");async function Mi(r){let e=await Dt(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}o(Mi,"getRequestHeaders");function Di(r,e=0){let t=3735928559^e,n=1103547991^e;for(let a=0,s;a<r.length;a++)s=r.charCodeAt(a),t=Math.imul(t^s,2654435761),n=Math.imul(n^s,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}o(Di,"cyrb53");var Et=o(r=>r,"linearEase");var Ei=o(r=>1-Math.cos(r*Math.PI/2),"easeIn");function Si(r,e,t,n,a,s=Et){r=Math.max(e,Math.min(r,t));let l=(r-Math.min(e,t))/Math.abs(t-e),c=s(l);return n+c*(a-n)}o(Si,"interpolate");function Pi(r,e,t){let n=r*(Math.PI/180)/2,a=e/2;return t*Math.tan(n)/a}o(Pi,"getProjectionScaleFactor");function wi(r){return new ke(new ae(r[0][0],r[0][1]),new ae(r[1][0],r[1][1])).getCenter().toArray()}o(wi,"getBoundingBoxCenter");function Ci(r,e){return r<e||e<=12}o(Ci,"shouldExpandZoomLevel");function Ii(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof Y?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof P&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof Y&&(e=r.parentObject3D.parent.userData.computedOpacity),e}o(Ii,"getGroupContainerOpacity");u();var Ce=class Ce{constructor(e){i(this,"visible");i(this,"altitude");i(this,"color");i(this,"dirty",!0);i(this,"maxWidth");i(this,"maxHeight");i(this,"hoverByPolygon");i(this,"flipToFaceCamera",Qe.flipToFaceCamera);i(this,"font");i(this,"fillOpacity");i(this,"fontSize");i(this,"margin");i(this,"outlineWidth");i(this,"outlineBlur");i(this,"outlineOffsetX");i(this,"strokeColor");i(this,"strokeOpacity");i(this,"strokeWidth");i(this,"hoverColor");i(this,"outlineOffsetY");i(this,"outlineColor");i(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};o(Ce,"Text3DStyleComponent");var we=Ce,Qe=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});u();u();var Le=class Le{constructor(e){i(this,"dirty",!0);i(this,"visible",!0);i(this,"opacity",1);i(this,"verticalOffset",0);i(this,"interactive",!1);i(this,"color");i(this,"material");i(this,"rotation");i(this,"scale");e&&Object.assign(this,e)}};o(Le,"ModelStyleComponnet");var Ie=Le;u();var St=[1,1,1],Pt=[0,0,0];export{se as a,et as b,Ot as c,ue as d,_ as e,zt as f,O as g,Wt as h,Jt as i,qt as j,Yt as k,it as l,$t as m,Kt as n,wt as o,er as p,v as q,de as r,fe as s,A as t,at as u,wr as v,He as w,Cr as x,Ir as y,Lr as z,Or as A,Ar as B,kr as C,Gr as D,K as E,Vr as F,ut as G,jr as H,ze as I,ge as J,ye as K,X as L,Je as M,Z as N,P as O,j as P,W as Q,Q as R,J as S,Y as T,Nn as U,Ye as V,Rn as W,mt as X,$e as Y,Wn as Z,dt as _,pt as $,gt as aa,yt as ba,bt as ca,xt as da,ot as ea,xi as fa,vi as ga,vt as ha,Tt as ia,Mt as ja,Ti as ka,Mi as la,Di as ma,Et as na,Ei as oa,Si as pa,Pi as qa,wi as ra,Ci as sa,Ii as ta,we as ua,Qe as va,Ie as wa,St as xa,Pt as ya};
@@ -337,7 +337,6 @@ declare module '@mappedin/react-sdk/mappedin-js/src' {
337
337
  export type THydrateMapDataBundle = {
338
338
  type: 'binary';
339
339
  options?: {
340
- version?: '2.0.0' | '3.0.0';
341
340
  enterprise?: boolean;
342
341
  };
343
342
  languagePacks?: {
@@ -351,7 +350,6 @@ declare module '@mappedin/react-sdk/mappedin-js/src' {
351
350
  } | {
352
351
  type: 'json';
353
352
  options?: {
354
- version?: '2.0.0' | '3.0.0';
355
353
  enterprise?: boolean;
356
354
  };
357
355
  languagePacks?: {
@@ -4900,11 +4898,6 @@ declare module '@mappedin/react-sdk/packages/mvf-utils/mvf-utils' {
4900
4898
  * @internal
4901
4899
  */
4902
4900
  layoutId?: 'draft';
4903
- /**
4904
- * @hidden
4905
- * @internal
4906
- */
4907
- mvfVersion?: '2.0.0' | '3.0.0';
4908
4901
  };
4909
4902
  /**
4910
4903
  * @interface
@@ -5078,7 +5071,6 @@ declare module '@mappedin/react-sdk/packages/mvf-utils/mvf-utils' {
5078
5071
  * outdoor map. If a map is not a multi-building map, an empty array is returned.
5079
5072
  */
5080
5073
  export const getBuildingIds: (mvf: ParsedMVF) => string[];
5081
- export function unzipAndParseMVFv2(data: Uint8Array, inputVersion?: '2.0.0' | '3.0.0'): Promise<ParsedMVF>;
5082
5074
  }
5083
5075
 
5084
5076
  declare module '@mappedin/react-sdk/packages/mvf-utils/geometry' {
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{k as E,l as V,m as k}from"./chunk-MOOEGGRP.js";import{d as x,q as A}from"./chunk-MZY3INHN.js";import"./chunk-WULPIMBT.js";import"./chunk-VPFGFRS7.js";import"./chunk-2DFVQLLS.js";import{a}from"./chunk-VMPZPJW5.js";import{a as n}from"./chunk-2OY65JNC.js";a();a();import Y,{useCallback as $,useMemo as q}from"react";import{useContext as C,useEffect as T,useRef as S,useState as D}from"react";import{createPortal as B}from"react-dom";a();import{createContext as z,useContext as F}from"react";a();var L=class L extends Error{constructor(t){super("".concat(t," must be used within a MapView component."))}};n(L,"MapViewNullError");var m=L;var p=z({mapData:void 0,mapView:void 0});function G(){let{mapData:e,mapView:t}=F(p);if(!e||!t)throw new m("useMap");return{mapData:e,mapView:t}}n(G,"useMap");a();import{useEffect as U}from"react";function u(e,t){U(()=>{t!=null&&typeof e=="function"&&e(t)},[e,t])}n(u,"useOnLoad");function O(e){let{mapView:t}=C(p),r=S(),[o,i]=D(null);return T(()=>{if(t==null)throw new m("Marker");return r.current=t.Markers.add(e.target,"",{...e.options,dynamicResize:!0}),i(r.current),()=>{t==null||r.current==null||t.Markers.remove(r.current)}},[t,e.target]),T(()=>{o&&(t==null||t.updateState(o,{...e.options}))},[e.options]),u(e.onLoad,o),t==null||o==null?null:B(e.children,o.contentEl,o.id)}n(O,"Marker");function J(e){let{mapView:t}=C(p),[r,o]=D(null),i=S(A()),l=S(e.target),f=$(d=>{var M;o(d),(M=e.onLoad)==null||M.call(e,d)},[e.onLoad]);T(()=>{if(t==null)throw new m("Marker");if(r&&r.target!==e.target){let{duration:d=300,easing:M="linear"}=e;t.Markers.animateTo(r,e.target,{duration:d,easing:M})}},[t,e.target,r]);let c=q(()=>({...e,duration:void 0,easing:void 0}),[e.duration,e.easing]);return Y.createElement(O,{...c,key:i.current,target:l.current,onLoad:f})}n(J,"AnimatedMarker");a();import{useContext as K,useEffect as R,useRef as Q,useState as X}from"react";function Z(e){let{mapView:t}=K(p),r=Q(),[o,i]=X(void 0);return R(()=>{if(t==null)throw new m("Label");return r.current=t.Labels.add(e.target,e.text,e.options),i(r.current),()=>{t==null||r.current==null||t.Labels.remove(r.current)}},[t,e.target]),R(()=>{r.current&&(t==null||t.updateState(r.current,{text:e.text,...e.options}))},[e.text,e.options]),u(e.onLoad,o),null}n(Z,"Label");a();import{useCallback as _,useContext as ee,useEffect as te}from"react";function re(e,t){let{mapView:r}=ee(p),o=_(i=>t(i),[t]);te(()=>{if(r==null)throw new m("useEvent");return r.on(e,o),()=>{r!=null&&r.off(e,o)}},[r,e,t])}n(re,"useEvent");a();import{useContext as ae,useEffect as oe,useRef as ne,useState as ie}from"react";function pe(e){let{mapView:t}=ae(p),r=ne(),[o,i]=ie(void 0);return oe(()=>{if(t==null)throw new m("Path");let l=t.Paths.add(e.coordinate,e.options);return l.animation.then(()=>{var f;(f=e.onDrawComplete)==null||f.call(e)}),i(l),r.current=l,()=>{r.current&&t.Paths.remove(r.current)}},[t,e.coordinate,e.options]),u(e.onLoad,o),null}n(pe,"Path");a();import w,{useCallback as me,useEffect as ue,useMemo as se,useRef as j,useState as W}from"react";var de={width:"100%",height:"100%",position:"relative"};function le(e){let{mapData:t,options:r,style:o,fallback:i,children:l,...f}=e,c=j(!1),[d,M]=W(void 0),[h,P]=W(!0),y=j(null),b=se(()=>r,[]),v=me(()=>{if(t&&(y!=null&&y.current)){if(d)return;V(y.current,t,b).then(g=>{M(g)}).catch(g=>{x.error("Failed to render MapView",g)}).finally(()=>{P(!1)})}},[t,y.current,b]);return ue(()=>{c.current||(c.current=!0,v())},[v]),u(e.onLoad,d),w.createElement(p.Provider,{value:{mapData:t,mapView:d}},w.createElement("div",{"data-testid":"mappedin-map",ref:y,style:{...de,...o},...f}),h?w.createElement(w.Fragment,null,i):l)}n(le,"MapView");a();import{useContext as fe,useEffect as H,useState as ce}from"react";function Me(e){let{mapView:t}=fe(p),[r,o]=ce(!1);return H(()=>{if(t==null)throw new m("Navigation");return t.Navigation.draw(e.directions,e.options).then(()=>{var i;o(!0),(i=e.onDrawComplete)==null||i.call(e)}),()=>{t.Navigation.clear()}},[t,e.directions,e.options]),H(()=>{r!==!1&&typeof e.onLoad=="function"&&e.onLoad()},[e.onLoad,r]),null}n(Me,"Navigation");a();import{useContext as Pe,useEffect as ye,useRef as he,useState as xe}from"react";function we(e){let{mapView:t}=Pe(p),r=he(),[o,i]=xe(void 0);return ye(()=>{if(t==null)throw new Error("MapView not initialized");return r.current=t.Shapes.add(e.geometry,e.style,e.floor),i(r.current),()=>{t==null||r.current==null||t.Shapes.remove(r.current)}},[t,e.geometry,e.style,e.floor]),u(e.onLoad,o),null}n(we,"Shape");a();import{useContext as ge,useEffect as I,useRef as Le,useState as Te}from"react";function Se(e){let{mapView:t}=ge(p),r=Le(),[o,i]=Te(void 0);return I(()=>{if(t==null)throw new m("Model");return r.current=t.Models.add(e.target,e.url,e.options),i(r.current),()=>{t==null||r.current==null||t.Models.remove(r.current)}},[t,e.url]),I(()=>{r.current&&(t==null||t.updateState(r.current,{position:e.target,...e.options}))},[e.options,e.target]),u(e.onLoad,o),null}n(Se,"Model");a();import{useCallback as Ne,useEffect as be,useMemo as ve,useRef as Ae,useState as N}from"react";function Ee(e){let[t,r]=N(void 0),[o,i]=N(!0),[l,f]=N(void 0),c=Ae(0),d=ve(()=>e,[]),M=Ne(()=>{let h=++c.current;i(!0),f(void 0),E(d).then(P=>{c.current===h&&r(P)}).catch(P=>{c.current===h&&(x.error("Failed to fetch MapData",P),f(P))}).finally(()=>{c.current===h&&i(!1)})},[d]);return be(()=>{M()},[M]),{mapData:t,isLoading:o,error:l}}n(Ee,"useMapData");var Xt=k;export{J as AnimatedMarker,Z as Label,le as MapView,O as Marker,Se as Model,Me as Navigation,pe as Path,we as Shape,Xt as default,re as useEvent,G as useMap,Ee as useMapData};
1
+ import{k as E,l as V,m as k}from"./chunk-LQS3FVBN.js";import{d as x,q as A}from"./chunk-VVO7QO3Y.js";import"./chunk-FSBH4P52.js";import"./chunk-OFX4UKYI.js";import"./chunk-FAMEMKII.js";import{a}from"./chunk-GVHB2OJC.js";import{a as n}from"./chunk-BYMKRV3A.js";a();a();import Y,{useCallback as $,useMemo as q}from"react";import{useContext as C,useEffect as T,useRef as S,useState as D}from"react";import{createPortal as B}from"react-dom";a();import{createContext as z,useContext as F}from"react";a();var L=class L extends Error{constructor(t){super("".concat(t," must be used within a MapView component."))}};n(L,"MapViewNullError");var m=L;var p=z({mapData:void 0,mapView:void 0});function G(){let{mapData:e,mapView:t}=F(p);if(!e||!t)throw new m("useMap");return{mapData:e,mapView:t}}n(G,"useMap");a();import{useEffect as U}from"react";function u(e,t){U(()=>{t!=null&&typeof e=="function"&&e(t)},[e,t])}n(u,"useOnLoad");function O(e){let{mapView:t}=C(p),r=S(),[o,i]=D(null);return T(()=>{if(t==null)throw new m("Marker");return r.current=t.Markers.add(e.target,"",{...e.options,dynamicResize:!0}),i(r.current),()=>{t==null||r.current==null||t.Markers.remove(r.current)}},[t,e.target]),T(()=>{o&&(t==null||t.updateState(o,{...e.options}))},[e.options]),u(e.onLoad,o),t==null||o==null?null:B(e.children,o.contentEl,o.id)}n(O,"Marker");function J(e){let{mapView:t}=C(p),[r,o]=D(null),i=S(A()),l=S(e.target),f=$(d=>{var M;o(d),(M=e.onLoad)==null||M.call(e,d)},[e.onLoad]);T(()=>{if(t==null)throw new m("Marker");if(r&&r.target!==e.target){let{duration:d=300,easing:M="linear"}=e;t.Markers.animateTo(r,e.target,{duration:d,easing:M})}},[t,e.target,r]);let c=q(()=>({...e,duration:void 0,easing:void 0}),[e.duration,e.easing]);return Y.createElement(O,{...c,key:i.current,target:l.current,onLoad:f})}n(J,"AnimatedMarker");a();import{useContext as K,useEffect as R,useRef as Q,useState as X}from"react";function Z(e){let{mapView:t}=K(p),r=Q(),[o,i]=X(void 0);return R(()=>{if(t==null)throw new m("Label");return r.current=t.Labels.add(e.target,e.text,e.options),i(r.current),()=>{t==null||r.current==null||t.Labels.remove(r.current)}},[t,e.target]),R(()=>{r.current&&(t==null||t.updateState(r.current,{text:e.text,...e.options}))},[e.text,e.options]),u(e.onLoad,o),null}n(Z,"Label");a();import{useCallback as _,useContext as ee,useEffect as te}from"react";function re(e,t){let{mapView:r}=ee(p),o=_(i=>t(i),[t]);te(()=>{if(r==null)throw new m("useEvent");return r.on(e,o),()=>{r!=null&&r.off(e,o)}},[r,e,t])}n(re,"useEvent");a();import{useContext as ae,useEffect as oe,useRef as ne,useState as ie}from"react";function pe(e){let{mapView:t}=ae(p),r=ne(),[o,i]=ie(void 0);return oe(()=>{if(t==null)throw new m("Path");let l=t.Paths.add(e.coordinate,e.options);return l.animation.then(()=>{var f;(f=e.onDrawComplete)==null||f.call(e)}),i(l),r.current=l,()=>{r.current&&t.Paths.remove(r.current)}},[t,e.coordinate,e.options]),u(e.onLoad,o),null}n(pe,"Path");a();import w,{useCallback as me,useEffect as ue,useMemo as se,useRef as j,useState as W}from"react";var de={width:"100%",height:"100%",position:"relative"};function le(e){let{mapData:t,options:r,style:o,fallback:i,children:l,...f}=e,c=j(!1),[d,M]=W(void 0),[h,P]=W(!0),y=j(null),b=se(()=>r,[]),v=me(()=>{if(t&&(y!=null&&y.current)){if(d)return;V(y.current,t,b).then(g=>{M(g)}).catch(g=>{x.error("Failed to render MapView",g)}).finally(()=>{P(!1)})}},[t,y.current,b]);return ue(()=>{c.current||(c.current=!0,v())},[v]),u(e.onLoad,d),w.createElement(p.Provider,{value:{mapData:t,mapView:d}},w.createElement("div",{"data-testid":"mappedin-map",ref:y,style:{...de,...o},...f}),h?w.createElement(w.Fragment,null,i):l)}n(le,"MapView");a();import{useContext as fe,useEffect as H,useState as ce}from"react";function Me(e){let{mapView:t}=fe(p),[r,o]=ce(!1);return H(()=>{if(t==null)throw new m("Navigation");return t.Navigation.draw(e.directions,e.options).then(()=>{var i;o(!0),(i=e.onDrawComplete)==null||i.call(e)}),()=>{t.Navigation.clear()}},[t,e.directions,e.options]),H(()=>{r!==!1&&typeof e.onLoad=="function"&&e.onLoad()},[e.onLoad,r]),null}n(Me,"Navigation");a();import{useContext as Pe,useEffect as ye,useRef as he,useState as xe}from"react";function we(e){let{mapView:t}=Pe(p),r=he(),[o,i]=xe(void 0);return ye(()=>{if(t==null)throw new Error("MapView not initialized");return r.current=t.Shapes.add(e.geometry,e.style,e.floor),i(r.current),()=>{t==null||r.current==null||t.Shapes.remove(r.current)}},[t,e.geometry,e.style,e.floor]),u(e.onLoad,o),null}n(we,"Shape");a();import{useContext as ge,useEffect as I,useRef as Le,useState as Te}from"react";function Se(e){let{mapView:t}=ge(p),r=Le(),[o,i]=Te(void 0);return I(()=>{if(t==null)throw new m("Model");return r.current=t.Models.add(e.target,e.url,e.options),i(r.current),()=>{t==null||r.current==null||t.Models.remove(r.current)}},[t,e.url]),I(()=>{r.current&&(t==null||t.updateState(r.current,{position:e.target,...e.options}))},[e.options,e.target]),u(e.onLoad,o),null}n(Se,"Model");a();import{useCallback as Ne,useEffect as be,useMemo as ve,useRef as Ae,useState as N}from"react";function Ee(e){let[t,r]=N(void 0),[o,i]=N(!0),[l,f]=N(void 0),c=Ae(0),d=ve(()=>e,[]),M=Ne(()=>{let h=++c.current;i(!0),f(void 0),E(d).then(P=>{c.current===h&&r(P)}).catch(P=>{c.current===h&&(x.error("Failed to fetch MapData",P),f(P))}).finally(()=>{c.current===h&&i(!1)})},[d]);return be(()=>{M()},[M]),{mapData:t,isLoading:o,error:l}}n(Ee,"useMapData");var Xt=k;export{J as AnimatedMarker,Z as Label,le as MapView,O as Marker,Se as Model,Me as Navigation,pe as Path,we as Shape,Xt as default,re as useEvent,G as useMap,Ee as useMapData};