@mappedin/mappedin-js 6.7.0 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { Color as Color$1, CompositeExpression, DiffCommand, DiffOperations, Feature as Feature$2, FeatureFilter, FeatureState, FilterSpecification, Formatted, FormattedSection, GlobalProperties, ICanonicalTileID, IMercatorCoordinate, InterpolationType, LayerSpecification, LightSpecification, Padding, ProjectionSpecification, PromoteIdSpecification, PropertyValueSpecification, ResolvedImage, SkySpecification, SourceExpression, SourceSpecification, SpriteSpecification, StylePropertyExpression, StylePropertySpecification, StyleSpecification, TerrainSpecification, TransitionSpecification, VariableAnchorOffsetCollection } from '@maplibre/maplibre-gl-style-spec';
2
- import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, BaseTextAreaProperties, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseTexture, EnterpriseVenue as MVFEnterpriseVenue, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloatingFloorTextProperties, FloorCollection, FloorId, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, FloorTextCommonProperties, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle, LineStringStyle as TMVFLineStringStyle, Location as MVFLocation, LocationId, LocationLink, LocationSocial, LocationState, MultiPolygon, NavigationFlagDeclarations, NodeCollection, NodeCollection as MVFNodeCollection, NodeId, ObstructionCollection, ObstructionFeature, ObstructionId, ObstructionProperties, OpeningHoursSpecification, OperationHours, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, Point, PointStyle, PointStyle as TMVFPointStyle, Polygon, PolygonStyle, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SpaceCollection, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection, StyleCollection as TMVFStyleCollection, TilesetStyle } from '@mappedin/mvf-v2';
3
- import { ParsedMVF, RawMVF } from '@mappedin/mvf-v2/no-validator';
2
+ import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, BaseTextAreaProperties, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseTexture, EnterpriseVenue as MVFEnterpriseVenue, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloatingFloorTextProperties, FloorCollection, FloorId, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, FloorTextCommonProperties, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle, LineStringStyle as TMVFLineStringStyle, Location as MVF2Location, LocationId, LocationLink, LocationSocial, LocationState, MultiPolygon, NavigationFlagDeclarations, NodeCollection, NodeCollection as MVFNodeCollection, NodeId, ObstructionCollection, ObstructionFeature, ObstructionId, ObstructionProperties, OpeningHoursSpecification, OperationHours, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, ParsedMVFv3, Point, PointStyle, PointStyle as TMVFPointStyle, Polygon, PolygonStyle, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SpaceCollection, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection, StyleCollection as TMVFStyleCollection, TilesetStyle } from '@mappedin/mvf-v2';
3
+ import { ParsedMVF, ParsedMVFv3, RawMVF } from '@mappedin/mvf-v2/no-validator';
4
4
  import { Group as TweenGroup, Tween } from '@tweenjs/tween.js';
5
- import { AmbientLight, BatchedMesh, BatchedMeshGeometryRange, BufferAttribute, BufferGeometry, Camera, Camera as ThreeCamera, Color, DirectionalLight, Group, Intersection, LineSegments, Mesh, MeshLambertMaterial, MeshLambertMaterialParameters, Object3D, Object3DEventMap, PerspectiveCamera, Plane, PlaneGeometry, Raycaster, Scene, ShaderMaterial, Texture, TubeGeometry, Vector2, Vector3, WebGLRenderer } from 'three';
5
+ import { AmbientLight, BatchedMesh, BatchedMeshGeometryRange, Box3, BufferAttribute, BufferGeometry, Camera, Camera as ThreeCamera, Color, DirectionalLight, Group, Intersection, LineSegments, Mesh, MeshLambertMaterial, MeshLambertMaterialParameters, Object3D, Object3DEventMap, PerspectiveCamera, Plane, PlaneGeometry, Raycaster, Scene, ShaderMaterial, Texture, TubeGeometry, Vector2, Vector3, WebGLRenderer } from 'three';
6
6
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
7
7
 
