@mappedin/react-sdk 6.0.1-beta.47 → 6.0.1-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +12048 -1731
- package/lib/esm/GLTFExporter-3DFFENGH.js +1 -0
- package/lib/esm/GLTFLoader-LMGM5WIS.js +1 -0
- package/lib/esm/browser-3IFYTMA6.js +1 -0
- package/lib/esm/chunk-DDMRROUJ.js +1 -0
- package/lib/esm/chunk-GSTLKYPH.js +1 -0
- package/lib/esm/chunk-HILRB2WN.js +1 -0
- package/lib/esm/chunk-KAPCGJLB.js +1 -0
- package/lib/esm/chunk-LSBQEE4P.js +1 -0
- package/lib/esm/chunk-U2BLDPFK.js +1 -0
- package/lib/esm/index.d.ts +251 -152
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-RUJ4OCW4.js +1 -0
- package/lib/esm/internal-KCZM4CS6.js +1 -0
- package/lib/esm/outdoor-context-v4-XMQP2LLE.js +1 -0
- package/lib/esm/text3d-7F3YT2BT.js +1 -0
- package/package.json +2 -2
- package/lib/esm/GLTFExporter-7OZO7OAN.js +0 -1
- package/lib/esm/GLTFLoader-BTM3ARCC.js +0 -1
- package/lib/esm/browser-RWOI5BLY.js +0 -1
- package/lib/esm/chunk-3DLWMSMA.js +0 -1
- package/lib/esm/chunk-7WCA75NG.js +0 -1
- package/lib/esm/chunk-MH6J7HN7.js +0 -1
- package/lib/esm/chunk-NS37OT4J.js +0 -1
- package/lib/esm/chunk-OEBM7FFM.js +0 -1
- package/lib/esm/chunk-PEDEW3M6.js +0 -1
- package/lib/esm/chunk-SB6JFH4C.js +0 -1
- package/lib/esm/inspector-WRNBK432.js +0 -1
- package/lib/esm/internal-KFN6TGNE.js +0 -1
- package/lib/esm/outdoor-context-v4-T22T5B5J.js +0 -1
- package/lib/esm/roboto-regular-3HSVPIGX.js +0 -1
- package/lib/esm/text3d-LSJE37UM.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as se,k as ke,l as Ge}from"./chunk-HILRB2WN.js";import{Q as x,R as ie,T as oe,V as O,W as ae,db as Ae,qa as Oe}from"./chunk-GSTLKYPH.js";import{c as i,i as o,j as h,k as I,l as g,q as u,r as d}from"./chunk-U2BLDPFK.js";u();function Ct(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=i(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}i(Ct,"debounce");u();u();var et="[MappedinJS]",tt=(a=>(a[a.LOG=0]="LOG",a[a.WARN=1]="WARN",a[a.ERROR=2]="ERROR",a[a.SILENT=3]="SILENT",a))(tt||{});function rt(r=""){let e="".concat(et).concat(r?"-".concat(r):"");return{logState:d.env.NODE_ENV==="test"?3:0,log(...t){this.logState<=0&&console.log(e,...t)},warn(...t){this.logState<=1&&console.warn(e,...t)},error(...t){this.logState<=2&&console.error(e,...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)},setLevel(t){0<=t&&t<=3&&(this.logState=t)}}}i(rt,"createLogger");var Ne=rt();function kt(r){0<=r&&r<=3&&(Ne.logState=r)}i(kt,"setLoggerLevel");var ue=Ne;u();u();var le=class le extends Error{};i(le,"InvalidTokenError");var R=le;R.prototype.name="InvalidTokenError";function nt(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}))}i(nt,"b64DecodeUnicode");function it(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 nt(e)}catch(t){return atob(e)}}i(it,"base64UrlDecode");function _e(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=it(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,")"))}}i(_e,"jwtDecode");u();var B=63710088e-1;function Yt(r){var t,n;let e=_e(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:{}}}i(Yt,"decodeAccessToken");function A(r){return r*(Math.PI/180)}i(A,"toRadians");function ot(r){return r*(180/Math.PI)}i(ot,"toDegrees");function Kt(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}i(Kt,"round");function Fe(r,e){return(r%e+e)%e}i(Fe,"euclideanModulo");function Jt([r,e],[t,n]){let a=A(n-e),s=A(t-r),l=A(e),c=A(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 B*p}i(Jt,"haversineDistance");function $t([r,e],[t,n]){let a=A(e),s=A(r),l=A(n),m=A(t)-s,p=Math.sin(m)*Math.cos(l),y=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(m);return ot((Math.atan2(p,y)+Math.PI*2)%(Math.PI*2))}i($t,"getForwardBearing");function qt(r,e){let t=Fe(r,Math.PI*2),n=Fe(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}}i(qt,"shortestTweenRotation");function at(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)}i(at,"isFiniteBox");function Xt(r,e,t,n){return(r<e||r>t)&&ue.warn(n),Math.min(t,Math.max(e,r))}i(Xt,"clampWithWarning");function Zt(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}i(Zt,"arraysEqual");u();var X=class X extends Error{constructor(t){super(t);o(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,X)}};i(X,"AssertionError");var ce=X;function Re(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,Re),a}}i(Re,"assertExists");function rr(r,e,t){if(Re(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)}}i(rr,"assertType");u();var me=[0,4,6,8,10],D=i(()=>{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(){o(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={}}};i(pe,"PubSub");var de=pe;u();var Be="mi-session-data",Ve="mi-local-data",H="id",W="deviceId",V,T,v,z=class z{constructor(){I(this,T);I(this,v);try{let e=sessionStorage.getItem(Be);e?g(this,T,JSON.parse(e)):g(this,T,{[H]:D()})}catch(e){g(this,T,{[H]:D()})}try{let e=localStorage.getItem(Ve);e?g(this,v,JSON.parse(e)):g(this,v,{[W]:D()})}catch(e){g(this,v,{[W]:D()})}h(this,T)[H]||(h(this,T)[H]=D()),h(this,v)[W]||(h(this,v)[W]=D())}static getInstance(){return h(this,V)||g(this,V,new z),h(this,V)}static ___clearInstance(){g(this,V,void 0)}saveSessionData(e,t){h(this,T)[e]=t;try{return sessionStorage.setItem(Be,JSON.stringify(h(this,T))),!0}catch(n){return!1}}loadSessionData(e){let t=h(this,T)[e];if(t!=null)return t}saveLocalData(e,t){h(this,v)[e]=t;try{return localStorage.setItem(Ve,JSON.stringify(h(this,v))),!0}catch(n){return!1}}loadLocalData(e){let t=h(this,v)[e];if(t!=null)return t}};V=new WeakMap,T=new WeakMap,v=new WeakMap,i(z,"SafeStorage"),I(z,V);var fe=z;u();function st(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}i(st,"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},Ir={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 C(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}i(C,"feature");function ut(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 C(n,e,t)}i(ut,"point");function Cr(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 C(c,e,t)}i(Cr,"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 C(n,e,t)}i(He,"lineString");function Lr(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}i(Lr,"featureCollection");function Or(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return C(n,e,t)}i(Or,"multiLineString");function Ar(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return C(n,e,t)}i(Ar,"multiPoint");function kr(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return C(n,e,t)}i(kr,"multiPolygon");function Gr(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r*t}i(Gr,"radiansToLength");function Nr(r,e){e===void 0&&(e="kilometers");var t=Ue[e];if(!t)throw new Error(e+" units is invalid");return r/t}i(Nr,"lengthToRadians");function _r(r){var e=r%(2*Math.PI);return e*180/Math.PI}i(_r,"radiansToDegrees");function Fr(r){var e=r%360;return e*Math.PI/180}i(Fr,"degreesToRadians");function je(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}i(je,"isNumber");function Y(r,e,t){if(r!==null)for(var n,a,s,l,c,m,p,y=0,f=0,P,w=r.type,E=w==="FeatureCollection",N=w==="Feature",re=E?r.features.length:1,_=0;_<re;_++){p=E?r.features[_].geometry:N?r.geometry:r,P=p?p.type==="GeometryCollection":!1,c=P?p.geometries.length:1;for(var ne=0;ne<c;ne++){var M=0,F=0;if(l=P?p.geometries[ne]:p,l!==null){m=l.coordinates;var L=l.type;switch(y=t&&(L==="Polygon"||L==="MultiPolygon")?1:0,L){case null:break;case"Point":if(e(m,f,_,M,F)===!1)return!1;f++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<m.length;n++){if(e(m[n],f,_,M,F)===!1)return!1;f++,L==="MultiPoint"&&M++}L==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<m.length;n++){for(a=0;a<m[n].length-y;a++){if(e(m[n][a],f,_,M,F)===!1)return!1;f++}L==="MultiLineString"&&M++,L==="Polygon"&&F++}L==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<m.length;n++){for(F=0,a=0;a<m[n].length;a++){for(s=0;s<m[n][a].length-y;s++){if(e(m[n][a][s],f,_,M,F)===!1)return!1;f++}F++}M++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Y(l.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}i(Y,"coordEach");function Hr(r,e,t,n){var a=t;return Y(r,function(s,l,c,m,p){l===0&&t===void 0?a=s:a=e(a,s,l,c,m,p)},n),a}i(Hr,"coordReduce");function Wr(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++);}i(Wr,"featureEach");function lt(r,e){var t,n,a,s,l,c,m,p,y,f,P=0,w=r.type==="FeatureCollection",E=r.type==="Feature",N=w?r.features.length:1;for(t=0;t<N;t++){for(c=w?r.features[t].geometry:E?r.geometry:r,p=w?r.features[t].properties:E?r.properties:{},y=w?r.features[t].bbox:E?r.bbox:void 0,f=w?r.features[t].id:E?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,P,p,y,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,P,p,y,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],P,p,y,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}P++}}i(lt,"geomEach");function ct(r,e){lt(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(C(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 y=t.coordinates[p],f={type:m,coordinates:y};if(e(C(f,a),n,p)===!1)return!1}})}i(ct,"flattenEach");function mt(r,e){ct(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,y=0;if(Y(t,function(f,P,w,E,N){if(c===void 0||n>m||E>p||N>y){c=f,m=n,p=E,y=N,s=0;return}var re=He([c,f],t.properties);if(e(re,n,a,N,s)===!1)return!1;s++,c=f})===!1)return!1}}})}i(mt,"segmentEach");function zr(r,e,t){var n=t,a=!1;return mt(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}i(zr,"segmentReduce");function he(r){var e=[1/0,1/0,-1/0,-1/0];return Y(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}i(he,"bbox");he.default=he;var We=he;function ze(r){return We(r)}i(ze,"getBoundingBoxFromFeature");u();var ye="#ffffff";var be=class be{constructor(e={}){o(this,"initialColor",ye);o(this,"color",ye);o(this,"initialTopColor");o(this,"topColor");o(this,"topTexture");o(this,"texture");o(this,"hoverColor");o(this,"dirty",!0);o(this,"visible",!0);o(this,"opacity",1);o(this,"width",.1);o(this,"height",.1);o(this,"initialHeight",.1);o(this,"altitude",0);o(this,"join","round");o(this,"cap","round");o(this,"showImage",!0);o(this,"flipImageToFaceCamera",!0);o(this,"url");o(this,"side","double");o(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}};i(be,"StyleComponent");var ge=be;var xe=class xe extends Oe{constructor(){super(...arguments);o(this,"type","entityBatchedMesh");o(this,"userData",{entities:{}})}};i(xe,"EntityBatchedMesh");var Z=xe,K,j,De=class De{constructor(e){o(this,"mesh");o(this,"focusMesh");o(this,"imageMesh");o(this,"textMesh");o(this,"textEntityId");o(this,"type","geometry");o(this,"dirty",!0);o(this,"detached",!1);o(this,"instanceIndex",-1);o(this,"geometry");o(this,"material");o(this,"feature");o(this,"currentHeight",.1);o(this,"focusable",!1);o(this,"color",new ae);o(this,"topColor",new ae);o(this,"position",new x);o(this,"altitude",0);I(this,K,1);I(this,j);o(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 opacity(){return h(this,K)}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}g(this,K,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,j)?h(this,j):(g(this,j,ze(this.feature)),h(this,j))}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)}};K=new WeakMap,j=new WeakMap,i(De,"MeshComponent");var Ye=De;u();var Ke="#ffffff",k,Te=class Te{constructor(e={}){o(this,"color",Ke);o(this,"initialColor",Ke);o(this,"topColor");o(this,"initialTopColor");o(this,"opacity",1);o(this,"height");I(this,k);o(this,"outline",!0);o(this,"texture");o(this,"topTexture");o(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){g(this,k,void 0);return}g(this,k,(t=h(this,k))!=null?t:{start:0,end:0,intensity:0}),Object.assign(h(this,k),e)}};k=new WeakMap,i(Te,"GeometryGroupStyleComponent");var Q=Te;var ve=class ve extends O{constructor(t,n=new Q){super();o(this,"visible",!0);o(this,"type","geometry-group");o(this,"components");o(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 Z?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}};i(ve,"GeometryGroupObject3D");var S=ve;u();var Ee=class Ee extends O{};i(Ee,"Geometry2DObject3D");var G=Ee,Me=class Me{constructor(e,t,n=0){o(this,"id");o(this,"verticalOffset");o(this,"occluderId");o(this,"object3d",new G);o(this,"components");o(this,"disposed",!1);o(this,"worldPosition",new x);this.id=e.id||D(),this.components=[e],this.verticalOffset=n,this.object3d=new G,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};i(Me,"Geometry2D");var J=Me;u();var Se=class Se extends O{constructor(){super(...arguments);o(this,"type","geometry");o(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)})}};i(Se,"Geometry3DObject3D");var ee=Se,Pe=class Pe{constructor(e,t){o(this,"id",D());o(this,"components");o(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 S?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof S&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};i(Pe,"Geometry3D");var $=Pe;var U=class U extends O{constructor(t){super();o(this,"childrenIds",new Set);o(this,"children",[]);o(this,"type","group-container");o(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});o(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 U?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof J?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof S?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof $&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof U?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof J?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof S?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof $&&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}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(t=>{t instanceof G?t.userData.worldPositionDirty=!0:t instanceof U&&t.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};i(U,"GroupContainerObject3D");var q=U;u();var Vn={top:0,bottom:0,left:0,right:0,type:"pixel"},Je="mappedin";var jn={ALWAYS_ON_TOP:10},Un=250;u();function pt(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]}i(pt,"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}i($e,"getGeometryByGeometryId");function qn(r,e,t=[],n=new ie,a){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let s=$e(r.getInternalState(),e);return qe(s,t,n,a),t}i(qn,"getVerticesOfEntity");var te=new x;function qe(r,e=[],t=new ie,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++)te.fromBufferAttribute(s,l),n!==void 0&&(te.z=n),e.push(te.clone()),t.expandByPoint(te)}}for(let a of r.children)qe(a,e,t,n)}}i(qe,"traverse");u();function ft(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}i(ft,"getPixelRatio");u();function ht(r,e,t=!1){let n=null,a=0;return function(...s){a++,a===1&&t===!0&&r(...s);let l=i(()=>{(!t||a>1)&&r(...s),n=null,a=0},"later");clearTimeout(n),n=setTimeout(l,e)}}i(ht,"debounce");u();var yt=(()=>{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=yt.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(l){let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}i(n,"getInfo");function a(){var l,c;if(!Xe().isWindows)return!1;if(t!==void 0)return t;let s=(c=(l=gt())==null?void 0:l.toLowerCase())!=null?c:"";return t=s.includes("intel")&&(s.includes("uhd")||s.includes("iris")),t}return i(a,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:a,_setCanvas(s){r=s,e=void 0,t=void 0}}})(),gt=Ze.getInfo,bt=Ze.shouldDisableOffscreenCanvas;u();function xt(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}i(xt,"pick");function Dt(r){return Object.keys(r).length===0}i(Dt,"isEmpty");u();var Tt=i(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 Mi(r,e,t,n){let a=r*(Math.PI/180),s=n/B,l=r+s*180/Math.PI,c=t/B/Math.cos(a),m=e+c*180/Math.PI;return{lat:l,lon:m}}i(Mi,"cartesianToGeographic");function Si(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,y=B*p*Math.cos(l),f=B*m;return{x:y,y:f}}i(Si,"geographicToCartesian");var vt=i((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 ee)&&e.add(n.userData.entityId);vt(n,e)}return e},"populateGeometry3DIdsInScene"),Et=i((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 G&&e.add(n.userData.entityId),Et(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}i(Mt,"mergeObjects");function Pi(r,e,t,n){let a={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},s=new oe,l=new x(a.scale,-a.scale,a.scale),c=new oe().makeTranslation(a.translateX,a.translateY,a.translateZ).scale(l),m=t.elevation;return{id:Je,type:"custom",renderingMode:"3d",render:i((p,y)=>{if(s.fromArray(y),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")}}i(Pi,"createCustomLayer");function St(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}i(St,"fetchToken");async function wi(r){let e=await St(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}i(wi,"getRequestHeaders");function Ii(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)}i(Ii,"cyrb53");var Pt=i(r=>r,"linearEase");var Ci=i(r=>1-Math.cos(r*Math.PI/2),"easeIn");function Li(r,e,t,n,a,s=Pt){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)}i(Li,"interpolate");function Oi(r,e,t){let n=r*(Math.PI/180)/2,a=e/2;return t*Math.tan(n)/a}i(Oi,"getProjectionScaleFactor");function Ai(r){return new ke(new se(r[0][0],r[0][1]),new se(r[1][0],r[1][1])).getCenter().toArray()}i(Ai,"getBoundingBoxCenter");function ki(r,e){return r<e||e<=12}i(ki,"shouldExpandZoomLevel");function Gi(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof q?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof S&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof q&&(e=r.parentObject3D.parent.userData.computedOpacity),e}i(Gi,"getGroupContainerOpacity");u();var Ie=class Ie{constructor(e){o(this,"visible");o(this,"altitude");o(this,"color");o(this,"dirty",!0);o(this,"maxWidth");o(this,"maxHeight");o(this,"hoverByPolygon");o(this,"flipToFaceCamera",Qe.flipToFaceCamera);o(this,"font");o(this,"fillOpacity");o(this,"fontSize");o(this,"margin");o(this,"outlineWidth");o(this,"outlineBlur");o(this,"outlineOffsetX");o(this,"strokeColor");o(this,"strokeOpacity");o(this,"strokeWidth");o(this,"hoverColor");o(this,"outlineOffsetY");o(this,"outlineColor");o(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}};i(Ie,"Text3DStyleComponent");var we=Ie,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){o(this,"dirty",!0);o(this,"visible",!0);o(this,"opacity",1);o(this,"verticalOffset",0);o(this,"interactive",!1);o(this,"color");o(this,"material");o(this,"rotation");o(this,"scale");e&&Object.assign(this,e)}};i(Le,"ModelStyleComponnet");var Ce=Le;u();var wt=[1,1,1],It=[0,0,0];export{et as a,tt as b,kt as c,ue as d,B as e,Yt as f,A as g,Kt as h,Jt as i,$t as j,qt as k,at as l,Xt as m,Zt as n,Ct as o,rr as p,D as q,de as r,fe as s,C as t,ut as u,Cr as v,He as w,Lr as x,Or as y,Ar as z,kr as A,Gr as B,Nr as C,_r as D,Fr as E,Y as F,Hr as G,Wr as H,ct as I,zr as J,We as K,ye as L,ge as M,Z as N,Ye as O,Q as P,S as Q,G as R,J as S,ee as T,$ as U,q as V,Vn as W,Je as X,jn as Y,Un as Z,pt as _,$e as $,qn as aa,ft as ba,ht as ca,bt as da,xt as ea,Dt as fa,Tt as ga,st as ha,Mi as ia,Si as ja,vt as ka,Et as la,Mt as ma,Pi as na,wi as oa,Ii as pa,Pt as qa,Ci as ra,Li as sa,Oi as ta,Ai as ua,ki as va,Gi as wa,we as xa,Qe as ya,Ce as za,wt as Aa,It as Ba};
|