@mappedin/mappedin-js 6.17.0 → 6.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-WJIVKLX5.js → GLTFExporter-CXO2YAF3.js} +1 -1
- package/lib/esm/{GLTFLoader-UVI44S2F.js → GLTFLoader-I7TPEHSY.js} +1 -1
- package/lib/esm/{chunk-VBXAQAZN.js → chunk-43W5ISDI.js} +1 -1
- package/lib/esm/{chunk-QV35JDEX.js → chunk-72VREA6L.js} +1 -1
- package/lib/esm/{chunk-I6I3EXJN.js → chunk-PCYD3VDS.js} +1 -1
- package/lib/esm/{chunk-QYWRASNF.js → chunk-PUC4BMPX.js} +1 -1
- package/lib/esm/{chunk-DWA5ATYZ.js → chunk-RTTZ7LHQ.js} +1 -1
- package/lib/esm/index.d.ts +16 -16
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-47NR3USD.js → inspector-AQXLD4YL.js} +1 -1
- package/lib/esm/{internal-HBF7XZ6U.js → internal-7BZS3RBF.js} +1 -1
- package/lib/esm/{src-QBZJI5BR.js → src-YUNUBHAQ.js} +1 -1
- package/lib/esm/{text3d-I6QPYM5K.js → text3d-Z7SSD7IN.js} +1 -1
- package/package.json +1 -1
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mappedin_mvf_v22 from "@mappedin/mvf-v2";
|
|
2
2
|
import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, BaseTextAreaProperties, Category, CategoryId, Connection as Connection$1, Details, EnterpriseCategory as EnterpriseCategory$1, EnterpriseCategoryId, EnterpriseLocation as EnterpriseLocation$1, EnterpriseLocationId, EnterpriseLocationInstance, EnterpriseTexture, EnterpriseVenue as EnterpriseVenue$1, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as Facade$1, Feature as Feature$1, FeatureCollection as FeatureCollection$1, FloatingFloorTextProperties, FloorCollection, FloorId, FloorProperties, FloorStack as FloorStack$1, FloorTextCommonProperties, Geometry as Geometry$1, Hyperlink as Hyperlink$1, Image, Language, LineStringStyle, LineStringStyle as TMVFLineStringStyle, Location, LocationId, LocationLink, LocationSocial, LocationSocial as LocationSocial$1, LocationState, LocationState as LocationState$1, MVFv2_STANDARD_MVFv3, MultiPolygon as MultiPolygon$1, NavigationFlagDeclarations, NodeCollection, NodeId, ObstructionCollection, ObstructionCollection as ObstructionCollection$1, ObstructionFeature, ObstructionId, OpeningHoursSpecification, OperationHours, OperationHours as OperationHours$1, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, Point as Point$1, PointStyle, PointStyle as TMVFPointStyle, Polygon as Polygon$1, PolygonStyle, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SiblingGroup as SiblingGroup$1, SpaceCollection, SpaceCollection as SpaceCollection$1, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection, StyleCollection as TMVFStyleCollection, TilesetStyle } from "@mappedin/mvf-v2";
|
|
3
3
|
import { MVFv2_STANDARD_MVFv3 as MVFv2_STANDARD_MVFv3$1, ParsedMVF as ParsedMVF$1, RawMVF } from "@mappedin/mvf-v2/no-validator-lite";
|
|
4
4
|
import * as _mappedin_renderer_three0 from "@mappedin/renderer-three";
|
|
@@ -12013,8 +12013,8 @@ declare class Area extends DetailedMapData<AreaCollection['features'][number]> i
|
|
|
12013
12013
|
*/
|
|
12014
12014
|
get geoJSON(): {
|
|
12015
12015
|
properties: null;
|
|
12016
|
-
type:
|
|
12017
|
-
geometry:
|
|
12016
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12017
|
+
geometry: _mappedin_mvf_v22.Polygon;
|
|
12018
12018
|
};
|
|
12019
12019
|
/** @internal */
|
|
12020
12020
|
get focusTarget(): this;
|
|
@@ -12116,8 +12116,8 @@ declare class Door extends DetailedMapData<EntranceFeature> implements IGeoJSOND
|
|
|
12116
12116
|
*/
|
|
12117
12117
|
get geoJSON(): {
|
|
12118
12118
|
properties: null;
|
|
12119
|
-
type:
|
|
12120
|
-
geometry:
|
|
12119
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12120
|
+
geometry: _mappedin_mvf_v22.LineString;
|
|
12121
12121
|
};
|
|
12122
12122
|
/** @internal */
|
|
12123
12123
|
get focusTarget(): Coordinate;
|
|
@@ -12253,8 +12253,8 @@ declare class Space extends DetailedMapData<SpaceFeature> implements IGeoJSONDat
|
|
|
12253
12253
|
*/
|
|
12254
12254
|
get geoJSON(): {
|
|
12255
12255
|
properties: null;
|
|
12256
|
-
type:
|
|
12257
|
-
geometry:
|
|
12256
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12257
|
+
geometry: _mappedin_mvf_v22.Point | _mappedin_mvf_v22.Polygon | _mappedin_mvf_v22.LineString;
|
|
12258
12258
|
};
|
|
12259
12259
|
/** @internal */
|
|
12260
12260
|
get focusTarget(): this | Coordinate;
|
|
@@ -12340,7 +12340,7 @@ declare class PointOfInterest extends DetailedMapData<FeatureCollection$1<Point$
|
|
|
12340
12340
|
*/
|
|
12341
12341
|
get geoJSON(): {
|
|
12342
12342
|
properties: null;
|
|
12343
|
-
type:
|
|
12343
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12344
12344
|
geometry: Point$1;
|
|
12345
12345
|
};
|
|
12346
12346
|
/**
|
|
@@ -12454,8 +12454,8 @@ declare class Annotation extends DetailedMapData<AnnotationCollection['features'
|
|
|
12454
12454
|
*/
|
|
12455
12455
|
get geoJSON(): {
|
|
12456
12456
|
properties: null;
|
|
12457
|
-
type:
|
|
12458
|
-
geometry:
|
|
12457
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12458
|
+
geometry: _mappedin_mvf_v22.Point;
|
|
12459
12459
|
};
|
|
12460
12460
|
/** @internal */
|
|
12461
12461
|
get focusTarget(): Coordinate;
|
|
@@ -12671,8 +12671,8 @@ declare class MapObject extends DetailedMapData<ObstructionFeature> implements I
|
|
|
12671
12671
|
*/
|
|
12672
12672
|
get geoJSON(): {
|
|
12673
12673
|
properties: null;
|
|
12674
|
-
type:
|
|
12675
|
-
geometry:
|
|
12674
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12675
|
+
geometry: _mappedin_mvf_v22.Polygon | _mappedin_mvf_v22.LineString;
|
|
12676
12676
|
};
|
|
12677
12677
|
/** @internal */
|
|
12678
12678
|
get anchorTarget(): Coordinate;
|
|
@@ -12985,8 +12985,8 @@ declare class Node extends BaseMetaData implements IGeoJSONData, IFocusable, IAn
|
|
|
12985
12985
|
*/
|
|
12986
12986
|
get geoJSON(): {
|
|
12987
12987
|
properties: null;
|
|
12988
|
-
type:
|
|
12989
|
-
geometry:
|
|
12988
|
+
type: _mappedin_mvf_v22.FeatureType;
|
|
12989
|
+
geometry: _mappedin_mvf_v22.Point;
|
|
12990
12990
|
};
|
|
12991
12991
|
/** @internal */
|
|
12992
12992
|
get focusTarget(): Coordinate;
|
|
@@ -13424,7 +13424,7 @@ declare class EnterpriseLocation extends BaseMetaData implements Omit<Enterprise
|
|
|
13424
13424
|
parentId?: string;
|
|
13425
13425
|
});
|
|
13426
13426
|
/** @internal */
|
|
13427
|
-
get focusTarget():
|
|
13427
|
+
get focusTarget(): Space[] | Coordinate[];
|
|
13428
13428
|
/** @internal */
|
|
13429
13429
|
get navigationTarget(): Space[];
|
|
13430
13430
|
/**
|
|
@@ -15018,7 +15018,7 @@ declare class MapData {
|
|
|
15018
15018
|
* console.log(`Current language: ${language.name} (${language.code})`);
|
|
15019
15019
|
* ```
|
|
15020
15020
|
*/
|
|
15021
|
-
get currentLanguage():
|
|
15021
|
+
get currentLanguage(): _mappedin_mvf_v22.Language | undefined;
|
|
15022
15022
|
/**
|
|
15023
15023
|
* Gets the natural bearing of the map.
|
|
15024
15024
|
*
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as C,B as D,C as E,D as F,E as J,F as K,I as L,J as N,K as O,L as P,M as Q,N as R,O as S,P as T,Q as U,R as V,S as W,T as X,U as Y,V as Z,W as _,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-
|
|
1
|
+
import{A as C,B as D,C as E,D as F,E as J,F as K,I as L,J as N,K as O,L as P,M as Q,N as R,O as S,P as T,Q as U,R as V,S as W,T as X,U as Y,V as Z,W as _,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-PCYD3VDS.js";import{y as M}from"./chunk-72VREA6L.js";import{L as G,U as H,a,bb as I,c as b}from"./chunk-RTTZ7LHQ.js";import"./chunk-43W5ISDI.js";import"./chunk-PUC4BMPX.js";import"./chunk-IGHVNMJ3.js";export{y as ACTION_TYPE,G as ANIMATION_TWEENS,p as Annotation,i as Area,z as BEARING_TYPE,A as CONNECTION_TYPE,m as Connection,c as Coordinate,C as DOORS,g as DetailedMapData,D as Directions,j as Door,a as E_SDK_LOG_LEVEL,t as EnterpriseCategory,s as EnterpriseLocation,u as EnterpriseVenue,r as Facade,l as Floor,q as FloorStack,e as Hyperlink,f as ImageMetaData,F as LocationCategory,E as LocationProfile,h as MAPPEDIN_COLORS,n as MapObject,N as MapView,d as Node,o as PointOfInterest,k as Space,B as WALLS,M as __INTERNAL__MapLibreOverlay,Q as __setWatermarkOnClickFn,X as checkWorkerUrls,K as disableText3DWorker,H as enableTestMode,P as findPreferredLanguageInVenue,T as forceEnterpriseLocations,V as getMapData,W as getMapDataEnterprise,J as getMultiFloorState,Z as getVersion,O as hydrateMapData,R as hydrateMapDataFromMVF,v as parseMVF,I as preloadFont,b as setLoggerLevel,S as setUseEnterpriseAPI,L as setWorkersUrl,U as shouldForceEnterpriseLocations,Y as show3dMap,_ as show3dMapGeojson,x as unzipAndParseMVFv2,w as unzipMVF};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as J,H as re,i as B,q as I,r as H}from"./chunk-I6I3EXJN.js";import"./chunk-QV35JDEX.js";import{i as D}from"./chunk-DWA5ATYZ.js";import"./chunk-VBXAQAZN.js";import{a as v}from"./chunk-QYWRASNF.js";import{a as $,b as z,h as S}from"./chunk-IGHVNMJ3.js";v();v();v();v();var L=class n{constructor(e,i,t,o,s="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id="lil-gui-name-".concat(++n.nextNameID),this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},X=class extends L{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function W(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var Ae={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:W,toHexString:W},F={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},we={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=F.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return F.toHexString(o)}},_e={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=F.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return F.toHexString(o)}},Ee=[Ae,F,we,_e];function ke(n){return Ee.find(e=>e.match(n))}var K=class extends L{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=ke(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=W(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},T=class extends L{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Z=class extends L{constructor(e,i,t,o,s,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(s);let r=l!==void 0;this.step(r?l:this._getImplicitStep(),r),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},s=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,r,c,p,d,a,h=5,u=b=>{r=b.clientX,c=p=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",f),window.addEventListener("mouseup",m)},f=b=>{if(l){let C=b.clientX-r,M=b.clientY-c;Math.abs(M)>h?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>h&&m()}if(!l){let C=b.clientY-p;a-=C*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}p=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},g=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",u),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",g)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(g,b,C,M,_)=>(g-b)/(C-b)*(_-M)+M,i=g=>{let b=this.$slider.getBoundingClientRect(),C=e(g,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=g=>{this._setDraggingStyle(!0),i(g.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",s)},o=g=>{i(g.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",s)},l=!1,r,c,p=g=>{g.preventDefault(),this._setDraggingStyle(!0),i(g.touches[0].clientX),l=!1},d=g=>{g.touches.length>1||(this._hasScrollBar?(r=g.touches[0].clientX,c=g.touches[0].clientY,l=!0):p(g),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",h))},a=g=>{if(l){let b=g.touches[0].clientX-r,C=g.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?p(g):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h))}else g.preventDefault(),i(g.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h)},u=this._callOnFinishChange.bind(this),f=400,m,y=g=>{if(Math.abs(g.deltaX)<Math.abs(g.deltaY)&&this._hasScrollBar)return;g.preventDefault();let C=this._normalizeMouseWheel(g)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(u,f)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-".concat(i),e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},Q=class extends L{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},q=class extends L{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Me='.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "\u2195";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "\u25BE";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "\u25B8";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "\u2713";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}';function Le(n){let e=document.createElement("style");e.innerHTML=n;let i=document.querySelector("head link[rel=stylesheet], head style");i?document.head.insertBefore(e,i):document.head.appendChild(e)}var se=!1,ee=class n{constructor({parent:e,autoPlace:i=e===void 0,container:t,width:o,title:s="Controls",closeFolders:l=!1,injectStyles:r=!0,touchStyles:c=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),c&&this.domElement.classList.add("allow-touch-styles"),!se&&r&&(Le(Me),se=!0),t?t.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),o&&this.domElement.style.setProperty("--width",o+"px"),this._closeFolders=l}add(e,i,t,o,s){if(Object(t)===t)return new Q(this,e,i,t);let l=e[i];switch(typeof l){case"number":return new Z(this,e,i,t,o,s);case"boolean":return new X(this,e,i);case"string":return new q(this,e,i);case"function":return new T(this,e,i)}console.error("gui.add failed\n property:",i,"\n object:",e,"\n value:",l)}addColor(e,i,t=1){return new K(this,e,i,t)}addFolder(e){let i=new n({parent:this,title:e});return this.root._closeFolders&&i.close(),i}load(e,i=!0){return e.controllers&&this.controllers.forEach(t=>{t instanceof T||t._name in e.controllers&&t.load(e.controllers[t._name])}),i&&e.folders&&this.folders.forEach(t=>{t._title in e.folders&&t.load(e.folders[t._title])}),this}save(e=!0){let i={controllers:{},folders:{}};return this.controllers.forEach(t=>{if(!(t instanceof T)){if(t._name in i.controllers)throw new Error('Cannot save GUI with duplicate property "'.concat(t._name,'"'));i.controllers[t._name]=t.save()}}),e&&this.folders.forEach(t=>{if(t._title in i.folders)throw new Error('Cannot save GUI with duplicate folder "'.concat(t._title,'"'));i.folders[t._title]=t.save()}),i}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let i=this.$children.clientHeight;this.$children.style.height=i+"px",this.domElement.classList.add("transition");let t=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",t))};this.$children.addEventListener("transitionend",t);let o=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=o+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(t=>t.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(i=>{e=e.concat(i.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(i=>{e=e.concat(i.foldersRecursive())}),e}},U=ee;v();v();var E=(()=>{let n=null;return function(i){if(!n){let t=document.createElement("canvas");t.width=1,t.height=1,n=t.getContext("2d")}return n.fillStyle=i,n.fillStyle}})();function ae(n){let e;for(e of n)e()}var $e=["interactive"];function G(n,e,i){let t={id:e.id,__type:e.__type},o=i.addFolder("".concat(e.type,"-").concat(e.id));for(let s in e){if(s==="visible"&&o.add(e,s).onChange(l=>{n.updateState(t,{[s]:l})}),s==="color"||s==="hoverColor"){e[s]=E(e[s]),o.addColor(e,s).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="height"){o.add(e,s,0,20,1).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="texture"&&e.texture){o.addFolder("Texture - side").add(e.texture,"url").onChange(r=>{n.updateState(t,{texture:{url:r}})});continue}if(s==="topTexture"&&e.topTexture){o.addFolder("Texture - top").add(e.topTexture,"url").onChange(r=>{n.updateState(t,{topTexture:{url:r}})});continue}if(s==="opacity"){o.add(e,s,0,1,.1).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="altitude"){o.add(e,s,0,100,1).onChange(l=>{n.updateState(t,{[s]:l})});continue}$e.includes(s)&&o.add(e,s).onChange(l=>{n.updateState(t,{[s]:l})})}return e.isInView&&(o.add(e,"isInView").listen().disable(),o.add(e,"isInViewCheck")),{cleanup(){o.destroy()}}}v();v();function Se(){let n=[];function e(o,s){var c;let l=Object.values(o.getMapData())[0],r=s;if(r&&B.is(r)){let p=(c=l.getByType("enterprise-location"))==null?void 0:c.find(d=>d.spaces.some(a=>a.id===r.id));p&&(r=p)}return r}async function i(o,s){return s instanceof H?o.Camera.focusOn(s.locations.flatMap(l=>l.spaces),O):s instanceof I?o.Camera.focusOn(s.spaces,O):o.Camera.focusOn(s,O)}function t(o,s,{focus:l=!1}={}){if(!window.enableHighlightCard)return()=>{};let r=e(o,s),c=document.createElement("div");if(c.style.cssText="\n position: absolute;\n top: 20px;\n left: 20px;\n background-color: rgba(30, 30, 30, 0.95);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n border-radius: 12px;\n padding: 24px;\n max-width: 320px;\n z-index: 1000;\n font-family: 'Arial', sans-serif;\n transition: all 0.3s ease;\n color: #e0e0e0;\n ","name"in r){let d=document.createElement("h3");d.textContent=r.name,d.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",c.appendChild(d)}if(r instanceof I){if(r.description){let d=document.createElement("p");d.textContent=r.description,d.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",c.appendChild(d)}if(r.tags&&r.tags.length>0){let d=document.createElement("div");d.style.cssText="\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n margin-bottom: 16px;\n overflow-x: hidden;\n max-height: 30px; /* Adjust this value based on your font size and padding */\n ",r.tags.forEach(a=>{let h=document.createElement("span");h.textContent=a,h.style.cssText="\n background-color: #3a3a3a;\n color: #e0e0e0;\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n white-space: nowrap;\n ",d.appendChild(h)}),c.appendChild(d)}}let p;if(!(s instanceof H)){let d=new U({autoPlace:!1});d.domElement.style.cssText="\n position: relative;\n overflow-y: auto;\n margin-top: 16px;\n border-top: 1px solid #444;\n padding-top: 16px;\n ";let a=o.getState(s);a&&(G(o,$({id:s.id},a),d),c.appendChild(d.domElement)),p=d}return document.body.appendChild(c),l&&i(o,r),()=>{c.style.opacity="0",c.style.transform="translateY(-10px)",setTimeout(()=>c.remove(),300),p==null||p.destroy()}}return{highlightCard:t,highlight:(o,s,{focus:l=!0}={})=>{n.length>0&&n.forEach(c=>o.Markers.remove(c));let r=e(o,s);if(r instanceof I)l&&o.Camera.focusOn(r.spaces,O),n.push(...r.spaces.map(c=>o.Markers.add(c,'<div style="padding: 15px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 250px; position: relative;">\n <h3 style="margin: 0 0 10px; color: #333; font-size: 16px; font-weight: 600;">'.concat(r.name,"</h3>\n ").concat(r.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(r.description,"</p>"):"","\n ").concat(r.tags?r.tags.map(p=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(p,"</span>")).join(" "):"",'\n <div style="position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ffffff;"></div>\n </div>'),{rank:"always-visible",placement:"top"})));else if(r instanceof H){l&&o.Camera.focusOn(r.locations.flatMap(d=>d.spaces),O);let c=new Map,p=new Set;r.locations.forEach(d=>{c.has(d.name)||(d.spaces.forEach(a=>{n.push(o.Markers.add(a,'<div style="padding: 12px; background-color: rgba(0, 153, 51, 0.95); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transform: translateY(-4px); transition: all 0.3s ease;">\n <span style="font-weight: 600; color: #FFFFFF; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">'.concat(d.name,"</span>\n </div>"),{rank:"always-visible"}))}),c.set(d.name,!0))}),r.locations.forEach(d=>{d.coordinates.forEach(a=>{let h="".concat(a.latitude,",").concat(a.longitude);if(!p.has(h)&&!c.has(d.name)){let u=o.Markers.add(a,'<div style="padding: 10px; background-color: rgba(51, 102, 204, 0.9); border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);">\n <span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">'.concat(d.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});p.add(h),n.push(u)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var O={duration:300,easing:"ease-in-out"},R=Se();v();var w={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function Ie(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function le(n,e,i){var d;let t=new D,o=i.addFolder("Search");o.open();let s=o.add(w,"search").onChange(async a=>{let h=await e.Search.query(a,w.options);h&&(w.results=h,r(h,t))}),l=document.createElement("div");l.style.marginLeft="10px",(d=s.domElement.parentElement)==null||d.appendChild(l);let{renderSearch:r,close:c}=De(n,e,l,s.$input),p=o.addFolder("Advanced");return p.close(),Ie(p),document.addEventListener("keydown",a=>{(a.metaKey||a.ctrlKey)&&a.key==="k"?(a.preventDefault(),o._closed&&o.open(),s.$input.focus()):a.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function De(n,e,i,t){let o,s;t.addEventListener("input",async r=>{r instanceof InputEvent&&(r.inputType==="insertText"||r.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{var p;let c=await e.Search.suggest(t.value);c&&c.length>0&&l((p=c[0])==null?void 0:p.suggestion)},100))});function l(r){if(!r){t.placeholder="";return}let c=t.value;t.value=r,t.setSelectionRange(c.length,r.length)}return{renderSearch(r,c){var p,d;if(r.places.length===0&&((p=r.enterpriseCategories)==null?void 0:p.length)===0&&((d=r.enterpriseLocations)==null?void 0:d.length)===0){i.textContent="No results found.";return}s=Te(i,r,n,c)},close(){s.destroy()}}}function Te(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,N.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,N.optionsList),s.style.display="block";let l=[],r=(h,u)=>{if(u&&u.length>0){let f=document.createElement("li");f.textContent=h,Object.assign(f.style,N.sectionHeader),s.appendChild(f),u.forEach((m,y)=>{let g=document.createElement("li");g.textContent="".concat("name"in m.item?m.item.name:""," (").concat(m.type,")"),Object.assign(g.style,N.option),g.tabIndex=0,g.addEventListener("focus",()=>{p(l.indexOf(g))}),g.addEventListener("mouseover",()=>{g.style.backgroundColor="#f0f0f0"}),g.addEventListener("mouseout",()=>{g.style.backgroundColor=""}),g.addEventListener("click",()=>{}),g.setAttribute("data-type",h),g.setAttribute("data-index",y.toString()),s.appendChild(g),l.push(g)})}};r("enterpriseLocations",e.enterpriseLocations),r("enterpriseCategories",e.enterpriseCategories),r("Places",e.places),o.appendChild(s),n.appendChild(o);let c=[],p=h=>{c.forEach(g=>g()),c=[],l.forEach((g,b)=>{b===h?g.style.backgroundColor="#e0e0e0":g.style.backgroundColor=""});let u=l[h],f=u.getAttribute("data-type"),m=parseInt(u.getAttribute("data-index")||"0",10);if(!f)return;let{item:y}=e[f.toLowerCase()][m];t.publish("highlight",y)},d=h=>{!o.contains(h.target)&&h.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var N={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function de(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=le(n,e,i);o.on("highlight",d=>{if(d){t.forEach(h=>h()),t=[];let a=d instanceof I?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!B.is(a))return;t.push(R.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let s=i.addFolder("Click \u{1F447}").close(),{sub:l}=Fe(n,s);l.on("click",d=>{var a;t.forEach(h=>h()),t=[],(a=d.spaces)!=null&&a[0]&&(t=[R.highlightCard(n,d.spaces[0])])});let r=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Oe(n,r),p;c.on("hover",d=>{var a;(a=d.spaces)!=null&&a[0]?(p==null||p(),t.length===0&&(p=R.highlightCard(n,d.spaces[0]))):(p==null||p(),p=void 0)})}function Fe(n,e){let i=new D,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),s=[];function l(){s.forEach(c=>c()),s.length=0}let r=0;return n.on("click",c=>{var u,f,m;let{labels:p,coordinate:d}=c;l(),i.publish("click",c),clearInterval(r),o.load(JSON.stringify([d.longitude,d.latitude]));let a=p==null?void 0:p[0];if(a!=null){let y=P(n,a,e);if(!y)return;s.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(u=c.spaces)==null?void 0:u[0])!=null?m:(f=c.objects)==null?void 0:f[0];if(h){let y=z($($({},h),n.getState(h)),{isInView:!1,isInViewCheck:j(n,h.id)}),{cleanup:g}=G(n,y,e);r=setInterval(()=>{y.isInView=n.isInView(a||h)},500),s.push(g)}}),{sub:i}}function Oe(n,e){let i=new D;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(r=>{n.setHoverColor(r)});let s=[];function l(){s.forEach(r=>r()),s.length=0}return n.on("hover",r=>{var m,y,g;let{coordinate:c,spaces:p,objects:d,markers:a,labels:h}=r;l(),i.publish("hover",r),o.load(JSON.stringify([c.longitude,c.latitude]));let u=(g=(y=(m=p==null?void 0:p[0])!=null?m:d==null?void 0:d[0])!=null?y:a==null?void 0:a[0])!=null?g:h==null?void 0:h[0];if(!u)return;let f=n.getState(u);f&&(t.type=f.type,t.id=u.id)}),{sub:i}}function j(n,e){return function(){console.log("isInView",n.isInView(e))}}function ce(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(u=>{this.labels[u.id]=u}),c()},removeAllLabels(){i.Labels.removeAll().forEach(u=>{delete this.labels[u.id]}),c()}},{addLabel:o,destroy:s}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let r=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.labels[m.id],(y=r.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:g}=y;r.set(m.id,g)}function f(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];u(y)}}return{rerender:f,add:u,remove:h}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:h,coordinate:u})=>{if(!n._closed)if(h!=null&&h[0]){d==null||d.close();let f=r.get(h[0].id);if(n.open(),!f)return;f==null||f.open(),f==null||f.domElement.scrollIntoView({block:"start"}),f==null||f.domElement.focus(),d=f}else o(u)});function a(h){for(let u of h)t.labels[u.id]=u;c()}return{populatelabels:a,destroy(){s()}}}function Pe(n,e,i,t,o){var m,y,g;let{interactive:s,enabled:l,rank:r,anchor:c,dynamicResize:p,zIndex:d,contentHTML:a,lowPriorityPin:h}=t;if(s==null||l==null)throw new Error("incomplete marker state");let u={interactive:s,enabled:l,rank:r||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:p||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:(m=h==null?void 0:h.enabled)!=null?m:!0,size:(y=h==null?void 0:h.size)!=null?y:8,color:E((g=h==null?void 0:h.color)!=null?g:"#666")},remove(){n.Markers.remove(e),o==null||o(e),i.destroy()},isInView:j(n,e.id)};i.onChange(b=>{let C={interactive:u.interactive,enabled:u.enabled,rank:u.rank,dynamicResize:u.dynamicResize,contentHTML:u.contentHTML,lowPriorityPin:{enabled:u.lowPriorityPin.enabled,size:u.lowPriorityPin.size,color:u.lowPriorityPin.color}};u.rank==="always-visible"&&(C.zIndex=u.zIndex),n.updateState(e,C)}),i.add(u,"interactive"),i.add(u,"enabled"),i.add(u,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(u,"anchor").name("anchor (read-only)").disable(),i.add(u,"dynamicResize").name("dynamic resize"),u.rank==="always-visible"&&i.add(u,"zIndex",0,1e3,1).name("z-index"),i.add(u,"contentHTML").name("content HTML");let f=i.addFolder("Low Priority Pin");f.add(u.lowPriorityPin,"enabled"),f.add(u.lowPriorityPin,"size",1,20,1),f.addColor(u.lowPriorityPin,"color"),f.close(),i.add(u,"isInView"),i.add(u,"remove")}function ze(n,e,i,t,o){let{appearance:s,interactive:l}=t;if(!s||s.margin==null||l==null)throw new Error("incomplte label state");let r={text:e.text,interactive:l,appearance:z($({},s),{margin:s.margin||0,pinColor:s.pinColor?E(s.pinColor):"black",textColor:s.textColor?E(s.textColor):"black"}),remove(){n.Labels.remove(e),o==null||o(e),i.destroy()},isInView:j(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:r.appearance,interactive:r.interactive})}),i.add(r.appearance,"margin",0,20).name("margin"),i.add(r,"text"),i.add(r,"interactive"),i.addColor(r.appearance,"pinColor").name("pin color"),i.addColor(r.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(r.appearance,"textColor").name("text color"),i.addColor(r.appearance,"textOutlineColor").name("text outline color"),i.add(r,"isInView"),i.add(r,"remove")}function P(n,e,i,{onRemove:t}={}){var r;let o=n.getState(e);if(!o)throw new Error("error getting state for entity: ".concat(e.id));let s=o.type===J?((r=e.text)==null?void 0:r.substring(0,12))||"Label":"Marker ".concat(e.id.toString().substring(0,8)),l=i.addFolder(s);if(l.close(),o.type===J)ze(n,e,l,o,t);else if(o.type===re)Pe(n,e,l,o,t);else throw new Error("unsupported entity type: ".concat(o.type));return{labelItemFolder:l,destroy(){l.destroy()}}}function Be(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var he={};v();function ue(n,e,i){var ne,oe;let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),s=document.createElement("div");Object.assign(s.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(s);let l=()=>e.getDimensions(),[r,c,p,d]=(ne=i==null?void 0:i.padding)!=null?ne:[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i!=null&&i.padding?"pixel":e.Camera.screenOffsets.type,inset_top:r,inset_left:d,inset_right:c,inset_bottom:p,animateOnLoad:!0,visualizeInset:!!(r||c||p||d),"Focus on click":(oe=i==null?void 0:i.focusOnClick)!=null?oe:!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function h(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:k}=l();a.inset_type==="portion"?Object.assign(s.style,{left:a.inset_left*x+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*x+"px"}):Object.assign(s.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(ie),ie(a.visualizeInset);let u,f,m,y;function g(){let{width:x,height:k}=l(),Y=e.Camera.screenOffsets.type,V=a.inset_type;Y!==V&&(V==="portion"&&Y==="pixel"?(a.inset_top=x>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=x>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/x,1):0,a.inset_right=k>0?Math.min(a.inset_right/x,1):0):V==="pixel"&&Y==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*x),a.inset_right=Math.round(a.inset_right*x))),u&&u.destroy(),f&&f.destroy(),m&&m.destroy(),y&&y.destroy(),a.inset_type==="portion"?(u=t.add(a,"inset_top",0,1,.01).onChange(_),f=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),y=t.add(a,"inset_right",0,1,.01).onChange(_)):(u=t.add(a,"inset_top",0,k,1).onChange(_),f=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,x,1).onChange(_),y=t.add(a,"inset_right",0,x,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{g(),_()}),g();let b=Ue(e);t.add(a,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let C=x=>{t._closed||(a.center_lat=x.center.latitude,a.center_lon=x.center.longitude,a.zoomLevel=x.zoomLevel,a.bearing=x.bearing,a.pitch=x.pitch)};e.on("camera-change",C);let M=[()=>{e.off("camera-change",C)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),h()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function ie(x){h(),x?s.style.display="block":s.style.display="none"}return()=>({destroy(){t.destroy(),ae(M)}})}function Ue(n){return function(i){var l;let{spaces:t,objects:o}=i,s=(l=t==null?void 0:t[0])!=null?l:o==null?void 0:o[0];s&&n.Camera.focusOn(s)}}v();function pe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(u=>{delete this.markers[u.id]}),c()}},{addMarker:o,destroy:s}=Ge(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let r=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.markers[m.id],(y=r.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:g}=y;r.set(m.id,g)}function f(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];u(y)}}return{rerender:f,add:u,remove:h}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:h,coordinate:u})=>{if(!n._closed)if(h!=null&&h[0]){d==null||d.close();let f=r.get(h[0].id);if(n.open(),!f)return;f==null||f.open(),f==null||f.domElement.scrollIntoView({block:"start"}),f==null||f.domElement.focus(),d=f}else o(u)});function a(h){for(let u of h)t.markers[u.id]=u;c()}return{populateMarkers:a,destroy(){s()}}}function Ge(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(s){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(s,t.contentHTML,l)}}}v();function fe(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}v();function ge(n,e,i){var s,l;n.close();let t={language:(l=(s=i.currentLanguage)==null?void 0:s.code)!=null?l:"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o==null?void 0:o.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}v();function me(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,s={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(s,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(s,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(s,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(s)}v();function be(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}v();function ye(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),s=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",r={enabled:!1,method:o||"dp-optimal",radius:s?parseFloat(s):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,p,d;t.add(r,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,p=void 0,r.startCoordinate="",r.endCoordinate="",r.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(r,"startCoordinate").name("Start").disable().listen(),t.add(r,"endCoordinate").name("End").disable().listen(),t.add(r,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&p&&r.enabled&&u(c,p)}),t.add(r,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&p&&r.enabled&&u(c,p)}),t.add(r,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&p&&r.enabled&&u(c,p)}),t.add(r,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>h()};t.add(a,"clear").name("Clear Path");function h(){c=void 0,p=void 0,r.startCoordinate="",r.endCoordinate="",r.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function u(m,y){var g;d&&(e.Paths.remove(d),d=void 0);try{let b=await e.getDirections(m,y,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:r.method,radius:r.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:r.includeDoorBufferNodes}});if(b){d=e.Paths.add(b.coordinates,{interactive:!0,color:"green",width:1});let M=((g=b.distance)==null?void 0:g.toFixed(2))||"N/A";r.pathInfo="".concat(b.coordinates.length," pts, ").concat(M,"m")}else r.pathInfo="No path found"}catch(b){r.pathInfo="Error: ".concat(b instanceof Error?b.message:"Unknown")}}let f=async m=>{if(r.enabled)if(c){let y=m.coordinate;p=y,r.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),r.pathInfo="Calculating...",await u(c,p),c=void 0,p=void 0}else{let y=m.coordinate;c=y,r.startCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),r.pathInfo="Click to set end..."}};return e.on("click",f),{destroy(){e.off("click",f),t.destroy()}}}v();function ve(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function s(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>s());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>s()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>s());let r=i.addFolder("Desaturate");r.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>s()),r.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>s());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>s()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>s())}function Ce(n,e,i){Re();let t=new U({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),de(e,n,t),ue(t,e,i==null?void 0:i.camera);let o=t.addFolder("Levels").close(),s=t.addFolder("Scene Controls");s.close();let l=t.addFolder("Labels");be(t,e,n);let r=t.addFolder("Markers");fe(t,e);let c=t.addFolder("misc");me(t,e,n),ve(t,e),ye(t,e,n),ge(c,e,n);let p={level:e.currentFloor.id},{populatelabels:d}=ce(l,n,e),{populateMarkers:a}=pe(r,n,e),h=n.getByType("floor").reduce((f,m)=>(f[m.name]=m.id,f),{}),u=o.add(p,"level",h).onChange(f=>{e.setFloor(f),p.level=e.currentFloor.id,u.updateDisplay()});return e.on("floor-change-start",f=>{o.controllers[0].setValue(f.floor.id)}),n.getByType("space").forEach(f=>{e.updateState(f,{interactive:!0})}),n.getByType("object").forEach(f=>{e.updateState(f,{interactive:!0})}),n.getByType("object").forEach(f=>{e.updateState(f,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:s,populateMarkers:a}}var xe="mappedin-sdk-debug-css";function Re(){if(document.getElementById(xe))return;let n=document.createElement("style");n.id=xe,n.textContent=he,document.head.appendChild(n)}var te=class{constructor(e,i){S(this,"_enabled",!1);S(this,"mv");S(this,"api");S(this,"mapData");S(this,"scenegraphVisualizerMounted",!1);S(this,"storeStateToLocalStorageEnabled",!1);this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){var t;if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=Ce(this.mapData,this.mv,e);i.onOpenClose(async o=>{if(o===i&&!o._closed&&!this.scenegraphVisualizerMounted){this.scenegraphVisualizerMounted=!0;try{let{mountSceneGraphVisualizer:s}=await import("./src-QBZJI5BR.js");s(this.api.core,i)}catch(s){}}}),(t=this.api.getMapDataInternal())==null||t.spaces.forEach(o=>{this.mv.updateState(o,{interactive:!0})})}get enabled(){return this._enabled}};export{te as Inspector};
|
|
1
|
+
import{G as J,H as re,i as B,q as I,r as H}from"./chunk-PCYD3VDS.js";import"./chunk-72VREA6L.js";import{i as D}from"./chunk-RTTZ7LHQ.js";import"./chunk-43W5ISDI.js";import{a as v}from"./chunk-PUC4BMPX.js";import{a as $,b as z,h as S}from"./chunk-IGHVNMJ3.js";v();v();v();v();var L=class n{constructor(e,i,t,o,s="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id="lil-gui-name-".concat(++n.nextNameID),this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},X=class extends L{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function W(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var Ae={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:W,toHexString:W},F={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},we={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=F.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return F.toHexString(o)}},_e={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=F.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return F.toHexString(o)}},Ee=[Ae,F,we,_e];function ke(n){return Ee.find(e=>e.match(n))}var K=class extends L{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=ke(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=W(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},T=class extends L{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},Z=class extends L{constructor(e,i,t,o,s,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(s);let r=l!==void 0;this.step(r?l:this._getImplicitStep(),r),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},s=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,r,c,p,d,a,h=5,u=b=>{r=b.clientX,c=p=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",f),window.addEventListener("mouseup",m)},f=b=>{if(l){let C=b.clientX-r,M=b.clientY-c;Math.abs(M)>h?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>h&&m()}if(!l){let C=b.clientY-p;a-=C*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}p=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},g=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",u),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",g)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(g,b,C,M,_)=>(g-b)/(C-b)*(_-M)+M,i=g=>{let b=this.$slider.getBoundingClientRect(),C=e(g,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=g=>{this._setDraggingStyle(!0),i(g.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",s)},o=g=>{i(g.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",s)},l=!1,r,c,p=g=>{g.preventDefault(),this._setDraggingStyle(!0),i(g.touches[0].clientX),l=!1},d=g=>{g.touches.length>1||(this._hasScrollBar?(r=g.touches[0].clientX,c=g.touches[0].clientY,l=!0):p(g),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",h))},a=g=>{if(l){let b=g.touches[0].clientX-r,C=g.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?p(g):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h))}else g.preventDefault(),i(g.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h)},u=this._callOnFinishChange.bind(this),f=400,m,y=g=>{if(Math.abs(g.deltaX)<Math.abs(g.deltaY)&&this._hasScrollBar)return;g.preventDefault();let C=this._normalizeMouseWheel(g)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(u,f)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-".concat(i),e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},Q=class extends L{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},q=class extends L{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Me='.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "\u2195";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "\u25BE";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "\u25B8";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "\u2713";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}';function Le(n){let e=document.createElement("style");e.innerHTML=n;let i=document.querySelector("head link[rel=stylesheet], head style");i?document.head.insertBefore(e,i):document.head.appendChild(e)}var se=!1,ee=class n{constructor({parent:e,autoPlace:i=e===void 0,container:t,width:o,title:s="Controls",closeFolders:l=!1,injectStyles:r=!0,touchStyles:c=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),c&&this.domElement.classList.add("allow-touch-styles"),!se&&r&&(Le(Me),se=!0),t?t.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),o&&this.domElement.style.setProperty("--width",o+"px"),this._closeFolders=l}add(e,i,t,o,s){if(Object(t)===t)return new Q(this,e,i,t);let l=e[i];switch(typeof l){case"number":return new Z(this,e,i,t,o,s);case"boolean":return new X(this,e,i);case"string":return new q(this,e,i);case"function":return new T(this,e,i)}console.error("gui.add failed\n property:",i,"\n object:",e,"\n value:",l)}addColor(e,i,t=1){return new K(this,e,i,t)}addFolder(e){let i=new n({parent:this,title:e});return this.root._closeFolders&&i.close(),i}load(e,i=!0){return e.controllers&&this.controllers.forEach(t=>{t instanceof T||t._name in e.controllers&&t.load(e.controllers[t._name])}),i&&e.folders&&this.folders.forEach(t=>{t._title in e.folders&&t.load(e.folders[t._title])}),this}save(e=!0){let i={controllers:{},folders:{}};return this.controllers.forEach(t=>{if(!(t instanceof T)){if(t._name in i.controllers)throw new Error('Cannot save GUI with duplicate property "'.concat(t._name,'"'));i.controllers[t._name]=t.save()}}),e&&this.folders.forEach(t=>{if(t._title in i.folders)throw new Error('Cannot save GUI with duplicate folder "'.concat(t._title,'"'));i.folders[t._title]=t.save()}),i}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let i=this.$children.clientHeight;this.$children.style.height=i+"px",this.domElement.classList.add("transition");let t=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",t))};this.$children.addEventListener("transitionend",t);let o=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=o+"px"})}),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(t=>t.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(i=>{e=e.concat(i.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(i=>{e=e.concat(i.foldersRecursive())}),e}},U=ee;v();v();var E=(()=>{let n=null;return function(i){if(!n){let t=document.createElement("canvas");t.width=1,t.height=1,n=t.getContext("2d")}return n.fillStyle=i,n.fillStyle}})();function ae(n){let e;for(e of n)e()}var $e=["interactive"];function G(n,e,i){let t={id:e.id,__type:e.__type},o=i.addFolder("".concat(e.type,"-").concat(e.id));for(let s in e){if(s==="visible"&&o.add(e,s).onChange(l=>{n.updateState(t,{[s]:l})}),s==="color"||s==="hoverColor"){e[s]=E(e[s]),o.addColor(e,s).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="height"){o.add(e,s,0,20,1).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="texture"&&e.texture){o.addFolder("Texture - side").add(e.texture,"url").onChange(r=>{n.updateState(t,{texture:{url:r}})});continue}if(s==="topTexture"&&e.topTexture){o.addFolder("Texture - top").add(e.topTexture,"url").onChange(r=>{n.updateState(t,{topTexture:{url:r}})});continue}if(s==="opacity"){o.add(e,s,0,1,.1).onChange(l=>{n.updateState(t,{[s]:l})});continue}if(s==="altitude"){o.add(e,s,0,100,1).onChange(l=>{n.updateState(t,{[s]:l})});continue}$e.includes(s)&&o.add(e,s).onChange(l=>{n.updateState(t,{[s]:l})})}return e.isInView&&(o.add(e,"isInView").listen().disable(),o.add(e,"isInViewCheck")),{cleanup(){o.destroy()}}}v();v();function Se(){let n=[];function e(o,s){var c;let l=Object.values(o.getMapData())[0],r=s;if(r&&B.is(r)){let p=(c=l.getByType("enterprise-location"))==null?void 0:c.find(d=>d.spaces.some(a=>a.id===r.id));p&&(r=p)}return r}async function i(o,s){return s instanceof H?o.Camera.focusOn(s.locations.flatMap(l=>l.spaces),O):s instanceof I?o.Camera.focusOn(s.spaces,O):o.Camera.focusOn(s,O)}function t(o,s,{focus:l=!1}={}){if(!window.enableHighlightCard)return()=>{};let r=e(o,s),c=document.createElement("div");if(c.style.cssText="\n position: absolute;\n top: 20px;\n left: 20px;\n background-color: rgba(30, 30, 30, 0.95);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n border-radius: 12px;\n padding: 24px;\n max-width: 320px;\n z-index: 1000;\n font-family: 'Arial', sans-serif;\n transition: all 0.3s ease;\n color: #e0e0e0;\n ","name"in r){let d=document.createElement("h3");d.textContent=r.name,d.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",c.appendChild(d)}if(r instanceof I){if(r.description){let d=document.createElement("p");d.textContent=r.description,d.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",c.appendChild(d)}if(r.tags&&r.tags.length>0){let d=document.createElement("div");d.style.cssText="\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n margin-bottom: 16px;\n overflow-x: hidden;\n max-height: 30px; /* Adjust this value based on your font size and padding */\n ",r.tags.forEach(a=>{let h=document.createElement("span");h.textContent=a,h.style.cssText="\n background-color: #3a3a3a;\n color: #e0e0e0;\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n white-space: nowrap;\n ",d.appendChild(h)}),c.appendChild(d)}}let p;if(!(s instanceof H)){let d=new U({autoPlace:!1});d.domElement.style.cssText="\n position: relative;\n overflow-y: auto;\n margin-top: 16px;\n border-top: 1px solid #444;\n padding-top: 16px;\n ";let a=o.getState(s);a&&(G(o,$({id:s.id},a),d),c.appendChild(d.domElement)),p=d}return document.body.appendChild(c),l&&i(o,r),()=>{c.style.opacity="0",c.style.transform="translateY(-10px)",setTimeout(()=>c.remove(),300),p==null||p.destroy()}}return{highlightCard:t,highlight:(o,s,{focus:l=!0}={})=>{n.length>0&&n.forEach(c=>o.Markers.remove(c));let r=e(o,s);if(r instanceof I)l&&o.Camera.focusOn(r.spaces,O),n.push(...r.spaces.map(c=>o.Markers.add(c,'<div style="padding: 15px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 250px; position: relative;">\n <h3 style="margin: 0 0 10px; color: #333; font-size: 16px; font-weight: 600;">'.concat(r.name,"</h3>\n ").concat(r.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(r.description,"</p>"):"","\n ").concat(r.tags?r.tags.map(p=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(p,"</span>")).join(" "):"",'\n <div style="position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ffffff;"></div>\n </div>'),{rank:"always-visible",placement:"top"})));else if(r instanceof H){l&&o.Camera.focusOn(r.locations.flatMap(d=>d.spaces),O);let c=new Map,p=new Set;r.locations.forEach(d=>{c.has(d.name)||(d.spaces.forEach(a=>{n.push(o.Markers.add(a,'<div style="padding: 12px; background-color: rgba(0, 153, 51, 0.95); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transform: translateY(-4px); transition: all 0.3s ease;">\n <span style="font-weight: 600; color: #FFFFFF; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">'.concat(d.name,"</span>\n </div>"),{rank:"always-visible"}))}),c.set(d.name,!0))}),r.locations.forEach(d=>{d.coordinates.forEach(a=>{let h="".concat(a.latitude,",").concat(a.longitude);if(!p.has(h)&&!c.has(d.name)){let u=o.Markers.add(a,'<div style="padding: 10px; background-color: rgba(51, 102, 204, 0.9); border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);">\n <span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">'.concat(d.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});p.add(h),n.push(u)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var O={duration:300,easing:"ease-in-out"},R=Se();v();var w={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function Ie(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function le(n,e,i){var d;let t=new D,o=i.addFolder("Search");o.open();let s=o.add(w,"search").onChange(async a=>{let h=await e.Search.query(a,w.options);h&&(w.results=h,r(h,t))}),l=document.createElement("div");l.style.marginLeft="10px",(d=s.domElement.parentElement)==null||d.appendChild(l);let{renderSearch:r,close:c}=De(n,e,l,s.$input),p=o.addFolder("Advanced");return p.close(),Ie(p),document.addEventListener("keydown",a=>{(a.metaKey||a.ctrlKey)&&a.key==="k"?(a.preventDefault(),o._closed&&o.open(),s.$input.focus()):a.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function De(n,e,i,t){let o,s;t.addEventListener("input",async r=>{r instanceof InputEvent&&(r.inputType==="insertText"||r.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{var p;let c=await e.Search.suggest(t.value);c&&c.length>0&&l((p=c[0])==null?void 0:p.suggestion)},100))});function l(r){if(!r){t.placeholder="";return}let c=t.value;t.value=r,t.setSelectionRange(c.length,r.length)}return{renderSearch(r,c){var p,d;if(r.places.length===0&&((p=r.enterpriseCategories)==null?void 0:p.length)===0&&((d=r.enterpriseLocations)==null?void 0:d.length)===0){i.textContent="No results found.";return}s=Te(i,r,n,c)},close(){s.destroy()}}}function Te(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,N.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,N.optionsList),s.style.display="block";let l=[],r=(h,u)=>{if(u&&u.length>0){let f=document.createElement("li");f.textContent=h,Object.assign(f.style,N.sectionHeader),s.appendChild(f),u.forEach((m,y)=>{let g=document.createElement("li");g.textContent="".concat("name"in m.item?m.item.name:""," (").concat(m.type,")"),Object.assign(g.style,N.option),g.tabIndex=0,g.addEventListener("focus",()=>{p(l.indexOf(g))}),g.addEventListener("mouseover",()=>{g.style.backgroundColor="#f0f0f0"}),g.addEventListener("mouseout",()=>{g.style.backgroundColor=""}),g.addEventListener("click",()=>{}),g.setAttribute("data-type",h),g.setAttribute("data-index",y.toString()),s.appendChild(g),l.push(g)})}};r("enterpriseLocations",e.enterpriseLocations),r("enterpriseCategories",e.enterpriseCategories),r("Places",e.places),o.appendChild(s),n.appendChild(o);let c=[],p=h=>{c.forEach(g=>g()),c=[],l.forEach((g,b)=>{b===h?g.style.backgroundColor="#e0e0e0":g.style.backgroundColor=""});let u=l[h],f=u.getAttribute("data-type"),m=parseInt(u.getAttribute("data-index")||"0",10);if(!f)return;let{item:y}=e[f.toLowerCase()][m];t.publish("highlight",y)},d=h=>{!o.contains(h.target)&&h.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var N={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function de(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=le(n,e,i);o.on("highlight",d=>{if(d){t.forEach(h=>h()),t=[];let a=d instanceof I?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!B.is(a))return;t.push(R.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let s=i.addFolder("Click \u{1F447}").close(),{sub:l}=Fe(n,s);l.on("click",d=>{var a;t.forEach(h=>h()),t=[],(a=d.spaces)!=null&&a[0]&&(t=[R.highlightCard(n,d.spaces[0])])});let r=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Oe(n,r),p;c.on("hover",d=>{var a;(a=d.spaces)!=null&&a[0]?(p==null||p(),t.length===0&&(p=R.highlightCard(n,d.spaces[0]))):(p==null||p(),p=void 0)})}function Fe(n,e){let i=new D,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),s=[];function l(){s.forEach(c=>c()),s.length=0}let r=0;return n.on("click",c=>{var u,f,m;let{labels:p,coordinate:d}=c;l(),i.publish("click",c),clearInterval(r),o.load(JSON.stringify([d.longitude,d.latitude]));let a=p==null?void 0:p[0];if(a!=null){let y=P(n,a,e);if(!y)return;s.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(u=c.spaces)==null?void 0:u[0])!=null?m:(f=c.objects)==null?void 0:f[0];if(h){let y=z($($({},h),n.getState(h)),{isInView:!1,isInViewCheck:j(n,h.id)}),{cleanup:g}=G(n,y,e);r=setInterval(()=>{y.isInView=n.isInView(a||h)},500),s.push(g)}}),{sub:i}}function Oe(n,e){let i=new D;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(r=>{n.setHoverColor(r)});let s=[];function l(){s.forEach(r=>r()),s.length=0}return n.on("hover",r=>{var m,y,g;let{coordinate:c,spaces:p,objects:d,markers:a,labels:h}=r;l(),i.publish("hover",r),o.load(JSON.stringify([c.longitude,c.latitude]));let u=(g=(y=(m=p==null?void 0:p[0])!=null?m:d==null?void 0:d[0])!=null?y:a==null?void 0:a[0])!=null?g:h==null?void 0:h[0];if(!u)return;let f=n.getState(u);f&&(t.type=f.type,t.id=u.id)}),{sub:i}}function j(n,e){return function(){console.log("isInView",n.isInView(e))}}function ce(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(u=>{this.labels[u.id]=u}),c()},removeAllLabels(){i.Labels.removeAll().forEach(u=>{delete this.labels[u.id]}),c()}},{addLabel:o,destroy:s}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let r=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.labels[m.id],(y=r.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:g}=y;r.set(m.id,g)}function f(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];u(y)}}return{rerender:f,add:u,remove:h}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:h,coordinate:u})=>{if(!n._closed)if(h!=null&&h[0]){d==null||d.close();let f=r.get(h[0].id);if(n.open(),!f)return;f==null||f.open(),f==null||f.domElement.scrollIntoView({block:"start"}),f==null||f.domElement.focus(),d=f}else o(u)});function a(h){for(let u of h)t.labels[u.id]=u;c()}return{populatelabels:a,destroy(){s()}}}function Pe(n,e,i,t,o){var m,y,g;let{interactive:s,enabled:l,rank:r,anchor:c,dynamicResize:p,zIndex:d,contentHTML:a,lowPriorityPin:h}=t;if(s==null||l==null)throw new Error("incomplete marker state");let u={interactive:s,enabled:l,rank:r||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:p||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:(m=h==null?void 0:h.enabled)!=null?m:!0,size:(y=h==null?void 0:h.size)!=null?y:8,color:E((g=h==null?void 0:h.color)!=null?g:"#666")},remove(){n.Markers.remove(e),o==null||o(e),i.destroy()},isInView:j(n,e.id)};i.onChange(b=>{let C={interactive:u.interactive,enabled:u.enabled,rank:u.rank,dynamicResize:u.dynamicResize,contentHTML:u.contentHTML,lowPriorityPin:{enabled:u.lowPriorityPin.enabled,size:u.lowPriorityPin.size,color:u.lowPriorityPin.color}};u.rank==="always-visible"&&(C.zIndex=u.zIndex),n.updateState(e,C)}),i.add(u,"interactive"),i.add(u,"enabled"),i.add(u,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(u,"anchor").name("anchor (read-only)").disable(),i.add(u,"dynamicResize").name("dynamic resize"),u.rank==="always-visible"&&i.add(u,"zIndex",0,1e3,1).name("z-index"),i.add(u,"contentHTML").name("content HTML");let f=i.addFolder("Low Priority Pin");f.add(u.lowPriorityPin,"enabled"),f.add(u.lowPriorityPin,"size",1,20,1),f.addColor(u.lowPriorityPin,"color"),f.close(),i.add(u,"isInView"),i.add(u,"remove")}function ze(n,e,i,t,o){let{appearance:s,interactive:l}=t;if(!s||s.margin==null||l==null)throw new Error("incomplte label state");let r={text:e.text,interactive:l,appearance:z($({},s),{margin:s.margin||0,pinColor:s.pinColor?E(s.pinColor):"black",textColor:s.textColor?E(s.textColor):"black"}),remove(){n.Labels.remove(e),o==null||o(e),i.destroy()},isInView:j(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:r.appearance,interactive:r.interactive})}),i.add(r.appearance,"margin",0,20).name("margin"),i.add(r,"text"),i.add(r,"interactive"),i.addColor(r.appearance,"pinColor").name("pin color"),i.addColor(r.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(r.appearance,"textColor").name("text color"),i.addColor(r.appearance,"textOutlineColor").name("text outline color"),i.add(r,"isInView"),i.add(r,"remove")}function P(n,e,i,{onRemove:t}={}){var r;let o=n.getState(e);if(!o)throw new Error("error getting state for entity: ".concat(e.id));let s=o.type===J?((r=e.text)==null?void 0:r.substring(0,12))||"Label":"Marker ".concat(e.id.toString().substring(0,8)),l=i.addFolder(s);if(l.close(),o.type===J)ze(n,e,l,o,t);else if(o.type===re)Pe(n,e,l,o,t);else throw new Error("unsupported entity type: ".concat(o.type));return{labelItemFolder:l,destroy(){l.destroy()}}}function Be(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var he={};v();function ue(n,e,i){var ne,oe;let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),s=document.createElement("div");Object.assign(s.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(s);let l=()=>e.getDimensions(),[r,c,p,d]=(ne=i==null?void 0:i.padding)!=null?ne:[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i!=null&&i.padding?"pixel":e.Camera.screenOffsets.type,inset_top:r,inset_left:d,inset_right:c,inset_bottom:p,animateOnLoad:!0,visualizeInset:!!(r||c||p||d),"Focus on click":(oe=i==null?void 0:i.focusOnClick)!=null?oe:!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function h(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:k}=l();a.inset_type==="portion"?Object.assign(s.style,{left:a.inset_left*x+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*x+"px"}):Object.assign(s.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(ie),ie(a.visualizeInset);let u,f,m,y;function g(){let{width:x,height:k}=l(),Y=e.Camera.screenOffsets.type,V=a.inset_type;Y!==V&&(V==="portion"&&Y==="pixel"?(a.inset_top=x>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=x>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/x,1):0,a.inset_right=k>0?Math.min(a.inset_right/x,1):0):V==="pixel"&&Y==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*x),a.inset_right=Math.round(a.inset_right*x))),u&&u.destroy(),f&&f.destroy(),m&&m.destroy(),y&&y.destroy(),a.inset_type==="portion"?(u=t.add(a,"inset_top",0,1,.01).onChange(_),f=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),y=t.add(a,"inset_right",0,1,.01).onChange(_)):(u=t.add(a,"inset_top",0,k,1).onChange(_),f=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,x,1).onChange(_),y=t.add(a,"inset_right",0,x,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{g(),_()}),g();let b=Ue(e);t.add(a,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let C=x=>{t._closed||(a.center_lat=x.center.latitude,a.center_lon=x.center.longitude,a.zoomLevel=x.zoomLevel,a.bearing=x.bearing,a.pitch=x.pitch)};e.on("camera-change",C);let M=[()=>{e.off("camera-change",C)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),h()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function ie(x){h(),x?s.style.display="block":s.style.display="none"}return()=>({destroy(){t.destroy(),ae(M)}})}function Ue(n){return function(i){var l;let{spaces:t,objects:o}=i,s=(l=t==null?void 0:t[0])!=null?l:o==null?void 0:o[0];s&&n.Camera.focusOn(s)}}v();function pe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(u=>{delete this.markers[u.id]}),c()}},{addMarker:o,destroy:s}=Ge(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let r=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.markers[m.id],(y=r.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:g}=y;r.set(m.id,g)}function f(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];u(y)}}return{rerender:f,add:u,remove:h}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:h,coordinate:u})=>{if(!n._closed)if(h!=null&&h[0]){d==null||d.close();let f=r.get(h[0].id);if(n.open(),!f)return;f==null||f.open(),f==null||f.domElement.scrollIntoView({block:"start"}),f==null||f.domElement.focus(),d=f}else o(u)});function a(h){for(let u of h)t.markers[u.id]=u;c()}return{populateMarkers:a,destroy(){s()}}}function Ge(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(s){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(s,t.contentHTML,l)}}}v();function fe(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}v();function ge(n,e,i){var s,l;n.close();let t={language:(l=(s=i.currentLanguage)==null?void 0:s.code)!=null?l:"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o==null?void 0:o.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}v();function me(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,s={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(s,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(s,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(s,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(s)}v();function be(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}v();function ye(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),s=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",r={enabled:!1,method:o||"dp-optimal",radius:s?parseFloat(s):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,p,d;t.add(r,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,p=void 0,r.startCoordinate="",r.endCoordinate="",r.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(r,"startCoordinate").name("Start").disable().listen(),t.add(r,"endCoordinate").name("End").disable().listen(),t.add(r,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&p&&r.enabled&&u(c,p)}),t.add(r,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&p&&r.enabled&&u(c,p)}),t.add(r,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&p&&r.enabled&&u(c,p)}),t.add(r,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>h()};t.add(a,"clear").name("Clear Path");function h(){c=void 0,p=void 0,r.startCoordinate="",r.endCoordinate="",r.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function u(m,y){var g;d&&(e.Paths.remove(d),d=void 0);try{let b=await e.getDirections(m,y,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:r.method,radius:r.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:r.includeDoorBufferNodes}});if(b){d=e.Paths.add(b.coordinates,{interactive:!0,color:"green",width:1});let M=((g=b.distance)==null?void 0:g.toFixed(2))||"N/A";r.pathInfo="".concat(b.coordinates.length," pts, ").concat(M,"m")}else r.pathInfo="No path found"}catch(b){r.pathInfo="Error: ".concat(b instanceof Error?b.message:"Unknown")}}let f=async m=>{if(r.enabled)if(c){let y=m.coordinate;p=y,r.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),r.pathInfo="Calculating...",await u(c,p),c=void 0,p=void 0}else{let y=m.coordinate;c=y,r.startCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),r.pathInfo="Click to set end..."}};return e.on("click",f),{destroy(){e.off("click",f),t.destroy()}}}v();function ve(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function s(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>s());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>s()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>s());let r=i.addFolder("Desaturate");r.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>s()),r.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>s());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>s()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>s())}function Ce(n,e,i){Re();let t=new U({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),de(e,n,t),ue(t,e,i==null?void 0:i.camera);let o=t.addFolder("Levels").close(),s=t.addFolder("Scene Controls");s.close();let l=t.addFolder("Labels");be(t,e,n);let r=t.addFolder("Markers");fe(t,e);let c=t.addFolder("misc");me(t,e,n),ve(t,e),ye(t,e,n),ge(c,e,n);let p={level:e.currentFloor.id},{populatelabels:d}=ce(l,n,e),{populateMarkers:a}=pe(r,n,e),h=n.getByType("floor").reduce((f,m)=>(f[m.name]=m.id,f),{}),u=o.add(p,"level",h).onChange(f=>{e.setFloor(f),p.level=e.currentFloor.id,u.updateDisplay()});return e.on("floor-change-start",f=>{o.controllers[0].setValue(f.floor.id)}),n.getByType("space").forEach(f=>{e.updateState(f,{interactive:!0})}),n.getByType("object").forEach(f=>{e.updateState(f,{interactive:!0})}),n.getByType("object").forEach(f=>{e.updateState(f,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:s,populateMarkers:a}}var xe="mappedin-sdk-debug-css";function Re(){if(document.getElementById(xe))return;let n=document.createElement("style");n.id=xe,n.textContent=he,document.head.appendChild(n)}var te=class{constructor(e,i){S(this,"_enabled",!1);S(this,"mv");S(this,"api");S(this,"mapData");S(this,"scenegraphVisualizerMounted",!1);S(this,"storeStateToLocalStorageEnabled",!1);this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){var t;if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=Ce(this.mapData,this.mv,e);i.onOpenClose(async o=>{if(o===i&&!o._closed&&!this.scenegraphVisualizerMounted){this.scenegraphVisualizerMounted=!0;try{let{mountSceneGraphVisualizer:s}=await import("./src-YUNUBHAQ.js");s(this.api.core,i)}catch(s){}}}),(t=this.api.getMapDataInternal())==null||t.spaces.forEach(o=>{this.mv.updateState(o,{interactive:!0})})}get enabled(){return this._enabled}};export{te as Inspector};
|