8
8
  declare const VALID_CONTEXTS: readonly [
@@ -576,7 +576,11 @@ declare function createEnvControl(): {
576
576
  __getState: () => Environment;
577
577
  };
578
578
  type EnvControl = ReturnType<typeof createEnvControl>;
579
- export declare function unzipAndParseMVFv2(data: Uint8Array, inputVersion?: string): Promise<ParsedMVF>;
579
+ type ParsedMVFResult = {
580
+ mvf2: ParsedMVF;
581
+ mvf3?: ParsedMVFv3;
582
+ };
583
+ export declare function unzipAndParseMVFv2(data: Uint8Array, inputVersion?: string): Promise<ParsedMVFResult>;
580
584
  type TDrawFn = (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number) => void;
581
585
  type MaterialSide = "back" | "front" | "double";
582
586
  type Style = {
@@ -5223,6 +5227,10 @@ declare class FocusableComponent {
5223
5227
  * Vertices of the geometry in world space
5224
5228
  */
5225
5229
  vertices?: Vector3[];
5230
+ /**
5231
+ * Bounding box computed from object for frustum culling
5232
+ */
5233
+ boundingBox: Box3;
5226
5234
  }
5227
5235
  type TextureStyle = {
5228
5236
  texture?: SingleTexture;
@@ -17321,7 +17329,6 @@ declare class GeometryInFocusSystem extends PubSub$1<{
17321
17329
  focusablesDirty: boolean;
17322
17330
  private state;
17323
17331
  private camera;
17324
- private projectToScreen;
17325
17332
  private cameraFrustum;
17326
17333
  private viewProjectionMatrix;
17327
17334
  private tempScreenPos;
@@ -17330,11 +17337,10 @@ declare class GeometryInFocusSystem extends PubSub$1<{
17330
17337
  private focusableEntities;
17331
17338
  private debug;
17332
17339
  private debugBBoxElements;
17333
- private debugVertexDots;
17334
17340
  private viewfinder;
17335
17341
  private screenBoundsMap;
17336
17342
  private screenDiagonal;
17337
- constructor(state: RendererState, camera: PerspectiveCamera, projectToScreen: Core["project"]);
17343
+ constructor(state: RendererState, camera: Camera);
17338
17344
  resize(): void;
17339
17345
  /**
17340
17346
  * Everything within this square is considered "in focus" and ranked based on proximity to center.
@@ -17346,15 +17352,13 @@ declare class GeometryInFocusSystem extends PubSub$1<{
17346
17352
  * @returns Array of perimeter vertices in world space
17347
17353
  */
17348
17354
  private simplifyVertices;
17349
- /**
17350
- * Projects a 3D vertex from world space to screen coordinates
17351
- * @param worldPosition - Position in world space
17352
- */
17353
- private projectVertexToScreen;
17354
17355
  /**
17355
17356
  * Computes screen-space bounding box and depth info from world-space vertices
17356
- * Projects all vertices to screen space and finds the bounding box
17357
- * Only culls if ALL vertices are outside the camera frustum
17357
+ * Projects all vertices to clip space and finds the bounding box
17358
+ * Culls if the bounding box doesn't intersect the camera frustum
17359
+ *
17360
+ * @param focusableComponent - Component containing vertices and/or bounding box
17361
+ * @returns Screen-space bounding box and closest depth, or undefined if not visible
17358
17362
  */
17359
17363
  private computeScreenSpaceBounds;
17360
17364
  private updateFocusableEntities;
@@ -17364,10 +17368,6 @@ declare class GeometryInFocusSystem extends PubSub$1<{
17364
17368
  * Updates debug visualization for screen-space bounding boxes
17365
17369
  */
17366
17370
  private updateDebugBBoxes;
17367
- /**
17368
- * Updates debug visualization for vertex dots on screen
17369
- */
17370
- private updateDebugVertexDots;
17371
17371
  compute(): void;
17372
17372
  showDebug(): void;
17373
17373
  hideDebug(): void;
@@ -24701,7 +24701,8 @@ export declare class ImageMetaData extends BaseMetaData {
24701
24701
  */
24702
24702
  destroy(): void;
24703
24703
  }
24704
- type LocationData = Omit<MVFLocation, "categories" | "spaces" | "obstructions" | "entrances" | "shapes" | "connections" | "annotations" | "areas" | "openingHoursSpecification" | "links" | "pictures" | "website" | "icon"> & {
24704
+ type MVF3Location = Required<ParsedMVFv3>["locations"][number];
24705
+ type LocationData = Omit<MVF2Location, "categories" | "spaces" | "obstructions" | "entrances" | "shapes" | "connections" | "annotations" | "areas" | "openingHoursSpecification" | "links" | "pictures" | "website" | "icon"> & {
24705
24706
  links: Hyperlink[];
24706
24707
  images: ImageMetaData[];
24707
24708
  icon?: ImageMetaData;
@@ -24756,9 +24757,28 @@ export declare class LocationProfile extends BaseMetaData implements LocationDat
24756
24757
  * @format uri
24757
24758
  */
24758
24759
  icon?: ImageMetaData;
24760
+ /**
24761
+ * Additional user defined data. The type is unknown, so it is recommended to validate the data before use.
24762
+ *
24763
+ * _Only available when loading MVFv3 data._
24764
+ *
24765
+ * ```ts
24766
+ * const mapData = await getMapData({
24767
+ * ...
24768
+ * mvfVersion: '3.0.0',
24769
+ * });
24770
+ *
24771
+ * const locationProfile = mapData.getById('location-profile', id);
24772
+ * if (typeof locationProfile?.extra?.myProperty === 'string') {
24773
+ * // Do something
24774
+ * }
24775
+ * ```
24776
+ */
24777
+ extra?: Record<string, unknown>;
24759
24778
  /** @internal */
24760
24779
  constructor(data: MapDataInternal, options: {
24761
- mvfData: MVFLocation;
24780
+ mvf2Data: MVF2Location;
24781
+ mvf3Data?: MVF3Location;
24762
24782
  });
24763
24783
  /**
24764
24784
  * Gets the {@link Space}s associated with the location.
@@ -25680,6 +25700,7 @@ type TMapDataInternalOptions = {
25680
25700
  binaryBundle?: Uint8Array;
25681
25701
  tokenManager?: TokenManager;
25682
25702
  getMapDataOptions?: TGetMapDataOptions;
25703
+ mvf3?: ParsedMVFv3;
25683
25704
  };
25684
25705
  type MVFNodeFeature = MVFNodeCollection["features"][number];
25685
25706
  type MVFFloorFeature = FloorCollection["features"][number];
@@ -26126,6 +26147,7 @@ type MapDataRecords = {
26126
26147
  [floorId: string]: AnnotationCollection["features"][number][];
26127
26148
  };
26128
26149
  mvfAreasById: Record<AreaId, AreaCollection["features"][number]>;
26150
+ mvf3LocationsById: Record<string, Required<ParsedMVFv3>["locations"][number]>;
26129
26151
  };
26130
26152
  type EnterpriseMapDataRecords = {
26131
26153
  connectionsByExternalId: Record<string, Connection[]>;
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{A as C,B as D,C as E,D as F,E as H,F as I,H as J,I as K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,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-6KD6R6PO.js";import{a,c as b,db as G}from"./chunk-23T7JYTY.js";import"./chunk-IISBJAU5.js";import"./chunk-HA3ORCZX.js";import"./chunk-5W2UDR4H.js";export{y as ACTION_TYPE,I as ANIMATION_TWEENS,p as Annotation,h 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,i as Door,a as E_SDK_LOG_LEVEL,t as EnterpriseCategory,s as EnterpriseLocation,u as EnterpriseVenue,r as Facade,k as Floor,q as FloorStack,e as Hyperlink,f as ImageMetaData,F as LocationCategory,E as LocationProfile,l as MAPPEDIN_COLORS,n as MapObject,M as MapView,d as Node,o as PointOfInterest,j as Space,B as WALLS,P as __setWatermarkOnClickFn,W as checkWorkerUrls,K as disableText3DWorker,H as enableTestMode,O as findPreferredLanguageInVenue,S as forceEnterpriseLocations,U as getMapData,V as getMapDataEnterprise,J as getMultiFloorState,Y as getVersion,N as hydrateMapData,Q as hydrateMapDataFromMVF,v as parseMVF,G as preloadFont,b as setLoggerLevel,R as setUseEnterpriseAPI,L as setWorkersUrl,T as shouldForceEnterpriseLocations,X as show3dMap,Z as show3dMapGeojson,x as unzipAndParseMVFv2,w as unzipMVF};
1
+ import{A as C,B as D,C as E,D as F,E as H,F as I,H as J,I as K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,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-CFQGZNHP.js";import{a,c as b,db as G}from"./chunk-LJQH3W4N.js";import"./chunk-7FAUHPYW.js";import"./chunk-UEWLJ77M.js";import"./chunk-5W2UDR4H.js";export{y as ACTION_TYPE,I as ANIMATION_TWEENS,p as Annotation,h 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,i as Door,a as E_SDK_LOG_LEVEL,t as EnterpriseCategory,s as EnterpriseLocation,u as EnterpriseVenue,r as Facade,k as Floor,q as FloorStack,e as Hyperlink,f as ImageMetaData,F as LocationCategory,E as LocationProfile,l as MAPPEDIN_COLORS,n as MapObject,M as MapView,d as Node,o as PointOfInterest,j as Space,B as WALLS,P as __setWatermarkOnClickFn,W as checkWorkerUrls,K as disableText3DWorker,H as enableTestMode,O as findPreferredLanguageInVenue,S as forceEnterpriseLocations,U as getMapData,V as getMapDataEnterprise,J as getMultiFloorState,Y as getVersion,N as hydrateMapData,Q as hydrateMapDataFromMVF,v as parseMVF,G as preloadFont,b as setLoggerLevel,R as setUseEnterpriseAPI,L as setWorkersUrl,T as shouldForceEnterpriseLocations,X as show3dMap,Z as show3dMapGeojson,x as unzipAndParseMVFv2,w as unzipMVF};
@@ -1 +1 @@
1
- import{G as se,J as X,K as ae,h as H,q as S,r as B}from"./chunk-6KD6R6PO.js";import{y as D}from"./chunk-23T7JYTY.js";import"./chunk-IISBJAU5.js";import{$ as re,a as v}from"./chunk-HA3ORCZX.js";import{a as $,b as z,i as I}from"./chunk-5W2UDR4H.js";v();v();v();v();var L=class n{constructor(e,i,t,r,a="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(a),this.domElement.classList.add("controller"),this.domElement.classList.add(r),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)}},K=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 _e={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:W,toHexString:W},T={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=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Ee={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Me=[_e,T,we,Ee];function ke(n){return Me.find(e=>e.match(n))}var V=class extends L{constructor(e,i,t,r){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=r,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 a=W(this.$text.value);a&&this._setValueFromHexString(a)}),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}},F=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",r=>{r.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,r,a,l){super(e,i,t,"number"),this._initInput(),this.min(r),this.max(a);let o=l!==void 0;this.step(o?l:this._getImplicitStep(),o),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())},r=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))},a=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,o,c,p,d,s,h=5,u=b=>{o=b.clientX,c=p=b.clientY,l=!0,d=this.getValue(),s=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-o,k=b.clientY-c;Math.abs(k)>h?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>h&&m()}if(!l){let C=b.clientY-p;s-=C*this._step*this._arrowKeyMultiplier(b),d+s>this._max?s=this._max-d:d+s<this._min&&(s=this._min-d),this._snapClampSetValue(d+s)}p=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",a,{passive:!1}),this.$input.addEventListener("mousedown",u),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",f)}_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=(f,b,C,k,w)=>(f-b)/(C-b)*(w-k)+k,i=f=>{let b=this.$slider.getBoundingClientRect(),C=e(f,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=f=>{this._setDraggingStyle(!0),i(f.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",a)},r=f=>{i(f.clientX)},a=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",a)},l=!1,o,c,p=f=>{f.preventDefault(),this._setDraggingStyle(!0),i(f.touches[0].clientX),l=!1},d=f=>{f.touches.length>1||(this._hasScrollBar?(o=f.touches[0].clientX,c=f.touches[0].clientY,l=!0):p(f),window.addEventListener("touchmove",s,{passive:!1}),window.addEventListener("touchend",h))},s=f=>{if(l){let b=f.touches[0].clientX-o,C=f.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?p(f):(window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h))}else f.preventDefault(),i(f.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h)},u=this._callOnFinishChange.bind(this),g=400,m,y=f=>{if(Math.abs(f.deltaX)<Math.abs(f.deltaY)&&this._hasScrollBar)return;f.preventDefault();let C=this._normalizeMouseWheel(f)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(u,g)};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,r){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(r)}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",r=>{r.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}},Le='.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 $e(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 le=!1,ee=class n{constructor({parent:e,autoPlace:i=e===void 0,container:t,width:r,title:a="Controls",closeFolders:l=!1,injectStyles:o=!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(a),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"),!le&&o&&($e(Le),le=!0),t?t.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=l}add(e,i,t,r,a){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,r,a);case"boolean":return new K(this,e,i);case"string":return new q(this,e,i);case"function":return new F(this,e,i)}console.error("gui.add failed\n property:",i,"\n object:",e,"\n value:",l)}addColor(e,i,t=1){return new V(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 F||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 F)){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=a=>{a.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",t))};this.$children.addEventListener("transitionend",t);let r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"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}},G=ee;v();v();var E=(()=>{let n=new re;return function(i){return n.set(i),"#".concat(n.getHexString())}})();function de(n){let e;for(e of n)e()}var Ie=["interactive"];function U(n,e,i){let t={id:e.id,__type:e.__type},r=i.addFolder("".concat(e.type,"-").concat(e.id));for(let a in e){if(a==="visible"&&r.add(e,a).onChange(l=>{n.updateState(t,{[a]:l})}),a==="color"||a==="hoverColor"){e[a]=E(e[a]),r.addColor(e,a).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="height"){r.add(e,a,0,20,1).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="texture"&&e.texture){r.addFolder("Texture - side").add(e.texture,"url").onChange(o=>{n.updateState(t,{texture:{url:o}})});continue}if(a==="topTexture"&&e.topTexture){r.addFolder("Texture - top").add(e.topTexture,"url").onChange(o=>{n.updateState(t,{topTexture:{url:o}})});continue}if(a==="opacity"){r.add(e,a,0,1,.1).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="altitude"){r.add(e,a,0,100,1).onChange(l=>{n.updateState(t,{[a]:l})});continue}Ie.includes(a)&&r.add(e,a).onChange(l=>{n.updateState(t,{[a]:l})})}return e.isInView&&(r.add(e,"isInView").listen().disable(),r.add(e,"isInViewCheck")),{cleanup(){r.destroy()}}}v();v();function Se(){let n=[];function e(r,a){var c;let l=Object.values(r.getMapData())[0],o=a;if(o&&H.is(o)){let p=(c=l.getByType("enterprise-location"))==null?void 0:c.find(d=>d.spaces.some(s=>s.id===o.id));p&&(o=p)}return o}async function i(r,a){return a instanceof B?r.Camera.focusOn(a.locations.flatMap(l=>l.spaces),O):a instanceof S?r.Camera.focusOn(a.spaces,O):r.Camera.focusOn(a,O)}function t(r,a,{focus:l=!1}={}){if(!window.enableHighlightCard)return()=>{};let o=e(r,a),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 o){let d=document.createElement("h3");d.textContent=o.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(o instanceof S){if(o.description){let d=document.createElement("p");d.textContent=o.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(o.tags&&o.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 ",o.tags.forEach(s=>{let h=document.createElement("span");h.textContent=s,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(!(a instanceof B)){let d=new G({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 s=r.getState(a);s&&(U(r,$({id:a.id},s),d),c.appendChild(d.domElement)),p=d}return document.body.appendChild(c),l&&i(r,o),()=>{c.style.opacity="0",c.style.transform="translateY(-10px)",setTimeout(()=>c.remove(),300),p==null||p.destroy()}}return{highlightCard:t,highlight:(r,a,{focus:l=!0}={})=>{n.length>0&&n.forEach(c=>r.Markers.remove(c));let o=e(r,a);if(o instanceof S)l&&r.Camera.focusOn(o.spaces,O),n.push(...o.spaces.map(c=>r.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(o.name,"</h3>\n ").concat(o.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(o.description,"</p>"):"","\n ").concat(o.tags?o.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(o instanceof B){l&&r.Camera.focusOn(o.locations.flatMap(d=>d.spaces),O);let c=new Map,p=new Set;o.locations.forEach(d=>{c.has(d.name)||(d.spaces.forEach(s=>{n.push(r.Markers.add(s,'<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))}),o.locations.forEach(d=>{d.coordinates.forEach(s=>{let h="".concat(s.latitude,",").concat(s.longitude);if(!p.has(h)&&!c.has(d.name)){let u=r.Markers.add(s,'<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=>r.Markers.remove(c))}}}}var O={duration:300,easing:"ease-in-out"},R=Se();v();var _={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 De(n){n.add(_.options.places.fields,"name").name("Places: Name"),n.add(_.options.places.fields,"description").name("Places: Description"),n.add(_.options.places.fields,"link").name("Places: Link"),n.add(_.options.places.fields,"category").name("Places: Category"),n.add(_.options.places,"limit"),n.add(_.options.locations.fields,"name").name("Locations: Name"),n.add(_.options.locations.fields,"tag").name("Locations: Tag"),n.add(_.options.locations.fields,"description").name("Locations: Description"),n.add(_.options.places,"limit"),n.add(_.options.categories.fields,"name").name("Categories: Name")}function ce(n,e,i){var d;let t=new D,r=i.addFolder("Search");r.open();let a=r.add(_,"search").onChange(async s=>{let h=await e.Search.query(s,_.options);h&&(_.results=h,o(h,t))}),l=document.createElement("div");l.style.marginLeft="10px",(d=a.domElement.parentElement)==null||d.appendChild(l);let{renderSearch:o,close:c}=Fe(n,e,l,a.$input),p=r.addFolder("Advanced");return p.close(),De(p),document.addEventListener("keydown",s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"?(s.preventDefault(),r._closed&&r.open(),a.$input.focus()):s.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Fe(n,e,i,t){let r,a;t.addEventListener("input",async o=>{o instanceof InputEvent&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")&&(clearTimeout(r),r=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(o){if(!o){t.placeholder="";return}let c=t.value;t.value=o,t.setSelectionRange(c.length,o.length)}return{renderSearch(o,c){var p,d;if(o.places.length===0&&((p=o.enterpriseCategories)==null?void 0:p.length)===0&&((d=o.enterpriseLocations)==null?void 0:d.length)===0){i.textContent="No results found.";return}a=Te(i,o,n,c)},close(){a.destroy()}}}function Te(n,e,i,t){n.innerHTML="";let r=document.createElement("div");Object.assign(r.style,N.dropdownContainer);let a=document.createElement("ul");a.className="options-list",Object.assign(a.style,N.optionsList),a.style.display="block";let l=[],o=(h,u)=>{if(u&&u.length>0){let g=document.createElement("li");g.textContent=h,Object.assign(g.style,N.sectionHeader),a.appendChild(g),u.forEach((m,y)=>{let f=document.createElement("li");f.textContent="".concat("name"in m.item?m.item.name:""," (").concat(m.type,")"),Object.assign(f.style,N.option),f.tabIndex=0,f.addEventListener("focus",()=>{p(l.indexOf(f))}),f.addEventListener("mouseover",()=>{f.style.backgroundColor="#f0f0f0"}),f.addEventListener("mouseout",()=>{f.style.backgroundColor=""}),f.addEventListener("click",()=>{}),f.setAttribute("data-type",h),f.setAttribute("data-index",y.toString()),a.appendChild(f),l.push(f)})}};o("enterpriseLocations",e.enterpriseLocations),o("enterpriseCategories",e.enterpriseCategories),o("Places",e.places),r.appendChild(a),n.appendChild(r);let c=[],p=h=>{c.forEach(f=>f()),c=[],l.forEach((f,b)=>{b===h?f.style.backgroundColor="#e0e0e0":f.style.backgroundColor=""});let u=l[h],g=u.getAttribute("data-type"),m=parseInt(u.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},d=h=>{!r.contains(h.target)&&h.target!==n&&s()};document.addEventListener("click",d);let s=()=>{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 he(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:r}=ce(n,e,i);r.on("highlight",d=>{if(d){t.forEach(h=>h()),t=[];let s=d instanceof S?d.spaces[0]:d;if(n.Camera.focusOn(d),s&&!H.is(s))return;t.push(R.highlightCard(n,s,{focus:!0}))}else t.forEach(s=>s()),t=[]});let a=i.addFolder("Click \u{1F447}").close(),{sub:l}=Oe(n,a);l.on("click",d=>{var s;t.forEach(h=>h()),t=[],(s=d.spaces)!=null&&s[0]&&(t=[R.highlightCard(n,d.spaces[0])])});let o=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Pe(n,o),p;c.on("hover",d=>{var s;(s=d.spaces)!=null&&s[0]?(p==null||p(),t.length===0&&(p=R.highlightCard(n,d.spaces[0]))):(p==null||p(),p=void 0)})}function Oe(n,e){let i=new D,t={position:"",hoverColor:E(n.getHoverColor())},r=e.add(t,"position").disable(),a=[];function l(){a.forEach(c=>c()),a.length=0}let o=0;return n.on("click",c=>{var u,g,m;let{labels:p,coordinate:d}=c;l(),i.publish("click",c),clearInterval(o),r.load(JSON.stringify([d.longitude,d.latitude]));let s=p==null?void 0:p[0];if(s!=null){let y=P(n,s,e);if(!y)return;a.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(u=c.spaces)==null?void 0:u[0])!=null?m:(g=c.objects)==null?void 0:g[0];if(h){let y=z($($({},h),n.getState(h)),{isInView:!1,isInViewCheck:j(n,h.id)}),{cleanup:f}=U(n,y,e);o=setInterval(()=>{y.isInView=n.isInView(s||h)},500),a.push(f)}}),{sub:i}}function Pe(n,e){let i=new D;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},r=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(o=>{n.setHoverColor(o)});let a=[];function l(){a.forEach(o=>o()),a.length=0}return n.on("hover",o=>{var m,y,f;let{coordinate:c,spaces:p,objects:d,markers:s,labels:h}=o;l(),i.publish("hover",o),r.load(JSON.stringify([c.longitude,c.latitude]));let u=(f=(y=(m=p==null?void 0:p[0])!=null?m:d==null?void 0:d[0])!=null?y:s==null?void 0:s[0])!=null?f:h==null?void 0:h[0];if(!u)return;let g=n.getState(u);g&&(t.type=g.type,t.id=u.id)}),{sub:i}}function j(n,e){return function(){console.log("isInView",n.isInView(e))}}function ue(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:r,destroy:a}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let o=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.labels[m.id],(y=o.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];u(y)}}return{rerender:g,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 g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),d=g}else r(u)});function s(h){for(let u of h)t.labels[u.id]=u;c()}return{populatelabels:s,destroy(){a()}}}function ze(n,e,i,t,r){var m,y,f;let{interactive:a,enabled:l,rank:o,anchor:c,dynamicResize:p,zIndex:d,contentHTML:s,lowPriorityPin:h}=t;if(a==null||l==null)throw new Error("incomplete marker state");let u={interactive:a,enabled:l,rank:o||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:p||!1,zIndex:d||0,contentHTML:s||"",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((f=h==null?void 0:h.color)!=null?f:"#666")},remove(){n.Markers.remove(e),r==null||r(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 g=i.addFolder("Low Priority Pin");g.add(u.lowPriorityPin,"enabled"),g.add(u.lowPriorityPin,"size",1,20,1),g.addColor(u.lowPriorityPin,"color"),g.close(),i.add(u,"isInView"),i.add(u,"remove")}function He(n,e,i,t,r){let{appearance:a,interactive:l}=t;if(!a||a.margin==null||l==null)throw new Error("incomplte label state");let o={text:e.text,interactive:l,appearance:z($({},a),{margin:a.margin||0,pinColor:a.pinColor?E(a.pinColor):"black",textColor:a.textColor?E(a.textColor):"black"}),remove(){n.Labels.remove(e),r==null||r(e),i.destroy()},isInView:j(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:o.appearance,interactive:o.interactive})}),i.add(o.appearance,"margin",0,20).name("margin"),i.add(o,"text"),i.add(o,"interactive"),i.addColor(o.appearance,"pinColor").name("pin color"),i.addColor(o.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(o.appearance,"textColor").name("text color"),i.addColor(o.appearance,"textOutlineColor").name("text outline color"),i.add(o,"isInView"),i.add(o,"remove")}function P(n,e,i,{onRemove:t}={}){var o;let r=n.getState(e);if(!r)throw new Error("error getting state for entity: ".concat(e.id));let a=r.type===X?((o=e.text)==null?void 0:o.substring(0,12))||"Label":"Marker ".concat(e.id.toString().substring(0,8)),l=i.addFolder(a);if(l.close(),r.type===X)He(n,e,l,r,t);else if(r.type===ae)ze(n,e,l,r,t);else throw new Error("unsupported entity type: ".concat(r.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(r){return i._closed||!t.onClick?void 0:e.Labels.add(r,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var pe={};v();function ge(n,e,i){var ne,oe;let t=n.addFolder("Camera \u{1F4F7}"),r=e.Camera.center.toJSON(),a=document.createElement("div");Object.assign(a.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(a);let l=()=>e.getDimensions(),[o,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],s={center_lat:r.latitude,center_lon:r.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:o,inset_left:d,inset_right:c,inset_bottom:p,animateOnLoad:!0,visualizeInset:!!(o||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(){s.inset_type=e.Camera.screenOffsets.type,s.inset_left=e.Camera.screenOffsets.left,s.inset_top=e.Camera.screenOffsets.top,s.inset_right=e.Camera.screenOffsets.right,s.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:M}=l();s.inset_type==="portion"?Object.assign(a.style,{left:s.inset_left*x+"px",top:s.inset_top*M+"px",bottom:s.inset_bottom*M+"px",right:s.inset_right*x+"px"}):Object.assign(a.style,{left:s.inset_left+"px",top:s.inset_top+"px",bottom:s.inset_bottom+"px",right:s.inset_right+"px"})}t.add(s,"center_lat").listen().disable(),t.add(s,"center_lon").listen().disable(),t.add(s,"zoomLevel",16,22,.5).listen().disable(),t.add(s,"pitch").listen().disable(),t.add(s,"bearing").listen().disable(),t.add(s,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(s,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(s,"animateOnLoad"),t.add(s,"visualizeInset").onChange(ie),ie(s.visualizeInset);let u,g,m,y;function f(){let{width:x,height:M}=l(),Y=e.Camera.screenOffsets.type,J=s.inset_type;Y!==J&&(J==="portion"&&Y==="pixel"?(s.inset_top=x>0?Math.min(s.inset_top/M,1):0,s.inset_bottom=x>0?Math.min(s.inset_bottom/M,1):0,s.inset_left=M>0?Math.min(s.inset_left/x,1):0,s.inset_right=M>0?Math.min(s.inset_right/x,1):0):J==="pixel"&&Y==="portion"&&(s.inset_top=Math.round(s.inset_top*M),s.inset_bottom=Math.round(s.inset_bottom*M),s.inset_left=Math.round(s.inset_left*x),s.inset_right=Math.round(s.inset_right*x))),u&&u.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),s.inset_type==="portion"?(u=t.add(s,"inset_top",0,1,.01).onChange(w),g=t.add(s,"inset_bottom",0,1,.01).onChange(w),m=t.add(s,"inset_left",0,1,.01).onChange(w),y=t.add(s,"inset_right",0,1,.01).onChange(w)):(u=t.add(s,"inset_top",0,M,1).onChange(w),g=t.add(s,"inset_bottom",0,M,1).onChange(w),m=t.add(s,"inset_left",0,x,1).onChange(w),y=t.add(s,"inset_right",0,x,1).onChange(w))}t.add(s,"inset_type",["pixel","portion"]).onChange(()=>{f(),w()}),f();let b=Ue(e);t.add(s,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),s["Focus on click"]&&e.on("click",b),t.add(s,"Focus on current floor");let C=x=>{t._closed||(s.center_lat=x.center.latitude,s.center_lon=x.center.longitude,s.zoomLevel=x.zoomLevel,s.bearing=x.bearing,s.pitch=x.pitch)};e.on("camera-change",C);let k=[()=>{e.off("camera-change",C)}];function w(){e.Camera.setScreenOffsets({top:s.inset_top,left:s.inset_left,right:s.inset_right,bottom:s.inset_bottom,type:s.inset_type}),h()}(s.inset_top||s.inset_right||s.inset_bottom||s.inset_left)&&w();function ie(x){h(),x?a.style.display="block":a.style.display="none"}return()=>({destroy(){t.destroy(),de(k)}})}function Ue(n){return function(i){var l;let{spaces:t,objects:r}=i,a=(l=t==null?void 0:t[0])!=null?l:r==null?void 0:r[0];a&&n.Camera.focusOn(a)}}v();function fe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(u=>{delete this.markers[u.id]}),c()}},{addMarker:r,destroy:a}=Re(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let o=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.markers[m.id],(y=o.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];u(y)}}return{rerender:g,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 g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),d=g}else r(u)});function s(h){for(let u of h)t.markers[u.id]=u;c()}return{populateMarkers:s,destroy(){a()}}}function Re(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 r=i.addFolder("Low Priority Pin");return r.add(t.lowPriorityPin,"enabled"),r.add(t.lowPriorityPin,"size",1,20,1),r.addColor(t.lowPriorityPin,"color"),r.close(),{destroy(){i.destroy()},addMarker(a){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(a,t.contentHTML,l)}}}v();function me(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 be(n,e,i){var a,l;n.close();let t={language:(l=(a=i.currentLanguage)==null?void 0:a.code)!=null?l:"en"},r=i.getByType("enterprise-venue");n.add(t,"language",r==null?void 0:r.languages.map(o=>o.code)).onChange(o=>{i.changeLanguage(o)})}v();function ye(n,e,i){let t=n.addFolder("Debug");t.close();let r=e.Debug.state,a={showPolygonLabelTextAreaMesh:r.showPolygonLabelTextAreaMesh,showCollisionBoxes:r.showCollisionBoxes,showEnvMap:r.showEnvMap};t.add(a,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(a,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(a,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(a)}v();function ve(n,e,i){let t=n.addFolder("Text3D").close(),r={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(r,"all").name("Show All"),t.add(r,"removeAll").name("Remove All")}v();function xe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let r=localStorage.getItem("directionsMethod"),a=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",o={enabled:!1,method:r||"dp-optimal",radius:a?parseFloat(a):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,p,d;t.add(o,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,p=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(o,"startCoordinate").name("Start").disable().listen(),t.add(o,"endCoordinate").name("End").disable().listen(),t.add(o,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&p&&o.enabled&&u(c,p)}),t.add(o,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&p&&o.enabled&&u(c,p)}),t.add(o,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&p&&o.enabled&&u(c,p)}),t.add(o,"pathInfo").name("Path Info").disable().listen();let s={clear:()=>h()};t.add(s,"clear").name("Clear Path");function h(){c=void 0,p=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function u(m,y){var f;d&&(e.Paths.remove(d),d=void 0);try{let b=await e.getDirections(m,y,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:o.method,radius:o.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:o.includeDoorBufferNodes}});if(b){d=e.Paths.add(b.coordinates,{interactive:!0,color:"green",width:1});let k=((f=b.distance)==null?void 0:f.toFixed(2))||"N/A";o.pathInfo="".concat(b.coordinates.length," pts, ").concat(k,"m")}else o.pathInfo="No path found"}catch(b){o.pathInfo="Error: ".concat(b instanceof Error?b.message:"Unknown")}}let g=async m=>{if(o.enabled)if(c){let y=m.coordinate;p=y,o.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Calculating...",await u(c,p),c=void 0,p=void 0}else{let y=m.coordinate;c=y,o.startCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}function Ae(n,e,i){Ne();let t=new G({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),he(e,n,t),ge(t,e,i==null?void 0:i.camera);let r=t.addFolder("Levels").close(),a=t.addFolder("Scene Controls");a.close();let l=t.addFolder("Labels");ve(t,e,n);let o=t.addFolder("Markers");me(t,e);let c=t.addFolder("misc");ye(t,e,n),xe(t,e,n),be(c,e,n);let p={level:e.currentFloor.id},{populatelabels:d}=ue(l,n,e),{populateMarkers:s}=fe(o,n,e),h=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),u=r.add(p,"level",h).onChange(g=>{e.setFloor(g),p.level=e.currentFloor.id,u.updateDisplay()});return e.on("floor-change-start",g=>{r.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:a,populateMarkers:s}}var Ce="mappedin-sdk-debug-css";function Ne(){if(document.getElementById(Ce))return;let n=document.createElement("style");n.id=Ce,n.textContent=pe,document.head.appendChild(n)}var te=class{constructor(e,i){I(this,"_enabled",!1);I(this,"mv");I(this,"api");I(this,"mapData");I(this,"scenegraphVisualizerMounted",!1);I(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}=Ae(this.mapData,this.mv,e);i.onOpenClose(r=>{r===i&&!r._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,se(this.api.core,i))}),(t=this.api.getMapDataInternal())==null||t.spaces.forEach(r=>{this.mv.updateState(r,{interactive:!0})})}get enabled(){return this._enabled}};export{te as Inspector};
1
+ import{G as se,J as X,K as ae,h as H,q as S,r as B}from"./chunk-CFQGZNHP.js";import{y as D}from"./chunk-LJQH3W4N.js";import"./chunk-7FAUHPYW.js";import{$ as re,a as v}from"./chunk-UEWLJ77M.js";import{a as $,b as z,i as I}from"./chunk-5W2UDR4H.js";v();v();v();v();var L=class n{constructor(e,i,t,r,a="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(a),this.domElement.classList.add("controller"),this.domElement.classList.add(r),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)}},K=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 _e={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:W,toHexString:W},T={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=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Ee={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=T.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 r=n*t<<16^e*t<<8^i*t<<0;return T.toHexString(r)}},Me=[_e,T,we,Ee];function ke(n){return Me.find(e=>e.match(n))}var V=class extends L{constructor(e,i,t,r){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=r,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 a=W(this.$text.value);a&&this._setValueFromHexString(a)}),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}},F=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",r=>{r.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,r,a,l){super(e,i,t,"number"),this._initInput(),this.min(r),this.max(a);let o=l!==void 0;this.step(o?l:this._getImplicitStep(),o),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())},r=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))},a=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,o,c,p,d,s,h=5,u=b=>{o=b.clientX,c=p=b.clientY,l=!0,d=this.getValue(),s=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-o,k=b.clientY-c;Math.abs(k)>h?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>h&&m()}if(!l){let C=b.clientY-p;s-=C*this._step*this._arrowKeyMultiplier(b),d+s>this._max?s=this._max-d:d+s<this._min&&(s=this._min-d),this._snapClampSetValue(d+s)}p=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",a,{passive:!1}),this.$input.addEventListener("mousedown",u),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",f)}_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=(f,b,C,k,w)=>(f-b)/(C-b)*(w-k)+k,i=f=>{let b=this.$slider.getBoundingClientRect(),C=e(f,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=f=>{this._setDraggingStyle(!0),i(f.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",a)},r=f=>{i(f.clientX)},a=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",a)},l=!1,o,c,p=f=>{f.preventDefault(),this._setDraggingStyle(!0),i(f.touches[0].clientX),l=!1},d=f=>{f.touches.length>1||(this._hasScrollBar?(o=f.touches[0].clientX,c=f.touches[0].clientY,l=!0):p(f),window.addEventListener("touchmove",s,{passive:!1}),window.addEventListener("touchend",h))},s=f=>{if(l){let b=f.touches[0].clientX-o,C=f.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?p(f):(window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h))}else f.preventDefault(),i(f.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",s),window.removeEventListener("touchend",h)},u=this._callOnFinishChange.bind(this),g=400,m,y=f=>{if(Math.abs(f.deltaX)<Math.abs(f.deltaY)&&this._hasScrollBar)return;f.preventDefault();let C=this._normalizeMouseWheel(f)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(u,g)};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,r){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(r)}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",r=>{r.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}},Le='.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 $e(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 le=!1,ee=class n{constructor({parent:e,autoPlace:i=e===void 0,container:t,width:r,title:a="Controls",closeFolders:l=!1,injectStyles:o=!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(a),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"),!le&&o&&($e(Le),le=!0),t?t.appendChild(this.domElement):i&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=l}add(e,i,t,r,a){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,r,a);case"boolean":return new K(this,e,i);case"string":return new q(this,e,i);case"function":return new F(this,e,i)}console.error("gui.add failed\n property:",i,"\n object:",e,"\n value:",l)}addColor(e,i,t=1){return new V(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 F||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 F)){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=a=>{a.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",t))};this.$children.addEventListener("transitionend",t);let r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"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}},G=ee;v();v();var E=(()=>{let n=new re;return function(i){return n.set(i),"#".concat(n.getHexString())}})();function de(n){let e;for(e of n)e()}var Ie=["interactive"];function U(n,e,i){let t={id:e.id,__type:e.__type},r=i.addFolder("".concat(e.type,"-").concat(e.id));for(let a in e){if(a==="visible"&&r.add(e,a).onChange(l=>{n.updateState(t,{[a]:l})}),a==="color"||a==="hoverColor"){e[a]=E(e[a]),r.addColor(e,a).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="height"){r.add(e,a,0,20,1).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="texture"&&e.texture){r.addFolder("Texture - side").add(e.texture,"url").onChange(o=>{n.updateState(t,{texture:{url:o}})});continue}if(a==="topTexture"&&e.topTexture){r.addFolder("Texture - top").add(e.topTexture,"url").onChange(o=>{n.updateState(t,{topTexture:{url:o}})});continue}if(a==="opacity"){r.add(e,a,0,1,.1).onChange(l=>{n.updateState(t,{[a]:l})});continue}if(a==="altitude"){r.add(e,a,0,100,1).onChange(l=>{n.updateState(t,{[a]:l})});continue}Ie.includes(a)&&r.add(e,a).onChange(l=>{n.updateState(t,{[a]:l})})}return e.isInView&&(r.add(e,"isInView").listen().disable(),r.add(e,"isInViewCheck")),{cleanup(){r.destroy()}}}v();v();function Se(){let n=[];function e(r,a){var c;let l=Object.values(r.getMapData())[0],o=a;if(o&&H.is(o)){let p=(c=l.getByType("enterprise-location"))==null?void 0:c.find(d=>d.spaces.some(s=>s.id===o.id));p&&(o=p)}return o}async function i(r,a){return a instanceof B?r.Camera.focusOn(a.locations.flatMap(l=>l.spaces),O):a instanceof S?r.Camera.focusOn(a.spaces,O):r.Camera.focusOn(a,O)}function t(r,a,{focus:l=!1}={}){if(!window.enableHighlightCard)return()=>{};let o=e(r,a),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 o){let d=document.createElement("h3");d.textContent=o.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(o instanceof S){if(o.description){let d=document.createElement("p");d.textContent=o.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(o.tags&&o.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 ",o.tags.forEach(s=>{let h=document.createElement("span");h.textContent=s,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(!(a instanceof B)){let d=new G({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 s=r.getState(a);s&&(U(r,$({id:a.id},s),d),c.appendChild(d.domElement)),p=d}return document.body.appendChild(c),l&&i(r,o),()=>{c.style.opacity="0",c.style.transform="translateY(-10px)",setTimeout(()=>c.remove(),300),p==null||p.destroy()}}return{highlightCard:t,highlight:(r,a,{focus:l=!0}={})=>{n.length>0&&n.forEach(c=>r.Markers.remove(c));let o=e(r,a);if(o instanceof S)l&&r.Camera.focusOn(o.spaces,O),n.push(...o.spaces.map(c=>r.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(o.name,"</h3>\n ").concat(o.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(o.description,"</p>"):"","\n ").concat(o.tags?o.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(o instanceof B){l&&r.Camera.focusOn(o.locations.flatMap(d=>d.spaces),O);let c=new Map,p=new Set;o.locations.forEach(d=>{c.has(d.name)||(d.spaces.forEach(s=>{n.push(r.Markers.add(s,'<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))}),o.locations.forEach(d=>{d.coordinates.forEach(s=>{let h="".concat(s.latitude,",").concat(s.longitude);if(!p.has(h)&&!c.has(d.name)){let u=r.Markers.add(s,'<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=>r.Markers.remove(c))}}}}var O={duration:300,easing:"ease-in-out"},R=Se();v();var _={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 De(n){n.add(_.options.places.fields,"name").name("Places: Name"),n.add(_.options.places.fields,"description").name("Places: Description"),n.add(_.options.places.fields,"link").name("Places: Link"),n.add(_.options.places.fields,"category").name("Places: Category"),n.add(_.options.places,"limit"),n.add(_.options.locations.fields,"name").name("Locations: Name"),n.add(_.options.locations.fields,"tag").name("Locations: Tag"),n.add(_.options.locations.fields,"description").name("Locations: Description"),n.add(_.options.places,"limit"),n.add(_.options.categories.fields,"name").name("Categories: Name")}function ce(n,e,i){var d;let t=new D,r=i.addFolder("Search");r.open();let a=r.add(_,"search").onChange(async s=>{let h=await e.Search.query(s,_.options);h&&(_.results=h,o(h,t))}),l=document.createElement("div");l.style.marginLeft="10px",(d=a.domElement.parentElement)==null||d.appendChild(l);let{renderSearch:o,close:c}=Fe(n,e,l,a.$input),p=r.addFolder("Advanced");return p.close(),De(p),document.addEventListener("keydown",s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"?(s.preventDefault(),r._closed&&r.open(),a.$input.focus()):s.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Fe(n,e,i,t){let r,a;t.addEventListener("input",async o=>{o instanceof InputEvent&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")&&(clearTimeout(r),r=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(o){if(!o){t.placeholder="";return}let c=t.value;t.value=o,t.setSelectionRange(c.length,o.length)}return{renderSearch(o,c){var p,d;if(o.places.length===0&&((p=o.enterpriseCategories)==null?void 0:p.length)===0&&((d=o.enterpriseLocations)==null?void 0:d.length)===0){i.textContent="No results found.";return}a=Te(i,o,n,c)},close(){a.destroy()}}}function Te(n,e,i,t){n.innerHTML="";let r=document.createElement("div");Object.assign(r.style,N.dropdownContainer);let a=document.createElement("ul");a.className="options-list",Object.assign(a.style,N.optionsList),a.style.display="block";let l=[],o=(h,u)=>{if(u&&u.length>0){let g=document.createElement("li");g.textContent=h,Object.assign(g.style,N.sectionHeader),a.appendChild(g),u.forEach((m,y)=>{let f=document.createElement("li");f.textContent="".concat("name"in m.item?m.item.name:""," (").concat(m.type,")"),Object.assign(f.style,N.option),f.tabIndex=0,f.addEventListener("focus",()=>{p(l.indexOf(f))}),f.addEventListener("mouseover",()=>{f.style.backgroundColor="#f0f0f0"}),f.addEventListener("mouseout",()=>{f.style.backgroundColor=""}),f.addEventListener("click",()=>{}),f.setAttribute("data-type",h),f.setAttribute("data-index",y.toString()),a.appendChild(f),l.push(f)})}};o("enterpriseLocations",e.enterpriseLocations),o("enterpriseCategories",e.enterpriseCategories),o("Places",e.places),r.appendChild(a),n.appendChild(r);let c=[],p=h=>{c.forEach(f=>f()),c=[],l.forEach((f,b)=>{b===h?f.style.backgroundColor="#e0e0e0":f.style.backgroundColor=""});let u=l[h],g=u.getAttribute("data-type"),m=parseInt(u.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},d=h=>{!r.contains(h.target)&&h.target!==n&&s()};document.addEventListener("click",d);let s=()=>{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 he(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:r}=ce(n,e,i);r.on("highlight",d=>{if(d){t.forEach(h=>h()),t=[];let s=d instanceof S?d.spaces[0]:d;if(n.Camera.focusOn(d),s&&!H.is(s))return;t.push(R.highlightCard(n,s,{focus:!0}))}else t.forEach(s=>s()),t=[]});let a=i.addFolder("Click \u{1F447}").close(),{sub:l}=Oe(n,a);l.on("click",d=>{var s;t.forEach(h=>h()),t=[],(s=d.spaces)!=null&&s[0]&&(t=[R.highlightCard(n,d.spaces[0])])});let o=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Pe(n,o),p;c.on("hover",d=>{var s;(s=d.spaces)!=null&&s[0]?(p==null||p(),t.length===0&&(p=R.highlightCard(n,d.spaces[0]))):(p==null||p(),p=void 0)})}function Oe(n,e){let i=new D,t={position:"",hoverColor:E(n.getHoverColor())},r=e.add(t,"position").disable(),a=[];function l(){a.forEach(c=>c()),a.length=0}let o=0;return n.on("click",c=>{var u,g,m;let{labels:p,coordinate:d}=c;l(),i.publish("click",c),clearInterval(o),r.load(JSON.stringify([d.longitude,d.latitude]));let s=p==null?void 0:p[0];if(s!=null){let y=P(n,s,e);if(!y)return;a.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(u=c.spaces)==null?void 0:u[0])!=null?m:(g=c.objects)==null?void 0:g[0];if(h){let y=z($($({},h),n.getState(h)),{isInView:!1,isInViewCheck:j(n,h.id)}),{cleanup:f}=U(n,y,e);o=setInterval(()=>{y.isInView=n.isInView(s||h)},500),a.push(f)}}),{sub:i}}function Pe(n,e){let i=new D;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},r=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(o=>{n.setHoverColor(o)});let a=[];function l(){a.forEach(o=>o()),a.length=0}return n.on("hover",o=>{var m,y,f;let{coordinate:c,spaces:p,objects:d,markers:s,labels:h}=o;l(),i.publish("hover",o),r.load(JSON.stringify([c.longitude,c.latitude]));let u=(f=(y=(m=p==null?void 0:p[0])!=null?m:d==null?void 0:d[0])!=null?y:s==null?void 0:s[0])!=null?f:h==null?void 0:h[0];if(!u)return;let g=n.getState(u);g&&(t.type=g.type,t.id=u.id)}),{sub:i}}function j(n,e){return function(){console.log("isInView",n.isInView(e))}}function ue(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:r,destroy:a}=Be(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let o=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.labels[m.id],(y=o.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];u(y)}}return{rerender:g,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 g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),d=g}else r(u)});function s(h){for(let u of h)t.labels[u.id]=u;c()}return{populatelabels:s,destroy(){a()}}}function ze(n,e,i,t,r){var m,y,f;let{interactive:a,enabled:l,rank:o,anchor:c,dynamicResize:p,zIndex:d,contentHTML:s,lowPriorityPin:h}=t;if(a==null||l==null)throw new Error("incomplete marker state");let u={interactive:a,enabled:l,rank:o||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:p||!1,zIndex:d||0,contentHTML:s||"",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((f=h==null?void 0:h.color)!=null?f:"#666")},remove(){n.Markers.remove(e),r==null||r(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 g=i.addFolder("Low Priority Pin");g.add(u.lowPriorityPin,"enabled"),g.add(u.lowPriorityPin,"size",1,20,1),g.addColor(u.lowPriorityPin,"color"),g.close(),i.add(u,"isInView"),i.add(u,"remove")}function He(n,e,i,t,r){let{appearance:a,interactive:l}=t;if(!a||a.margin==null||l==null)throw new Error("incomplte label state");let o={text:e.text,interactive:l,appearance:z($({},a),{margin:a.margin||0,pinColor:a.pinColor?E(a.pinColor):"black",textColor:a.textColor?E(a.textColor):"black"}),remove(){n.Labels.remove(e),r==null||r(e),i.destroy()},isInView:j(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:o.appearance,interactive:o.interactive})}),i.add(o.appearance,"margin",0,20).name("margin"),i.add(o,"text"),i.add(o,"interactive"),i.addColor(o.appearance,"pinColor").name("pin color"),i.addColor(o.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(o.appearance,"textColor").name("text color"),i.addColor(o.appearance,"textOutlineColor").name("text outline color"),i.add(o,"isInView"),i.add(o,"remove")}function P(n,e,i,{onRemove:t}={}){var o;let r=n.getState(e);if(!r)throw new Error("error getting state for entity: ".concat(e.id));let a=r.type===X?((o=e.text)==null?void 0:o.substring(0,12))||"Label":"Marker ".concat(e.id.toString().substring(0,8)),l=i.addFolder(a);if(l.close(),r.type===X)He(n,e,l,r,t);else if(r.type===ae)ze(n,e,l,r,t);else throw new Error("unsupported entity type: ".concat(r.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(r){return i._closed||!t.onClick?void 0:e.Labels.add(r,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var pe={};v();function ge(n,e,i){var ne,oe;let t=n.addFolder("Camera \u{1F4F7}"),r=e.Camera.center.toJSON(),a=document.createElement("div");Object.assign(a.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(a);let l=()=>e.getDimensions(),[o,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],s={center_lat:r.latitude,center_lon:r.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:o,inset_left:d,inset_right:c,inset_bottom:p,animateOnLoad:!0,visualizeInset:!!(o||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(){s.inset_type=e.Camera.screenOffsets.type,s.inset_left=e.Camera.screenOffsets.left,s.inset_top=e.Camera.screenOffsets.top,s.inset_right=e.Camera.screenOffsets.right,s.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:M}=l();s.inset_type==="portion"?Object.assign(a.style,{left:s.inset_left*x+"px",top:s.inset_top*M+"px",bottom:s.inset_bottom*M+"px",right:s.inset_right*x+"px"}):Object.assign(a.style,{left:s.inset_left+"px",top:s.inset_top+"px",bottom:s.inset_bottom+"px",right:s.inset_right+"px"})}t.add(s,"center_lat").listen().disable(),t.add(s,"center_lon").listen().disable(),t.add(s,"zoomLevel",16,22,.5).listen().disable(),t.add(s,"pitch").listen().disable(),t.add(s,"bearing").listen().disable(),t.add(s,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(s,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(s,"animateOnLoad"),t.add(s,"visualizeInset").onChange(ie),ie(s.visualizeInset);let u,g,m,y;function f(){let{width:x,height:M}=l(),Y=e.Camera.screenOffsets.type,J=s.inset_type;Y!==J&&(J==="portion"&&Y==="pixel"?(s.inset_top=x>0?Math.min(s.inset_top/M,1):0,s.inset_bottom=x>0?Math.min(s.inset_bottom/M,1):0,s.inset_left=M>0?Math.min(s.inset_left/x,1):0,s.inset_right=M>0?Math.min(s.inset_right/x,1):0):J==="pixel"&&Y==="portion"&&(s.inset_top=Math.round(s.inset_top*M),s.inset_bottom=Math.round(s.inset_bottom*M),s.inset_left=Math.round(s.inset_left*x),s.inset_right=Math.round(s.inset_right*x))),u&&u.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),s.inset_type==="portion"?(u=t.add(s,"inset_top",0,1,.01).onChange(w),g=t.add(s,"inset_bottom",0,1,.01).onChange(w),m=t.add(s,"inset_left",0,1,.01).onChange(w),y=t.add(s,"inset_right",0,1,.01).onChange(w)):(u=t.add(s,"inset_top",0,M,1).onChange(w),g=t.add(s,"inset_bottom",0,M,1).onChange(w),m=t.add(s,"inset_left",0,x,1).onChange(w),y=t.add(s,"inset_right",0,x,1).onChange(w))}t.add(s,"inset_type",["pixel","portion"]).onChange(()=>{f(),w()}),f();let b=Ue(e);t.add(s,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),s["Focus on click"]&&e.on("click",b),t.add(s,"Focus on current floor");let C=x=>{t._closed||(s.center_lat=x.center.latitude,s.center_lon=x.center.longitude,s.zoomLevel=x.zoomLevel,s.bearing=x.bearing,s.pitch=x.pitch)};e.on("camera-change",C);let k=[()=>{e.off("camera-change",C)}];function w(){e.Camera.setScreenOffsets({top:s.inset_top,left:s.inset_left,right:s.inset_right,bottom:s.inset_bottom,type:s.inset_type}),h()}(s.inset_top||s.inset_right||s.inset_bottom||s.inset_left)&&w();function ie(x){h(),x?a.style.display="block":a.style.display="none"}return()=>({destroy(){t.destroy(),de(k)}})}function Ue(n){return function(i){var l;let{spaces:t,objects:r}=i,a=(l=t==null?void 0:t[0])!=null?l:r==null?void 0:r[0];a&&n.Camera.focusOn(a)}}v();function fe(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(u=>{delete this.markers[u.id]}),c()}},{addMarker:r,destroy:a}=Re(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let o=new Map,{rerender:c}=p();function p(){function h(m){var y;delete t.markers[m.id],(y=o.get(m.id))==null||y.destroy()}function u(m){let y=P(i,m,l,{onRemove:b=>{h(b)}});if(!y)return;let{labelItemFolder:f}=y;o.set(m.id,f)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];u(y)}}return{rerender:g,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 g=o.get(h[0].id);if(n.open(),!g)return;g==null||g.open(),g==null||g.domElement.scrollIntoView({block:"start"}),g==null||g.domElement.focus(),d=g}else r(u)});function s(h){for(let u of h)t.markers[u.id]=u;c()}return{populateMarkers:s,destroy(){a()}}}function Re(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 r=i.addFolder("Low Priority Pin");return r.add(t.lowPriorityPin,"enabled"),r.add(t.lowPriorityPin,"size",1,20,1),r.addColor(t.lowPriorityPin,"color"),r.close(),{destroy(){i.destroy()},addMarker(a){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(a,t.contentHTML,l)}}}v();function me(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 be(n,e,i){var a,l;n.close();let t={language:(l=(a=i.currentLanguage)==null?void 0:a.code)!=null?l:"en"},r=i.getByType("enterprise-venue");n.add(t,"language",r==null?void 0:r.languages.map(o=>o.code)).onChange(o=>{i.changeLanguage(o)})}v();function ye(n,e,i){let t=n.addFolder("Debug");t.close();let r=e.Debug.state,a={showPolygonLabelTextAreaMesh:r.showPolygonLabelTextAreaMesh,showCollisionBoxes:r.showCollisionBoxes,showEnvMap:r.showEnvMap};t.add(a,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(a,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(a,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(a)}v();function ve(n,e,i){let t=n.addFolder("Text3D").close(),r={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(r,"all").name("Show All"),t.add(r,"removeAll").name("Remove All")}v();function xe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let r=localStorage.getItem("directionsMethod"),a=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",o={enabled:!1,method:r||"dp-optimal",radius:a?parseFloat(a):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,p,d;t.add(o,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,p=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(o,"startCoordinate").name("Start").disable().listen(),t.add(o,"endCoordinate").name("End").disable().listen(),t.add(o,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&p&&o.enabled&&u(c,p)}),t.add(o,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&p&&o.enabled&&u(c,p)}),t.add(o,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&p&&o.enabled&&u(c,p)}),t.add(o,"pathInfo").name("Path Info").disable().listen();let s={clear:()=>h()};t.add(s,"clear").name("Clear Path");function h(){c=void 0,p=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function u(m,y){var f;d&&(e.Paths.remove(d),d=void 0);try{let b=await e.getDirections(m,y,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:o.method,radius:o.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:o.includeDoorBufferNodes}});if(b){d=e.Paths.add(b.coordinates,{interactive:!0,color:"green",width:1});let k=((f=b.distance)==null?void 0:f.toFixed(2))||"N/A";o.pathInfo="".concat(b.coordinates.length," pts, ").concat(k,"m")}else o.pathInfo="No path found"}catch(b){o.pathInfo="Error: ".concat(b instanceof Error?b.message:"Unknown")}}let g=async m=>{if(o.enabled)if(c){let y=m.coordinate;p=y,o.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Calculating...",await u(c,p),c=void 0,p=void 0}else{let y=m.coordinate;c=y,o.startCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}function Ae(n,e,i){Ne();let t=new G({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),he(e,n,t),ge(t,e,i==null?void 0:i.camera);let r=t.addFolder("Levels").close(),a=t.addFolder("Scene Controls");a.close();let l=t.addFolder("Labels");ve(t,e,n);let o=t.addFolder("Markers");me(t,e);let c=t.addFolder("misc");ye(t,e,n),xe(t,e,n),be(c,e,n);let p={level:e.currentFloor.id},{populatelabels:d}=ue(l,n,e),{populateMarkers:s}=fe(o,n,e),h=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),u=r.add(p,"level",h).onChange(g=>{e.setFloor(g),p.level=e.currentFloor.id,u.updateDisplay()});return e.on("floor-change-start",g=>{r.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:a,populateMarkers:s}}var Ce="mappedin-sdk-debug-css";function Ne(){if(document.getElementById(Ce))return;let n=document.createElement("style");n.id=Ce,n.textContent=pe,document.head.appendChild(n)}var te=class{constructor(e,i){I(this,"_enabled",!1);I(this,"mv");I(this,"api");I(this,"mapData");I(this,"scenegraphVisualizerMounted",!1);I(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}=Ae(this.mapData,this.mv,e);i.onOpenClose(r=>{r===i&&!r._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,se(this.api.core,i))}),(t=this.api.getMapDataInternal())==null||t.spaces.forEach(r=>{this.mv.updateState(r,{interactive:!0})})}get enabled(){return this._enabled}};export{te as Inspector};