@mappedin/mappedin-js 6.5.0 → 6.6.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.
- package/THIRD_PARTY_LICENSES.txt +31 -0
- package/lib/esm/{GLTFExporter-IJ34CDQB.js → GLTFExporter-RQ4X3IWO.js} +1 -1
- package/lib/esm/{GLTFLoader-PXCR6USU.js → GLTFLoader-VJHWNKS5.js} +1 -1
- package/lib/esm/{chunk-WD5FGIM2.js → chunk-6SFEDLKY.js} +1 -1
- package/lib/esm/chunk-CJ52KBIE.js +1 -0
- package/lib/esm/chunk-D53OXR7Z.js +1 -0
- package/lib/esm/{chunk-LUNYQOMN.js → chunk-RJF4TTOJ.js} +1 -1
- package/lib/esm/index.d.ts +205 -36
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-X3O45PWP.js +1 -0
- package/lib/esm/{internal-65WQUW6L.js → internal-YSYMTO44.js} +1 -1
- package/lib/esm/{text3d-6ACSQOS4.js → text3d-24KWRIMN.js} +1 -1
- package/package.json +1 -1
- package/lib/esm/chunk-CBDJZJXS.js +0 -1
- package/lib/esm/chunk-PGIGUASH.js +0 -1
- package/lib/esm/inspector-IOGM6LC5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,ca as x,da as y,w as A,x as w,y as g}from"./chunk-
|
|
1
|
+
import{a as b,ca as x,da as y,w as A,x as w,y as g}from"./chunk-6SFEDLKY.js";b();function M(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new y,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=B(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=B(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}function B(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new x(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}function R(o,l){if(l===A)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===g||l===w){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===g)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}export{M as a,R as b};
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -17489,6 +17489,12 @@ declare class Core extends PubSub<MapEvent> {
|
|
|
17489
17489
|
getState<T extends EntityId<EntityState>>(geometryOrGeometryId: T): T extends EntityId<LabelState> ? LabelState : T extends EntityId<GeometryState> ? GeometryState : T extends EntityId<MarkerState> ? MarkerState : T extends EntityId<GeometryGroupState> ? GeometryGroupState : T extends EntityId<GroupContainerState> ? GroupContainerState : T extends EntityId<ModelState> ? ModelState : T extends EntityId<PathState> ? PathState : T extends EntityId<ShapeState> ? ShapeState : T extends EntityId<ImageState> ? ImageState : T extends EntityId<Text3DState> ? Text3DState : EntityState;
|
|
17490
17490
|
getState(geometryOrGeometryId?: Record<string | number, any> | string | number): EntityState;
|
|
17491
17491
|
getState<T extends EntityState>(geometryOrGeometryId: T["id"]): T extends LabelState ? LabelState : T extends GeometryState ? GeometryState : T extends MarkerState ? MarkerState : T extends GeometryGroupState ? GeometryGroupState : T extends GroupContainerState ? GroupContainerState : T extends ModelState ? ModelState : T extends PathState ? PathState : T extends ShapeState ? ShapeState : T extends ImageState ? ImageState : EntityState;
|
|
17492
|
+
/**
|
|
17493
|
+
* Get rendered state for an entity (e.g., runtime rendering state that changes frequently)
|
|
17494
|
+
* @param entity The entity to get rendered state for
|
|
17495
|
+
* @returns Object with all available rendered state properties, or undefined if not found
|
|
17496
|
+
*/
|
|
17497
|
+
getRenderedState(entity: EntityId<LabelState> | string | number): LabelRenderedState | undefined;
|
|
17492
17498
|
/**
|
|
17493
17499
|
* Set the state of the map view or any entity that was added, regardless of whether it is visible in the scene.
|
|
17494
17500
|
*/
|
|
@@ -17841,6 +17847,7 @@ declare class LabelComponent {
|
|
|
17841
17847
|
get scaledPinSize(): number;
|
|
17842
17848
|
iconPadding: number;
|
|
17843
17849
|
get scaledIconPadding(): number;
|
|
17850
|
+
get textVisible(): boolean;
|
|
17844
17851
|
dirty: boolean;
|
|
17845
17852
|
textDirty: boolean;
|
|
17846
17853
|
pinDirty: boolean;
|
|
@@ -18342,6 +18349,12 @@ type ImagePlacementOptions = {
|
|
|
18342
18349
|
*/
|
|
18343
18350
|
minimumSizeRatio?: number;
|
|
18344
18351
|
};
|
|
18352
|
+
type LabelRenderedState = {
|
|
18353
|
+
/**
|
|
18354
|
+
* whether the text is visible
|
|
18355
|
+
*/
|
|
18356
|
+
textVisible: boolean;
|
|
18357
|
+
};
|
|
18345
18358
|
declare const collisionRankingTierSchema: z.ZodUnion<readonly [
|
|
18346
18359
|
z.ZodEnum<{
|
|
18347
18360
|
low: "low";
|
|
@@ -19967,6 +19980,22 @@ export declare class MapView {
|
|
|
19967
19980
|
* ```
|
|
19968
19981
|
*/
|
|
19969
19982
|
getState<T extends MapElementsWithState>(target: T): TGetState<T>;
|
|
19983
|
+
/**
|
|
19984
|
+
* Gets the rendered state of a map element.
|
|
19985
|
+
*
|
|
19986
|
+
* Retrieves runtime rendering state that changes frequently, such as text visibility for labels.
|
|
19987
|
+
*
|
|
19988
|
+
* @param target The map element to get the rendered state for.
|
|
19989
|
+
* @returns An object containing the requested rendered state keys, or undefined if not found.
|
|
19990
|
+
*
|
|
19991
|
+
* @example Get label text visibility
|
|
19992
|
+
* ```ts
|
|
19993
|
+
* const label = mapView.Labels.add(space, 'Hello');
|
|
19994
|
+
* const renderedState = mapView.__EXPERIMENTAL__getRenderedState(label);
|
|
19995
|
+
* console.log('Text visible:', renderedState?.textVisible);
|
|
19996
|
+
* ```
|
|
19997
|
+
*/
|
|
19998
|
+
__EXPERIMENTAL__getRenderedState<T extends MapElementWithRenderedState>(target: T): TGetRenderedState<T> | undefined;
|
|
19970
19999
|
/**
|
|
19971
20000
|
* Sets the hover color for map elements.
|
|
19972
20001
|
*
|
|
@@ -22229,6 +22258,7 @@ declare class GeoJsonApi extends PubSub$1<TNavigationEvents> {
|
|
|
22229
22258
|
get currentFloorStack(): FloorStack;
|
|
22230
22259
|
get currentFloor(): Floor;
|
|
22231
22260
|
getState<T extends MapElementsWithState | string>(target: T): TGetState<T>;
|
|
22261
|
+
__EXPERIMENTAL__getRenderedState<T extends MapElementWithRenderedState>(target: T): TGetRenderedState<T> | undefined;
|
|
22232
22262
|
setHoverColor(c: string): void;
|
|
22233
22263
|
getHoverColor(): string | undefined;
|
|
22234
22264
|
/**
|
|
@@ -22447,17 +22477,49 @@ type DirectionProperties = {
|
|
|
22447
22477
|
};
|
|
22448
22478
|
type DirectionFeature = Feature$1<Point$1, DirectionProperties>;
|
|
22449
22479
|
type DirectionsCollection = FeatureCollection$1<Point$1, DirectionProperties>;
|
|
22450
|
-
|
|
22480
|
+
interface DoorGeometry {
|
|
22481
|
+
geoJSON: {
|
|
22482
|
+
geometry: {
|
|
22483
|
+
coordinates: [
|
|
22484
|
+
[
|
|
22485
|
+
number,
|
|
22486
|
+
number
|
|
22487
|
+
],
|
|
22488
|
+
[
|
|
22489
|
+
number,
|
|
22490
|
+
number
|
|
22491
|
+
]
|
|
22492
|
+
];
|
|
22493
|
+
};
|
|
22494
|
+
};
|
|
22495
|
+
}
|
|
22496
|
+
type BaseSimplifyOptions = {
|
|
22451
22497
|
/**
|
|
22452
22498
|
* Enable or disable simplifying.
|
|
22453
22499
|
*/
|
|
22454
22500
|
enabled: boolean;
|
|
22455
22501
|
/**
|
|
22456
22502
|
* The radius of the buffer around the path to consider when simplifying, in meters.
|
|
22457
|
-
* @default 0.
|
|
22503
|
+
* @default 0.4
|
|
22504
|
+
*/
|
|
22505
|
+
radius?: number;
|
|
22506
|
+
};
|
|
22507
|
+
type GreedyLosOptions = BaseSimplifyOptions & {
|
|
22508
|
+
__EXPERIMENTAL_METHOD?: "greedy-los";
|
|
22509
|
+
};
|
|
22510
|
+
type RdpOptions = BaseSimplifyOptions & {
|
|
22511
|
+
__EXPERIMENTAL_METHOD: "rdp";
|
|
22512
|
+
};
|
|
22513
|
+
type DpOptimalOptions = BaseSimplifyOptions & {
|
|
22514
|
+
__EXPERIMENTAL_METHOD: "dp-optimal";
|
|
22515
|
+
/**
|
|
22516
|
+
* Whether to include door buffer nodes in DP simplification.
|
|
22517
|
+
* When true, predecessor and successor nodes of doors are marked with preventSmoothing.
|
|
22518
|
+
* @default false
|
|
22458
22519
|
*/
|
|
22459
|
-
|
|
22520
|
+
includeDoorBufferNodes?: boolean;
|
|
22460
22521
|
};
|
|
22522
|
+
type SimplifyDirectionsOptions = GreedyLosOptions | RdpOptions | DpOptimalOptions;
|
|
22461
22523
|
type DirectionsZone = {
|
|
22462
22524
|
geometry: Feature$1<MultiPolygon$1 | Polygon$1>;
|
|
22463
22525
|
/**
|
|
@@ -22475,6 +22537,7 @@ declare class Navigator$1 {
|
|
|
22475
22537
|
graph: NavigationGraph;
|
|
22476
22538
|
private geometryEdgesByMapId;
|
|
22477
22539
|
private flagDeclarations;
|
|
22540
|
+
private getDoorByNodeId;
|
|
22478
22541
|
private disabledNodeIds;
|
|
22479
22542
|
/**
|
|
22480
22543
|
* Constructs a Navigator instance to manage pathfinding with optional obstructions and grouping features.
|
|
@@ -22483,13 +22546,15 @@ declare class Navigator$1 {
|
|
|
22483
22546
|
* @param {ObstructionCollection} [obstructions] - Optional collection of obstructions that could block paths.
|
|
22484
22547
|
* @param {SpaceCollection} [spaces] - Optional collection of spaces that could block paths.
|
|
22485
22548
|
* @param {string} [groupBy] - Optional property name to group nodes and paths for differentiated processing.
|
|
22549
|
+
* @param {Function} getDoorByNodeId - Function to get door object by node ID.
|
|
22486
22550
|
*/
|
|
22487
|
-
constructor({ nodes, geojsonCollection, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, }: {
|
|
22551
|
+
constructor({ nodes, geojsonCollection, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, getDoorByNodeId, }: {
|
|
22488
22552
|
nodes: NodeCollection$1;
|
|
22489
22553
|
geojsonCollection?: ObstructionCollection | SpaceCollection;
|
|
22490
22554
|
groupBy?: string;
|
|
22491
22555
|
multiplicativeDistanceWeightScaling?: boolean;
|
|
22492
22556
|
flagDeclarations?: NavigationFlagDeclarations;
|
|
22557
|
+
getDoorByNodeId: (nodeId: string) => DoorGeometry | undefined;
|
|
22493
22558
|
});
|
|
22494
22559
|
private getDisabledNodeIds;
|
|
22495
22560
|
/**
|
|
@@ -22502,9 +22567,11 @@ declare class Navigator$1 {
|
|
|
22502
22567
|
* @param {SimplifyDirectionsOptions} [simplify] - Options to simplify the pathfinding result.
|
|
22503
22568
|
* @returns {DirectionsCollection} A collection of directional features representing the path.
|
|
22504
22569
|
*/
|
|
22505
|
-
getDirections({ zones: directionsZones, originIds, destinationNodeIds, disabledConnectionNodeIds, simplify, multiplicativeDistanceWeightScaling, overrideEdgeWeights, }: {
|
|
22570
|
+
getDirections({ zones: directionsZones, originIds, from, to, destinationNodeIds, disabledConnectionNodeIds, simplify, multiplicativeDistanceWeightScaling, overrideEdgeWeights, }: {
|
|
22506
22571
|
originIds: string[];
|
|
22507
22572
|
destinationNodeIds: string[];
|
|
22573
|
+
from: NodeFeature[];
|
|
22574
|
+
to: NodeFeature[];
|
|
22508
22575
|
zones?: DirectionsZone[];
|
|
22509
22576
|
disabledConnectionNodeIds?: string[];
|
|
22510
22577
|
simplify?: SimplifyDirectionsOptions;
|
|
@@ -22519,11 +22586,21 @@ declare class Navigator$1 {
|
|
|
22519
22586
|
*/
|
|
22520
22587
|
private generatePath;
|
|
22521
22588
|
/**
|
|
22522
|
-
* Simplifies a sequence of steps by reducing unnecessary nodes using
|
|
22589
|
+
* Simplifies a sequence of steps by reducing unnecessary nodes using line-of-sight checks.
|
|
22590
|
+
*
|
|
22591
|
+
* Method Selection:
|
|
22592
|
+
* - 'greedy-los': Greedy forward scan with line-of-sight validation. Fastest, O(n) time complexity. Good default choice.
|
|
22593
|
+
* - 'rdp': Uses Ramer-Douglas-Peucker preprocessing + line-of-sight validation + door buffer nodes.
|
|
22594
|
+
* Better for paths with doors and complex geometry. Medium speed.
|
|
22595
|
+
* - 'dp-optimal': Dynamic Programming for globally optimal simplification. Slowest but highest quality, O(n²) complexity.
|
|
22596
|
+
* Best when path quality is critical (e.g., indoor navigation with many turns).
|
|
22597
|
+
*
|
|
22598
|
+
* Performance: greedy-los < rdp < dp-optimal
|
|
22599
|
+
* Quality: greedy-los < rdp < dp-optimal
|
|
22523
22600
|
*
|
|
22524
22601
|
* @param {Edge[]} steps - The steps to simplify.
|
|
22525
|
-
* @param {
|
|
22526
|
-
*
|
|
22602
|
+
* @param {SimplifyDirectionsOptions} options - Simplification options.
|
|
22603
|
+
* @param {boolean} multiplicativeDistanceWeightScaling - Distance weight scaling option.
|
|
22527
22604
|
* @returns {Edge[]} An array of simplified edges representing a more direct path.
|
|
22528
22605
|
*/
|
|
22529
22606
|
private simplifyAllSteps;
|
|
@@ -22566,6 +22643,8 @@ declare class Navigator$1 {
|
|
|
22566
22643
|
* @returns {Edge[]} An array of simplified edges.
|
|
22567
22644
|
*/
|
|
22568
22645
|
private simplifySteps;
|
|
22646
|
+
private simplifyStepsImprovedWithSimplifyBeforeLoSChecks;
|
|
22647
|
+
private simplifyStepsWithDPMethod;
|
|
22569
22648
|
/**
|
|
22570
22649
|
* Calculates the approximate distance between two geographic coordinates on Earth's surface.
|
|
22571
22650
|
*
|
|
@@ -22653,13 +22732,14 @@ declare class DirectionsInternal {
|
|
|
22653
22732
|
/**
|
|
22654
22733
|
* @hidden
|
|
22655
22734
|
*/
|
|
22656
|
-
constructor({ nodes, geojsonCollection, connections, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, }: {
|
|
22735
|
+
constructor({ nodes, geojsonCollection, connections, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, getDoorByNodeId, }: {
|
|
22657
22736
|
nodes: ParsedMVF["node.geojson"];
|
|
22658
22737
|
geojsonCollection: ParsedMVF["obstruction"] | ParsedMVF["space"];
|
|
22659
22738
|
connections: ParsedMVF["connection.json"];
|
|
22660
22739
|
groupBy?: string;
|
|
22661
22740
|
multiplicativeDistanceWeightScaling?: boolean;
|
|
22662
22741
|
flagDeclarations?: ParsedMVF["navigationFlags.json"];
|
|
22742
|
+
getDoorByNodeId: (nodeId: string) => DoorGeometry | undefined;
|
|
22663
22743
|
});
|
|
22664
22744
|
processTargets(fromNodesByTarget: Map<TNavigationTarget, string[]>, toNodesByTarget: Map<TNavigationTarget, string[]>, mapData: MapDataInternal): {
|
|
22665
22745
|
originIds: string[];
|
|
@@ -22668,10 +22748,7 @@ declare class DirectionsInternal {
|
|
|
22668
22748
|
};
|
|
22669
22749
|
getDirections: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
22670
22750
|
accessible: boolean;
|
|
22671
|
-
smoothing:
|
|
22672
|
-
enabled: boolean;
|
|
22673
|
-
radius: number;
|
|
22674
|
-
};
|
|
22751
|
+
smoothing: SimplifyDirectionsOptions;
|
|
22675
22752
|
zones: TDirectionZone[];
|
|
22676
22753
|
excludedConnections: Connection[];
|
|
22677
22754
|
connectionIdWeightMap: Record<string, number>;
|
|
@@ -22679,10 +22756,7 @@ declare class DirectionsInternal {
|
|
|
22679
22756
|
/** @deprecated use getDirections instead */
|
|
22680
22757
|
getDirectionsSync: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
22681
22758
|
accessible: boolean;
|
|
22682
|
-
smoothing:
|
|
22683
|
-
enabled: boolean;
|
|
22684
|
-
radius: number;
|
|
22685
|
-
};
|
|
22759
|
+
smoothing: SimplifyDirectionsOptions;
|
|
22686
22760
|
zones: TDirectionZone[];
|
|
22687
22761
|
excludedConnections: Connection[];
|
|
22688
22762
|
connectionIdWeightMap: Record<string, number>;
|
|
@@ -23500,31 +23574,121 @@ export type TGetDirectionsOptions = {
|
|
|
23500
23574
|
*/
|
|
23501
23575
|
accessible?: boolean;
|
|
23502
23576
|
/**
|
|
23503
|
-
* Enable or disable
|
|
23504
|
-
*
|
|
23577
|
+
* Enable or disable path smoothing for directions.
|
|
23578
|
+
* When enabled, the path is simplified using line-of-sight checks to provide a more visually appealing route and shorter instructions.
|
|
23579
|
+
*
|
|
23580
|
+
* Can be a boolean to enable or disable smoothing, or an object with configuration options.
|
|
23505
23581
|
*
|
|
23506
|
-
*
|
|
23582
|
+
* **Available methods:**
|
|
23583
|
+
* - `'greedy-los'` (default): Greedy forward scan with line-of-sight validation. Fastest, O(n) time complexity. Good default choice.
|
|
23584
|
+
* - `'rdp'`: Uses Ramer-Douglas-Peucker preprocessing + line-of-sight validation + door buffer nodes. Better for paths with doors and complex geometry. Medium speed.
|
|
23585
|
+
* - `'dp-optimal'`: Dynamic Programming for globally optimal simplification. Slowest but highest quality, O(n²) complexity. Best when path quality is critical.
|
|
23507
23586
|
*
|
|
23508
23587
|
* @default true for non-enterprise mode, false for enterprise mode
|
|
23509
23588
|
*
|
|
23510
23589
|
* @example
|
|
23511
23590
|
* ```ts
|
|
23512
|
-
* // Enable smoothing with
|
|
23591
|
+
* // Enable smoothing with default settings
|
|
23513
23592
|
* mapView.getDirections(firstSpace, secondSpace, {
|
|
23514
|
-
*
|
|
23515
|
-
*
|
|
23593
|
+
* smoothing: true
|
|
23594
|
+
* })
|
|
23595
|
+
*
|
|
23596
|
+
* // Enable smoothing with custom radius (in meters)
|
|
23597
|
+
* mapView.getDirections(firstSpace, secondSpace, {
|
|
23598
|
+
* smoothing: {
|
|
23599
|
+
* radius: 1.5,
|
|
23516
23600
|
* }
|
|
23517
23601
|
* })
|
|
23518
23602
|
*
|
|
23519
|
-
* //
|
|
23603
|
+
* // Use greedy line-of-sight method (default, explicit)
|
|
23520
23604
|
* mapView.getDirections(firstSpace, secondSpace, {
|
|
23521
|
-
* smoothing:
|
|
23605
|
+
* smoothing: {
|
|
23606
|
+
* enabled: true,
|
|
23607
|
+
* __EXPERIMENTAL_METHOD: 'greedy-los',
|
|
23608
|
+
* radius: 0.4,
|
|
23609
|
+
* }
|
|
23610
|
+
* })
|
|
23611
|
+
*
|
|
23612
|
+
* // Use RDP method (always uses line-of-sight)
|
|
23613
|
+
* mapView.getDirections(firstSpace, secondSpace, {
|
|
23614
|
+
* smoothing: {
|
|
23615
|
+
* enabled: true,
|
|
23616
|
+
* __EXPERIMENTAL_METHOD: 'rdp',
|
|
23617
|
+
* radius: 0.4,
|
|
23618
|
+
* }
|
|
23619
|
+
* })
|
|
23620
|
+
*
|
|
23621
|
+
* // Use DP-optimal method with door buffer nodes
|
|
23622
|
+
* mapView.getDirections(firstSpace, secondSpace, {
|
|
23623
|
+
* smoothing: {
|
|
23624
|
+
* enabled: true,
|
|
23625
|
+
* __EXPERIMENTAL_METHOD: 'dp-optimal',
|
|
23626
|
+
* __EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES: true,
|
|
23627
|
+
* radius: 0.4,
|
|
23628
|
+
* }
|
|
23522
23629
|
* })
|
|
23523
23630
|
* ```
|
|
23524
23631
|
*/
|
|
23525
23632
|
smoothing?: boolean | {
|
|
23633
|
+
/**
|
|
23634
|
+
* Enable or disable path smoothing.
|
|
23635
|
+
* @default true for non-enterprise mode, false for enterprise mode
|
|
23636
|
+
*/
|
|
23637
|
+
enabled?: boolean;
|
|
23638
|
+
/**
|
|
23639
|
+
* The radius of the buffer around the path to consider when simplifying, in meters.
|
|
23640
|
+
* @default 0.75
|
|
23641
|
+
*/
|
|
23642
|
+
radius?: number;
|
|
23643
|
+
/**
|
|
23644
|
+
* @experimental
|
|
23645
|
+
* Path smoothing method using greedy line-of-sight algorithm.
|
|
23646
|
+
* Fastest method with O(n) time complexity. Good default choice.
|
|
23647
|
+
* @default 'greedy-los'
|
|
23648
|
+
*/
|
|
23649
|
+
__EXPERIMENTAL_METHOD?: "greedy-los";
|
|
23650
|
+
} | {
|
|
23651
|
+
/**
|
|
23652
|
+
* Enable or disable path smoothing.
|
|
23653
|
+
* @default true for non-enterprise mode, false for enterprise mode
|
|
23654
|
+
*/
|
|
23655
|
+
enabled?: boolean;
|
|
23656
|
+
/**
|
|
23657
|
+
* The radius of the buffer around the path to consider when simplifying, in meters.
|
|
23658
|
+
* @default 0.75
|
|
23659
|
+
*/
|
|
23660
|
+
radius?: number;
|
|
23661
|
+
/**
|
|
23662
|
+
* @experimental
|
|
23663
|
+
* Path smoothing method using Ramer-Douglas-Peucker preprocessing with line-of-sight validation.
|
|
23664
|
+
* Better for paths with doors and complex geometry. Medium speed.
|
|
23665
|
+
* Always uses line-of-sight validation (cannot be disabled).
|
|
23666
|
+
*/
|
|
23667
|
+
__EXPERIMENTAL_METHOD: "rdp";
|
|
23668
|
+
} | {
|
|
23669
|
+
/**
|
|
23670
|
+
* Enable or disable path smoothing.
|
|
23671
|
+
* @default true for non-enterprise mode, false for enterprise mode
|
|
23672
|
+
*/
|
|
23526
23673
|
enabled?: boolean;
|
|
23527
|
-
|
|
23674
|
+
/**
|
|
23675
|
+
* The radius of the buffer around the path to consider when simplifying, in meters.
|
|
23676
|
+
* @default 0.75
|
|
23677
|
+
*/
|
|
23678
|
+
radius?: number;
|
|
23679
|
+
/**
|
|
23680
|
+
* @experimental
|
|
23681
|
+
* Path smoothing method using Dynamic Programming for globally optimal simplification.
|
|
23682
|
+
* Slowest but highest quality, O(n²) complexity. Best when path quality is critical.
|
|
23683
|
+
*/
|
|
23684
|
+
__EXPERIMENTAL_METHOD: "dp-optimal";
|
|
23685
|
+
/**
|
|
23686
|
+
* @experimental
|
|
23687
|
+
* Whether to include 0.5m buffer nodes perpendicular to doors in DP simplification.
|
|
23688
|
+
* When true, predecessor and successor nodes of doors are marked with preventSmoothing.
|
|
23689
|
+
* @default false
|
|
23690
|
+
*/
|
|
23691
|
+
__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES?: boolean;
|
|
23528
23692
|
};
|
|
23529
23693
|
/**
|
|
23530
23694
|
* Defines the special zones for navigation operations.
|
|
@@ -23780,6 +23944,9 @@ export type WithState<T> = T extends {
|
|
|
23780
23944
|
export type TUpdateState<T extends MapElementsWithState | string> = T extends {
|
|
23781
23945
|
__type: infer U;
|
|
23782
23946
|
} ? U extends keyof MapElementToUpdateState ? MapElementToUpdateState[U] : never : T extends string ? T extends keyof MapElementToUpdateState ? MapElementToUpdateState[T] : Record<string, any> : never;
|
|
23947
|
+
export type MapElementToGetRenderedState = {
|
|
23948
|
+
[Label.__type]: ReadonlyDeep<LabelRenderedState>;
|
|
23949
|
+
};
|
|
23783
23950
|
/**
|
|
23784
23951
|
* The type for getting the state of map elements.
|
|
23785
23952
|
* Returns the full state type for all element types.
|
|
@@ -23787,6 +23954,10 @@ export type TUpdateState<T extends MapElementsWithState | string> = T extends {
|
|
|
23787
23954
|
export type TGetState<T extends MapElementsWithState | string> = T extends {
|
|
23788
23955
|
__type: infer U;
|
|
23789
23956
|
} ? U extends keyof MapElementToGetState ? MapElementToGetState[U] : never : T extends string ? T extends keyof MapElementToGetState ? MapElementToGetState[T] : Record<string, any> : never;
|
|
23957
|
+
type MapElementWithRenderedState = WithState<Label>;
|
|
23958
|
+
type TGetRenderedState<T extends MapElementWithRenderedState | string> = T extends {
|
|
23959
|
+
__type: infer U;
|
|
23960
|
+
} ? U extends keyof MapElementToGetRenderedState ? MapElementToGetRenderedState[U] : never : T extends string ? T extends keyof MapElementToGetRenderedState ? MapElementToGetRenderedState[T] : Record<string, any> : never;
|
|
23790
23961
|
export type GlobalState = {
|
|
23791
23962
|
/**
|
|
23792
23963
|
* The color of the background, in hex format(#000000).
|
|
@@ -24911,8 +25082,7 @@ export declare class Connection extends DetailedMapData<Feature<Point, SpaceProp
|
|
|
24911
25082
|
* @internal
|
|
24912
25083
|
*/
|
|
24913
25084
|
constructor(data: MapDataInternal, options: {
|
|
24914
|
-
|
|
24915
|
-
accessible?: boolean;
|
|
25085
|
+
mvfData: MVFConnection;
|
|
24916
25086
|
});
|
|
24917
25087
|
/**
|
|
24918
25088
|
* Whether the connection is accessible. For example elevators are accessible while stairs are not.
|
|
@@ -24948,10 +25118,6 @@ export declare class Connection extends DetailedMapData<Feature<Point, SpaceProp
|
|
|
24948
25118
|
* @returns {Floor[]} An array of floors for the connection.
|
|
24949
25119
|
*/
|
|
24950
25120
|
get floors(): Floor[];
|
|
24951
|
-
/**
|
|
24952
|
-
* Gets the location profiles ({@link LocationProfile}) associated with the connection.
|
|
24953
|
-
*/
|
|
24954
|
-
get locationProfiles(): LocationProfile[];
|
|
24955
25121
|
/** @internal */
|
|
24956
25122
|
get focusTarget(): Coordinate[];
|
|
24957
25123
|
/**
|
|
@@ -25611,8 +25777,6 @@ type MapDataRecords = {
|
|
|
25611
25777
|
locationProfilesByExternalId: Record<string, LocationProfile[]>;
|
|
25612
25778
|
objectEntranceNodeIdsByObstructionId: Record<string, string[]>;
|
|
25613
25779
|
obstructionIdByEntranceId: Record<string, string>;
|
|
25614
|
-
connectionIdsByLatLon: Record<string, string[]>;
|
|
25615
|
-
mvfConnectionIdsByLatLon: Record<string, string[]>;
|
|
25616
25780
|
locationProfilesByAttachedFeatureId: Record<string, LocationProfile[]>;
|
|
25617
25781
|
mvfSpacesById: Record<string, SpaceCollection["features"][number]>;
|
|
25618
25782
|
mvfNodesById: Record<string, NodeCollection["features"][number]>;
|
|
@@ -26245,7 +26409,6 @@ declare class MapDataInternal extends PubSub$1<{
|
|
|
26245
26409
|
mvfAnnotationsById: MapDataRecords["mvfAnnotationsById"];
|
|
26246
26410
|
mvfConnectionsById: MapDataRecords["mvfConnectionsById"];
|
|
26247
26411
|
mvfConnectionsByNodeId: MapDataRecords["mvfConnectionsByNodeId"];
|
|
26248
|
-
mvfConnectionIdsByLatLon: MapDataRecords["mvfConnectionIdsByLatLon"];
|
|
26249
26412
|
mvfEntrancesById: MapDataRecords["mvfEntrancesById"];
|
|
26250
26413
|
mvfNodesById: MapDataRecords["mvfNodesById"];
|
|
26251
26414
|
mvfObstructionById: MapDataRecords["mvfObstructionById"];
|
|
@@ -26261,7 +26424,6 @@ declare class MapDataInternal extends PubSub$1<{
|
|
|
26261
26424
|
floorStacksByExternalId: MapDataRecords["floorStacksByExternalId"];
|
|
26262
26425
|
doorsByExternalId: MapDataRecords["doorsByExternalId"];
|
|
26263
26426
|
areasByExternalId: MapDataRecords["areasByExternalId"];
|
|
26264
|
-
connectionSpaceIdsByLatLon: MapDataRecords["connectionIdsByLatLon"];
|
|
26265
26427
|
locationProfilesByAttachedFeatureId: MapDataRecords["locationProfilesByAttachedFeatureId"];
|
|
26266
26428
|
entranceNodeIdsBySpaceId?: MapDataRecords["entranceNodeIdsBySpaceId"];
|
|
26267
26429
|
locationsById: EnterpriseMapDataRecords["locationsById"];
|
|
@@ -26460,6 +26622,13 @@ declare class MapDataInternal extends PubSub$1<{
|
|
|
26460
26622
|
getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | TNavigationTarget[], opt?: TGetDirectionsOptions) => Promise<Directions | undefined>;
|
|
26461
26623
|
getDirectionsMultiDestination: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], opt?: TGetDirectionsOptions) => Promise<Directions[] | undefined>;
|
|
26462
26624
|
getDistance(from: Space | Door | Coordinate | MapObject | PointOfInterest | Annotation | Node$1 | EnterpriseLocation | Area, to: Space | Door | Coordinate | MapObject | PointOfInterest | Annotation | Node$1 | EnterpriseLocation | Area): number;
|
|
26625
|
+
/**
|
|
26626
|
+
* Gets the door associated with a node.
|
|
26627
|
+
*
|
|
26628
|
+
* @param nodeId The ID of the node to check
|
|
26629
|
+
* @returns The door object if the node is associated with a door, undefined otherwise
|
|
26630
|
+
*/
|
|
26631
|
+
getDoorByNodeId: (nodeId: string) => Door | undefined;
|
|
26463
26632
|
transformImageRequest: (url: string) => Promise<{
|
|
26464
26633
|
url: string;
|
|
26465
26634
|
}>;
|
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-
|
|
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-D53OXR7Z.js";import{a,c as b,cb as G}from"./chunk-CJ52KBIE.js";import"./chunk-RJF4TTOJ.js";import"./chunk-6SFEDLKY.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as se,J as X,K as ae,h as H,q as S,r as B}from"./chunk-D53OXR7Z.js";import{y as D}from"./chunk-CJ52KBIE.js";import"./chunk-RJF4TTOJ.js";import{$ as re,a as v}from"./chunk-6SFEDLKY.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,d,u,c,s,h=5,p=b=>{o=b.clientX,d=u=b.clientY,l=!0,c=this.getValue(),s=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-o,k=b.clientY-d;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-u;s-=C*this._step*this._arrowKeyMultiplier(b),c+s>this._max?s=this._max-c:c+s<this._min&&(s=this._min-c),this._snapClampSetValue(c+s)}u=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",p),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,d,u=f=>{f.preventDefault(),this._setDraggingStyle(!0),i(f.touches[0].clientX),l=!1},c=f=>{f.touches.length>1||(this._hasScrollBar?(o=f.touches[0].clientX,d=f.touches[0].clientY,l=!0):u(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-d;Math.abs(b)>Math.abs(C)?u(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)},p=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(p,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",c,{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:d=!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",u=>{(u.code==="Enter"||u.code==="Space")&&(u.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"),d&&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){var a,l;let t={id:e.id,__type:e.__type},r=i.addFolder("".concat(e.type,"-").concat(e.id));for(let o in e){if(o==="visible"&&r.add(e,o).onChange(d=>{n.updateState(t,{[o]:d})}),o==="color"||o==="hoverColor"){e[o]=E(e[o]),r.addColor(e,o).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="height"){r.add(e,o,0,20,1).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="texture"&&e.texture){(a=r.addFolder("Texture - side").add(e,"texture"))==null||a.onChange(u=>{n.updateState(t,{texture:{url:u}})});continue}if(o==="topTexture"&&e.topTexture){(l=r.addFolder("Texture - top").add(e,"topTexture"))==null||l.onChange(u=>{n.updateState(t,{topTexture:{url:u}})});continue}if(o==="opacity"){r.add(e,o,0,1,.1).onChange(d=>{n.updateState(t,{[o]:d})});continue}if(o==="altitude"){r.add(e,o,0,100,1).onChange(d=>{n.updateState(t,{[o]:d})});continue}Ie.includes(o)&&r.add(e,o).onChange(d=>{n.updateState(t,{[o]:d})})}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 d;let l=Object.values(r.getMapData())[0],o=a;if(o&&H.is(o)){let u=(d=l.getByType("enterprise-location"))==null?void 0:d.find(c=>c.spaces.some(s=>s.id===o.id));u&&(o=u)}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),d=document.createElement("div");if(d.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 c=document.createElement("h3");c.textContent=o.name,c.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",d.appendChild(c)}if(o instanceof S){if(o.description){let c=document.createElement("p");c.textContent=o.description,c.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",d.appendChild(c)}if(o.tags&&o.tags.length>0){let c=document.createElement("div");c.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 ",c.appendChild(h)}),d.appendChild(c)}}let u;if(!(a instanceof B)){let c=new G({autoPlace:!1});c.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),c),d.appendChild(c.domElement)),u=c}return document.body.appendChild(d),l&&i(r,o),()=>{d.style.opacity="0",d.style.transform="translateY(-10px)",setTimeout(()=>d.remove(),300),u==null||u.destroy()}}return{highlightCard:t,highlight:(r,a,{focus:l=!0}={})=>{n.length>0&&n.forEach(d=>r.Markers.remove(d));let o=e(r,a);if(o instanceof S)l&&r.Camera.focusOn(o.spaces,O),n.push(...o.spaces.map(d=>r.Markers.add(d,'<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(u=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(u,"</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(c=>c.spaces),O);let d=new Map,u=new Set;o.locations.forEach(c=>{d.has(c.name)||(c.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(c.name,"</span>\n </div>"),{rank:"always-visible"}))}),d.set(c.name,!0))}),o.locations.forEach(c=>{c.coordinates.forEach(s=>{let h="".concat(s.latitude,",").concat(s.longitude);if(!u.has(h)&&!d.has(c.name)){let p=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(c.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});u.add(h),n.push(p)}})})}return()=>{n.forEach(d=>r.Markers.remove(d))}}}}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 c;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",(c=a.domElement.parentElement)==null||c.appendChild(l);let{renderSearch:o,close:d}=Fe(n,e,l,a.$input),u=r.addFolder("Advanced");return u.close(),De(u),document.addEventListener("keydown",s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"?(s.preventDefault(),r._closed&&r.open(),a.$input.focus()):s.key==="Escape"&&(d(),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 u;let d=await e.Search.suggest(t.value);d&&d.length>0&&l((u=d[0])==null?void 0:u.suggestion)},100))});function l(o){if(!o){t.placeholder="";return}let d=t.value;t.value=o,t.setSelectionRange(d.length,o.length)}return{renderSearch(o,d){var u,c;if(o.places.length===0&&((u=o.enterpriseCategories)==null?void 0:u.length)===0&&((c=o.enterpriseLocations)==null?void 0:c.length)===0){i.textContent="No results found.";return}a=Te(i,o,n,d)},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,p)=>{if(p&&p.length>0){let g=document.createElement("li");g.textContent=h,Object.assign(g.style,N.sectionHeader),a.appendChild(g),p.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",()=>{u(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 d=[],u=h=>{d.forEach(f=>f()),d=[],l.forEach((f,b)=>{b===h?f.style.backgroundColor="#e0e0e0":f.style.backgroundColor=""});let p=l[h],g=p.getAttribute("data-type"),m=parseInt(p.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},c=h=>{!r.contains(h.target)&&h.target!==n&&s()};document.addEventListener("click",c);let s=()=>{n.innerHTML="",document.removeEventListener("click",c)};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",c=>{if(c){t.forEach(h=>h()),t=[];let s=c instanceof S?c.spaces[0]:c;if(n.Camera.focusOn(c),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",c=>{var s;t.forEach(h=>h()),t=[],(s=c.spaces)!=null&&s[0]&&(t=[R.highlightCard(n,c.spaces[0])])});let o=i.addFolder("Hover \u{1F681}").close(),{sub:d}=Pe(n,o),u;d.on("hover",c=>{var s;(s=c.spaces)!=null&&s[0]?(u==null||u(),t.length===0&&(u=R.highlightCard(n,c.spaces[0]))):(u==null||u(),u=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(d=>d()),a.length=0}let o=0;return n.on("click",d=>{var p,g,m;let{labels:u,coordinate:c}=d;l(),i.publish("click",d),clearInterval(o),r.load(JSON.stringify([c.longitude,c.latitude]));let s=u==null?void 0:u[0];if(s!=null){let y=P(n,s,e);if(!y)return;a.push(y.destroy),y.labelItemFolder.openAnimated()}let h=(m=(p=d.spaces)==null?void 0:p[0])!=null?m:(g=d.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:d,spaces:u,objects:c,markers:s,labels:h}=o;l(),i.publish("hover",o),r.load(JSON.stringify([d.longitude,d.latitude]));let p=(f=(y=(m=u==null?void 0:u[0])!=null?m:c==null?void 0:c[0])!=null?y:s==null?void 0:s[0])!=null?f:h==null?void 0:h[0];if(!p)return;let g=n.getState(p);g&&(t.type=g.type,t.id=p.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(p=>{this.labels[p.id]=p}),d()},removeAllLabels(){i.Labels.removeAll().forEach(p=>{delete this.labels[p.id]}),d()}},{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:d}=u();function u(){function h(m){var y;delete t.labels[m.id],(y=o.get(m.id))==null||y.destroy()}function p(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];p(y)}}return{rerender:g,add:p,remove:h}}n.domElement.classList.add("list-items");let c;i.on("click",({labels:h,coordinate:p})=>{if(!n._closed)if(h!=null&&h[0]){c==null||c.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(),c=g}else r(p)});function s(h){for(let p of h)t.labels[p.id]=p;d()}return{populatelabels:s,destroy(){a()}}}function ze(n,e,i,t,r){var m,y,f;let{interactive:a,enabled:l,rank:o,anchor:d,dynamicResize:u,zIndex:c,contentHTML:s,lowPriorityPin:h}=t;if(a==null||l==null)throw new Error("incomplete marker state");let p={interactive:a,enabled:l,rank:o||"medium",anchor:Array.isArray(d)?d.join(", "):d||"center",dynamicResize:u||!1,zIndex:c||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:p.interactive,enabled:p.enabled,rank:p.rank,dynamicResize:p.dynamicResize,contentHTML:p.contentHTML,lowPriorityPin:{enabled:p.lowPriorityPin.enabled,size:p.lowPriorityPin.size,color:p.lowPriorityPin.color}};p.rank==="always-visible"&&(C.zIndex=p.zIndex),n.updateState(e,C)}),i.add(p,"interactive"),i.add(p,"enabled"),i.add(p,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(p,"anchor").name("anchor (read-only)").disable(),i.add(p,"dynamicResize").name("dynamic resize"),p.rank==="always-visible"&&i.add(p,"zIndex",0,1e3,1).name("z-index"),i.add(p,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(p.lowPriorityPin,"enabled"),g.add(p.lowPriorityPin,"size",1,20,1),g.addColor(p.lowPriorityPin,"color"),g.close(),i.add(p,"isInView"),i.add(p,"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(d=>{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,d,u,c]=(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:c,inset_right:d,inset_bottom:u,animateOnLoad:!0,visualizeInset:!!(o||d||u||c),"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 p,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))),p&&p.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),s.inset_type==="portion"?(p=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)):(p=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(p=>{delete this.markers[p.id]}),d()}},{addMarker:r,destroy:a}=Re(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let o=new Map,{rerender:d}=u();function u(){function h(m){var y;delete t.markers[m.id],(y=o.get(m.id))==null||y.destroy()}function p(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];p(y)}}return{rerender:g,add:p,remove:h}}n.domElement.classList.add("list-items");let c;i.on("click",({markers:h,coordinate:p})=>{if(!n._closed)if(h!=null&&h[0]){c==null||c.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(),c=g}else r(p)});function s(h){for(let p of h)t.markers[p.id]=p;d()}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:""},d,u,c;t.add(o,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(d=void 0,u=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",c&&(e.Paths.remove(c),c=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),d&&u&&o.enabled&&p(d,u)}),t.add(o,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),d&&u&&o.enabled&&p(d,u)}),t.add(o,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),d&&u&&o.enabled&&p(d,u)}),t.add(o,"pathInfo").name("Path Info").disable().listen();let s={clear:()=>h()};t.add(s,"clear").name("Clear Path");function h(){d=void 0,u=void 0,o.startCoordinate="",o.endCoordinate="",o.pathInfo="",c&&(e.Paths.remove(c),c=void 0)}async function p(m,y){var f;c&&(e.Paths.remove(c),c=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){c=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(d){let y=m.coordinate;u=y,o.endCoordinate="".concat(y.latitude.toFixed(6),", ").concat(y.longitude.toFixed(6)),o.pathInfo="Calculating...",await p(d,u),d=void 0,u=void 0}else{let y=m.coordinate;d=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 d=t.addFolder("misc");ye(t,e,n),xe(t,e,n),be(d,e,n);let u={level:e.currentFloor.id},{populatelabels:c}=ue(l,n,e),{populateMarkers:s}=fe(o,n,e),h=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),p=r.add(u,"level",h).onChange(g=>{e.setFloor(g),u.level=e.currentFloor.id,p.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:c,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};
|